-fopenmp fails when gcc is compiled to /usr/local

2014-03-03 Thread John Frankish
Using gcc-4.7.2 compiled to /usr/local

The following fails:

echo "int main(){}" > hello.c
gcc hello.c -fopenmp

..with a message that libgomp.spec cannot be found

editing the output of gcc -dumpspecs:

include(libgomp.spec) -> include(/usr/local/lib/libgomp.spec)
include(libitm.spec) -> include(/usr/local/lib/libitm.spec)

fixes the error, but shouldn't be required.

Regards
John


compiling with "-flto -fuse-linker-plugin" gives libtool error

2015-11-29 Thread john . frankish
Compiling some packages with "-flto -fuse-linker-plugin" gives a libtool
error during "make". Compiling the same package without "-flto
-fuse-linker-plugin" allows "make" to complete without errors.

Using gcc-4.9.1/binutils-2.24.51 or gcc-5.2.0/binutils-2.25.1

The problem seems to occur with a few 10's of packages (eg cogl-1.20.0), but
not with others (eg gnome-music-3.16.2).

Using cogl-1.20.0 as an example:

CC="gcc -flto -fuse-linker-plugin -mtune=generic -Os -pipe" CXX="g++ -flto
-fuse-linker-plugin -mtune=generic -Os -pipe -fno-exceptions -fno-rtti"
./configure --prefix=/usr/local --disable-static --localstatedir=/var
--enable-gles1 --enable-gles2 --enable-cogl-gst=yes

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make
...
CC   cogl-enum-types.lo
CCLD libcogl.la
../libtool: eval: line 1: syntax error: unexpected "|"
Makefile:1507: recipe for target 'libcogl.la' failed
make[4]: *** [libcogl.la] Error 2

This can be fixed by using NM="gcc-nm", but as binutils was compiled with lto 
enabled, it shouldn't be required?