[DTrace-devel] [PATCH 1/2] tests: do not pass -flto to the compiler or linker

Kris Van Hees kris.van.hees at oracle.com
Thu Jan 16 22:22:34 UTC 2025


On Thu, Jan 16, 2025 at 09:54:17PM +0000, Nick Alcock wrote:
> 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 at oracle.com>

Reviewed-by: Kris Van Hees <kris.van.hees at 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
> 



More information about the DTrace-devel mailing list