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

2022-10-03 Thread Hauke Mehrtens

On 9/28/22 12:11, Petr Štetiar wrote:

Thomas Langer  [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

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


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

2022-09-28 Thread Petr Štetiar
Thomas Langer  [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.

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

Cheers,

Petr

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


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

2022-09-13 Thread Thomas Langer via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
Change the argp-standalone package to produce a shared library instead
of a static library for the target. The host build is not changed.

Update related packages to add it as a direct dependency, otherwise the
buildsystem will complain.

Signed-off-by: Thomas Langer 
---

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.

With that said, this should only be merged after the pull-request is also 
merged.

---
 package/libs/argp-standalone/Makefile | 12 -
 .../003-argp-standalone-1.3-shared.patch  | 51 +++
 package/libs/elfutils/Makefile|  5 +-
 package/system/iucode-tool/Makefile   |  5 +-
 4 files changed, 65 insertions(+), 8 deletions(-)
 create mode 100644 
package/libs/argp-standalone/patches/003-argp-standalone-1.3-shared.patch

diff --git a/package/libs/argp-standalone/Makefile 
b/package/libs/argp-standalone/Makefile
index 1a48dcb2cd..a73c0311bf 100644
--- a/package/libs/argp-standalone/Makefile
+++ b/package/libs/argp-standalone/Makefile
@@ -9,13 +9,16 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=argp-standalone
 PKG_VERSION:=1.3
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.lysator.liu.se/~nisse/misc/
 PKG_HASH:=dec79694da1319acd2238ce95df57f3680fea2482096e483323fddf3d818d8be
 PKG_MAINTAINER:=Ted Hess 
 
+PKG_FIXUP:=patch-libtool autoreconf
+PKG_INSTALL=1
+
 PKG_LICENSE:=LGPL-2.1
 PKG_LICENSE:=Makefile.am
 
@@ -44,7 +47,7 @@ define Build/InstallDev
$(CP)   $(PKG_BUILD_DIR)/argp.h \
$(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
-   $(CP)   $(PKG_BUILD_DIR)/libargp.a \
+   $(CP)   $(PKG_INSTALL_DIR)/usr/lib/*.so* \
$(1)/usr/lib/
 endef
 
@@ -57,5 +60,10 @@ define Host/Install
$(1)/lib/
 endef
 
+define Package/argp-standalone/install
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
+endef
+
 $(eval $(call BuildPackage,argp-standalone))
 $(eval $(call HostBuild))
diff --git 
a/package/libs/argp-standalone/patches/003-argp-standalone-1.3-shared.patch 
b/package/libs/argp-standalone/patches/003-argp-standalone-1.3-shared.patch
new file mode 100644
index 00..6eac7a41b2
--- /dev/null
+++ b/package/libs/argp-standalone/patches/003-argp-standalone-1.3-shared.patch
@@ -0,0 +1,51 @@
+This argp patch comes from 
https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-libs/argp-standalone/files/argp-standalone-1.3-shared.patch
+
+--- a/Makefile.am
 b/Makefile.am
+@@ -21,20 +21,20 @@
+ AUTOMAKE_OPTIONS = foreign
+ SUBDIRS = . testsuite
+ 
+-LIBOBJS = @LIBOBJS@
++LTLIBOBJS = @LTLIBOBJS@
+ 
+-noinst_LIBRARIES = libargp.a
++lib_LTLIBRARIES = libargp.la
+ noinst_PROGRAMS = argp-test
+ noinst_HEADERS = argp.h argp-fmtstream.h argp-namefrob.h # argp-comp.h
+ 
+ EXTRA_DIST = mempcpy.c strchrnul.c strndup.c Versions
+ 
+ # Leaves out argp-fs-xinl.c and argp-xinl.c 
+-libargp_a_SOURCES = argp-ba.c argp-eexst.c argp-fmtstream.c \
++libargp_la_SOURCES = argp-ba.c argp-eexst.c argp-fmtstream.c \
+   argp-help.c argp-parse.c argp-pv.c \
+   argp-pvh.c
+ 
+-libargp_a_LIBADD = $(LIBOBJS)
++libargp_la_LIBADD = $(LTLIBOBJS)
+ 
+-argp_test_LDADD = libargp.a
++argp_test_LDADD = libargp.la
+ 
+--- a/configure.ac
 b/configure.ac
+@@ -17,6 +17,7 @@ AC_PROG_CC
+ AC_PROG_MAKE_SET
+ AC_PROG_RANLIB
+ AM_PROG_CC_STDC
++AC_PROG_LIBTOOL
+ 
+ if test "x$am_cv_prog_cc_stdc" = xno ; then
+   AC_ERROR([the C compiler doesn't handle ANSI-C])
+--- a/testsuite/Makefile.am
 b/testsuite/Makefile.am
+@@ -5,7 +5,7 @@ TS_ALL = $(TS_PROGS) $(TS_SH)
+ 
+ noinst_PROGRAMS = $(TS_PROGS) ex1 ex3 ex4
+ 
+-LDADD = ../libargp.a
++LDADD = -L../.libs -largp
+ 
+ EXTRA_DIST = $(TS_SH) run-tests
+ CLEANFILES = test.out
diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile
index 4ca37d3b06..64e778048b 100644
--- a/package/libs/elfutils/Makefile
+++ b/package/libs/elfutils/Makefile
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=elfutils
 PKG_VERSION:=0.187
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION)
@@ -22,7 +22,6 @@ PKG_CPE_ID:=cpe:/a:elfutils_project:elfutils
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_USE_MIPS16:=1
-PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
@@ -43,7 +42,7 @@ endef
 
 define Package/libdw
   $(call Package/elfutils/Default)
-  DEPENDS:=+libelf +libbz2