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 <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user