From ca31ce92a11021e67c81e2a3e2da51f45ec61f69 Mon Sep 17 00:00:00 2001 From: Yu-hsin Wang Date: Mon, 17 Oct 2022 13:59:18 +0800 Subject: [PATCH] scons: fix systrace header test Latest compilers default checks the unused and uninitialized. Those checks result in false negative of the header test. We fix it by replacing the temp variable to (void *)1. Btw, (void *)0 not works here because the function is declare with nonnull. https://elixir.bootlin.com/glibc/latest/source/debug/execinfo.h#L38 Change-Id: I3b51faf7595b861bfbd131c0a42fd6d78a5e9698 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64652 Maintainer: Gabe Black Tested-by: kokoro Reviewed-by: Gabe Black --- src/sim/SConsopts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sim/SConsopts b/src/sim/SConsopts index 07997c75f4..98be89bc30 100644 --- a/src/sim/SConsopts +++ b/src/sim/SConsopts @@ -31,7 +31,7 @@ import gem5_scons with gem5_scons.Configure(main) as conf: if conf.CheckLibWithHeader([None, 'execinfo'], 'execinfo.h', 'C', - 'char temp; backtrace_symbols_fd((void *)&temp, 0, 0);'): + 'backtrace_symbols_fd((void *)1, 0, 0);'): conf.env['BACKTRACE_IMPL'] = 'glibc' else: conf.env['BACKTRACE_IMPL'] = 'none'