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

Armv6 builds of rust appear to be armv7 contaminated. #49280

Closed
plugwash opened this issue Mar 22, 2018 · 6 comments
Closed

Armv6 builds of rust appear to be armv7 contaminated. #49280

plugwash opened this issue Mar 22, 2018 · 6 comments
Labels
A-codegen Area: Code generation C-enhancement Category: An issue proposing an enhancement or a PR with one. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@plugwash
Copy link

I maintain Raspbian, a project to re-build Debian armhf for armv6. I have been trying to upgrade the rustc package in Raspbian buster from 1.23 to 1.24.

We scan all built packages with readelf to look for armv7 code that has slipped through the net and while buliding rust 1.24 I ran into a couple of files where readelf shows armv7 tags.

/usr/lib/arm-linux-gnueabihf/librustc_trans-7f6686b7daae4f4c.so
/usr/lib/rustlib/arm-unknown-linux-gnueabihf/lib/librustc_binaryen-70d23131694c64c7.rlib

It is possible that this is a false positive, for example the armv7 code could be hidden behind runtime checks. Unfortunately I have been unable to determine where exactly the armv7 tags are coming from (I am not an expert on rust of it's build system by any means). It is also possible that this represents a real bug that will lead to crashes on armv6.

Help determining which one it is would be much appreciated.

@estebank estebank added the O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state label Mar 22, 2018
@plugwash
Copy link
Author

I suspect #49267 is related, different platform but a similar looking contamination issue on one of the same libraries.

@plugwash
Copy link
Author

Based on the other report I looked for a similarly named log and found

build/arm-unknown-linux-gnueabihf/stage0-rustc/arm-unknown-linux-gnueabihf/release/build/rustc_binaryen-881941f3666d29e3/output

And in there I found "-march=native"

Further searching found

ADD_COMPILE_FLAG("-march=native")

In

src/binaryen/CMakeLists.txt

I have commented that line out and will see where I get to.

As a general rule the only time -march=native is appropriate is when a user specifically specifies it because they know that the binaries they are building will only ever be used on the machine they are built on.

@sanxiyn
Copy link
Member

sanxiyn commented Mar 23, 2018

Since both librustc_trans and librustc_binaryen link LLVM and others don't, this points LLVM build as a source of a problem.

@plugwash
Copy link
Author

Removing the -march=native from src/binaryen/CMakeLists.txt seems to have resulted in a build with no armv7 contamination.

@cuviper
Copy link
Member

cuviper commented Mar 24, 2018

If binaryen was the only problem, note that it's been removed in #48125. So I guess the remaining question is whether we need to fix this on the beta branch, just for 1.25.

Also FWIW, the binaryen code will only execute if you target wasm32-unknown-unknown.

@XAMPPRocky XAMPPRocky added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-codegen Area: Code generation T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 26, 2018
@workingjubilee
Copy link
Member

Apologies if I am mistaken, but I believe this was fixed with the removal of binaryen, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation C-enhancement Category: An issue proposing an enhancement or a PR with one. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants