[Bug driver/124987] New: Status of GCC patch for --help --verbose with linker flags (PR108328) and impact on visibility detection in curl

jiangxuezhi2 at huawei dot com gcc-bugzilla@gcc.gnu.org
Wed Apr 22 14:02:12 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124987

            Bug ID: 124987
           Summary: Status of GCC patch for --help --verbose with linker
                    flags (PR108328) and impact on visibility detection in
                    curl
           Product: gcc
           Version: 14.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jiangxuezhi2 at huawei dot com
  Target Milestone: ---

I'm writing to follow up on a small but impactful patch from January 2023 that
fixes an issue with gcc --help when linker flags like -Wl,... are present.

https://gcc.gnu.org/pipermail/gcc-patches/2023-January/609529.html

The issue can be reproduced with:

~~~shell
gcc -v -Wl,-z,relro --help | grep -i visibility
~~~

When -Wl,xxx is passed (or when CC contains such flags), the cc1 options
(including -fvisibility=) are missing from the help output. This happens
because n_infiles remains zero and the driver logic skips invoking
subprocesses.

This causes real problems for projects like curl. 
https://github.com/curl/curl/blob/master/m4/curl-compilers.m4#L1498

In m4/curl-compilers.m4, curl's configure script uses $CC --help --verbose to
detect whether -fvisibility=hidden is supported. If the check fails, symbol
hiding is silently disabled, resulting in larger binaries with more exported
symbols than necessary.

We've seen this in practice when CC includes hardening flags like -Wl,-z,relro
— the visibility feature goes undetected and the build quietly falls back to
less optimal settings.


So,does it make sense to merge that patch (PR108328), or is there a reason it
hasn't landed? Thanks for taking a look.


More information about the Gcc-bugs mailing list