-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 support for FreeBSD on PowerPC64 #57758
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
This comment has been minimized.
This comment has been minimized.
r? @nagisa |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
☔ The latest upstream changes (presumably #57704) made this pull request unmergeable. Please resolve the merge conflicts. |
println!("cargo:rustc-link-lib={}", stdcppname); | ||
if target.contains("powerpc64-unknown-freebsd") { | ||
println!("cargo:rustc-link-search=native=/usr/local/lib/gcc6"); | ||
println!("cargo:rustc-link-lib=static=stdc++"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This particular piece of code should perhaps be moved slightly up to where stdcppname
variable is assigned.
@@ -263,7 +263,12 @@ fn main() { | |||
} else if cxxflags.contains("stdlib=libc++") { | |||
println!("cargo:rustc-link-lib=c++"); | |||
} else { | |||
println!("cargo:rustc-link-lib={}", stdcppname); | |||
if target.contains("powerpc64-unknown-freebsd") { | |||
println!("cargo:rustc-link-search=native=/usr/local/lib/gcc6"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does llvm-config
not print this path out? If I remember my freebsd correctly, this would mean that gcc
would be required to build rustc then. Which is not that big of a deal, but still something to improve on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FreeBSD on powerpc64 ships an old version of gcc (4.2.1) in the 'base' system, since it can't build llvm I had to use gcc7 from our 'ports tree'. For whatever reason the linker tried to link 'something' against libstdc++ from gcc-4.2.1 instead of libstdc++ from gcc7 and the link failed (I was not able to figure out how to pass -Wl,-rpath=/usr/local/lib/gcc7). Linking to a static version of libstdc++ made the problem go away.
This is just an ugly hack to fix a FreeBSD problem and should probably stays as a patch file in our 'ports tree'
The changes look good. Please squash the commits together into one or two and give these commits a description that makes it obvious what these changes are about (i.e. "Add support for powerpc64-unknown-freebsd target" instead of "Update file.rs"). You should also remove the merge commit as a part of the rebase process. You can read about rebasing here (also here) and here about rewriting the commit (and its message). |
Closing in favour of #57809. Thanks! |
@@ -263,7 +263,12 @@ fn main() { | |||
} else if cxxflags.contains("stdlib=libc++") { | |||
println!("cargo:rustc-link-lib=c++"); | |||
} else { | |||
println!("cargo:rustc-link-lib={}", stdcppname); | |||
if target.contains("powerpc64-unknown-freebsd") { | |||
println!("cargo:rustc-link-search=native=/usr/local/lib/gcc6"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put gcc8, this is our default gcc version since a few weeks.
The changes add support for building rustc on freebsd powerpc64. Reference issue #57112