diff options
author | Andreas K. Hüttel <dilfridge@gentoo.org> | 2018-12-14 20:43:04 +0100 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2019-11-21 07:43:20 +0000 |
commit | 063cf8fab330ecd692172a380df43826b0e7d7e8 (patch) | |
tree | 1b446a2e393efa5dc6fa3f8702bc5e4ed75e00ae | |
parent | Gentoo: Add a C.UTF-8 locale (diff) | |
download | glibc-063cf8fab330ecd692172a380df43826b0e7d7e8.tar.gz glibc-063cf8fab330ecd692172a380df43826b0e7d7e8.tar.bz2 glibc-063cf8fab330ecd692172a380df43826b0e7d7e8.zip |
Gentoo: force -O0 in conform tests to survive $CC changesgentoo/glibc-9999-15
In bug #659030 Gentoo started passing user's CFLAGS via $CC variable.
conform tests should but are not ready to handle -O1/-O2 yet.
Tests fail to validate headers due to inlining of weak symbol aliases
and other problems. Let's force it back to -O0 until it's fixed upstream.
Original patch by Sergei, ported to the new python test framework by Andreas
Bug: https://bugs.gentoo.org/659030
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-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 0c3f70f431..1b2cab64f2 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 9f5febf5d0..d5d1ce16fd 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: |