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

Add initial support for ppc64 #159

Merged
merged 1 commit into from Jan 1, 2022
Merged

Conversation

luke-jr
Copy link
Contributor

@luke-jr luke-jr commented Jun 20, 2020

Note, I couldn't get a complete build to work... Got as far as (95/96) BUILDING cargo v0.30.0 though.

[RUSTC] -o output/prefix-s/lib/rustlib/powerpc64le-unknown-linux-gnu/lib/libcore.rlib
make: *** [Makefile:120: output/prefix-s/lib/rustlib/powerpc64le-unknown-linux-gnu/lib/libcore.rlib] Segmentation fault

@r-burns
Copy link
Contributor

r-burns commented Sep 19, 2021

It looks like the issue you ran into was not architecture-specific and has been fixed since you opened this. I was able to apply this patch on top of db097f7 and bootstrap rustc 1.29 on powerpc64le-linux (using a workaround in #187).

@luke-jr
Copy link
Contributor Author

luke-jr commented Oct 28, 2021

All of -C run_rustc completes now! But the resulting toolchain appears to be unable to build rustc 1.29.1, so something is still wrong :/

The build is looking for _ZN4core3num19ASCII_LOWERCASE_MAP17hf5d18b4e3429b9aeE, but the libstd built has _ZN4core3num19ASCII_LOWERCASE_MAP17hf935b1a9ae318099E instead. Not sure what the random value at the end is supposed to be, so kinda dead in the water again.

@luke-jr
Copy link
Contributor Author

luke-jr commented Oct 28, 2021

   Compiling bootstrap v0.0.0 (file:///var/tmp/portage/dev-lang/rust-1.29.1_p20210830/work/rustc-1.29.1-src/src/bootstrap)
error: /var/tmp/portage/dev-lang/rust-1.29.1_p20210830/work/rustc-1.29.1-src/build/bootstrap/debug/deps/libserde_derive-b505111b61dd22f0.so: undefined symbol: _ZN4core3num19ASCII_LOWERCASE_MAP17hf5d18b4e3429b9aeE
   --> bootstrap/lib.rs:124:1
    |
124 | extern crate serde_derive;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

error: Could not compile `bootstrap`.

@thepowersgang
Copy link
Owner

That random number is the symbol hash, it's derived from a whole host of things. I've seen it be different before (I think as part of 1.39), and traced it to a (now fixed) mrustc bug. Is your branch based on a recent master?

@luke-jr
Copy link
Contributor Author

luke-jr commented Oct 29, 2021

I was trying to reproduce @r-burns's success, so based my work on db097f7. I think I was intimidated by master, since it seems to have a lot of incomplete work toward newer versions. I can try it, though - what target is known to work currently (the newer the better)?

@thepowersgang
Copy link
Owner

1.39 is still the highest fully supported version.

@r-burns
Copy link
Contributor

r-burns commented Oct 30, 2021

FWIW, I built mrustc as a nix package, so it was using all of the deterministic build mechanisms enforced by nixpkgs stdenv such as fixed -frandom-seed and SOURCE_DATE_EPOCH. I don't know anything about how that random value is derived, so not sure if this is relevant.

@thepowersgang
Copy link
Owner

It's not random, it's a stable hash of the crate ID and the (incremental-safe) definition ID.
I think the original issue I saw was due to not using enum niche optimisations where they were expected.

@luke-jr
Copy link
Contributor Author

luke-jr commented Oct 30, 2021

Went to try master w/ 1.39 and realised I did already (ffb0961 to be specific).

It failed pretty early with:

Process was terminated with signal 7
FAILING COMMAND:  /var/tmp/portage/dev-lang/rust-1.40.0_p20211027/work/rustc-1.40.0-src/mrustc/output/build_compiler_builtins-0_1_18_H22_run > /var/tmp/portage/dev-lang/rust-1.40.0_p20211027/work/rustc-1.40.0-src/mrustc/output/build_libc-0_2_62_Hd_run

(note that the inevitable target of this package would be 1.40.0, built using the mrustc-built 1.39.0 - it never got that far; but I am not trying to build 1.40.0 with mrustc here)

@thepowersgang
Copy link
Owner

thepowersgang commented Oct 30, 2021

SIGBUS - that's odd, does make test (which runs a basic "hello, world") work?

@luke-jr
Copy link
Contributor Author

luke-jr commented Oct 30, 2021

This was during RUSTC_VERSION=1.39.0 MRUSTC_TARGET_VER=1.39 OUTDIR_SUF=-1.39.0 make -f minicargo.mk LIBS, so long before hello world would be applicable?

@luke-jr
Copy link
Contributor Author

luke-jr commented Oct 30, 2021

FWIW, playing around, I tried 953b8a9 w/ 1.54.0 and got that same error

@thepowersgang
Copy link
Owner

I guess you'll have to do some debugging (e.g. run the relevant program in gdb) to find the codegen error.

@luke-jr
Copy link
Contributor Author

luke-jr commented Oct 30, 2021

Moved that topic to #194

@thepowersgang thepowersgang merged commit 1a09188 into thepowersgang:master Jan 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants