From 131437b76b67d29f0a0bfcc1fc16237d6ebfcf09 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 17 Sep 2021 11:41:17 +0000 Subject: 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]". --- sys/targets/targets.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit mrf-deployment