Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 532482 - [science overlay] sci-mathematics/open-axiom-1.4.2 - ld: attempted static link of dynamic object `/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/libgomp.so'
Summary: [science overlay] sci-mathematics/open-axiom-1.4.2 - ld: attempted static lin...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-13 17:49 UTC by w0rm
Modified: 2015-05-25 23:57 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (file_532482.txt,63.04 KB, text/plain)
2014-12-13 17:49 UTC, w0rm
Details
emerge --info (file_532482.txt,20.53 KB, text/plain)
2014-12-13 17:52 UTC, w0rm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description w0rm 2014-12-13 17:49:59 UTC
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
Comment 1 w0rm 2014-12-13 17:52:00 UTC
Created attachment 391594 [details]
emerge --info
Comment 2 François Bissey 2014-12-14 01:17:59 UTC
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.
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2014-12-15 22:13:06 UTC
(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).
Comment 4 SpanKY gentoo-dev 2015-05-25 23:57:33 UTC
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).