Skip to contentSkip to conversation

util-linux compile problems

Buildroot New Sven Neumann 4 participants 12 messages Aug 8, 2011 – Aug 12, 2011

lore
Share & tools
lore
#0 lore raw

Hi,

after updating buildroot we are getting compile errors from building util-linux. First the linker was complaining that it couldn't find libintl_gettext and related symbols. I was able to fix that by passing --disable-nls to the configure script (patch follows). Now I am getting errors all over the place because program_invocation_short_name is not defined. This is correct and there's a configure check to test for this. Based on this check a fallback is provided by include/c.h. However this file is not included from all places that use program_invocation_short_name.

Now I wonder if this would best be fixed by patching all affected source files in util-linux or if UCLIBC_HAS_PROGRAM_INVOCATION_NAME should be selected when util-linux is selected.

Sven

#1 lore raw

PATCH 1/2 util-linux: fix BR2_PACKAGE_UTIL_LINUX_UUIDD option

---
 package/util-linux/util-linux.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
package/util-linux/util-linux.mk +1 -1
index 570a1d1..d34759b 100644
@@ -35,7 +35,7 @@ UTIL_LINUX_CONF_OPT += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FSCK),,--disable-fsck) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBMOUNT),,--disable-libmount) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBUUID),,--disable-libuuid) \
-	$(if $(BR2_PACKAGE_UTIL_LINUX_UUID),,--disable-uuid) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_UUIDD),,--disable-uuidd) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBBLKID),,--disable-libblkid) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_AGETTY),,--disable-agetty) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_CRAMFS),,--disable-cramfs) \
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH 1/2 util-linux: fix BR2_PACKAGE_UTIL_LINUX_UUIDD option

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Sven" == Sven Neumann <[email protected]> writes:

Sven> Signed-off-by: Sven Neumann <[email protected]>

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 2/2 util-linux: disable NLS

In reply to Sven Neumann
---
 package/util-linux/util-linux.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
package/util-linux/util-linux.mk +1 -1
index d34759b..9f9d2a8 100644
@@ -11,7 +11,7 @@ UTIL_LINUX_AUTORECONF = YES
 UTIL_LINUX_INSTALL_STAGING = YES
 UTIL_LINUX_DEPENDENCIES = host-pkg-config
 
-UTIL_LINUX_CONF_OPT += --disable-rpath --disable-makeinstall-chown
+UTIL_LINUX_CONF_OPT += --disable-rpath --disable-makeinstall-chown --disable-nls
 
 # If both util-linux and busybox are selected, make certain util-linux
 # wins the fight over who gets to have their utils actually installed
Signature · 1 line
1.7.4.1
#4 lore raw
In reply to Sven Neumann

Hi Sven,

Quoted 4 lines

after updating buildroot we are getting compile errors from building util-linux. First the linker was complaining that it couldn't find libintl_gettext and related symbols. I was able to fix that by passing --disable-nls to the configure script (patch follows).

I've tried the 2.20-rc1 and also found this problem, that I didn't see before. I got rid of it by selecting libintl and adding it to build dependencies. Could you try this?

Quoted 9 lines

Now I am getting errors all over the place because program_invocation_short_name is not defined. This is correct and there's a configure check to test for this. Based on this check a fallback is provided by include/c.h. However this file is not included from all places that use program_invocation_short_name.

Now I wonder if this would best be fixed by patching all affected source files in util-linux or if UCLIBC_HAS_PROGRAM_INVOCATION_NAME should be selected when util-linux is selected.

Yegor

#5 lore raw
Quoted 10 lines · Yegor Yefremov

Hi Sven,

Quoted 4 lines

after updating buildroot we are getting compile errors from building util-linux. First the linker was complaining that it couldn't find libintl_gettext and related symbols. I was able to fix that by passing --disable-nls to the configure script (patch follows).

I've tried the 2.20-rc1 and also found this problem, that I didn't see before. I got rid of it by selecting libintl and adding it to build dependencies. Could you try this?

Well, I don't think that libintl should be selected only because a few tools from util-linux gain native language support then. But I agree that it might be better only to use --disable-nls if libintl is not selected already.

Sven

#6 lore raw
In reply to Sven Neumann
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Sven" == Sven Neumann <[email protected]> writes:

Sven> Hi,
Sven> after updating buildroot we are getting compile errors from building Sven> util-linux. First the linker was complaining that it couldn't find Sven> libintl_gettext and related symbols. I was able to fix that by Sven> passing --disable-nls to the configure script (patch follows). Sven> Now I am getting errors all over the place because
Sven> program_invocation_short_name is not defined. This is correct Sven> and there's a configure check to test for this. Based on this check Sven> a fallback is provided by include/c.h. However this file is not Sven> included from all places that use program_invocation_short_name.

Sven> Now I wonder if this would best be fixed by patching all affected Sven> source files in util-linux or if UCLIBC_HAS_PROGRAM_INVOCATION_NAME Sven> should be selected when util-linux is selected.

We got rid of the BR2_PROGRAM_INVOCATION option back on the 27/7, as the dependencies got quite messy and it only adds ~100 bytes to uClibc, so check your uclibc .config.

We already pass --disable-nls unless you have locales enabled, so perhaps it needs similar handling as libglib2 for uClibc (select LIBINTIL if BR2_NEEDS_GETTEXT). Thomas also mentioned something about that, but I haven't done a locale build lately to test. Will do so now.

Signature · 1 line
Bye, Peter Korsgaard
#7 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Korsgaard <[email protected]> writes:

Hi,

Peter> We already pass --disable-nls unless you have locales enabled, Peter> so perhaps it needs similar handling as libglib2 for uClibc Peter> (select LIBINTIL if BR2_NEEDS_GETTEXT). Thomas also mentioned Peter> something about that, but I haven't done a locale build lately Peter> to test. Will do so now.

It seems to work fine here with:

BR2_arm=y
BR2_arm926t=y
BR2_TOOLCHAIN_BUILDROOT_LARGEFILE=y
BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
BR2_PACKAGE_UTIL_LINUX=y
BR2_PACKAGE_UTIL_LINUX_MOUNT=y
BR2_PACKAGE_UTIL_LINUX_FSCK=y
BR2_PACKAGE_UTIL_LINUX_LIBMOUNT=y
BR2_PACKAGE_UTIL_LINUX_UUIDD=y
BR2_PACKAGE_UTIL_LINUX_AGETTY=y
BR2_PACKAGE_UTIL_LINUX_CRAMFS=y
BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT=y
BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT=y
BR2_PACKAGE_UTIL_LINUX_FALLOCATE=y
BR2_PACKAGE_UTIL_LINUX_UNSHARE=y
BR2_PACKAGE_UTIL_LINUX_RENAME=y
BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS=y
BR2_PACKAGE_UTIL_LINUX_WALL=y
BR2_PACKAGE_UTIL_LINUX_ARCH=y
BR2_PACKAGE_UTIL_LINUX_INIT=y
BR2_PACKAGE_UTIL_LINUX_KILL=y
BR2_PACKAGE_UTIL_LINUX_LAST=y
BR2_PACKAGE_UTIL_LINUX_MESG=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
BR2_PACKAGE_UTIL_LINUX_RAW=y
BR2_PACKAGE_UTIL_LINUX_RESET=y
BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS=y
BR2_PACKAGE_UTIL_LINUX_WRITE=y

E.G. locale support and all util-linux options enabled, but no gettext/libintl.

Signature · 1 line
Bye, Peter Korsgaard
#8 lore raw

Hi,

Quoted 41 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Korsgaard <[email protected]> writes:

Hi,

Peter> We already pass --disable-nls unless you have locales enabled, Peter> so perhaps it needs similar handling as libglib2 for uClibc Peter> (select LIBINTIL if BR2_NEEDS_GETTEXT). Thomas also mentioned Peter> something about that, but I haven't done a locale build lately Peter> to test. Will do so now.

It seems to work fine here with:

BR2_arm=y
BR2_arm926t=y
BR2_TOOLCHAIN_BUILDROOT_LARGEFILE=y
BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
BR2_PACKAGE_UTIL_LINUX=y
BR2_PACKAGE_UTIL_LINUX_MOUNT=y
BR2_PACKAGE_UTIL_LINUX_FSCK=y
BR2_PACKAGE_UTIL_LINUX_LIBMOUNT=y
BR2_PACKAGE_UTIL_LINUX_UUIDD=y
BR2_PACKAGE_UTIL_LINUX_AGETTY=y
BR2_PACKAGE_UTIL_LINUX_CRAMFS=y
BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT=y
BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT=y
BR2_PACKAGE_UTIL_LINUX_FALLOCATE=y
BR2_PACKAGE_UTIL_LINUX_UNSHARE=y
BR2_PACKAGE_UTIL_LINUX_RENAME=y
BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS=y
BR2_PACKAGE_UTIL_LINUX_WALL=y
BR2_PACKAGE_UTIL_LINUX_ARCH=y
BR2_PACKAGE_UTIL_LINUX_INIT=y
BR2_PACKAGE_UTIL_LINUX_KILL=y
BR2_PACKAGE_UTIL_LINUX_LAST=y
BR2_PACKAGE_UTIL_LINUX_MESG=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
BR2_PACKAGE_UTIL_LINUX_RAW=y
BR2_PACKAGE_UTIL_LINUX_RESET=y
BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS=y
BR2_PACKAGE_UTIL_LINUX_WRITE=y

Quoted 2 lines

E.G. locale support and all util-linux options enabled, but no gettext/libintl.

Well, it works for me in that configuration as well. But it doesn't work for the configuration that has locale support enabled and gettext/libintl:

BR2_ENABLE_LOCALE=y
BR2_NEEDS_GETTEXT=y
BR2_NEEDS_GETTEXT_IF_LOCALE=y
BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
BR2_PACKAGE_GETTEXT=y
BR2_PACKAGE_LIBINTL=y

I've tried the following patch, but it doesn't seem to help:

package/util-linux/Config.in +2 -0
index 816130d..ed0ba8b 100644
@@ -1,5 +1,7 @@
 config BR2_PACKAGE_UTIL_LINUX
        bool "util-linux"
+       select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
+       select BR2_PACKAGE_LIBINTL if BR2_NEEDS_GETTEXT_IF_LOCALE
        depends on BR2_LARGEFILE
        depends on BR2_USE_WCHAR
        help
(quoted diff) +0 -0

b/package/util-linux/util-linux.mk
index d34759b..c124256 100644

package/util-linux/util-linux.mk +0 -0
@@ -9,7 +9,7 @@ UTIL_LINUX_SOURCE =

util-linux-$(UTIL_LINUX_VERSION).tar.bz2
UTIL_LINUX_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/util-linux/v
$(UTIL_LINUX_VER
UTIL_LINUX_AUTORECONF = YES UTIL_LINUX_INSTALL_STAGING = YES
-UTIL_LINUX_DEPENDENCIES = host-pkg-config +UTIL_LINUX_DEPENDENCIES = host-pkg-config $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),g

UTIL_LINUX_CONF_OPT += --disable-rpath --disable-makeinstall-chown

#9 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Sven" == Sven Neumann <[email protected]> writes:

Hi,

Sven> Well, it works for me in that configuration as well. But it Sven> doesn't work for the configuration that has locale support Sven> enabled and gettext/libintl:

Sven> BR2_ENABLE_LOCALE=y
Sven> BR2_NEEDS_GETTEXT=y
Sven> BR2_NEEDS_GETTEXT_IF_LOCALE=y
Sven> BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
Sven> BR2_PACKAGE_GETTEXT=y
Sven> BR2_PACKAGE_LIBINTL=y

Sven> I've tried the following patch, but it doesn't seem to help:

Ahh, ok - That's easy to fix, similar to how we do it E.G. with avahi. I've committed a fix doing that.

Signature · 1 line
Bye, Peter Korsgaard
#10 lore raw

Hi,

Quoted 11 lines · Peter Korsgaard

Sven> Well, it works for me in that configuration as well. But it Sven> doesn't work for the configuration that has locale support Sven> enabled and gettext/libintl:

Sven> BR2_ENABLE_LOCALE=y
Sven> BR2_NEEDS_GETTEXT=y
Sven> BR2_NEEDS_GETTEXT_IF_LOCALE=y
Sven> BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
Sven> BR2_PACKAGE_GETTEXT=y
Sven> BR2_PACKAGE_LIBINTL=y

Quoted 4 lines

Sven> I've tried the following patch, but it doesn't seem to help:

Ahh, ok - That's easy to fix, similar to how we do it E.G. with avahi. I've committed a fix doing that.

That fix seems to do the trick. But now the build fails when it tries to install the translations:

Making install in po
make[2]: Entering directory
`/home/sven/git/buildroot/output/build/util-linux-2.19.1/po'
/bin/sh
@MKINSTALLDIRS@ /home/sven/git/buildroot/output/host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/share /bin/sh: Can't open @MKINSTALLDIRS@
make[2]: *** [install-data-yes] Error 127

Sven

#11 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Sven" == Sven Neumann <[email protected]> writes:

Sven> That fix seems to do the trick. But now the build fails when it tries to Sven> install the translations:

Sven> Making install in po
Sven> make[2]: Entering directory
Sven> `/home/sven/git/buildroot/output/build/util-linux-2.19.1/po'
Sven> /bin/sh
Sven> @MKINSTALLDIRS@ /home/sven/git/buildroot/output/host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/share Sven> /bin/sh: Can't open @MKINSTALLDIRS@
Sven> make[2]: *** [install-data-yes] Error 127

Ahh, see it now. I've fixed it in git. The problem is that util-linux use mkinstalldirs to install .po files, and it gets the definition of it from a custom nls.m4 (based on the one from gettext). If you have gettext enabled, then we end up using that one instead when we autoreconf util-linux.

Signature · 1 line
Bye, Peter Korsgaard