* [Buildroot] [PATCH v3 0/2] Fix logrotate autobuild failure
@ 2015-03-01 21:06 Fabio Porcedda
2015-03-01 21:06 ` [Buildroot] [PATCH v3 1/2] popt: add to the "popt.pc" file the libintl library Fabio Porcedda
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Fabio Porcedda @ 2015-03-01 21:06 UTC (permalink / raw)
To: buildroot
This patch set fix a logrotate autobuild failure:
http://autobuild.buildroot.net/results/159bf5730414ca7f73dcdae95090177355193636
http://autobuild.buildroot.net/results/ebe6ab7fc0f2cff98de06b3dc374730da9e9e4f2
v3:
- popt: instead of using sed add a patch and send it upstream
- logrotate: improve commit message
v2:
- logroate: instead of adding a patch just overwrite from the command line the
LOADLIBES variable
Fabio Porcedda (2):
popt: add to the "popt.pc" file the libintl library
logrotate: use pkg-config for the opt library
package/logrotate/logrotate.mk | 6 ++-
...-the-libintl-library-to-the-Libs.private-.patch | 47 ++++++++++++++++++++++
package/popt/popt.mk | 4 ++
3 files changed, 55 insertions(+), 2 deletions(-)
create mode 100644 package/popt/0004-popt.pc-add-the-libintl-library-to-the-Libs.private-.patch
--
2.3.1
^ permalink raw reply [flat|nested] 10+ messages in thread* [Buildroot] [PATCH v3 1/2] popt: add to the "popt.pc" file the libintl library 2015-03-01 21:06 [Buildroot] [PATCH v3 0/2] Fix logrotate autobuild failure Fabio Porcedda @ 2015-03-01 21:06 ` Fabio Porcedda 2015-03-04 22:27 ` Thomas Petazzoni 2015-03-01 21:06 ` [Buildroot] [PATCH v3 2/2] logrotate: use pkg-config for the opt library Fabio Porcedda 2015-03-01 21:35 ` [Buildroot] [PATCH v3 0/2] Fix logrotate autobuild failure Peter Korsgaard 2 siblings, 1 reply; 10+ messages in thread From: Fabio Porcedda @ 2015-03-01 21:06 UTC (permalink / raw) To: buildroot This change permits through pkg-config to retrive even the depenencies that is useful for a static linking. Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com> --- ...-the-libintl-library-to-the-Libs.private-.patch | 47 ++++++++++++++++++++++ package/popt/popt.mk | 4 ++ 2 files changed, 51 insertions(+) create mode 100644 package/popt/0004-popt.pc-add-the-libintl-library-to-the-Libs.private-.patch diff --git a/package/popt/0004-popt.pc-add-the-libintl-library-to-the-Libs.private-.patch b/package/popt/0004-popt.pc-add-the-libintl-library-to-the-Libs.private-.patch new file mode 100644 index 0000000..9b0b07e --- /dev/null +++ b/package/popt/0004-popt.pc-add-the-libintl-library-to-the-Libs.private-.patch @@ -0,0 +1,47 @@ +From 470755ccc353b59107c957972d908cbde4942c8d Mon Sep 17 00:00:00 2001 +From: Fabio Porcedda <fabio.porcedda@gmail.com> +Date: Sun, 1 Mar 2015 21:13:48 +0100 +Subject: [PATCH] popt.pc: add the libintl library to the Libs.private field + +If static linking and libintl is used, the program that uses the popt +library needs to link to the libintl library too so add the libintl +library to the libs.private field because is useful for programs that call + pkg-config --static --libs popt +they get the libintl library too: + -L<...> -lpopt -lintl + +This patch was already sent upstream: +http://rpm5.org/community/popt-devel/0294.html + +Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com> +--- + configure.ac | 1 + + popt.pc.in | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/configure.ac b/configure.ac +index e8eb238..816d272 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -90,6 +90,7 @@ popt_sysconfdir="${sysconfdir}" + eval "popt_sysconfdir=\"${popt_sysconfdir}\"" # expand contained ${prefix} + AC_DEFINE_UNQUOTED([POPT_SYSCONFDIR], ["$popt_sysconfdir"], [Full path to default POPT configuration directory]) + ++AC_SUBST([POPT_PKGCONFIG_LIBS_PRIVATE],"$LIBINTL") + + # Define a (hope) portable Libs pkgconfig directive that + # - Don't harm if the default library search path include ${libdir} +diff --git a/popt.pc.in b/popt.pc.in +index a86437c..0acfdb9 100644 +--- a/popt.pc.in ++++ b/popt.pc.in +@@ -6,5 +6,6 @@ includedir=@includedir@ + Name: popt + Version: @VERSION@ + Description: popt library. ++Libs.private: @POPT_PKGCONFIG_LIBS_PRIVATE@ + Libs: @POPT_PKGCONFIG_LIBS@ + Cflags: -I${includedir} +-- +2.3.1 + diff --git a/package/popt/popt.mk b/package/popt/popt.mk index 8ce64d4..605649b 100644 --- a/package/popt/popt.mk +++ b/package/popt/popt.mk @@ -13,6 +13,10 @@ POPT_LICENSE_FILES = COPYING POPT_AUTORECONF = YES POPT_GETTEXTIZE = YES +ifeq ($(BR2_PACKAGE_GETTEXT),y) +POPT_DEPENDENCIES += gettext +endif + POPT_CONF_ENV = ac_cv_va_copy=yes ifeq ($(BR2_PACKAGE_LIBICONV),y) -- 2.3.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH v3 1/2] popt: add to the "popt.pc" file the libintl library 2015-03-01 21:06 ` [Buildroot] [PATCH v3 1/2] popt: add to the "popt.pc" file the libintl library Fabio Porcedda @ 2015-03-04 22:27 ` Thomas Petazzoni 0 siblings, 0 replies; 10+ messages in thread From: Thomas Petazzoni @ 2015-03-04 22:27 UTC (permalink / raw) To: buildroot Dear Fabio Porcedda, On Sun, 1 Mar 2015 22:06:52 +0100, Fabio Porcedda wrote: > This change permits through pkg-config to retrive even the depenencies > that is useful for a static linking. > > Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com> Applied, thanks! Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH v3 2/2] logrotate: use pkg-config for the opt library 2015-03-01 21:06 [Buildroot] [PATCH v3 0/2] Fix logrotate autobuild failure Fabio Porcedda 2015-03-01 21:06 ` [Buildroot] [PATCH v3 1/2] popt: add to the "popt.pc" file the libintl library Fabio Porcedda @ 2015-03-01 21:06 ` Fabio Porcedda 2015-03-04 22:29 ` Thomas Petazzoni 2015-03-01 21:35 ` [Buildroot] [PATCH v3 0/2] Fix logrotate autobuild failure Peter Korsgaard 2 siblings, 1 reply; 10+ messages in thread From: Fabio Porcedda @ 2015-03-01 21:06 UTC (permalink / raw) To: buildroot Without using the pkg-config the dependencies are not included for a static linking so it fails to build. These failures are fixed by linking the libintl library that is a dependency of the opt library. This commit to be useful requires the previous commit 'popt: add to the "popt.pc" file the libintl library'. Fixes: http://autobuild.buildroot.net/results/159bf5730414ca7f73dcdae95090177355193636 http://autobuild.buildroot.net/results/ebe6ab7fc0f2cff98de06b3dc374730da9e9e4f2 Minimal defconfig to reproduce the build failure: BR2_STATIC_LIBS=y BR2_TOOLCHAIN_BUILDROOT_LOCALE=y BR2_PACKAGE_GETTEXT=y BR2_PACKAGE_LOGROTATE=y Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com> --- package/logrotate/logrotate.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package/logrotate/logrotate.mk b/package/logrotate/logrotate.mk index dc26d85..c1bca48 100644 --- a/package/logrotate/logrotate.mk +++ b/package/logrotate/logrotate.mk @@ -9,10 +9,12 @@ LOGROTATE_SITE = https://www.fedorahosted.org/releases/l/o/logrotate LOGROTATE_LICENSE = GPLv2+ LOGROTATE_LICENSE_FILES = COPYING -LOGROTATE_DEPENDENCIES = popt +LOGROTATE_DEPENDENCIES = popt host-pkgconf define LOGROTATE_BUILD_CMDS - $(MAKE) CC="$(TARGET_CC) $(TARGET_CFLAGS)" LDFLAGS="$(LDFLAGS)" -C $(@D) + $(MAKE) CC="$(TARGET_CC) $(TARGET_CFLAGS)" LDFLAGS="$(LDFLAGS)" \ + LOADLIBES="$(shell $(PKG_CONFIG_HOST_BINARY) --libs popt)" \ + -C $(@D) endef define LOGROTATE_INSTALL_TARGET_CMDS -- 2.3.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH v3 2/2] logrotate: use pkg-config for the opt library 2015-03-01 21:06 ` [Buildroot] [PATCH v3 2/2] logrotate: use pkg-config for the opt library Fabio Porcedda @ 2015-03-04 22:29 ` Thomas Petazzoni 2015-03-04 23:38 ` Fabio Porcedda 0 siblings, 1 reply; 10+ messages in thread From: Thomas Petazzoni @ 2015-03-04 22:29 UTC (permalink / raw) To: buildroot Dear Fabio Porcedda, In the title: s/opt/popt/ On Sun, 1 Mar 2015 22:06:53 +0100, Fabio Porcedda wrote: > Without using the pkg-config the dependencies are not included for a > static linking so it fails to build. > These failures are fixed by linking the libintl library that is a > dependency of the opt library. s/opt/popt/ I've fixed and committed. Though I have one concern below. > + $(MAKE) CC="$(TARGET_CC) $(TARGET_CFLAGS)" LDFLAGS="$(LDFLAGS)" \ > + LOADLIBES="$(shell $(PKG_CONFIG_HOST_BINARY) --libs popt)" \ It's not currently supported in Buildroot, but LOADLIBES is extended by the logrotate Makefile with -lacl or -lselinux when WITH_ACL or WITH_SELINUX are used. I'm not sure this will play well with your proposed solution. But ok, this can be handled when/if someone adds ACL and/or SELinux support to logrotate. Thanks! Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH v3 2/2] logrotate: use pkg-config for the opt library 2015-03-04 22:29 ` Thomas Petazzoni @ 2015-03-04 23:38 ` Fabio Porcedda 2015-03-05 8:28 ` Thomas Petazzoni 0 siblings, 1 reply; 10+ messages in thread From: Fabio Porcedda @ 2015-03-04 23:38 UTC (permalink / raw) To: buildroot On Wed, Mar 4, 2015 at 11:29 PM, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote: > Dear Fabio Porcedda, > > In the title: s/opt/popt/ > > On Sun, 1 Mar 2015 22:06:53 +0100, Fabio Porcedda wrote: >> Without using the pkg-config the dependencies are not included for a >> static linking so it fails to build. >> These failures are fixed by linking the libintl library that is a >> dependency of the opt library. > > s/opt/popt/ > > I've fixed and committed. Though I have one concern below. > > >> + $(MAKE) CC="$(TARGET_CC) $(TARGET_CFLAGS)" LDFLAGS="$(LDFLAGS)" \ >> + LOADLIBES="$(shell $(PKG_CONFIG_HOST_BINARY) --libs popt)" \ > > It's not currently supported in Buildroot, but LOADLIBES is extended by > the logrotate Makefile with -lacl or -lselinux when WITH_ACL or > WITH_SELINUX are used. I'm not sure this will play well with your > proposed solution. Thanks for noticing it. I didn't know that a variable forced from the command line cannot be extended. Now I'm aware of it. > But ok, this can be handled when/if someone adds ACL and/or SELinux > support to logrotate. Good idea. Thanks -- Fabio Porcedda ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH v3 2/2] logrotate: use pkg-config for the opt library 2015-03-04 23:38 ` Fabio Porcedda @ 2015-03-05 8:28 ` Thomas Petazzoni 2015-03-05 8:43 ` Fabio Porcedda 0 siblings, 1 reply; 10+ messages in thread From: Thomas Petazzoni @ 2015-03-05 8:28 UTC (permalink / raw) To: buildroot Dear Fabio Porcedda, On Thu, 5 Mar 2015 00:38:25 +0100, Fabio Porcedda wrote: > > It's not currently supported in Buildroot, but LOADLIBES is extended by > > the logrotate Makefile with -lacl or -lselinux when WITH_ACL or > > WITH_SELINUX are used. I'm not sure this will play well with your > > proposed solution. > > Thanks for noticing it. > I didn't know that a variable forced from the command line cannot be extended. > Now I'm aware of it. Depends on whether you pass variables in the environment (on the left hand side of make) or as make options (on the right hand side of make). Demonstration with a simple Makefile: === FOO = -lbaz ifeq ($(WITH_SELINUX),yes) FOO += -lselinux endif all: @echo $(FOO) === And now, the different cases: thomas at skate:/tmp$ make -lbaz thomas at skate:/tmp$ make FOO=-lpouet -lpouet thomas at skate:/tmp$ make FOO=-lpouet WITH_SELINUX=yes -lpouet thomas at skate:/tmp$ make WITH_SELINUX=yes -lbaz -lselinux thomas at skate:/tmp$ FOO=-lpouet make -lbaz thomas at skate:/tmp$ FOO=-lpouet make WITH_SELINUX=yes -lbaz -lselinux Best regards, Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH v3 2/2] logrotate: use pkg-config for the opt library 2015-03-05 8:28 ` Thomas Petazzoni @ 2015-03-05 8:43 ` Fabio Porcedda 0 siblings, 0 replies; 10+ messages in thread From: Fabio Porcedda @ 2015-03-05 8:43 UTC (permalink / raw) To: buildroot On Thu, Mar 5, 2015 at 9:28 AM, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote: > Dear Fabio Porcedda, > > On Thu, 5 Mar 2015 00:38:25 +0100, Fabio Porcedda wrote: > >> > It's not currently supported in Buildroot, but LOADLIBES is extended by >> > the logrotate Makefile with -lacl or -lselinux when WITH_ACL or >> > WITH_SELINUX are used. I'm not sure this will play well with your >> > proposed solution. >> >> Thanks for noticing it. >> I didn't know that a variable forced from the command line cannot be extended. >> Now I'm aware of it. > > Depends on whether you pass variables in the environment (on the left > hand side of make) or as make options (on the right hand side of make). > Demonstration with a simple Makefile: > > === > FOO = -lbaz > > ifeq ($(WITH_SELINUX),yes) > FOO += -lselinux > endif > > all: > @echo $(FOO) > === > > And now, the different cases: > > thomas at skate:/tmp$ make > -lbaz > thomas at skate:/tmp$ make FOO=-lpouet > -lpouet > thomas at skate:/tmp$ make FOO=-lpouet WITH_SELINUX=yes > -lpouet > thomas at skate:/tmp$ make WITH_SELINUX=yes > -lbaz -lselinux > thomas at skate:/tmp$ FOO=-lpouet make > -lbaz > thomas at skate:/tmp$ FOO=-lpouet make WITH_SELINUX=yes > -lbaz -lselinux Even the += behavior is different if the variable is passed on the left side or on the right side. === FOO ?= -lbaz ifeq ($(WITH_SELINUX),yes) FOO += -lselinux endif all: @echo $(FOO) === $ make FOO=-lpouet WITH_SELINUX=yes -lpouet $ FOO=-lpouet make WITH_SELINUX=yes -lpouet -lselinux So if we want that the default option can be changed from the command line and the makefile will still be able to add options to the same variable we need to use ?= and pass the variable on the left side. $ FOO=-lpouet make WITH_SELINUX=yes -lpouet -lselinux Best regards -- Fabio Porcedda ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH v3 0/2] Fix logrotate autobuild failure 2015-03-01 21:06 [Buildroot] [PATCH v3 0/2] Fix logrotate autobuild failure Fabio Porcedda 2015-03-01 21:06 ` [Buildroot] [PATCH v3 1/2] popt: add to the "popt.pc" file the libintl library Fabio Porcedda 2015-03-01 21:06 ` [Buildroot] [PATCH v3 2/2] logrotate: use pkg-config for the opt library Fabio Porcedda @ 2015-03-01 21:35 ` Peter Korsgaard 2015-03-01 21:43 ` Fabio Porcedda 2 siblings, 1 reply; 10+ messages in thread From: Peter Korsgaard @ 2015-03-01 21:35 UTC (permalink / raw) To: buildroot >>>>> "Fabio" == Fabio Porcedda <fabio.porcedda@gmail.com> writes: > This patch set fix a logrotate autobuild failure: > http://autobuild.buildroot.net/results/159bf5730414ca7f73dcdae95090177355193636 > http://autobuild.buildroot.net/results/ebe6ab7fc0f2cff98de06b3dc374730da9e9e4f2 > v3: > - popt: instead of using sed add a patch and send it upstream > - logrotate: improve commit message > v2: > - logroate: instead of adding a patch just overwrite from the command line the > LOADLIBES variable Hmm, while this is an improvement I still see failures. I could only get popt to pull in the gettext/libintl dependency if I added libiconv, but as we don't add libiconv to Libs.private we then end up with linker issues for it in logrotate: /home/peko/source/buildroot/output/host/usr/bin/arm-linux-gcc -Os -static logrotate.o log.o config.o basenames.o -L/home/peko/source/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib -lpopt -o logrotate logrotate.o: In function `compressLogFile': /home/peko/source/buildroot/output/build/logrotate-3.8.7/logrotate.c:537: warning: the use of OBSOLESCENT `utime' is discouraged, use `utimes' /home/peko/source/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libpopt.a(poptint.o): In function `POPT_fprintf': poptint.c:(.text+0x534): undefined reference to `libiconv_open' poptint.c:(.text+0x58c): undefined reference to `libiconv' poptint.c:(.text+0x5b8): undefined reference to `libiconv' poptint.c:(.text+0x62c): undefined reference to `libiconv_close' collect2: ld returned 1 exit status <builtin>: recipe for target 'logrotate' failed So I have left out this series for 2015.02. -- Bye, Peter Korsgaard ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH v3 0/2] Fix logrotate autobuild failure 2015-03-01 21:35 ` [Buildroot] [PATCH v3 0/2] Fix logrotate autobuild failure Peter Korsgaard @ 2015-03-01 21:43 ` Fabio Porcedda 0 siblings, 0 replies; 10+ messages in thread From: Fabio Porcedda @ 2015-03-01 21:43 UTC (permalink / raw) To: buildroot On Sun, Mar 1, 2015 at 10:35 PM, Peter Korsgaard <peter@korsgaard.com> wrote: >>>>>> "Fabio" == Fabio Porcedda <fabio.porcedda@gmail.com> writes: > > > This patch set fix a logrotate autobuild failure: > > http://autobuild.buildroot.net/results/159bf5730414ca7f73dcdae95090177355193636 > > http://autobuild.buildroot.net/results/ebe6ab7fc0f2cff98de06b3dc374730da9e9e4f2 > > > v3: > > - popt: instead of using sed add a patch and send it upstream > > - logrotate: improve commit message > > v2: > > - logroate: instead of adding a patch just overwrite from the command line the > > LOADLIBES variable > > Hmm, while this is an improvement I still see failures. > > I could only get popt to pull in the gettext/libintl dependency if I > added libiconv, but as we don't add libiconv to Libs.private we then end > up with linker issues for it in logrotate: > > /home/peko/source/buildroot/output/host/usr/bin/arm-linux-gcc -Os -static logrotate.o log.o config.o basenames.o -L/home/peko/source/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib -lpopt -o logrotate > logrotate.o: In function `compressLogFile': > /home/peko/source/buildroot/output/build/logrotate-3.8.7/logrotate.c:537: warning: the use of OBSOLESCENT `utime' is discouraged, use `utimes' > /home/peko/source/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libpopt.a(poptint.o): In function `POPT_fprintf': > poptint.c:(.text+0x534): undefined reference to `libiconv_open' > poptint.c:(.text+0x58c): undefined reference to `libiconv' > poptint.c:(.text+0x5b8): undefined reference to `libiconv' > poptint.c:(.text+0x62c): undefined reference to `libiconv_close' > collect2: ld returned 1 exit status > <builtin>: recipe for target 'logrotate' failed Thanks, for testing it, i forgot about the libiconv library, I will send an updated patch that fix it. > So I have left out this series for 2015.02. BR -- Fabio Porcedda ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-03-05 8:43 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-03-01 21:06 [Buildroot] [PATCH v3 0/2] Fix logrotate autobuild failure Fabio Porcedda 2015-03-01 21:06 ` [Buildroot] [PATCH v3 1/2] popt: add to the "popt.pc" file the libintl library Fabio Porcedda 2015-03-04 22:27 ` Thomas Petazzoni 2015-03-01 21:06 ` [Buildroot] [PATCH v3 2/2] logrotate: use pkg-config for the opt library Fabio Porcedda 2015-03-04 22:29 ` Thomas Petazzoni 2015-03-04 23:38 ` Fabio Porcedda 2015-03-05 8:28 ` Thomas Petazzoni 2015-03-05 8:43 ` Fabio Porcedda 2015-03-01 21:35 ` [Buildroot] [PATCH v3 0/2] Fix logrotate autobuild failure Peter Korsgaard 2015-03-01 21:43 ` Fabio Porcedda
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox