Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 570548

Summary: sys-fs/xfsdump - fails linking to 'libintl_gettext' under uclibc
Product: Gentoo Linux Reporter: Joshua Kinard <kumba>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: dev-embedded+disabled, embedded, mips
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 547292, 570544    
Attachments: Make gettext/libintl support optional in xfsdump-3.1.6

Description Joshua Kinard gentoo-dev 2016-01-02 01:41:37 UTC
xfsdump fails to build in a uClibc-based userland due to not getting the '-lintl' flag passed during linking:

    [CC]     var.o
content.o: In function `restore_file_cb':
content.c:(.text+0x4cb0): warning: the use of OBSOLESCENT `utime' is discouraged, use `utimes'
drive_scsitape.o: In function `ds_instantiate':
drive_scsitape.c:(.text+0x46c): undefined reference to `libintl_gettext'
drive_scsitape.c:(.text+0x4b0): undefined reference to `libintl_gettext'
drive_scsitape.c:(.text+0x528): undefined reference to `libintl_gettext'
drive_scsitape.c:(.text+0x628): undefined reference to `libintl_gettext'
drive_scsitape.o: In function `record_hdr_validate':
drive_scsitape.c:(.text+0x9f8): undefined reference to `libintl_gettext'
drive_scsitape.o:drive_scsitape.c:(.text+0xb04): more undefined references to `libintl_gettext' follow
main.o: In function `main':
main.c:(.text.startup+0x68): undefined reference to `libintl_bindtextdomain'
main.c:(.text.startup+0x70): undefined reference to `libintl_textdomain'
main.c:(.text.startup+0x124): undefined reference to `libintl_gettext'
main.c:(.text.startup+0x190): undefined reference to `libintl_gettext'
main.c:(.text.startup+0x204): undefined reference to `libintl_gettext'
main.c:(.text.startup+0x2b4): undefined reference to `libintl_gettext'
main.c:(.text.startup+0x558): undefined reference to `libintl_gettext'
main.o:main.c:(.text.startup+0x5cc): more undefined references to `libintl_gettext' follow
collect2: error: ld returned 1 exit status
../include/buildrules:32: recipe for target 'xfsrestore' failed
gmake[2]: *** [xfsrestore] Error 1
include/buildrules:22: recipe for target 'restore' failed
gmake[1]: *** [restore] Error 2
gmake[1]: *** Waiting for unfinished jobs....

It appears that using 'append-ldflags' from flag-o-matic will fix this issue, but that raises a QA flag because append-ldflags is not for passing library linking flags.  We're supposed to use 'append-libs' instead.

However, xfsdump's build system does not appear to honor $LIBS or something isn't picking up -lintl when added via append-libs.  So, bug this until a good solution can be found.
Comment 1 Joshua Kinard gentoo-dev 2016-01-02 03:24:53 UTC
Created attachment 421568 [details, diff]
Make gettext/libintl support optional in xfsdump-3.1.6

@base-system, @embedded,

I tried several approaches to getting xfsdump's build system to properly detect -lintl (provided by dev-libs/libintl on uclibc, not by sys-devel/gettext, it looks).  But unless I use append-ldflags to pass -lintl, the build will fail, as it looks like xfsdump's build system doesn't honor/use $LIBS correctly.

So, I instead modded the ebuild to make gettext support optional via the 'nls' USE flag, and for uclibc, this flag will be force-disabled in the uclibc profile's package.use.mask.  I also left the elibc_uclibc USE dep in there for the future.

Look good?
Comment 2 Joshua Kinard gentoo-dev 2016-01-18 08:55:27 UTC
Added to the tree on the 3.1.6 ebuild only.