Merge pull request #39947 from obsidiansystems/libcxx-cross

lib{std,}c++: Fix setup hooks for cross
This commit is contained in:
John Ericson 2018-05-03 18:20:13 -04:00 committed by GitHub
commit 88d18d2e04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 104 additions and 16 deletions

View file

@ -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++"

View file

@ -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"}"

View file

@ -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"}"

View file

@ -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"}"

View file

@ -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"}"

View file

@ -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"}"

View file

@ -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"}"

View file

@ -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"}"