Re: the mystery of math.h in lib/gcc/%triple-name%/%gcc-version%/include-fixed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/24/2018 11:23 AM, Jonathan Wakely wrote:
On Wed, 24 Oct 2018 at 16:05, Dennis Clarke wrote:
So the mess seems to be that one must have these include-fixed headers
in place OR not.

As I said earlier, when libstdc++ is built it looks at the target
headers and checks which features are present in the libc headers. It
then assumes that doesn't change. If the host machine's headers change
significantly, that can invalidate the configuration that libstdc++
decided on at build time.

Due to the significant changes to the libc <math.h> as part of patch
119966-02, I expect you cannot take a libstdc++ built on an unpatched
system and run it on a patched system.


Rainer should be able to confirm it, but I think this is related to
https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00330.html -- that patch
is present in all versions of GCC 7 and 8, so if you're seeing
problems with those versions then I suspect it's due to differences
between <math.h> when libstdc++ was configured and when you're trying
to use it.

What's not clear from your email is whether you built those versions
of GCC on the host machines where you're testing them (and if so,
whether it was before or after installing patch 119966-02) or whether
you built them on one machine and then copied them to the other hosts.


Thank you Jonathan.  This had me up late last night looking over three
different builds of gcc that go back at least two years.  Clearly two
years.  A few machines have those dastdardly libm patches and other
machines do not.  The gcc builds that were wonderfully bootstrapped on
systems without that libm patches are of course borked on any system
that has them. I suspect the reverse is also true.

So machine "b" did the bootstrap4 of 8.2.0 and the libm patches are NOT
there on that machine. I also have gcc 7.3.0 on machine "b" which was
built elsewhere :

Machine "b" has the unborked math.h :

b$ ls -lapb /usr/include/math.h
-rw-r--r--   1 root     bin         9694 Aug  7  2009 /usr/include/math.h
b$

gcc 7.3.0 fails here :

b$ /usr/local/gcc7/bin/g++ -m64 -Wl,-rpath=/usr/local/lib/\$ISALIST -o foo foo.cpp > /dev/null 2>&1
b$ echo $?
1
b$

gcc 8.2.0 works fine as it was bootstrapped here :

b$ /usr/local/gcc8/bin/g++ --version | head -1
g++ (GCC) 8.2.0
b$

b$ /usr/local/gcc8/bin/g++ -m64 -Wl,-rpath=/usr/local/lib/\$ISALIST -o foo foo.cpp > /dev/null 2>&1
b$ echo $?
0
b$
b$ ls -ladb /usr/local/gcc8/bin/g++ /usr/local/gcc7/bin/g++
-rwxr-xr-x 4 root root 6286112 Apr 18 2018 /usr/local/gcc7/bin/g++ -rwxr-xr-x 4 root root 6673584 Oct 23 15:59 /usr/local/gcc8/bin/g++

However the 7.3.0 has math.h in the include-fixed and that doesn't matter:

/usr/local/gcc7/lib/gcc/sparc64-sun-solaris2.10/7.3.0/include-fixed/math.h


What a mess.

Dennis



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux