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

add support for non-standard name of stdc++ library #28495

Merged
merged 1 commit into from Sep 19, 2015

Conversation

Projects
None yet
3 participants
@semarie
Copy link
Contributor

semarie commented Sep 18, 2015

it makes rustc compatible with gcc installation that are using
`--program-transform-name' configure flag (on OpenBSD for example).

  • detects at configure the name of stdc++ library on the system
  • use the detected name in llvm makefile (with enable-static-stdcpp),
    and pass it to mklldeps.py
  • generate mklldeps.rs using this detected name

note that CFG_STDCPP_NAME is about stdc++ name, not about libc++. If
using libc++, the default name will be `stdc++', but it won't be used
when linking.

r? @alexcrichton

I added this support globally instead of just for OpenBSD as it isn't specially related to OpenBSD (except OpenBSD use it for gcc-4.9). And as I would had to change llvm.mk', having just a default value inconfigure' for others platforms won't be very useful.

@semarie semarie force-pushed the semarie:stdcpp-name branch 2 times, most recently from fbaacfd to 2fb999c Sep 18, 2015

configure Outdated
@@ -1095,6 +1095,11 @@ envopt CPP
envopt CFLAGS
envopt CXXFLAGS

# stdc++ name in use
# used to manage non-standard name (on OpenBSD for example)
CFG_STDCPP_NAME=$(echo "stdc++" | sed "$($CFG_CC -v 2>&1 | sed -n "s/.*--program-transform-name='\([^']*\)'.*/\1/p")")

This comment has been minimized.

@semarie

semarie Sep 18, 2015

Author Contributor

program-transform-name is a sed regex (under OpenBSD for gcc-4.9 it is s,^,e,).

basically, it search for the configure flag program-transform-name in gcc -v, and use that with sed on the "stdc++" name. If the flag isn't found, the transformation applied is sed "" which means "no transformation".

add support for non-standard name of stdc++ library
it makes rustc compatible with gcc installation that are using
`--program-transform-name' configure flag (on OpenBSD for example).

- detects at configure the name of stdc++ library on the system

- use the detected name in llvm makefile (with enable-static-stdcpp),
  and pass it to mklldeps.py

- generate mklldeps.rs using this detected name

note that CFG_STDCPP_NAME is about stdc++ name, not about libc++. If
using libc++, the default name will be `stdc++', but it won't be used
when linking.

@semarie semarie force-pushed the semarie:stdcpp-name branch from 2fb999c to 913fe6d Sep 18, 2015

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Sep 18, 2015

@bors: r+ 913fe6d

Thanks!

bors added a commit that referenced this pull request Sep 19, 2015

Auto merge of #28495 - semarie:stdcpp-name, r=alexcrichton
it makes rustc compatible with gcc installation that are using
`--program-transform-name' configure flag (on OpenBSD for example).

- detects at configure the name of stdc++ library on the system

- use the detected name in llvm makefile (with enable-static-stdcpp),
  and pass it to mklldeps.py

- generate mklldeps.rs using this detected name

note that CFG_STDCPP_NAME is about stdc++ name, not about libc++. If
using libc++, the default name will be `stdc++', but it won't be used
when linking.

r? @alexcrichton 

I added this support globally instead of just for OpenBSD as it isn't specially related to OpenBSD (except OpenBSD use it for gcc-4.9). And as I would had to change `llvm.mk', having just a default value in `configure' for others platforms won't be very useful.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Sep 19, 2015

⌛️ Testing commit 913fe6d with merge 655b2ef...

@bors bors merged commit 913fe6d into rust-lang:master Sep 19, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@semarie semarie deleted the semarie:stdcpp-name branch Sep 19, 2015

bors added a commit that referenced this pull request Sep 19, 2015

Auto merge of #28501 - semarie:stdcpp-path, r=alexcrichton
By default, the linker in use under OpenBSD is the linker of base, which
don't include /usr/local/lib where libstdc++ of gcc-4.9 lives. We need
to add this directory to linker-path-search (using -L).

Search the path of libstdc++.a, which is a known name (libstdc++.so has
SO_VERSION) in the same directory.

r? @alexcrichton 

this commit needs #28495 to be commited first. It should be the last piece for building rustc under OpenBSD from scratch.

bors added a commit that referenced this pull request Sep 20, 2015

Auto merge of #28501 - semarie:stdcpp-path, r=alexcrichton
By default, the linker in use under OpenBSD is the linker of base, which
don't include /usr/local/lib where libstdc++ of gcc-4.9 lives. We need
to add this directory to linker-path-search (using -L).

Search the path of libstdc++.a, which is a known name (libstdc++.so has
SO_VERSION) in the same directory.

r? @alexcrichton 

this commit needs #28495 to be commited first. It should be the last piece for building rustc under OpenBSD from scratch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.