scons: Include libthr on freebsd no matter what compiler you're using.

The compiler won't change where the thread library is implemented.

Change-Id: Ic6fbaae2ff9c4a91ce86b06d62049b9d9a0e3132
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40960
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: B.A. Zeeb <baz21@cam.ac.uk>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2021-02-08 00:50:56 -08:00
parent dd0d54d749
commit 59e0ce27a3

View File

@@ -305,15 +305,20 @@ if main['GCC'] or main['CLANG']:
# As gcc and clang share many flags, do the common parts here
main.Append(CCFLAGS=['-pipe'])
main.Append(CCFLAGS=['-fno-strict-aliasing'])
# Enable -Wall and -Wextra and then disable the few warnings that
# we consistently violate
main.Append(CCFLAGS=['-Wall', '-Wundef', '-Wextra',
'-Wno-sign-compare', '-Wno-unused-parameter'])
# We always compile using C++14
main.Append(CXXFLAGS=['-std=c++14'])
if sys.platform.startswith('freebsd'):
main.Append(CCFLAGS=['-I/usr/local/include'])
main.Append(CXXFLAGS=['-I/usr/local/include'])
# On FreeBSD we need libthr.
main.Append(LIBS=['thr'])
conf.CheckLinkFlag('-Wl,--as-needed')
if GetOption('gold_linker'):
@@ -386,10 +391,6 @@ elif main['CLANG']:
main.Append(CXXFLAGS=['-stdlib=libc++'])
main.Append(LIBS=['c++'])
# On FreeBSD we need libthr.
if sys.platform.startswith('freebsd'):
main.Append(LIBS=['thr'])
# Add sanitizers flags
sanitizers=[]
if GetOption('with_ubsan'):