[PATCH] argp-standalone: generate a shared library instead of static library

Hauke Mehrtens hauke at hauke-m.de
Mon Oct 3 10:30:09 PDT 2022


On 9/28/22 12:11, Petr Štetiar wrote:
> Thomas Langer <tlanger at maxlinear.com> [2022-09-13 17:47:56]:
> 
> Hi,
> 
>> Change the argp-standalone package to produce a shared library instead
>> of a static library for the target. The host build is not changed.
> 
> we can see that from the diff already, so we would prefer to know, why would
> you like to have this change included.

argp-standalone is licensed under the LGPL. An application linking 
statically against it has to follow the LGPL, when an application links 
dynamically against it there is not need to follow LGPL.

>> Update related packages to add it as a direct dependency, otherwise the
>> buildsystem will complain.
>>
>> Please check also https://github.com/openwrt/packages/pull/19357,
>> a related pull request for the packages feed, to avoid that this change
>> is breaking all the packages that depend on argp-standalone.
> 
> Can't this be solved in some less intrusive way? I can imagine, that this is
> not going to be bisect friendly and could provide other woes in the future.
> 
> What about introducing shared library in conjunction to the static one, thus
> not breaking anything? Then if it makes sense, we could convert existing
> static users to shared version in a next step.

When the linker finds a static and a shared library with a matching name 
it will use the shared library by default. When a package is build in 
OpenWrt the build process has access to all libraries already build and 
will find the shared library. This will add an extra dependency.

When I looked on the Internet I also found this library:
https://github.com/xhebox/libuargp
It also looks like argp-standalone has some bugs:
https://www.openwall.com/lists/musl/2021/02/12/2

Maybe we should introduce libuargp as a new package which builds a 
shared library and place it in an own folder. Then package Makefiles 
which want to link against it have to modify the TARGET_FLAGS to include 
the extra folder.
This way we can do a slow migration to the shared library.

Hauke



More information about the openwrt-devel mailing list