Skip to content

rustc: Flag all builtins functions as hidden #37714

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

Merged
merged 1 commit into from
Nov 15, 2016

Conversation

alexcrichton
Copy link
Member

When compiling compiler-rt you typically compile with -fvisibility=hidden
which to ensure that all symbols are hidden in shared objects and don't show up
in symbol tables. This is important for these intrinsics being linked in every
crate to ensure that we're not unnecessarily bloating the public ABI of Rust
crates.

This should help allow the compiler-builtins project with Rust-defined builtins
start landing in-tree as well.

@alexcrichton
Copy link
Member Author

cc @japaric

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@nikomatsakis
Copy link
Contributor

Travis failure seems legit:

compiler_builtins.cgu-0.rs:(.text.main+0x14): undefined reference to `std::rt::lang_start::h9e00af3568de666f'

/usr/bin/ld generated: undefined reference to `std::rt::lang_start::h9e00af3568de666f'

/usr/bin/ld: /build/build/x86_64-unknown-linux-gnu/stage2-std/x86_64-unknown-linux-gnu/release/deps/compiler_builtins-8d46d19e412b053e: hidden symbol `_ZN3std2rt10lang_start17h9e00af3568de666fE' isn't defined

@alexcrichton
Copy link
Member Author

Indeed!

Hopefully fixed now

@@ -426,6 +426,14 @@ pub type OperandBundleDefRef = *mut OperandBundleDef_opaque;
pub type DiagnosticHandler = unsafe extern "C" fn(DiagnosticInfoRef, *mut c_void);
pub type InlineAsmDiagHandler = unsafe extern "C" fn(SMDiagnosticRef, *const c_void, c_uint);

#[repr(C)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a comment to mark where the enum came from, or preferably write an LLVMRust wrapper.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

When compiling compiler-rt you typically compile with `-fvisibility=hidden`
which to ensure that all symbols are hidden in shared objects and don't show up
in symbol tables. This is important for these intrinsics being linked in every
crate to ensure that we're not unnecessarily bloating the public ABI of Rust
crates.

This should help allow the compiler-builtins project with Rust-defined builtins
start landing in-tree as well.
@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 14, 2016

📌 Commit 88b4646 has been approved by nikomatsakis

@bors
Copy link
Collaborator

bors commented Nov 15, 2016

⌛ Testing commit 88b4646 with merge 30857ae...

bors added a commit that referenced this pull request Nov 15, 2016
rustc: Flag all builtins functions as hidden

When compiling compiler-rt you typically compile with `-fvisibility=hidden`
which to ensure that all symbols are hidden in shared objects and don't show up
in symbol tables. This is important for these intrinsics being linked in every
crate to ensure that we're not unnecessarily bloating the public ABI of Rust
crates.

This should help allow the compiler-builtins project with Rust-defined builtins
start landing in-tree as well.
@bors bors merged commit 88b4646 into rust-lang:master Nov 15, 2016
@alexcrichton alexcrichton deleted the builtins-hidden branch November 16, 2016 18:02
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.

5 participants