patchGNU Libtool - Patches: patch #10393, Fix shared library support on...


You are not allowed to post comments on this tracker with your current authentication level.

patch #10393: Fix shared library support on Android

Submitter:  Bruno Haible <haible>
Submitted:  Mon 18 Sep 2023 11:25:06 AM UTC
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Wed 17 Apr 2024 03:29:18 PM UTC, comment #3: 

Thank you for the suggestion. Since we are already embedding rpath into Android, we could take the next step and start using GNU/Linux versioning.

This would be contrary to the standard method of Android versioning, in which shared libraries are not versioned. Although this could be overwritten by users if needed. There are probably more people on Android using Libtool with the GNU linker than with the Android linker. I assume most people using the Android linker are also using the Android SDK. I really have no insight into this however, so corrections (and solutions) are welcome. :)

Ileana Dumitrescu <ildumi>
Group administrator
Wed 17 Apr 2024 09:19:34 AM UTC, comment #2: 

I have a suggestion. If we try to build a library that already exist in /system/lib/ or /system/lib64 there may be conflicts. So I think setting version_type to linux and adding $major as suffix to soname_spec will be a good idea.

Arun <zorro>
Tue 16 Jan 2024 01:58:57 PM UTC, comment #1: 

I went ahead and merged this in. Thanks for the patch!

Ileana Dumitrescu <ildumi>
Group administrator
Mon 18 Sep 2023 11:25:06 AM UTC, original submission:  

On Android, within the termux environment, I encountered two problems during the "make install" phase of GNU gettext. The attached patch fixes them.

1) On this platform, libtool is configured to relink libraries during "make install". This leads to a problem during the installation of libgettextsrc: The relink command that libtool emits has the form
  $CC -shared -fPIC -DPIC .libs/*.o -L$(libdir) ... -lgettextlib ... -o .libs/libgettextsrc-@VERSION@.soT
The option -lgettextlib resolves to $(libdir)/libgettextlib.a, not to $(libdir)/ Thus the linker attempts to include many object files from libgettextlib.a into libgettextsrc-@VERSION@.soT, but some of these reference global variables in a non-PIC way, and the linker thus complains

  ld.lld: error: relocation R_ARM_REL32 cannot be used against symbol 'program_name'; recompile with -fPIC

2) The installed executables don't have a RUNPATH property that points to the directory that contains the shared libraries. Thus these executables don't run.

Bruno Haible <haible>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by zorro (Posted a comment)
  • -email is unavailable- added by ildumi (Posted a comment)
  • -email is unavailable- added by haible (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-16 ildumi StatusNone Done
        Open/ClosedOpen Closed
    2023-09-18 haible Attached File- Added 0001-Fix-shared-library-support-on-Android.patch, #55144

    Back to the top

    Powered by Savane 3.13-3cd0.
    Corresponding source code