Strange linker flags transformation

Oleg Smolsky <[email protected]>
Newsgroups gmane.comp.gnu.libtool.general
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.