Skip to content

Options -Wtrampolines and -fstack-clash-protection not universal #277

@david-a-wheeler

Description

@david-a-wheeler

In the compiler option hardening materials, running the new "make" test on clang on MacOS causes failures with clang:

make
cc -O2 -Wall -Wformat=2 -Wconversion -Wtrampolines -Wimplicit-fallthrough  -D_FORTIFY_SOURCE=3  -D_GLIBCXX_ASSERTIONS  -fstack-clash-protection -fstack-protector-strong  -Wl,-z,nodlopen -Wl,-z,noexecstack  -Wl,-z,relro -Wl,-z,now  -fPIE -pie -fPIC -shared     demo.c   -o demo
clang: warning: argument unused during compilation: '-fstack-clash-protection' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
warning: unknown warning option '-Wtrampolines' [-Wunknown-warning-option]
1 warning generated.
ld: unknown option: -z

The -pie problem is known, and resolved by using -fpie. But -Wtrampolines and -fstack-clash-protection are not universal.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions