Created attachment 391592 [details] build log libtool: compile: x86_64-pc-linux-gnu-g++ -c -m64 -D_GNU_SOURCE -O2 -pipe -march=atom --param=l1-cache-size=24 --param=l1-cache-line-size=64 --param=l2-cache-size=512 -mtune=generic -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -flto=8 -ftree-vectorize -floop-parallelize-all -ftree-parallelize-loops=4 -fopenmp -fno-lto -fno-use-linker-plugin -O2 -Wall -DOPENAXIOM_ROOT_DIRECTORY=\"/usr/lib64/open-axiom/x86_64-pc-linux-gnu/1.4.2\" -I../../src/include -I../../config main.cc -o main.o >/dev/null 2>&1 ../../libtool --tag=CXX --mode=link x86_64-pc-linux-gnu-g++ -static -fopenmp -lgomp -fno-lto -fno-use-linker-plugin -m64 -all-static -o open-axiom main.lo -L./../utils -L./../lib -lOpenAxiom -lopen-axiom-core -lutil -lm -lm libtool: link: x86_64-pc-linux-gnu-g++ -fopenmp -fno-lto -fno-use-linker-plugin -m64 -static -o open-axiom .libs/main.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/libgomp.so -L./../utils -L./../lib -lOpenAxiom -lopen-axiom-core -lutil -lm /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../x86_64-pc-linux-gnu/bin/ld: attempted static link of dynamic object `/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/libgomp.so' collect2: error: ld returned 1 exit status
Created attachment 391594 [details] emerge --info
Wel, I am guessing it wouldn't happen it you didn't have: LDFLAGS="-fopenmp -lgomp" In your CFLAGS you negate -fopenmp with -fno-openmp I am afraid you have to remove that from LDLAGS too. Unfortunately you cannot negate "-lgomp" so you'll have to rethink how you configure your flags.
(In reply to Francois Bissey from comment #2) > Wel, I am guessing it wouldn't happen it you didn't have: > LDFLAGS="-fopenmp -lgomp" > In your CFLAGS you negate -fopenmp with -fno-openmp I am afraid you have to > remove that from LDLAGS too. Unfortunately you cannot negate "-lgomp" so > you'll have to rethink how you configure your flags. Well, while having '-lgomp' in LDFLAGS is not a clean thing, it should not break in this particular case. I'd say it looks like libtool bug misexpanding '-lgomp' to a dynamic '.so' library path. If you remove libgomp.la from gcc's libdir ir will compile happily. CC toolchain@ (gcc) and base-system@ (libtool).
there's no reason to have LDFLAGS=-lgomp. simply using LDFLAGS=-fopenmp is sufficient. libtool will expand -lfoo to the shared libs by design. pretty sure the problem is that, while -all-static was used, it was *after* the -lgomp flag. LDFLAGS is the wrong place for sticking -lfoo options because it gets expanded in the wrong place (needs to be before LDLIBS & objects by design).