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

            Bug ID: 117992
           Summary: gcc -flto -fharden leads to warning
           Product: gcc
           Version: 14.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: icenowy at aosc dot io
  Target Milestone: ---

When using the newly introduced "-fhardened" flag with "-flto", it leads to the
following warning:
```
gcc: warning: linker hardening options not enabled by '-fhardened' because
other link options were specified on the command line
gcc: warning: linker hardening options not enabled by '-fhardened' because
other link options were specified on the command line
```

I am compiling a dummy C file named main.c with content `int main(){}`
(quotation marks not included) with the command line `gcc main.c -fhardened -O2
-flto` and get this warning, removing `-flto` suppresses it.

GCC version is `14.2.0 20240801`.

Reply via email to