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

Make CFG_LIBDIR configurable #5223

Closed
fabiand opened this issue Mar 4, 2013 · 5 comments
Closed

Make CFG_LIBDIR configurable #5223

fabiand opened this issue Mar 4, 2013 · 5 comments

Comments

@fabiand
Copy link
Contributor

fabiand commented Mar 4, 2013

Currently CFG_LIBDIR is hard coded. it would be nice if this path could be adjusted using some configure arg.

@brson
Copy link
Contributor

brson commented Mar 4, 2013

I'm curious what this would be used for. CFG_LIBDIR exists to make dynamic loading slightly less bad on windows, by placing executables and libraries in the same directory.

@brson
Copy link
Contributor

brson commented Mar 14, 2013

As you mentioned in #5219, distros with multiarch support often put their libs in places like /usr/lib64. I understand the use case now and agree it should be configurable. Let's use whatever configure flag is standard.

@graydon
Copy link
Contributor

graydon commented May 1, 2013

assigning bug; change assignment if you disagree

@ghost ghost assigned graydon May 1, 2013
bors added a commit that referenced this issue May 7, 2013
fix for #6279 #6253

mk: rt.mk regression patch for mingw32 after #6176

currently do not pass optimization option just make it works only

mk: target.mk host.mk fix for duplicated rules of mingw32 after #6235

It can be simply fixed with CFG_LIB check whether bin or lib however considering multiple target triples with linux and windows, CFG_LIB needs to configurable #5223 and #5577
@catamorphism
Copy link
Contributor

I don't think this should block 0.7 -- re-milestone if you disagree, @graydon

@jhasse
Copy link
Contributor

jhasse commented Dec 12, 2013

Hi everyone! I tried to fix this with this commit.

The problem with the current implementation in configure: It sets CFG_LIBDIR to "lib" or "bin". But according to http://www.gnu.org/prep/standards/html_node/Directory-Variables.html libdir should always be an absolute path e.g. /usr/local/lib.

Also it overrides the value which could have been set by the user, because it is set after the call to valopts.

My patch fixes these issue and also make CFG_LIBDIR configurable: I introduced a new variable CFG_LIBDIR_RELATIVE which has the value CFG_LIBDIR has now (lib or bin). CFG_LIBDIR is then set to the correct absolute value.

After my patch, let's say someone sets libdir without changing the prefix:

$ ./configure --libdir=/usr/lib64
[...]
configure: CFG_PREFIX           := /usr/local
[...]
configure: CFG_LIBDIR           := /usr/lib64
configure: error: libdir must begin with the prefix. Use --prefix to set it accordingly.

This is because the script is unsure what the name of the library directory (relative to the prefix) is. He also has to change the prefix:

$ ./configure --libdir=/opt/lib64 --prefix=/opt
[...]
configure: CFG_PREFIX           := /opt
[...]
configure: CFG_LIBDIR           := /opt/lib64
configure: CFG_LIBDIR_RELATIVE  := lib64
[...]

The CFG_LIBDIR_RELATIVE variable then holds lib64 which is what will be used in several places by rust. For example rustpkg places libaries in a folder called lib64 instead of lib. Also this will result in stage1/lib64/ during the build phase.

If I run configure on my Windows machine without any arguments this will result in the following:

$ ./configure
[...]
configure: CFG_PREFIX           := /usr/local
[...]
configure: CFG_BUILD            := i686-pc-mingw32
[...]
configure: CFG_LIBDIR           := /usr/local/bin
configure: CFG_LIBDIR_RELATIVE  := bin
[...]

Everything as it should be ;)

What do you think?

@bors bors closed this as completed in 116773a Jan 7, 2014
bors added a commit to rust-lang-ci/rust that referenced this issue May 2, 2020
Use `try_eval_usize` over `eval_usize`

Fixes rust-lang#5223

changelog: Fix ICE in evaluating usizes
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

No branches or pull requests

5 participants