Skip to content

Export and use CROSS_TOOLCHAIN_PREFIX. #1126

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

Merged
merged 1 commit into from
Nov 11, 2022

Conversation

Alexhuszagh
Copy link
Contributor

No description provided.

@Alexhuszagh Alexhuszagh added the no changelog A valid PR without changelog (no-changelog) label Nov 7, 2022
@Alexhuszagh Alexhuszagh requested a review from a team as a code owner November 7, 2022 23:02
@Alexhuszagh
Copy link
Contributor Author

Alexhuszagh commented Nov 7, 2022

This will block #1112, #1118, #1123, and #1125 since it touches so many files, but simplifies a lot of the CMake files, as well as the linker files in #1125. This lets us get rid of a few effectively redundant scripts (like linkers for ARMv5TE, MIPS64, and MIPS64EL musl all of which checked for Rust 1.65 for linker flags), since we can now use CROSS_TOOLCHAIN_PREFIX for everything instead. Since the prefix contains the trailing -, so for example, riscv64-linux-gnu-, native toolchains can just use an empty variable so for every GCC target the proper C compiler can be found with ${CROSS_TOOLCHAIN_PREFIX}gcc.

bors try

bors bot added a commit that referenced this pull request Nov 7, 2022
@bors
Copy link
Contributor

bors bot commented Nov 7, 2022

try

Build failed:

@Alexhuszagh
Copy link
Contributor Author

Windows and executable permissions strikes again :/
bors try --target *freebsd

bors bot added a commit that referenced this pull request Nov 7, 2022
@bors
Copy link
Contributor

bors bot commented Nov 7, 2022

try

Build succeeded:

@Alexhuszagh
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Nov 8, 2022
@bors
Copy link
Contributor

bors bot commented Nov 8, 2022

try

Build succeeded:

@@ -27,15 +28,15 @@ RUN mkdir -p $CROSS_SYSROOT/usr/lib64
RUN ln -s $CROSS_SYSROOT/usr/lib/libc.so $CROSS_SYSROOT/usr/lib64/libc.so
RUN ln -s $CROSS_SYSROOT/usr/lib/libc.so.1 $CROSS_SYSROOT/usr/lib64/libc.so.1

COPY mips64el-linux-musl-gcc.sh /usr/bin/
COPY rust-1-65-musl-gcc.sh /usr/bin/"$CROSS_TOOLCHAIN_PREFIX"gcc.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@@ -37,5 +37,6 @@ COPY linux-runner native-linux-runner base-runner.sh /

ENV CROSS_TARGETARCH=$TARGETARCH
ENV CROSS_TARGETVARIANT=$TARGETVARIANT
ENV CROSS_TOOLCHAIN_PREFIX=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this to be defined as empty?

@@ -26,5 +26,6 @@ COPY --from=0 /qemu /qemu

COPY linux-runner base-runner.sh /

ENV CROSS_TOOLCHAIN_PREFIX=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto, do we need this?

Copy link
Contributor Author

@Alexhuszagh Alexhuszagh Nov 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It ensures consistency in all cases, and makes sure that scripts with set -u won't fail. It might not be technically needed, but ensures we have the exact same behavior for all image types. The only somewhat difference is for emscripten images, but that's because we really can't have a viable prefix for them, so we just use em (so emcc and em++ work, but this is very different than allowing emgcc and emg++ to work, which don't exist).

Copy link
Member

@Emilgardis Emilgardis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 11, 2022

Build succeeded:

@bors bors bot merged commit 9541e32 into cross-rs:main Nov 11, 2022
@Alexhuszagh Alexhuszagh deleted the toolchain_prefix branch November 11, 2022 19:26
@Emilgardis Emilgardis added this to the v0.3.0 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog A valid PR without changelog (no-changelog)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants