From 78494d166f1bbede620120c506ccd9f7878b05f9 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sun, 26 Sep 2021 15:53:26 -0400 Subject: sys/targets: do not build syz-executor as a PIE on FreeBSD (#2776) clang does not handle -static-pie, so syz-executor does not get built. Moreover, clang's FreeBSD driver does not properly support the creation of static PIEs; for instance, it always links libc.a, which is not compiled as PIC, instead of libc_pic.a. Until this is addressed somehow, we have to keep ASLR disabled. --- sys/targets/targets.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/targets/targets.go b/sys/targets/targets.go index 6296c3827..2f696b4b3 100644 --- a/sys/targets/targets.go +++ b/sys/targets/targets.go @@ -464,7 +464,8 @@ var oses = map[string]osCommon{ ExecutorUsesForkServer: true, KernelObject: "kernel.full", CPP: "g++", - cflags: []string{"-static-pie", "-lc++"}, + // FreeBSD is missing toolchain support for static PIEs. + cflags: []string{"-static", "-lc++"}, }, Darwin: { SyscallNumbers: true, -- cgit mrf-deployment