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

libdir detection is buggy in many cases #2038

Closed
Jehan opened this issue Jul 4, 2017 · 8 comments
Closed

libdir detection is buggy in many cases #2038

Jehan opened this issue Jul 4, 2017 · 8 comments
Labels
bug help wanted options Meson configuration options

Comments

@Jehan
Copy link
Contributor

Jehan commented Jul 4, 2017

I have been cross-compiling json-glib (which uses meson) for 32-bit and it would install it inside lib64/:

The compilation is fine and renders proper 32-bit:

$ file lib64/libjson-glib-1.0.so.0.301.0
lib64/libjson-glib-1.0.so.0.301.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped

Only the path is wrong.
Also since I am building from a 64-bit platform, this may be the problem, of course. Basically do not decide on the installation path from the build OS, but from the host one.
I filled a bug in json-glib, but they tell me the problem is with meson: https://bugzilla.gnome.org/show_bug.cgi?id=784532

Also for information, I do not consider the proposed solution of setting --libdir valid. I know of this option, which exists on all other build systems (and that's a good option), but it should not be a reason not to have sane defaults.

@jpakkane
Copy link
Member

jpakkane commented Jul 4, 2017

The default for that should probably be settable in the cross file...

@Jehan
Copy link
Contributor Author

Jehan commented Jul 4, 2017

What settings would it be? sizeof_int?
In any case, when cross-compiling, if such a settings is not set, that should default to lib/ (this can never go wrong).

Is there no good way to determine if the target is 64 bit? I could think of checking gcc -dumpmachine output, and if it has a 64 in it, assuming 64-bit. Now that's dirty and I can say for sure it is not totally reliable (for instance i686-w64-mingw32-gcc target is 32-bit).

As a last comment, I would not be against just defaulting to lib/ always, even when the target is know 64-bit. The directory lib64/ is somewhat considered deprecated by many distributions and I think all 64-bit distributions will look in lib/ as well as lib64/ anyway.

@jpakkane
Copy link
Member

jpakkane commented Jul 4, 2017

What settings would it be? sizeof_int?

I was thinking more in the line of libdir...

@Jehan
Copy link
Contributor Author

Jehan commented Jul 5, 2017

I was thinking more in the line of libdir...

In which section do you set this? I tried under every section in your doc (host_machine, binaries, properties… tried them all just to be sure) but it didn't set libdir.

Edit: or I realize suddenly, did you actually mean that you should add this? Hence the feature is not there yet?

@jpakkane
Copy link
Member

jpakkane commented Jul 5, 2017

did you actually mean that you should add this

Yes.

@nirbheek nirbheek added the bug label Jul 13, 2017
@nirbheek nirbheek changed the title Install in lib64/ even for 32-bit target libdir detection is buggy in many cases May 25, 2018
@nirbheek nirbheek added help wanted options Meson configuration options labels May 25, 2018
@topilski
Copy link

ping

@TheQwertiest
Copy link
Contributor

TheQwertiest commented May 30, 2019

The following changes were made in meson 0.50.0 that address the issue discussed here:

@dcbaker
Copy link
Member

dcbaker commented May 30, 2019

I think this should have been closed by 4743 as well. I'm going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted options Meson configuration options
Projects
None yet
Development

No branches or pull requests

6 participants