Skip to content

target tuples for solaris not quite right #40531

@binarycrusader

Description

@binarycrusader
Contributor

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://github.com/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.

Activity

binarycrusader

binarycrusader commented on Mar 14, 2017

@binarycrusader
ContributorAuthor
Mark-Simulacrum

Mark-Simulacrum commented on Jun 13, 2017

@Mark-Simulacrum
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(),
added
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
on Dec 14, 2018
ghost

ghost commented on Feb 25, 2019

@ghost

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.

added
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
and removed
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
on Apr 21, 2019
varkor

varkor commented on Apr 27, 2019

@varkor
Member

@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://github.com/rust-lang/rust/issues/40531.)
("x86_64-pc-solaris", x86_64_sun_solaris),

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

added
E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
on Apr 27, 2019
tesuji

tesuji commented on Jun 12, 2019

@tesuji
Contributor

@rustbot claim

self-assigned this
on Jun 12, 2019
added a commit that references this issue on Jun 12, 2019
b03ffbc
psumbera

psumbera commented on Oct 4, 2019

@psumbera
Contributor

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

varkor commented on Oct 7, 2019

@varkor
Member

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.

reopened this on Oct 7, 2019
removed
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
on Oct 7, 2019
varkor

varkor commented on Jan 14, 2020

@varkor
Member

Closing as a duplicate of #68214.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-target-specsArea: Compile-target specificationsC-bugCategory: This is a bug.O-solarisOperating system: SolarisT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @binarycrusader@jonas-schievink@varkor@psumbera@Mark-Simulacrum

    Issue actions

      target tuples for solaris not quite right · Issue #40531 · rust-lang/rust