diff options
author | Hanhwi Jang <jang.hanhwi@gmail.com> | 2018-01-30 19:17:33 +0900 |
---|---|---|
committer | Hanhwi Jang <jang.hanhwi@gmail.com> | 2018-02-01 03:45:16 +0000 |
commit | c872143864dcfee85c22db3904b4c05d0f1ddeae (patch) | |
tree | 9b0d4d76bd298fe774b673da12693f924cd81737 /SConstruct | |
parent | b919065ac9144ad1280851c1050a4136854423d6 (diff) | |
download | gem5-c872143864dcfee85c22db3904b4c05d0f1ddeae.tar.xz |
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>
Diffstat (limited to 'SConstruct')
-rwxr-xr-x | SConstruct | 7 |
1 files 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']) |