[dotest] Don't set the DWARF version override in CFLAGS_EXTRA.
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 20 Aug 2019 23:56:32 +0000 (23:56 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 20 Aug 2019 23:56:32 +0000 (23:56 +0000)
We cannot override the DWARF version in the CFLAGS_EXTRA because they
are used by tests that explicitly build without debug info. Instead, we
pass them through the regular CFLAGS.

llvm-svn: 369477

lldb/packages/Python/lldbsuite/test/dotest.py
lldb/packages/Python/lldbsuite/test/plugins/builder_base.py

index 7593c0d..5eb8bd5 100644 (file)
@@ -342,15 +342,14 @@ def parseOptionsAndInitTestdirs():
         configuration.skipCategories += test_categories.validate(
             args.skipCategories, False)
 
-    cflags_extras = ""
     if args.E:
-        cflags_extras += args.E
+        os.environ['CFLAGS_EXTRAS'] = args.E
 
     if args.dwarf_version:
         configuration.dwarf_version = args.dwarf_version
-        cflags_extras += '-gdwarf-{}'.format(args.dwarf_version)
-
-    os.environ['CFLAGS_EXTRAS'] = cflags_extras
+        # We cannot modify CFLAGS_EXTRAS because they're used in test cases
+        # that explicitly require no debug info.
+        os.environ['CFLAGS'] = '-gdwarf-{}'.format(configuration.dwarf_version)
 
     if args.d:
         sys.stdout.write(
index be891da..44695ce 100644 (file)
@@ -116,7 +116,7 @@ def getCmdLine(d):
     pattern = '%s="%s"' if "win32" in sys.platform else "%s='%s'"
 
     def setOrAppendVariable(k, v):
-        append_vars = ["CFLAGS_EXTRAS", "LD_EXTRAS"]
+        append_vars = ["CFLAGS", "CFLAGS_EXTRAS", "LD_EXTRAS"]
         if k in append_vars and k in os.environ:
             v = os.environ[k] + " " + v
         return pattern % (k, v)