aboutsummaryrefslogtreecommitdiffstats
path: root/sys/targets
diff options
context:
space:
mode:
authorAlexander Egorenov <eaibmz@gmail.com>2022-10-26 15:44:05 +0200
committerDmitry Vyukov <dvyukov@google.com>2022-10-26 21:07:28 -0700
commit5c716ff64acaf8672a9fe96c21951be48b2b8d5e (patch)
tree7c58c875bd3f6a19801d11ac127f002eade07ae3 /sys/targets
parent729b89b837233450284c187958dce585b67bd50e (diff)
sys/targets: fix -static-pie for s390x arch
On s390x, position independent code needs to be built with -fPIC or -fPIE for pie executables. How to reproduce on s390x ------------------------- $ git clone https://github.com/google/syzkaller.git $ cd syzkaller $ make executor go list -f '{{.Stale}}' ./sys/syz-sysgen | grep -q false || go install ./sys/syz-sysgen make .descriptions make[1]: '.descriptions' is up to date. mkdir -p ./bin/linux_s390x gcc -o ./bin/linux_s390x/syz-executor executor/executor.cc \ -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable \ -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds \ -Wno-format-overflow -static-pie -DGOOS_linux=1 -DGOARCH_s390x=1 \ -DHOSTGOOS_linux=1 -DGIT_REVISION=\"2159e4d29f58ffa1107fc2213dbc87185ff4498f\" /usr/bin/ld: read-only segment has dynamic relocations Signed-off-by: Alexander Egorenov <eaibmz@gmail.com>
Diffstat (limited to 'sys/targets')
-rw-r--r--sys/targets/targets.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/targets/targets.go b/sys/targets/targets.go
index f3be708f3..45db59d11 100644
--- a/sys/targets/targets.go
+++ b/sys/targets/targets.go
@@ -285,6 +285,7 @@ var List = map[string]map[string]*Target{
PtrSize: 8,
PageSize: 4 << 10,
DataOffset: 0xfffff000,
+ CFlags: []string{"-fPIE"},
LittleEndian: false,
Triple: "s390x-linux-gnu",
KernelArch: "s390",