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

Use correct libdir for multiarch Debian #651

Merged
merged 2 commits into from
Jun 4, 2020

Conversation

ilammy
Copy link
Collaborator

@ilammy ilammy commented Jun 4, 2020

Debian multiarch is a little bit complicated, one particularly important thing is the installation directory for libraries. For multiarch-enabled packages it should include the "target triple". However, for Debian this is not your usual target triple, but normalized target triple.

This is not really noticeable on x86_64 but on 32-bit x86 systems compilers tend to report {i386,i486,i586,i686}-linux-gnu when the correct one is only i386-linux-gnu.

We should use the correct, normalized triplet since that's what dynamic loader uses. If the library is installed into an incorrect multiarch subdirectory then it will fail to load.

Instead of asking the compiler, ask dpkg for the multiarch-correct triplet for the system on which we are building the package. We always build packages targeting the host system so this is correct approach.

Checklist

  • Change is covered by automated tests (only on BuiltBot)
  • The coding guidelines are followed
  • Changelog is updated (nothing notable)

Debian multiarch is a little bit complicated, one particularly important
thing is the installation directory for libraries. For multiarch-enabled
packages it should include the "target triple". However, for Debian this
is not your usual target triple, but *normalized* target triple [1].

[1]: https://wiki.debian.org/Multiarch/Tuples

This is not really noticeable on x86_64 but on 32-bit x86 systems
compilers tend to report {i386,i486,i586,i686}-linux-gnu when the
"correct" one is only i386-linux-gnu.

We should use the correct, normalized triplet since that's what dynamic
loader uses. If the library is installed into an incorrect multiarch
subdirectory then it will fail to load.

Instead of asking the compiler, ask dpkg for the multiarch-correct
triplet for the system on which we are building the package. We always
build packages targeting the host system so this is correct approach.
@ilammy ilammy added infrastructure Automated building and packaging O-Linux 🐧 Operating system: Linux installation Installation of Themis core and wrapper packages labels Jun 4, 2020
Optimize distro detection a bit to avoid duplicating code for Debian
and Ubuntu which are currently the same.

Co-authored-by: Dmytro Shapovalov <[email protected]>
@ilammy
Copy link
Collaborator Author

ilammy commented Jun 4, 2020

😂

@shadinua and I have managed to make similar changes at the same time (#652).

I've merged the changes. Now this PR contains our united, consolidated effort.

Copy link
Contributor

@shadinua shadinua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhere I already saw it :)

Nice solution, thanks!

@shadinua shadinua merged commit f9e0c59 into cossacklabs:master Jun 4, 2020
@ilammy ilammy deleted the deb-multiarch branch June 22, 2020 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Automated building and packaging installation Installation of Themis core and wrapper packages O-Linux 🐧 Operating system: Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants