From d52eff2843084b3aeada4e46029519cf17067385 Mon Sep 17 00:00:00 2001 From: Andrew Donnellan Date: Thu, 10 Oct 2019 10:56:46 +1100 Subject: sys/targets: Disable PIE/ASLR when building tests Due to issues with ASLR + ASan on ppc64le (see #1446), add the -no-pie flag to the test target so tests will pass. Signed-off-by: Andrew Donnellan --- sys/targets/targets.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'sys/targets') diff --git a/sys/targets/targets.go b/sys/targets/targets.go index 98cb00c07..f30a10c2c 100644 --- a/sys/targets/targets.go +++ b/sys/targets/targets.go @@ -69,10 +69,11 @@ func Get(OS, arch string) *Target { var List = map[string]map[string]*Target{ "test": { "64": { - PtrSize: 8, - PageSize: 4 << 10, - CFlags: []string{"-m64"}, - CrossCFlags: []string{"-m64", "-fsanitize=address"}, + PtrSize: 8, + PageSize: 4 << 10, + CFlags: []string{"-m64"}, + // Compile with -no-pie due to issues with ASan + ASLR on ppc64le + CrossCFlags: []string{"-m64", "-fsanitize=address", "-no-pie"}, osCommon: osCommon{ SyscallNumbers: true, SyscallPrefix: "SYS_", @@ -81,10 +82,11 @@ var List = map[string]map[string]*Target{ }, }, "64_fork": { - PtrSize: 8, - PageSize: 8 << 10, - CFlags: []string{"-m64"}, - CrossCFlags: []string{"-m64", "-fsanitize=address"}, + PtrSize: 8, + PageSize: 8 << 10, + CFlags: []string{"-m64"}, + // Compile with -no-pie due to issues with ASan + ASLR on ppc64le + CrossCFlags: []string{"-m64", "-fsanitize=address", "-no-pie"}, osCommon: osCommon{ SyscallNumbers: true, SyscallPrefix: "SYS_", -- cgit mrf-deployment