Bug 12031 - Build of cups-filters fails while linking, apparently due to missing libiconv
Summary: Build of cups-filters fails while linking, apparently due to missing libiconv
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2019.05.1
Hardware: All Linux
: P5 minor
Target Milestone: ---
Assignee: Carlos Santos
URL:
Keywords: link-failure
Depends on:
Blocks:
 
Reported: 2019-07-11 06:23 UTC by jakobcornell
Modified: 2019-09-21 17:09 UTC (History)
1 user (show)

See Also:
Host: i386
Target:
Build: amd64 Linux


Attachments
incorrect config - do not use (302 bytes, application/octet-stream)
2019-07-19 04:25 UTC, jakobcornell
Details
Buildroot config (304 bytes, application/octet-stream)
2019-07-19 18:56 UTC, jakobcornell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jakobcornell 2019-07-11 06:23:22 UTC
The command `make` fails with the following output:

[7m>>> cups-filters 1.21.3 Building[27m
PATH="/home/jakob/buildroot-2019.05.1/output/host/bin:/home/jakob/buildroot-2019.05.1/output/host/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/jakob/.cargo/bin"  /usr/bin/make -j3  -C /home/jakob/buildroot-2019.05.1/output/build/cups-filters-1.21.3/
make[1]: Entering directory '/home/jakob/buildroot-2019.05.1/output/build/cups-filters-1.21.3'
/usr/bin/make  all-am
make[2]: Entering directory '/home/jakob/buildroot-2019.05.1/output/build/cups-filters-1.21.3'
sed -e "s/Braille transcription/Additional Braille transcription (2)/" \
    -e "s/^  \\*Choice /  Choice /" \
    -e "s/^  Choice \"HyphLocale\//  *Choice \"HyphLocale\//" \
    -e s/LibLouis/LibLouis2/ \
    < filter/braille/filters/liblouis1.defs > filter/braille/filters/liblouis2.defs
sed -e "s/Braille transcription/Additional Braille transcription (3)/" \
    -e "s/^  \\*Choice /  Choice /" \
    -e "s/^  Choice \"None\//  *Choice \"None\//" \
    -e s/LibLouis/LibLouis3/ \
    < filter/braille/filters/liblouis1.defs > filter/braille/filters/liblouis3.defs
  CCLD     texttotext
sed -e "s/Braille transcription/Additional Braille transcription (4)/" \
    -e "s/^  \\*Choice /  Choice /" \
    -e "s/^  Choice \"None\//  *Choice \"None\//" \
    -e s/LibLouis/LibLouis4/ \
    < filter/braille/filters/liblouis1.defs > filter/braille/filters/liblouis4.defs
/home/jakob/buildroot-2019.05.1/output/host/lib/gcc/i686-buildroot-linux-uclibc/7.4.0/../../../../i686-buildroot-linux-uclibc/bin/ld: texttotext-texttotext.o: in function `main':
texttotext.c:(.text.startup+0xdf3): undefined reference to `libiconv_open'
/home/jakob/buildroot-2019.05.1/output/host/lib/gcc/i686-buildroot-linux-uclibc/7.4.0/../../../../i686-buildroot-linux-uclibc/bin/ld: texttotext.c:(.text.startup+0xfb0): undefined reference to `libiconv'
/home/jakob/buildroot-2019.05.1/output/host/lib/gcc/i686-buildroot-linux-uclibc/7.4.0/../../../../i686-buildroot-linux-uclibc/bin/ld: texttotext.c:(.text.startup+0xfe9): undefined reference to `libiconv'
/home/jakob/buildroot-2019.05.1/output/host/lib/gcc/i686-buildroot-linux-uclibc/7.4.0/../../../../i686-buildroot-linux-uclibc/bin/ld: texttotext.c:(.text.startup+0x16eb): undefined reference to `libiconv_close'
collect2: error: ld returned 1 exit status
Makefile:2541: recipe for target 'texttotext' failed
make[2]: *** [texttotext] Error 1
make[2]: Leaving directory '/home/jakob/buildroot-2019.05.1/output/build/cups-filters-1.21.3'
Makefile:1968: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/jakob/buildroot-2019.05.1/output/build/cups-filters-1.21.3'
package/pkg-generic.mk:238: recipe for target '/home/jakob/buildroot-2019.05.1/output/build/cups-filters-1.21.3/.stamp_built' failed
make: *** [/home/jakob/buildroot-2019.05.1/output/build/cups-filters-1.21.3/.stamp_built] Error 2

My Buildroot config is attached. I'm using uClibc in the toolchain, and libiconv is selected as a dependency in the target package list.
Comment 1 jakobcornell 2019-07-12 18:52:16 UTC
I've enabled Iconv in the uClibc config as well and done a clean build. The same error appears.
Comment 2 Carlos Santos 2019-07-18 20:34:14 UTC
Please run the following commands

    $ make savedefconfig BR2_DEFCONFIG=/tmp/bz12031.defconfig
    $ gzip /tmp/bz12031.defconfig

Then attach the resulting /tmp/bz12046.defconfig.gz file to this bug.
Comment 3 jakobcornell 2019-07-19 04:25:50 UTC
Created attachment 8161 [details]
incorrect config - do not use
Comment 4 jakobcornell 2019-07-19 17:11:40 UTC
Comment on attachment 8161 [details]
incorrect config - do not use

I'd changed some config parameters since getting the issue, so this config doesn't cause the error. Stay tuned for the proper config.
Comment 5 jakobcornell 2019-07-19 18:56:20 UTC
Created attachment 8166 [details]
Buildroot config

Here's the original config which causes the issue.
Comment 6 jakobcornell 2019-07-22 06:52:44 UTC
I've worked around the problem for now by adding `-liconv` to the `CUPS_LIBS` definition in `output/build/cups-filters-1.21.3/Makefile`. But I wonder how one would go about patching this so the dependency is used automatically under a uClibc toolchain.
Comment 7 Carlos Santos 2019-07-22 07:16:24 UTC
(In reply to jakobcornell from comment #6)

A patch fixing the problem was submitted:

    https://patchwork.ozlabs.org/patch/1134738/
Comment 8 jakobcornell 2019-07-22 07:35:34 UTC
Great, thanks!
Comment 9 Carlos Santos 2019-07-22 11:05:17 UTC
Reopening, since the patch was not committed yet, just submitted for review.
Comment 10 Carlos Santos 2019-09-21 17:09:31 UTC
Fixed by https://patchwork.ozlabs.org/patch/1164349/