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

Open
Jehan opened this Issue Jul 4, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@Jehan

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

This comment has been minimized.

Show comment
Hide comment
@jpakkane

jpakkane Jul 4, 2017

Member

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

Member

jpakkane commented Jul 4, 2017

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

@Jehan

This comment has been minimized.

Show comment
Hide comment
@Jehan

Jehan 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.

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

This comment has been minimized.

Show comment
Hide comment
@jpakkane

jpakkane Jul 4, 2017

Member

What settings would it be? sizeof_int?

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

Member

jpakkane commented Jul 4, 2017

What settings would it be? sizeof_int?

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

@Jehan

This comment has been minimized.

Show comment
Hide comment
@Jehan

Jehan 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?

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

This comment has been minimized.

Show comment
Hide comment
@jpakkane

jpakkane Jul 5, 2017

Member

did you actually mean that you should add this

Yes.

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 from Install in lib64/ even for 32-bit target to libdir detection is buggy in many cases May 25, 2018

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