gem5-dev@gem5.org

The gem5 Developer List

View all threads

[S] Change in gem5/gem5[develop]: scons: Add stdc++fs and libc++experimental for clang LIBS env

MJ
Melissa Jost (Gerrit)
Thu, Apr 13, 2023 6:54 PM

Melissa Jost has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/69777?usp=email )

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

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 'libc++experimental' to be linked for versions of clang
6 and older, and 'stdc++fs' to be linked for clang versions 7
through 9.

Change-Id: I4fa03923e8dc616046dead939c77d49b301de36b

M SConstruct
1 file changed, 17 insertions(+), 0 deletions(-)

diff --git a/SConstruct b/SConstruct
index e91e700..55d36ec 100755
--- a/SConstruct
+++ b/SConstruct
@@ -511,6 +511,23 @@

      env.Append(TCMALLOC_CCFLAGS=['-fno-builtin'])
  •    if compareVersions(env['CXXVERSION'], "10") < 0:
    
  •        # `libstdc++fs`` must be explicitly linked for  
    

`std::filesystem``

  •        # in clang versions 7 through 9. For clang version 6,
    
  •        # `libc++experimental`` must be explicitly linked instead.
    
  •        # As of clang version 10, this is not required.
    
  •        #
    
  •        # In addition, for clang versions 6 through 9,  the
    
  •        # `std::filesystem` is under the `experimental`
    
  •        # namespace(`std::experimental::filesystem`).
    
  •        #
    
  •        # Note: gem5 does not support clang versions < 6.
    
  •        if compareVersions(env['CXXVERSION'], "6") < 0:
    
  •            env.Append(LIBS=['libc++experimental'])
    
  •        else:
    
  •            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":
    

--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/69777?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I4fa03923e8dc616046dead939c77d49b301de36b
Gerrit-Change-Number: 69777
Gerrit-PatchSet: 1
Gerrit-Owner: Melissa Jost melissakjost@gmail.com
Gerrit-MessageType: newchange

Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/69777?usp=email ) Change subject: scons: Add stdc++fs and libc++experimental for clang LIBS env ...................................................................... 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 'libc++experimental' to be linked for versions of clang 6 and older, and 'stdc++fs' to be linked for clang versions 7 through 9. Change-Id: I4fa03923e8dc616046dead939c77d49b301de36b --- M SConstruct 1 file changed, 17 insertions(+), 0 deletions(-) diff --git a/SConstruct b/SConstruct index e91e700..55d36ec 100755 --- a/SConstruct +++ b/SConstruct @@ -511,6 +511,23 @@ env.Append(TCMALLOC_CCFLAGS=['-fno-builtin']) + if compareVersions(env['CXXVERSION'], "10") < 0: + # `libstdc++fs`` must be explicitly linked for `std::filesystem`` + # in clang versions 7 through 9. For clang version 6, + # `libc++experimental`` must be explicitly linked instead. + # As of clang version 10, this is not required. + # + # In addition, for clang versions 6 through 9, the + # `std::filesystem` is under the `experimental` + # namespace(`std::experimental::filesystem`). + # + # Note: gem5 does not support clang versions < 6. + if compareVersions(env['CXXVERSION'], "6") < 0: + env.Append(LIBS=['libc++experimental']) + else: + 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": -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69777?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I4fa03923e8dc616046dead939c77d49b301de36b Gerrit-Change-Number: 69777 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost <melissakjost@gmail.com> Gerrit-MessageType: newchange