Skip to content

building a c/c++ file with zig build-exe no longer enables stack-protector #18114

@xxxbxxx

Description

@xxxbxxx

Zig Version

0.12.0-dev.1585+5a91e94ef0

Steps to Reproduce and Observed Behavior

when compiling a c or c++ file, the stack-protector is no longer enabled
since 53f74d6 "move libssp into libcompiler_rt "

zig build-exe main.c -lc --verbose-cc
-> zig clang main.c [....] -fsanitize-trap=undefined -fno-sanitize=function -mred-zone -fno-omit-frame-pointer -fno-stack-protector -D_DEBUG -O0 [...]

(note that zig build-exe main.c -lc -fllvm does restore the previous behaviour)

Expected Behavior

zig build-exe main.c -lc --verbose-cc
-> zig clang main.c [....] -fsanitize-trap=undefined -fno-sanitize=function -mred-zone -fno-omit-frame-pointer -fstack-protector-strong --param ssp-buffer-size=4 -D_DEBUG -O0 [...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions