diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Keep the builder's home directory out of the binary
Git's Makefile defaults `prefix` to `$HOME` and compiles it into
`exec-cmd.o` as the fallback runtime prefix, so each build embedded
the path of whoever ran it and no two builders could produce the same
bytes. The release script also maps the build directory out of the
debug info, which otherwise differs between checkouts.
Diffstat (limited to '')
| -rwxr-xr-x | tools/release-build.sh | 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 6 insertions, 0 deletions
diff --git a/tools/release-build.sh b/tools/release-build.sh index c5ca6e9..a6d10dc 100755 --- a/tools/release-build.sh +++ b/tools/release-build.sh @@ -62,6 +62,12 @@ if supports "-fstack-clash-protection"; then CFLAGS="$CFLAGS -fstack-clash-protection" fi +# The debug info otherwise records the absolute build directory, so the same +# sources built in two checkouts would differ. +if supports "-ffile-prefix-map=/x=."; then + CFLAGS="$CFLAGS -ffile-prefix-map=$PWD=." +fi + LDFLAGS="-pie -Wl,-z,relro,-z,now -Wl,-z,noexecstack" # These reach only the cgit objects, so git's own sources are not held to them. |
