From 0d5d880994660e231f82b7cb1dcfab744158f7e0 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 13 May 2020 11:12:01 -0700 Subject: [PATCH] libgo: build syscall test with -static This avoids problems finding libgo.so when running the test as root, which invokes the test as a child process in various limited environments. Fixes PR go/95061 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/233897 --- gcc/go/gofrontend/MERGE | 2 +- libgo/Makefile.am | 4 ++++ libgo/Makefile.in | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 02f6746cf6b..b63bb3bd547 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -876bdf3df3bb33dbf1414237d84be5da32a48082 +93b3d88515db85e203d54f382200b84b56b0ae4c The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/Makefile.am b/libgo/Makefile.am index dea09de592b..eff0e00e787 100644 --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -967,6 +967,10 @@ endif # Also use -fno-inline to get better results from the memory profiler. runtime_pprof_check_GOCFLAGS = -static-libgo -fno-inline +# Use -static for the syscall tests, because otherwise when +# running as root the re-execs ignore LD_LIBRARY_PATH. +syscall_check_GOCFLAGS = -static + extra_go_files_runtime_internal_sys = version.go runtime/internal/sys.lo.dep: $(extra_go_files_runtime_internal_sys) diff --git a/libgo/Makefile.in b/libgo/Makefile.in index 607b88c5878..872663865b8 100644 --- a/libgo/Makefile.in +++ b/libgo/Makefile.in @@ -1104,6 +1104,10 @@ runtime_internal_sys_lo_check_GOCFLAGS = -fgo-compiling-runtime # otherwise we can't get the line numbers. # Also use -fno-inline to get better results from the memory profiler. runtime_pprof_check_GOCFLAGS = -static-libgo -fno-inline + +# Use -static for the syscall tests, because otherwise when +# running as root the re-execs ignore LD_LIBRARY_PATH. +syscall_check_GOCFLAGS = -static extra_go_files_runtime_internal_sys = version.go extra_go_files_internal_cpu = cpugen.go extra_go_files_golang_org_x_sys_cpu = gcpugen.go -- 2.30.2