https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118048
Bug ID: 118048
Summary: `-h`support does not work everywhere
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: driver
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
partly forwarded From
https://www.reddit.com/r/gcc/comments/1he7lp5/im_not_asking_to_support_its_because_this_is_just/
-h from the driver is passed on to the linker (and is the same as --soname).
It works for arm-linux-gnueabi and aarch64-linux-gnu but not for
x86_64-linux-gnu.
aarch64/aarch64-linux.h:#define LINUX_TARGET_LINK_SPEC "%{h*} \
arc/linux.h:#define LINK_SPEC "%{h*} \
arm/linux-elf.h:#define LINUX_TARGET_LINK_SPEC "%{h*} \
or1k/linux.h:#define LINK_SPEC "%{h*} \
Also for solaris:
sol2.h: "%{h*} %{v:-V} \
And when it is not in the LINK_SPEC we get the following odd error message:
[apinski@xeond2 upstream-cross-aarch64]$ ~/upstream-gcc/bin/gcc -ht.so t.cc
gcc: error: unrecognized command-line option ‘-h’
This used to work with an older version of GCC wehre no error message happened
even if it was not passed on to the linker.