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

            Bug ID: 117967
           Summary: -Wno-hardened does not disable all -fhardened warnings
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dangelog at gmail dot com
  Target Milestone: ---

If gcc is invoked with -fhardened and certain linker options are passed, a
warning is always generated, even under -Wno-hardened:

> $ g++ -fhardened -Wno-hardened -shared -x c++ -o /dev/null - <<< 'void f();'
> g++: warning: linker hardening options not enabled by ‘-fhardened’ because 
> other link options were specified on the command line

I'm not sure if this warning should be emitted at all when building a shared
library (if relro doesn't make sense for a shared library, shouldn't it be
silently dropped?). In any case, it should be suppressable. This is possibly
related to #117739 . 

Thanks,

Reply via email to