aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2021-09-17 11:41:17 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2021-09-17 15:00:18 +0200
commit131437b76b67d29f0a0bfcc1fc16237d6ebfcf09 (patch)
tree0d0362b87e8afc8f67d51b11ab085c0b2e29ad0d
parent5b989942e1043028009d3a08610a8f52efad7330 (diff)
sys/targets: do not set -static-pie for OpenBSD
In this case, executables are PIE by default and clang starts to compain about "error: argument unused during compilation: '-static-pie' [-Werror,-Wunused-command-line-argument]".
-rw-r--r--sys/targets/targets.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/targets/targets.go b/sys/targets/targets.go
index 0ae185554..6296c3827 100644
--- a/sys/targets/targets.go
+++ b/sys/targets/targets.go
@@ -367,7 +367,8 @@ var List = map[string]map[string]*Target{
PageSize: 4 << 10,
LittleEndian: true,
CCompiler: "c++",
- CFlags: []string{"-m64", "-static-pie", "-lutil"},
+ // PIE is enabled on OpenBSD by default, so no need for -static-pie.
+ CFlags: []string{"-m64", "-static", "-lutil"},
NeedSyscallDefine: func(nr uint64) bool {
switch nr {
case 8: // SYS___tfork