-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
10k staging builds are not yet finished on Hydra (mostly darwin), but we now have a 20k jobs rebuilding directly on master, so we would never get to merge this way...
- Loading branch information
Showing
67 changed files
with
423 additions
and
1,538 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
pkgs/build-support/binutils-wrapper/macos-sierra-reexport-hack.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
#! @shell@ | ||
|
||
set -eu -o pipefail | ||
|
||
path_backup="$PATH" | ||
if [ -n "@coreutils_bin@" ]; then | ||
PATH="@coreutils_bin@/bin" | ||
fi | ||
|
||
declare -r recurThreshold=300 | ||
|
||
declare overflowCount=0 | ||
for ((n=0; n < $#; ++n)); do | ||
case "${!n}" in | ||
-l*) let overflowCount+=1 ;; | ||
-reexport-l*) let overflowCount+=1 ;; | ||
*) ;; | ||
esac | ||
done | ||
|
||
declare -a allArgs=() | ||
|
||
if (( "$overflowCount" <= "$recurThreshold" )); then | ||
allArgs=("$@") | ||
else | ||
declare -a childrenLookup=() childrenLink=() | ||
|
||
while (( $# )); do | ||
case "$1" in | ||
-L/*) | ||
childrenLookup+=("$1") | ||
allArgs+=("$1") | ||
;; | ||
-L) | ||
echo "cctools LD does not support '-L foo' or '-l foo'" >&2 | ||
exit 1 | ||
;; | ||
-l) | ||
echo "cctools LD does not support '-L foo' or '-l foo'" >&2 | ||
exit 1 | ||
;; | ||
-lazy_library | -lazy_framework | -lto_library) | ||
# We aren't linking any "azy_library", "to_library", etc. | ||
allArgs+=("$1") | ||
;; | ||
-lazy-l | -weak-l) allArgs+=("$1") ;; | ||
# We can't so easily prevent header issues from these. | ||
-lSystem) allArgs+=("$1") ;; | ||
# Special case as indirection seems like a bad idea for something | ||
# so fundamental. Can be removed for simplicity. | ||
-l?* | -reexport-l?*) childrenLink+=("$1") ;; | ||
*) allArgs+=("$1") ;; | ||
esac | ||
|
||
shift | ||
done | ||
|
||
declare n=0 | ||
while (( $n < "${#childrenLink[@]}" )); do | ||
if [[ "${childrenLink[n]}" = -l* ]]; then | ||
childrenLink[n]="-reexport${childrenLink[n]}" | ||
fi | ||
let ++n | ||
done | ||
unset n | ||
|
||
declare -r outputNameLibless=$(basename $( \ | ||
if [[ -z "${outputName:+isUndefined}" ]]; then | ||
echo unnamed | ||
elif [[ "${outputName:0:3}" = lib ]]; then | ||
echo "${outputName:3}" | ||
else | ||
echo "${outputName}" | ||
fi)) | ||
declare -ra children=("$outputNameLibless-reexport-delegate-0" \ | ||
"$outputNameLibless-reexport-delegate-1") | ||
mkdir -p "$out/lib" | ||
PATH="$PATH:@out@/bin" | ||
symbolBloatObject=$outputNameLibless-symbol-hack.o | ||
if [[ ! -e $symbolBloatObject ]]; then | ||
# `-Q` means use GNU Assembler rather than Clang, avoiding an awkward | ||
# dependency cycle. | ||
printf '.private_extern _______child_hack_foo\nchild_hack_foo:\n' \ | ||
| @binPrefix@as -Q -- -o $symbolBloatObject | ||
fi | ||
# first half of libs | ||
@binPrefix@ld -macosx_version_min $MACOSX_DEPLOYMENT_TARGET -arch x86_64 -dylib \ | ||
-o "$out/lib/lib${children[0]}.dylib" \ | ||
-install_name "$out/lib/lib${children[0]}.dylib" \ | ||
"${childrenLookup[@]}" "$symbolBloatObject" \ | ||
"${childrenLink[@]:0:$((${#childrenLink[@]} / 2 ))}" | ||
# second half of libs | ||
@binPrefix@ld -macosx_version_min $MACOSX_DEPLOYMENT_TARGET -arch x86_64 -dylib \ | ||
-o "$out/lib/lib${children[1]}.dylib" \ | ||
-install_name "$out/lib/lib${children[1]}.dylib" \ | ||
"${childrenLookup[@]}" "$symbolBloatObject" \ | ||
"${childrenLink[@]:$((${#childrenLink[@]} / 2 ))}" | ||
allArgs+=("-L$out/lib" "-l${children[0]}" "-l${children[1]}") | ||
fi | ||
PATH="$path_backup" | ||
exec @prog@ "${allArgs[@]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.
@Ericson2314 is this a left-over of the revert of your commit?