Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion automation/bundle-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"recipe": {
"path": "build.sh",
"version": 1,
"sha256": "4bee95d75db3dfd03dc2ebc04be08037a23ef002a4aaa004b4d2f596780e35ee"
"sha256": "5237a3f2ff5a3816fc6958cf2e41220e0375833ae380e63686be34dd99f142ad"
},
"toolchain": {
"profile_id": null,
Expand Down
9 changes: 7 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ export TCC_COMMIT_FULL_HASH=$(git rev-parse HEAD)

## vlang/v#29744: with chained fixups, TCC lists the zero-fill __bss pages in __DATA's
## page_count, and macOS 27 dyld maps them from the file, which gives garbage globals.
## The patch counts only file-backed pages. It is only needed for builds that keep chained fixups.
## The patch counts only file-backed pages. It only affects builds that keep chained fixups,
## so the configure step below (--config-new_macho=no) does not use it. See vlang/v#29744.
git apply "$TCCMACHO_PATCH" || {
echo "tccmacho page_count patch failed to apply" >&2
exit 2
Expand All @@ -80,6 +81,10 @@ for i in include/*.h; do echo $i; ln -s $i $(basename $i); done

# --libdir=$TCC_FOLDER/lib \

## --config-new_macho=no: write the older LC_DYLD_INFO_ONLY rebase/bind info instead of
## chained fixups. TCC's chained fixups also list the zero-fill __bss pages, which macOS 27
## then maps from the file, so programs can start with garbage in their globals.
## See https://github.com/vlang/v/issues/29744 .
./configure \
--prefix=$TCC_FOLDER \
--bindir=$TCC_FOLDER \
Expand All @@ -88,7 +93,7 @@ for i in include/*.h; do echo $i; ln -s $i $(basename $i); done
--crtprefix=$TCC_FOLDER/lib:/usr/lib \
--sysincludepaths=$TCC_FOLDER/include:$TCC_FOLDER/lib/include:/usr/local/include:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include \
--libpaths=$TCC_FOLDER/lib:/usr/local/lib:/usr/lib:/lib \
--config-new_macho=yes \
--config-new_macho=no \
--config-codesign \
--cc="$CC" \
--extra-cflags="$CFLAGS" \
Expand Down
Loading