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

powerpc support #20980

Merged
merged 22 commits into from
Jan 15, 2015
Merged

powerpc support #20980

merged 22 commits into from
Jan 15, 2015

Conversation

richo
Copy link
Contributor

@richo richo commented Jan 12, 2015

Originally, this was going to be discussed and revisted, however I've been working on this for months, and a rebase on top of master was about 1 flight's worth of work so I just went ahead and did it.

This gets you as far as being able to target powerpc with, eg:

LD_LIBRARY_PATH=./x86_64-unknown-linux-gnu/stage2/lib/ x86_64-unknown-linux-gnu/stage2/bin/rustc -C linker=powerpc-linux-gnu-gcc --target powerpc-unknown-linux-gnu hello.rs

Would really love to get this out before 1.0. r? @alexcrichton

@@ -55,7 +56,8 @@ fn align_of_basic() {
#[cfg(any(target_arch = "x86",
target_arch = "arm",
target_arch = "mips",
target_arch = "mipsel"))]
target_arch = "mipsel",
target_arch = "powerpc"))]
Copy link
Member

Choose a reason for hiding this comment

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

Hm, to stem the flow of these additional target_arch settings, can you change this to be conditional on target_pointer_width?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry. Ignore that other comment if it got emailed. Willfix.

@alexcrichton
Copy link
Member

This looks pretty good to me, thanks!

I think we're definitely growing a real need for an extension to #[cfg] which allows us to cut down on the huge amount of #[cfg], but we can always worry about that later.

@@ -263,7 +263,7 @@ endif
######################################################################

# FIXME: x86-ism
LLVM_COMPONENTS=x86 arm aarch64 mips ipo bitreader bitwriter linker asmparser mcjit \
LLVM_COMPONENTS=x86 arm aarch64 mips powerpc ipo bitreader bitwriter linker asmparser mcjit \
Copy link
Member

Choose a reason for hiding this comment

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

Due to this I think you'll also want to touch the llvm-auto-clean-trigger to ensure LLVM is rebuilt.

@alexcrichton
Copy link
Member

As I also requested on #19790, could you analyze the before/after sizes of the compiler? Just want to make sure LLVM isn't bringing too many megabyte wads of powerpc support!

@richo
Copy link
Contributor Author

richo commented Jan 14, 2015

Awesome! Thanks so much for taking a look. I'll try to get these issues fixed tonight.

Regarding the size of the compiler:

After:
35M x86_64-unknown-linux-gnu/stage2/lib/librustc_llvm-4e7c5e5c.so
12K x86_64-unknown-linux-gnu/stage2/bin/rustc
3.2M x86_64-unknown-linux-gnu/llvm/Release+Asserts/lib/libLLVMPower*.a

I don't have a before handy, but I can build one before I get home. Comparison numbers from that PR:

Before:
x86_64-unknown-linux-gnu/llvm/Release+Asserts/lib/libLLVMAArch64*.a: 0M
x86_64-unknown-linux-gnu/stage2/lib/librustc_llvm-4e7c5e5c.so: 36,259K
x86_64-unknown-linux-gnu/stage3/bin/rustc: 51,329K

(I'm not sure what the huge discrepancy with the stage3 rustc and my stage2 are, did a bunch of things move out into libs?)

@richo
Copy link
Contributor Author

richo commented Jan 14, 2015

I cleaned up the issues in your comments, and grabbed a nightly to check on the sizes of the objects:

From the nightly on rust-lang.org:

42M ./lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_llvm-4e7c5e5c.so
8.0K bin/rustc
(And obviously no powerpc archives).

I guess since I branched, some other LLVM changes must have landed? My librustc_llvm is 7 megs smaller.

@richo
Copy link
Contributor Author

richo commented Jan 14, 2015

I finally made time to build the tree that I branched from, for comparison:

goodnight % for i in rust rust-vanilla; do du -hs $i/x86_64-unknown-linux-gnu/stage2/lib/librustc_llvm-*.so; done
42M     rust/x86_64-unknown-linux-gnu/stage2/lib/librustc_llvm-4e7c5e5c.so
40M     rust-vanilla/x86_64-unknown-linux-gnu/stage2/lib/librustc_llvm-4e7c5e5c.so
goodnight % for i in rust rust-vanilla; do du -hs $i/x86_64-unknown-linux-gnu/stage2/bin/rustc; done
8.0K    rust/x86_64-unknown-linux-gnu/stage2/bin/rustc
8.0K    rust-vanilla/x86_64-unknown-linux-gnu/stage2/bin/rustc

Is there anything else this needs for an r? @alexcrichton

bors added a commit that referenced this pull request Jan 15, 2015
Originally, this was going to be discussed and revisted, however I've been working on this for months, and a rebase on top of master was about 1 flight's worth of work so I just went ahead and did it.

This gets you as far as being able to target powerpc with, eg:

    LD_LIBRARY_PATH=./x86_64-unknown-linux-gnu/stage2/lib/ x86_64-unknown-linux-gnu/stage2/bin/rustc -C linker=powerpc-linux-gnu-gcc --target powerpc-unknown-linux-gnu hello.rs

Would really love to get this out before 1.0. r? @alexcrichton
@bors bors merged commit 78278d0 into rust-lang:master Jan 15, 2015
@brson
Copy link
Contributor

brson commented Jan 19, 2015

Nice.

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.

4 participants