Skip to content

Commit 3e61c1a

Browse files
authored
Merge pull request #58 from cavivie/main
Bump osx toolchains (also fix clang using wrong ld)
2 parents 83b2866 + 7aafa86 commit 3e61c1a

4 files changed

+11
-12
lines changed

docker/Dockerfile.aarch64-apple-darwin-cross

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,3 @@ ENV PATH=$PATH:/opt/osxcross/bin \
3131

3232
COPY cross-toolchains/docker/darwin-entry.sh /
3333
ENTRYPOINT ["/darwin-entry.sh"]
34-
35-
# by default, older versions of macOS (<10.9) link to libstdc++,
36-
# but rust expects it to link to libc++.
37-
ENV CFLAGS_x86_64_apple_darwin="-stdlib=libc++" \
38-
CXXFLAGS_x86_64_apple_darwin="-stdlib=libc++"

docker/Dockerfile.x86_64-apple-darwin-cross

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,3 @@ ENV PATH=$PATH:/opt/osxcross/bin \
3131

3232
COPY cross-toolchains/docker/darwin-entry.sh /
3333
ENTRYPOINT ["/darwin-entry.sh"]
34-
35-
# by default, older versions of macOS (<10.9) link to libstdc++,
36-
# but rust expects it to link to libc++.
37-
ENV CFLAGS_x86_64_apple_darwin="-stdlib=libc++" \
38-
CXXFLAGS_x86_64_apple_darwin="-stdlib=libc++"

docker/darwin-entry.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,13 @@ declare -x CC_${envvar_suffix}="${tools_prefix}"-clang
1515
declare -x CXX_${envvar_suffix}="${tools_prefix}"-clang++
1616
declare -x CARGO_TARGET_${upper_suffix}_LINKER="${tools_prefix}"-clang
1717

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

docker/darwin.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ if [[ "${MACOS_SDK_FILE}" == "nonexistent" ]] && [[ -z "${MACOS_SDK_URL}" ]]; th
1212
fi
1313

1414
main() {
15-
local commit=17bb5e2d0a46533c1dd525cf4e9a80d88bd9f00e
15+
local commit=ff8d100f3f026b4ffbe4ce96d8aac4ce06f1278b
1616

1717
install_packages curl \
1818
gcc \
1919
g++ \
2020
make \
2121
patch \
2222
xz-utils \
23-
python
23+
python3
2424

2525
apt-get update
2626
apt-get install --assume-yes --no-install-recommends clang \

0 commit comments

Comments
 (0)