Skip to content

zig cc -c -fstack-protector stopped working #18009

@markus-oberhumer

Description

@markus-oberhumer

Zig Version

0.12.0-dev.1607+f8b38a174

Steps to Reproduce and Observed Behavior

At https://github.com/upx/upx-test-build-with-zig we are continuously testing building UPX for 104 different build targets, and it seems that recently -fstack-protector as used in zig cc -c -fstack-protector stopped working

Possible cause: commit 53f74d6 by @andrewrk

# create a C test file that uses some stack
echo 'void foo(void *); void bar(void) { char stack[256 * 1024]; foo(stack); }' > x.c

# works
./zig-linux-x86_64-0.12.0-dev.1504+81219586b/zig cc -target x86_64-linux-musl -fstack-protector -c x.c

# FAILS
./zig-linux-x86_64-0.12.0-dev.1607+f8b38a174/zig cc -target x86_64-linux-musl -fstack-protector -c x.c
error: unable to create compilation: StackProtectorUnsupportedByTarget

Expected Behavior

No error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.regressionIt worked in a previous version of Zig, but stopped working.zig ccZig as a drop-in C compiler feature

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions