Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upexport_name with unusual utf8 breaks new version script based linker #38238
Comments
This comment has been minimized.
This comment has been minimized.
|
I guess, we should just restrict export_name to ASCII. |
This comment has been minimized.
This comment has been minimized.
|
So this is an artificial restriction, for no technical merit. I'd really like utf8 support for symbol names, just on principle. Nevertheless it doesn't work as is now (and used to) (albeit entirely because of a broken linker toolchain), so ASCII might be required... Iirc, swift re-encodes utf symbols in their name mangler, but that's not the same as real utf8 symbol names in the binary, which is just literally the coolest. I don't know of another language that allows that and can run (and the dynamic linker doesn't have any problem with it, because it just sees null terminated bytes, which utf8 preserves.) |
This comment has been minimized.
This comment has been minimized.
|
With which linkers do you run into the problem? |
This comment has been minimized.
This comment has been minimized.
|
Both gold and ld ( #[export_name="󠆷∀🢫"]
#[no_mangle]
pub extern fn whatever() {
println!("nothing");
}I guess unicode is too hard for C ppls.
|
This comment has been minimized.
This comment has been minimized.
|
I think we should report this as a bug against GNU LD, unless there is a way to quote symbol names. |
Mark-Simulacrum
added
A-linkage
A-unicode
labels
Jun 23, 2017
Mark-Simulacrum
added
the
C-feature-request
label
Jul 26, 2017
This comment has been minimized.
This comment has been minimized.
|
Triage: not aware of any changes |
m4b commentedDec 8, 2016
Unfortunately it looks like the awesome changes in #38117 caused breakage while linking when a weird export name is used (probably due to the version script requiring ascii, or some other esoterica):
NOTE haven't checked this particular version, but certain combinations of values cause linker error complaining about invalid chars in version script.