Skip to content

powerpc support - #20980

Merged
bors merged 22 commits into
rust-lang:masterfrom
richo:final-power
Jan 15, 2015
Merged

powerpc support#20980
bors merged 22 commits into
rust-lang:masterfrom
richo:final-power

Conversation

@richo

Copy link
Copy Markdown
Contributor

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

Comment threadsrc/libcoretest/mem.rs Outdated

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
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.

Comment threadmk/main.mk

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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:masterJan 15, 2015
@brson

Copy link
Copy Markdown
Contributor

Nice.

lnicola pushed a commit to lnicola/rust that referenced this pull request Nov 24, 2025
fix: Remove some deep normalizations from infer
Sign up for freeto 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

@richo@alexcrichton@brson@bors