scons: Add stdc++fs and libc++experimental for clang LIBS env

This change fixes a failure in the compiler tests:
https://jenkins.gem5.org/job/compiler-checks/573/

These tests were failing due to the use of `std::filesystem`, which
requires 'stdc++fs' to be linked for clang versions 6
through 10.

Change-Id: I4fa03923e8dc616046dead939c77d49b301de36b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69777
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Melissa Jost
2023-04-13 11:40:37 -07:00
committed by Melissa Jost
parent 6fdf0beedc
commit 912795afd3

View File

@@ -512,6 +512,18 @@ for variant_path in variant_paths:
env.Append(TCMALLOC_CCFLAGS=['-fno-builtin'])
if compareVersions(env['CXXVERSION'], "11") < 0:
# `libstdc++fs`` must be explicitly linked for `std::filesystem``
# in clang versions 6 through 10.
#
# In addition, for these versions, the
# `std::filesystem` is under the `experimental`
# namespace(`std::experimental::filesystem`).
#
# Note: gem5 does not support clang versions < 6.
env.Append(LIBS=['stdc++fs'])
# On Mac OS X/Darwin we need to also use libc++ (part of XCode) as
# opposed to libstdc++, as the later is dated.
if sys.platform == "darwin":