Linux DTrace development list
 help / color / mirror / Atom feed
* [PATCH 1/2] tests: do not pass -flto to the compiler or linker
@ 2025-01-16 21:54 Nick Alcock
  2025-01-16 21:54 ` [PATCH 2/2] drti: do not compile with LTO Nick Alcock
  2025-01-16 22:22 ` [PATCH 1/2] tests: do not pass -flto to the compiler or linker Kris Van Hees
  0 siblings, 2 replies; 4+ messages in thread
From: Nick Alcock @ 2025-01-16 21:54 UTC (permalink / raw)
  To: dtrace, dtrace-devel

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 <nick.alcock@oracle.com>
---
 runtest.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/runtest.sh b/runtest.sh
index 94634f80c2ebf..1cb5be8213396 100755
--- a/runtest.sh
+++ b/runtest.sh
@@ -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
-- 
2.47.1.279.g84c5f4e78e


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-16 22:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16 21:54 [PATCH 1/2] tests: do not pass -flto to the compiler or linker Nick Alcock
2025-01-16 21:54 ` [PATCH 2/2] drti: do not compile with LTO Nick Alcock
2025-01-16 22:24   ` Kris Van Hees
2025-01-16 22:22 ` [PATCH 1/2] tests: do not pass -flto to the compiler or linker Kris Van Hees

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox