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

build: Set a soname on the library #33

Merged
merged 4 commits into from
Sep 16, 2023
Merged

Conversation

agx
Copy link
Contributor

@agx agx commented Sep 11, 2023

This sets an soname for dynamic linking:

      $ readelf -a libgovarnam.so | grep SONAME
      0x000000000000000e (SONAME)             Library soname: [libgovarnam.so.1]

This is needed for ABI versioning and dynamlic linking. See e.g.
Section 8.1 of Debian's policy.

With this one gets properly versioned dependencies e.g.

      $ readelf -a _build/src/phosh-osk-stub | grep gov
      0x0000000000000001 (NEEDED)             Shared library: [libgovarnam.so.1]

While without that patch one gets an unversioned dependency which won't
allow to handle any ABI changes:

      $ readelf -a _build/src/phosh-osk-stub | grep libgovarn
      0x0000000000000001 (NEEDED)             Shared library: [/usr/local/lib/libgovarnam.so]

This includes the changes from #31 as otherwise there will be merge conflicts.

agx and others added 4 commits September 11, 2023 18:28
The current sed expression matches on all paths elements so if
one has it's development e.g. in

  /var/scratch/librem5/

it would truncate the patch to

  /var/scratchrem5/

which then fails the build. Fix that by only matching at the end of
paths to remove /lib from the libdir.
This sets an soname for dynamic linking:

  $ readelf -a libgovarnam.so | grep SONAME
  0x000000000000000e (SONAME)             Library soname: [libgovarnam.so.1]

This is needed for ABI versioning and dynamlic linking. See e.g.
Section 8.1 of Debian's policy.

With this one gets properly versioned dependencies e.g.

  $ readelf -a _build/src/phosh-osk-stub | grep gov
  0x0000000000000001 (NEEDED)             Shared library: [libgovarnam.so.1.9.0]

While without that patch one gets an unversioned dependency which won't
allow to handle any ABI changes:

  $ readelf -a _build/src/phosh-osk-stub | grep libgovarn
  0x0000000000000001 (NEEDED)             Shared library: [/usr/local/lib/libgovarnam.so]
@subins2000 subins2000 merged commit 0890d8c into varnamproject:master Sep 16, 2023
1 check failed
@subins2000
Copy link
Member

Thank you for the patches @agx ! Very helpful :)

@agx agx mentioned this pull request Sep 20, 2023
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

Successfully merging this pull request may close these issues.

2 participants