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

target tuples for solaris not quite right #40531

Closed
binarycrusader opened this issue Mar 14, 2017 · 8 comments · Fixed by #61761
Closed

target tuples for solaris not quite right #40531

binarycrusader opened this issue Mar 14, 2017 · 8 comments · Fixed by #61761
Assignees
Labels
A-target-specs Area: Compile-target specifications C-bug Category: This is a bug. O-solaris Operating system: Solaris T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@binarycrusader
Copy link
Contributor

binarycrusader commented Mar 14, 2017

There are actually two different generally expected encodings of the host tuple and they're subtly different than what some might expect.

For example, 'x86_64-sun-solaris' should probably be x86_64-pc-solaris. The reason for that is that the encoding schemes are actually:

#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
...
#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM

https:/gcc-mirror/gcc/blob/master/config.sub

So while 'sparcv9-sun-solaris' is correct because Sun is the (historical) manufacturer of sparc CPUs, 'x86_64-sun-solaris' is not, because the MANUFACTURER here is the manufacturer of the CPU not the operating system. There are special cases for this, for example 'x86_64-apple-darwin', even though Apple doesn't make x86_64 CPUs, but following gcc/clang conventions leads us to x86_64-pc-solaris.

This issue has been assigned to @lzutao via this comment.

@binarycrusader
Copy link
Contributor Author

binarycrusader commented Mar 14, 2017

/cc @dhduvall
/cc @ebeasant

@Mark-Simulacrum
Copy link
Member

An interesting discrepancy here is that our target and the LLVM target currently don't match. I'm not sure whether we can/should change anything here for backwards compatibility reasons, though an alias seems fine.

$ rg 'x86_64-.*-solaris'
src/librustc_back/target/mod.rs
204:    ("x86_64-sun-solaris", x86_64_sun_solaris),

src/librustc_back/target/x86_64_sun_solaris.rs
21:        llvm_target: "x86_64-pc-solaris".to_string(),

@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 27, 2017
@varkor varkor added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Dec 14, 2018
@ghost
Copy link

ghost commented Feb 25, 2019

Hi, can I take this issue up? Can someone give a hint on how to fix this?

I am a rust beginner, interested in compilers. This would be my first contribution.

@jonas-schievink jonas-schievink added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) and removed T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-build labels Apr 21, 2019
@varkor
Copy link
Member

varkor commented Apr 27, 2019

@Guruhegde: as far as I can tell, you should just be able to add a new line under:

"x86_64-sun-solaris",

containing "x86_64-pc-solaris",, and then add a new line under:
("x86_64-sun-solaris", x86_64_sun_solaris),

containing:

// `x86_64-pc-solaris` is an alias for `x86_64_sun_solaris` for backwards compatibility reasons.
// (See https:/rust-lang/rust/issues/40531.)
("x86_64-pc-solaris", x86_64_sun_solaris),

(Sorry for the delay: I only just saw your message.)

@varkor varkor added the E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. label Apr 27, 2019
@tesuji
Copy link
Contributor

tesuji commented Jun 12, 2019

@rustbot claim

@rustbot rustbot self-assigned this Jun 12, 2019
Centril added a commit to Centril/rust that referenced this issue Jun 12, 2019
Add an alias for x86_64-sun-solaris target tuple

Closes rust-lang#40531

r? @varkor
@psumbera
Copy link
Contributor

psumbera commented Oct 4, 2019

I wonder how it's supposed to work? Only x86_64-sun-solaris continues work for me:

$ /builds/rustc-1.37.0/bin/rustc --target=x86_64-sun-solaris test.rs
$ /builds/rustc-1.37.0/bin/rustc --target=x86_64-pc-solaris test.rs
ulx-0 17:17 /builds/psumbera/FIREFOX-2/TMP: /builds/rustc-1.37.0/bin/rustc --target=x86_64-pc-solaris test.rs
error[E0463]: can't find crate for `std`
  |
  = note: the `x86_64-pc-solaris` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.

This change make it harder for Mozilla Firefox to decide which target to use...

@varkor
Copy link
Member

varkor commented Oct 7, 2019

I think we may have to introduce some changes in src/tools/build-manifest/src/main.rs to make rustc try to use the alias. I.e. x86_64-pc-solaris should try to use the target x86_64-sun-solaris. I haven't had time to look into what else needs to be changed.

@varkor varkor reopened this Oct 7, 2019
@varkor varkor removed E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Oct 7, 2019
@jonas-schievink jonas-schievink added O-solaris Operating system: Solaris A-target-specs Area: Compile-target specifications labels Jan 14, 2020
@varkor
Copy link
Member

varkor commented Jan 14, 2020

Closing as a duplicate of #68214.

@varkor varkor closed this as completed Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-target-specs Area: Compile-target specifications C-bug Category: This is a bug. O-solaris Operating system: Solaris T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants