diff options
-rw-r--r-- | conform/conformtest.py | 6 | ||||
-rw-r--r-- | conform/linknamespace.py | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/conform/conformtest.py b/conform/conformtest.py index 951e3b2420..f2115bf432 100644 --- a/conform/conformtest.py +++ b/conform/conformtest.py @@ -562,7 +562,7 @@ class HeaderTests(object): o_file = os.path.join(self.temp_dir, 'test.o') with open(c_file, 'w') as c_file_out: c_file_out.write('#include <%s>\n%s' % (self.header, text)) - cmd = ('%s %s -c %s -o %s' % (self.cc, self.cflags, c_file, o_file)) + cmd = ('%s %s -O0 -c %s -o %s' % (self.cc, self.cflags, c_file, o_file)) try: subprocess.check_call(cmd, shell=True) except subprocess.CalledProcessError: @@ -613,7 +613,9 @@ class HeaderTests(object): out_file = os.path.join(self.temp_dir, 'namespace-out') with open(c_file, 'w') as c_file_out: c_file_out.write('#include <%s>\n' % self.header) - cmd = ('%s %s -E %s -P -Wp,-dN > %s' + # -O0 to negate effect of possible -O<N> passed to $CC + # See https://bugs.gentoo.org/659030#c6 + cmd = ('%s -O0 %s -E %s -P -Wp,-dN > %s' % (self.cc, self.cflags_namespace, c_file, out_file)) subprocess.check_call(cmd, shell=True) bad_tokens = set() diff --git a/conform/linknamespace.py b/conform/linknamespace.py index 87cd17b1ce..2812ec9406 100644 --- a/conform/linknamespace.py +++ b/conform/linknamespace.py @@ -157,7 +157,9 @@ def main(): files_seen = set() all_undef = {} current_undef = {} - compiler = '%s %s' % (args.cc, args.flags) + # -O0 avoid failures like + # '[initial] ptsname_r -> [libc.a(ptsname.o)] ptsname' + compiler = '%s %s -O0' % (args.cc, args.flags) c_syms = glibcconform.list_exported_functions(compiler, args.standard, args.header) with tempfile.TemporaryDirectory() as temp_dir: |