Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri, 9 Sep 2016 03:49:16 +0000 (UTC)
From: Musl Questions <>
To: "" <>
Subject: How to Compile Static Executables w/ PIE + SSP + BIND_NOW?

Arch Linux. Example app: mksh. 

CFLAGS+=' -static'
export CC CFLAGS 
sh -r -c lto

Using typical build flags:

CFLAGS="-march=amdfam15 -O2 -pipe -fstack-protector-all -fPIE"
LDFLAGS="-Wl,-z,now -Wl,-z,relro"

Does produce a static executable but without PIE or SSP. Have tried various options to no avail:

CFLAGS+=' -static -pie'


CFLAGS="-O2 -fstack-protector-strong"
LDFLAGS="-Wl,-z,now -Wl,-z,relro"

CFLAGS+=' -shared -pie -static'


CFLAGS="-O2 -fstack-protector-all"
LDFLAGS="-Wl,-z,now -Wl,-z,relro"
...and many other combos without success. How to create a static exe built against musl with PIE + SSP + BIND_NOW?

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.