diff options
author | John Ericson <Ericson2314@yahoo.com> | 2018-05-03 18:20:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-03 18:20:13 -0400 |
commit | 88d18d2e04087aba8601a0a002749c6c6cbaba54 (patch) | |
tree | e73fcbc13578aba182e3f5b78df384df2f1c1650 /pkgs/development/compilers/llvm | |
parent | 8ac79d257598018f229686730dea6de849c7ef23 (diff) | |
parent | 39df5831cae0dce4628e80cf7f6f5520a9dae18e (diff) | |
download | nixlib-88d18d2e04087aba8601a0a002749c6c6cbaba54.tar nixlib-88d18d2e04087aba8601a0a002749c6c6cbaba54.tar.gz nixlib-88d18d2e04087aba8601a0a002749c6c6cbaba54.tar.bz2 nixlib-88d18d2e04087aba8601a0a002749c6c6cbaba54.tar.lz nixlib-88d18d2e04087aba8601a0a002749c6c6cbaba54.tar.xz nixlib-88d18d2e04087aba8601a0a002749c6c6cbaba54.tar.zst nixlib-88d18d2e04087aba8601a0a002749c6c6cbaba54.zip |
Merge pull request #39947 from obsidiansystems/libcxx-cross
lib{std,}c++: Fix setup hooks for cross
Diffstat (limited to 'pkgs/development/compilers/llvm')
7 files changed, 91 insertions, 14 deletions
diff --git a/pkgs/development/compilers/llvm/3.5/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/3.5/libc++/setup-hook.sh index 9022fced6ecf..e18733b5ea3a 100644 --- a/pkgs/development/compilers/llvm/3.5/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/3.5/libc++/setup-hook.sh @@ -1,3 +1,14 @@ +# The `hostOffset` describes how the host platform of the dependencies are slid +# relative to the depending package. It is brought into scope of the setup hook +# defined as the role of the dependency whose hooks is being run. +case $hostOffset in + -1) local role='BUILD_' ;; + 0) local role='' ;; + 1) local role='TARGET_' ;; + *) echo "cc-wrapper: Error: Cannot be used with $hostOffset-offset deps" >2; + return 1 ;; +esac + linkCxxAbi="@linkCxxAbi@" -export NIX_CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_${role}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" +export NIX_${role}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/3.7/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/3.7/libc++/setup-hook.sh index 9022fced6ecf..e18733b5ea3a 100644 --- a/pkgs/development/compilers/llvm/3.7/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/3.7/libc++/setup-hook.sh @@ -1,3 +1,14 @@ +# The `hostOffset` describes how the host platform of the dependencies are slid +# relative to the depending package. It is brought into scope of the setup hook +# defined as the role of the dependency whose hooks is being run. +case $hostOffset in + -1) local role='BUILD_' ;; + 0) local role='' ;; + 1) local role='TARGET_' ;; + *) echo "cc-wrapper: Error: Cannot be used with $hostOffset-offset deps" >2; + return 1 ;; +esac + linkCxxAbi="@linkCxxAbi@" -export NIX_CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_${role}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" +export NIX_${role}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/3.8/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/3.8/libc++/setup-hook.sh index 9022fced6ecf..bcd93cf486ff 100644 --- a/pkgs/development/compilers/llvm/3.8/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/3.8/libc++/setup-hook.sh @@ -1,3 +1,14 @@ +# The `hostOffset` describes how the host platform of the dependencies +# relative to the depending package. It is brought into scope of the setup hook +# defined as the role of the dependency whose hooks is being run. +case $hostOffset in + -1) local role='BUILD_' ;; + 0) local role='' ;; + 1) local role='TARGET_' ;; + *) echo "cc-wrapper: Error: Cannot be used with $hostOffset-offset deps" >2; + return 1 ;; +esac + linkCxxAbi="@linkCxxAbi@" -export NIX_CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_${role}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" +export NIX_${role}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/3.9/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/3.9/libc++/setup-hook.sh index 9022fced6ecf..bcd93cf486ff 100644 --- a/pkgs/development/compilers/llvm/3.9/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/3.9/libc++/setup-hook.sh @@ -1,3 +1,14 @@ +# The `hostOffset` describes how the host platform of the dependencies +# relative to the depending package. It is brought into scope of the setup hook +# defined as the role of the dependency whose hooks is being run. +case $hostOffset in + -1) local role='BUILD_' ;; + 0) local role='' ;; + 1) local role='TARGET_' ;; + *) echo "cc-wrapper: Error: Cannot be used with $hostOffset-offset deps" >2; + return 1 ;; +esac + linkCxxAbi="@linkCxxAbi@" -export NIX_CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_${role}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" +export NIX_${role}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/4/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/4/libc++/setup-hook.sh index 9022fced6ecf..bcd93cf486ff 100644 --- a/pkgs/development/compilers/llvm/4/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/4/libc++/setup-hook.sh @@ -1,3 +1,14 @@ +# The `hostOffset` describes how the host platform of the dependencies +# relative to the depending package. It is brought into scope of the setup hook +# defined as the role of the dependency whose hooks is being run. +case $hostOffset in + -1) local role='BUILD_' ;; + 0) local role='' ;; + 1) local role='TARGET_' ;; + *) echo "cc-wrapper: Error: Cannot be used with $hostOffset-offset deps" >2; + return 1 ;; +esac + linkCxxAbi="@linkCxxAbi@" -export NIX_CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_${role}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" +export NIX_${role}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/5/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/5/libc++/setup-hook.sh index 9022fced6ecf..bcd93cf486ff 100644 --- a/pkgs/development/compilers/llvm/5/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/5/libc++/setup-hook.sh @@ -1,3 +1,14 @@ +# The `hostOffset` describes how the host platform of the dependencies +# relative to the depending package. It is brought into scope of the setup hook +# defined as the role of the dependency whose hooks is being run. +case $hostOffset in + -1) local role='BUILD_' ;; + 0) local role='' ;; + 1) local role='TARGET_' ;; + *) echo "cc-wrapper: Error: Cannot be used with $hostOffset-offset deps" >2; + return 1 ;; +esac + linkCxxAbi="@linkCxxAbi@" -export NIX_CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_${role}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" +export NIX_${role}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/6/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/6/libc++/setup-hook.sh index 9022fced6ecf..bcd93cf486ff 100644 --- a/pkgs/development/compilers/llvm/6/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/6/libc++/setup-hook.sh @@ -1,3 +1,14 @@ +# The `hostOffset` describes how the host platform of the dependencies +# relative to the depending package. It is brought into scope of the setup hook +# defined as the role of the dependency whose hooks is being run. +case $hostOffset in + -1) local role='BUILD_' ;; + 0) local role='' ;; + 1) local role='TARGET_' ;; + *) echo "cc-wrapper: Error: Cannot be used with $hostOffset-offset deps" >2; + return 1 ;; +esac + linkCxxAbi="@linkCxxAbi@" -export NIX_CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_${role}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" +export NIX_${role}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" |