From c872143864dcfee85c22db3904b4c05d0f1ddeae Mon Sep 17 00:00:00 2001 From: Hanhwi Jang Date: Tue, 30 Jan 2018 19:17:33 +0900 Subject: [PATCH] scons: Resolve backtrace implementation existence testing failure Change backtrace implementation testing code not to have NULL pointer. SCons fails to find backtrace implementation even if it exists. The implementation testing code contains NULL pointers as a backtrace buffer argument. Some compilers check the buffer is NULL pointed or not, and generate a compilation error. Change-Id: Icc5bc9a887b7a6bbc804b5b8a5a35a935c78a922 Reviewed-on: https://gem5-review.googlesource.com/7681 Reviewed-by: Gabe Black Maintainer: Gabe Black --- SConstruct | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index 09c3476d7..df647e725 100755 --- a/SConstruct +++ b/SConstruct @@ -814,11 +814,12 @@ if not GetOption('without_tcmalloc'): # list will be used by default. backtrace_impls = [ "none" ] -if conf.CheckLibWithHeader(None, 'execinfo.h', 'C', - 'backtrace_symbols_fd((void*)0, 0, 0);'): +backtrace_checker = 'char temp;' + \ + ' backtrace_symbols_fd((void*)&temp, 0, 0);' +if conf.CheckLibWithHeader(None, 'execinfo.h', 'C', backtrace_checker): backtrace_impls.append("glibc") elif conf.CheckLibWithHeader('execinfo', 'execinfo.h', 'C', - 'backtrace_symbols_fd((void*)0, 0, 0);'): + backtrace_checker): # NetBSD and FreeBSD need libexecinfo. backtrace_impls.append("glibc") main.Append(LIBS=['execinfo']) -- 2.30.2