Skip to content

openbsd: use specific linker instead of cc #30493

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 2 commits into from
Dec 21, 2015
Merged

Conversation

semarie
Copy link
Contributor

@semarie semarie commented Dec 20, 2015

this PR reverts previous ones, that tried to make cc to found estdc++ in /usr/local/lib. It causes more trouble than it resolvs things: rustc become unbuildable if another version already exists in /usr/local (for example, libstd-xxxx.so is found in /usr/local/lib and in builddir).

so this PR tries another way to achieve build, but using the good linker for building. By default, rustc use cc for linking. But under OpenBSD, cc is gcc 4.2.1 from base, whereas we build with gcc 4.9 from ports. By linking using the compiler found at compile-time, we ensure that the compiler will found his own stdc++ library without trouble.

r? @alexcrichton

it isn't the good way to process, as it makes conflicts when building rustc while another version of rustc in installed system-wide.
By default, rustc use `cc` as linker. Under OpenBSD, `cc` is gcc version 4.2.1.
So use the compiler found at configure-time for linking: it will be gcc 4.9.

It permits to resolv problem of finding -lestdc++ or -lgcc. For base gcc (4.2), there are in not standard path, whereas for ports gcc (4.9) there are in standard path.
@alexcrichton
Copy link
Member

@bors: r+ b74359a

bors added a commit that referenced this pull request Dec 21, 2015
this PR reverts previous ones, that tried to make `cc` to found `estdc++` in `/usr/local/lib`. It causes more trouble than it resolvs things: rustc become unbuildable if another version already exists in `/usr/local` (for example, `libstd-xxxx.so` is found in `/usr/local/lib` and in builddir).

so this PR tries another way to achieve build, but using the good linker for building. By default, rustc use `cc` for linking. But under OpenBSD, `cc` is gcc 4.2.1 from base, whereas we build with gcc 4.9 from ports. By linking using the compiler found at compile-time, we ensure that the compiler will found his own stdc++ library without trouble.

r? @alexcrichton
@bors
Copy link
Collaborator

bors commented Dec 21, 2015

⌛ Testing commit b74359a with merge 29e60ab...

@bors bors merged commit b74359a into rust-lang:master Dec 21, 2015
@semarie semarie deleted the openbsd-cc branch December 21, 2015 14:13
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.

3 participants