Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump osx toolchains (also fix clang using wrong ld) #58

Merged
merged 1 commit into from
Mar 28, 2024
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
5 changes: 0 additions & 5 deletions docker/Dockerfile.aarch64-apple-darwin-cross
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,3 @@ ENV PATH=$PATH:/opt/osxcross/bin \

COPY cross-toolchains/docker/darwin-entry.sh /
ENTRYPOINT ["/darwin-entry.sh"]

# by default, older versions of macOS (<10.9) link to libstdc++,
# but rust expects it to link to libc++.
ENV CFLAGS_x86_64_apple_darwin="-stdlib=libc++" \
CXXFLAGS_x86_64_apple_darwin="-stdlib=libc++"
5 changes: 0 additions & 5 deletions docker/Dockerfile.x86_64-apple-darwin-cross
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,3 @@ ENV PATH=$PATH:/opt/osxcross/bin \

COPY cross-toolchains/docker/darwin-entry.sh /
ENTRYPOINT ["/darwin-entry.sh"]

# by default, older versions of macOS (<10.9) link to libstdc++,
# but rust expects it to link to libc++.
ENV CFLAGS_x86_64_apple_darwin="-stdlib=libc++" \
CXXFLAGS_x86_64_apple_darwin="-stdlib=libc++"
9 changes: 9 additions & 0 deletions docker/darwin-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,13 @@ declare -x CC_${envvar_suffix}="${tools_prefix}"-clang
declare -x CXX_${envvar_suffix}="${tools_prefix}"-clang++
declare -x CARGO_TARGET_${upper_suffix}_LINKER="${tools_prefix}"-clang

# by default, older versions of macOS (<10.9) link to libstdc++,
# but rust expects it to link to libc++, we can set stdlib to libc++.
#
# some time, the osxcross clang wrapper can't use right ld linker,
# the error looks like: /usr/bin/ld: unrecognized option '-dynamic'.
# let the clang wrapper to use its own linker in the osxcross bin path.
declare -x CFLAGS_${envvar_suffix}="-stdlib=libc++ -fuse-ld=${tools_prefix}-ld"
declare -x CXXFLAGS_${envvar_suffix}="-stdlib=libc++ -fuse-ld=${tools_prefix}-ld"

exec "$@"
4 changes: 2 additions & 2 deletions docker/darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ if [[ "${MACOS_SDK_FILE}" == "nonexistent" ]] && [[ -z "${MACOS_SDK_URL}" ]]; th
fi

main() {
local commit=17bb5e2d0a46533c1dd525cf4e9a80d88bd9f00e
local commit=ff8d100f3f026b4ffbe4ce96d8aac4ce06f1278b

install_packages curl \
gcc \
g++ \
make \
patch \
xz-utils \
python
python3

apt-get update
apt-get install --assume-yes --no-install-recommends clang \
Expand Down