diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2018-05-03 17:52:11 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2018-05-03 17:55:03 -0400 |
commit | 39df5831cae0dce4628e80cf7f6f5520a9dae18e (patch) | |
tree | b36300395928c7624a5c5f7258fdad85b8935a82 /pkgs | |
parent | b45ef79b74d267891a11c1775a473c610ecebe78 (diff) | |
download | nixlib-39df5831cae0dce4628e80cf7f6f5520a9dae18e.tar nixlib-39df5831cae0dce4628e80cf7f6f5520a9dae18e.tar.gz nixlib-39df5831cae0dce4628e80cf7f6f5520a9dae18e.tar.bz2 nixlib-39df5831cae0dce4628e80cf7f6f5520a9dae18e.tar.lz nixlib-39df5831cae0dce4628e80cf7f6f5520a9dae18e.tar.xz nixlib-39df5831cae0dce4628e80cf7f6f5520a9dae18e.tar.zst nixlib-39df5831cae0dce4628e80cf7f6f5520a9dae18e.zip |
lib{std,}c++: Fix setup hooks for cross
Diffstat (limited to 'pkgs')
8 files changed, 104 insertions, 16 deletions
diff --git a/pkgs/development/compilers/gcc/libstdc++-hook.sh b/pkgs/development/compilers/gcc/libstdc++-hook.sh index 893bbbc0c2dc..2325eeb9e2cf 100644 --- a/pkgs/development/compilers/gcc/libstdc++-hook.sh +++ b/pkgs/development/compilers/gcc/libstdc++-hook.sh @@ -1,2 +1,13 @@ -export NIX_CXXSTDLIB_COMPILE+=" -isystem $(echo -n @gcc@/include/c++/*) -isystem $(echo -n @gcc@/include/c++/*)/$(@gcc@/bin/gcc -dumpmachine)" -export NIX_CXXSTDLIB_LINK=" -stdlib=libstdc++" +# 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 + +export NIX_${role}CXXSTDLIB_COMPILE+=" -isystem $(echo -n @gcc@/include/c++/*) -isystem $(echo -n @gcc@/include/c++/*)/$(@gcc@/bin/gcc -dumpmachine)" +export NIX_${role}CXXSTDLIB_LINK=" -stdlib=libstdc++" 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"}" |