diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2018-07-04 22:37:23 +0100 |
---|---|---|
committer | Andreas K. Hüttel <dilfridge@gentoo.org> | 2018-08-04 13:53:14 +0200 |
commit | ee2fe1b35879308968b95c4ae86e93087a5cb4eb (patch) | |
tree | fe29368335bb76bf922d62e2c254a92348dbef62 | |
parent | [no-patch] locale-gen: suppress ignored error when emptying already empty dir... (diff) | |
download | glibc-ee2fe1b35879308968b95c4ae86e93087a5cb4eb.tar.gz glibc-ee2fe1b35879308968b95c4ae86e93087a5cb4eb.tar.bz2 glibc-ee2fe1b35879308968b95c4ae86e93087a5cb4eb.zip |
Gentoo: force -O0 in conform tests to survive $CC changes
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.
Bug: https://bugs.gentoo.org/659030
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-rw-r--r-- | conform/conformtest.pl | 6 | ||||
-rw-r--r-- | conform/linknamespace.pl | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/conform/conformtest.pl b/conform/conformtest.pl index a4ef756105..f2f5013c50 100644 --- a/conform/conformtest.pl +++ b/conform/conformtest.pl @@ -132,7 +132,7 @@ sub compiletest ++$skipped; printf (" SKIP\n"); } else { - $ret = system "$CC $CFLAGS -c $fnamebase.c -o $fnamebase.o > $fnamebase.out 2>&1"; + $ret = system "$CC $CFLAGS -O0 -c $fnamebase.c -o $fnamebase.o > $fnamebase.out 2>&1"; if ($ret != 0) { if ($optional != 0) { printf (" $errmsg\n"); @@ -270,7 +270,9 @@ sub checknamespace { close (TESTFILE); undef %errors; - open (CONTENT, "$CC $CFLAGS_namespace -E $fnamebase.c -P -Wp,-dN | sed -e '/^# [1-9]/d' -e '/^[[:space:]]*\$/d' |"); + # -O0 to negate effect of possible -O<N> passed to $CC + # See https://bugs.gentoo.org/659030#c6 + open (CONTENT, "$CC -O0 $CFLAGS_namespace -E $fnamebase.c -P -Wp,-dN | sed -e '/^# [1-9]/d' -e '/^[[:space:]]*\$/d' |"); loop: while (<CONTENT>) { chop; if (/^#define (.*)/) { diff --git a/conform/linknamespace.pl b/conform/linknamespace.pl index 3fc6aca621..d3d4bc84b5 100644 --- a/conform/linknamespace.pl +++ b/conform/linknamespace.pl @@ -162,7 +162,8 @@ foreach my $sym (@sym_data) { # detected by this script if the same namespace issue applies for # static linking. -@c_syms = list_exported_functions ("$CC $flags", $standard, $header, $tmpdir); +# -O0 avoid failures like '[initial] ptsname_r -> [libc.a(ptsname.o)] ptsname' +@c_syms = list_exported_functions ("$CC $flags -O0", $standard, $header, $tmpdir); $cincfile = "$tmpdir/undef-$$.c"; $cincfile_o = "$tmpdir/undef-$$.o"; $cincfile_sym = "$tmpdir/undef-$$.sym"; |