From: Hanhwi Jang Date: Tue, 30 Jan 2018 10:17:33 +0000 (+0900) Subject: scons: Resolve backtrace implementation existence testing failure X-Git-Tag: v19.0.0.0~2334 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c872143864dcfee85c22db3904b4c05d0f1ddeae;p=gem5.git 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 --- 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'])