tests: do not pass -flto to the compiler or linker
PATCH 1/2 tests: do not pass -flto to the compiler or linker
We don't want to compile tests with -flto by default: if the distro compiler automatically activates it, turn it off by explicitly passing -fno-lto to all compiler and linker invocations in the testsuite.
(This is a bit fiddly because this is the first CPPFLAG which is not also a valid flag to dtrace(1) itself, so we have to split a variable up a bit.)
--- runtest.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
runtest.sh +4 -3
@@ -589,8 +589,9 @@ else exit 1 fi fi -export test_cppflags -export test_ldflags +core_raw_dt_flags="$test_cppflags" +export test_cppflags="$test_cppflags -fno-lto" +export test_ldflags="$test_ldflags -fno-lto" export test_libdir # Figure out if the preprocessor supports -fno-diagnostics-show-option: if it
@@ -1085,7 +1086,7 @@ for dt in $dtrace; do # Default and substitute in flags. The raw_dt_flags apply even to a # sh invocation. - raw_dt_flags="$test_cppflags" + raw_dt_flags="$core_raw_dt_flags" expected_tag= if [[ $testonly =~ ^err\.D_ ]]; then
Signature · 1 line
2.47.1.279.g84c5f4e78e
PATCH 2/2 drti: do not compile with LTO
drti.o is shipped as object code and can be reused by many compiler
versions: we must not put LTO IR into it.
--- libdtrace/Build | 4 ++++ 1 file changed, 4 insertions(+)
libdtrace/Build +4 -0
@@ -122,6 +122,10 @@ dt_prov_uprobe.c_CFLAGS := -Wno-pedantic dt_debug.c_CFLAGS := -Wno-prio-ctor-dtor drti.c_CFLAGS := -Wno-prio-ctor-dtor +# drti is shipped as an object file, so do not ever generate +# LTO for it, since that is compiler-version-specific. +drti.c_CFLAGS += -fno-lto + SHORTKERNELS := $(foreach kernel,$(KERNELS),$(shell printf %s $(kernel) | sed -e 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$$/\1.\2.\3/')) -include libdtrace/$(ARCHINC)/Build
Signature · 1 line
2.47.1.279.g84c5f4e78e
Re: [PATCH 2/2] drti: do not compile with LTO
Quoted 4 lines · Nick Alcock
drti.o is shipped as object code and can be reused by many compiler
versions: we must not put LTO IR into it.Signed-off-by Nick Alcock <[email protected]>
Quoted 22 lines
--- libdtrace/Build | 4 ++++ 1 file changed, 4 insertions(+)libdtrace/Build +4
-0@@ -122,6 +122,10 @@ dt_prov_uprobe.c_CFLAGS := -Wno-pedantic dt_debug.c_CFLAGS := -Wno-prio-ctor-dtor drti.c_CFLAGS := -Wno-prio-ctor-dtor +# drti is shipped as an object file, so do not ever generate +# LTO for it, since that is compiler-version-specific. +drti.c_CFLAGS += -fno-lto + SHORTKERNELS := $(foreach kernel,$(KERNELS),$(shell printf %s $(kernel) | sed -e 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$$/\1.\2.\3/')) -include libdtrace/$(ARCHINC)/BuildSignature · 1 line
2.47.1.279.g84c5f4e78e
Quoted 9 lines · Nick Alcock
We don't want to compile tests with -flto by default: if the distro compiler automatically activates it, turn it off by explicitly passing -fno-lto to all compiler and linker invocations in the testsuite.
(This is a bit fiddly because this is the first CPPFLAG which is not also a valid flag to dtrace(1) itself, so we have to split a variable up a bit.)
Signed-off-by Nick Alcock <[email protected]>
Quoted 32 lines
--- runtest.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)runtest.sh +4
-3@@ -589,8 +589,9 @@ else exit 1 fi fi -export test_cppflags -export test_ldflags +core_raw_dt_flags="$test_cppflags" +export test_cppflags="$test_cppflags -fno-lto" +export test_ldflags="$test_ldflags -fno-lto" export test_libdir # Figure out if the preprocessor supports -fno-diagnostics-show-option: if it@@ -1085,7 +1086,7 @@ for dt in $dtrace; do # Default and substitute in flags. The raw_dt_flags apply even to a # sh invocation. - raw_dt_flags="$test_cppflags" + raw_dt_flags="$core_raw_dt_flags" expected_tag= if [[ $testonly =~ ^err\.D_ ]]; thenSignature · 1 line
2.47.1.279.g84c5f4e78e