G++ driver missing option when sending to collect2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,
I have a compiler driver issue when using g++. I want to check whether it
is a bug.
I send '-Wl,--start-group x.o -lc -Wl,--end-group' to g++, but the command
collect2 received is '--start-group x.o --end-group' like the following
commands:

$ riscv32-unknown-elf-g++ test.o -Wl,--start-group x.o -lc -Wl,--end-group
-v 2>&1 | grep collect2
/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../libexec/gcc/riscv32-unknown-elf/11.0.0/collect2
-plugin
/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../libexec/gcc/riscv32-unknown-elf/11.0.0/liblto_plugin.so
-plugin-opt=/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../libexec/gcc/riscv32-unknown-elf/11.0.0/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccoy0c2c.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgloss
-plugin-opt=-pass-through=-lgcc -melf32lriscv
/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../lib/gcc/riscv32-unknown-elf/11.0.0/../../../../riscv32-unknown-elf/lib/crt0.o
/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../lib/gcc/riscv32-unknown-elf/11.0.0/crtbegin.o
-L/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../lib/gcc/riscv32-unknown-elf/11.0.0
-L/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../lib/gcc
-L/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../lib/gcc/riscv32-unknown-elf/11.0.0/../../../../riscv32-unknown-elf/lib
test.o --start-group x.o --end-group -lstdc++ -lm -lc -lgcc --start-group
-lc -lgloss --end-group -lgcc
/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../lib/gcc/riscv32-unknown-elf/11.0.0/crtend.o

Also I don't have the issue when using gcc:
$riscv32-unknown-elf-gcc test.o -Wl,--start-group x.o -lc -Wl,--end-group
-v 2>&1 | grep collect2
 /home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../libexec/gcc/riscv32-unknown-elf/11.0.0/collect2
-plugin
/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../libexec/gcc/riscv32-unknown-elf/11.0.0/liblto_plugin.so
-plugin-opt=/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../libexec/gcc/riscv32-unknown-elf/11.0.0/lto-wrapper
-plugin-opt=-fresolution=/tmp/cccekJC0.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgloss
-plugin-opt=-pass-through=-lgcc -melf32lriscv
/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../lib/gcc/riscv32-unknown-elf/11.0.0/../../../../riscv32-unknown-elf/lib/crt0.o
/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../lib/gcc/riscv32-unknown-elf/11.0.0/crtbegin.o
-L/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../lib/gcc/riscv32-unknown-elf/11.0.0
-L/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../lib/gcc
-L/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../lib/gcc/riscv32-unknown-elf/11.0.0/../../../../riscv32-unknown-elf/lib
test.o --start-group x.o -lc --end-group -lgcc --start-group -lc -lgloss
--end-group -lgcc
/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../lib/gcc/riscv32-unknown-elf/11.0.0/crtend.o

My g++ configuration:
$riscv32-unknown-elf-g++ -v
Using built-in specs.
COLLECT_GCC=/home/users1/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/riscv32-unknown-elf-g++
COLLECT_LTO_WRAPPER=/home/users/eddiekuo/upstream_toolchain/riscv32-unknown-elf/bin/../libexec/gcc/riscv32-unknown-elf/11.0.0/lto-wrapper
Target: riscv32-unknown-elf
Configured with: ../gcc/configure --target=riscv32-unknown-elf
--prefix=/home/users1/eddiekuo/upstream_toolchain/riscv32-unknown-elf
--enable-languages=c,c++ --disable-multilib --without-headers
--disable-shared --disable-threads --disable-libatomic --disable-libmudflap
--disable-libssp --with-newlib
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20210223 (experimental) (GCC)

Thanks,
Yeting



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux