[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Strange linker flags transformation
From: |
Oleg Smolsky |
Subject: |
Strange linker flags transformation |
Date: |
Tue, 16 Mar 2021 15:29:32 -0700 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 |
Hello, I'm experimenting with a different compiler setup and, hitting an
issue with Libtool while tweaking linker flags. Here is what I am trying
to invoke:
/bin/bash ./libtool --tag=CC --mode=link /opt/gcc-10sr/bin/gcc -g
-Wall -O2 -ljsoncpp -lmodpbase64 -lczmq -lzmq -lcrypto -lsqlite3
-Wl,--dynamic-linker,/opt/sysroot/lib64/ld-linux-x86-64.so.2
-Wl,-rpath,/opt/sysroot/lib64 -Wl,-rpath,/opt/gcc-10sr/lib64,/opt/3p/lib
-L/opt/gcc-10sr/lib64 -L/opt/3p/lib -o xxx_test
test/xxx_test/src/xxx_test.o libtask.la libutest.la -lpthread -lrt
And here is what is actually invoked:
libtool: link: /opt/gcc-10sr/bin/gcc -g -Wall -O2 -Wl,--dynamic-linker
-Wl,/opt/sysroot/lib64/ld-linux-x86-64.so.2 -Wl,-rpath
-Wl,/opt/sysroot/lib64 -Wl,-rpath -Wl,/opt/gcc-10sr/lib64
-Wl,/opt/3p/lib -o xxx_test test/xxx_test/src/xxx_test.o -ljsoncpp
/opt/3p/lib/libczmq.so /opt/3p/lib/libzmq.so -lcrypto
/opt/3p/lib/libsqlite3.so -L/opt/gcc-10sr/lib64 -L/opt/3p/lib
./.libs/libtask.a /opt/3p/lib/libmodpbase64.so
/opt/gcc-10sr/lib/../lib64/libstdc++.so ./.libs/libutest.a -lpthread
-lrt -Wl,-rpath -Wl,/opt/3p/lib -Wl,-rpath
-Wl,/opt/gcc-10sr/lib/../lib64 -Wl,-rpath -Wl,/opt/3p/lib -Wl,-rpath
-Wl,/opt/gcc-10sr/lib/../lib64
I am trying to understand where the trailer of that command is coming
from (the stuff after -lrt). These linker flags are malformed. This
specific example results in the following message:
..../bin/ld: fatal error: /opt/3p/lib: pread failed: Is a directory
I am trying to understand how this transformation is made... but
struggling. I get different errors depending on how the -Wl,xxxxxx bits
are cut...
I would appreciate any pointers. Thanks!
Oleg.
- Strange linker flags transformation,
Oleg Smolsky <=