Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 587620 - net-misc/wget-1.18 fails to build with uclibc due to undefined reference to libiconv in url.c
Summary: net-misc/wget-1.18 fails to build with uclibc due to undefined reference to l...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: uclibc-porting
  Show dependency tree
 
Reported: 2016-06-30 20:42 UTC by tt_1
Modified: 2016-11-22 08:41 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (wget-1.18-uclibc-failed.log,117.35 KB, text/plain)
2016-06-30 20:42 UTC, tt_1
Details
output of emerge --info (emerge-info,4.35 KB, text/plain)
2016-06-30 20:47 UTC, tt_1
Details
wget-1.18.ebuild.patch (wget-1.18.ebuild.patch,567 bytes, patch)
2016-07-02 11:25 UTC, René Rhéaume
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2016-06-30 20:42:38 UTC
Created attachment 439256 [details]
build.log

utils.o: In function `touch':
utils.c:(.text+0x75c): warning: the use of OBSOLESCENT `utime' is discouraged, use `utimes'
/usr/lib/gcc/armv7a-hardfloat-linux-uclibceabi/4.9.3/../../../libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
url.o: In function `url_file_name':
url.c:(.text+0x12f8): undefined reference to `libiconv_open'
url.c:(.text+0x1384): undefined reference to `libiconv'
url.c:(.text+0x13a4): undefined reference to `libiconv'
url.c:(.text+0x13e8): undefined reference to `libiconv_close'
url.c:(.text+0x1644): undefined reference to `libiconv_close'
collect2: error: ld returned 1 exit status
Makefile:1500: recipe for target 'wget' failed
make[3]: *** [wget] Error 1


I attached the full build log, both dev-libs/libiconv and virtual/libiconv are installed of course. 

it may be related to #557122 in some point. 

uclibc is built with the default config, I may attach it if it is helpfull.
Comment 1 tt_1 2016-06-30 20:47:11 UTC
Created attachment 439258 [details]
output of emerge --info
Comment 2 Anthony Basile gentoo-dev 2016-06-30 22:38:53 UTC
This should do it:

echo "net-misc/wget net-misc_wget_0" >> /etc/portage/package.env
mkdir /etc/portage/env
echo "LDFLAGS=-liconv" > /etc/portage/env/net-misc_wget_0

Unfortunately I broke out libiconv from uclibc so you need to explicitly link against it.  I don't want to go fixing a bunch of ebuilds adding this.  Rather I should get iconv working in uclibc.
Comment 3 tt_1 2016-07-01 05:30:11 UTC
Indeed, to apply LDFLAGS=-liconv fixes the compile error.
Comment 4 René Rhéaume 2016-07-02 11:25:00 UTC
Created attachment 439424 [details, diff]
wget-1.18.ebuild.patch

I solved that problem by applying the same trick as for Solaris and Darwin as described in bug 585924
Comment 5 Anthony Basile gentoo-dev 2016-07-11 11:26:24 UTC
(In reply to René Rhéaume from comment #4)
> Created attachment 439424 [details, diff] [details, diff]
> wget-1.18.ebuild.patch
> 
> I solved that problem by applying the same trick as for Solaris and Darwin
> as described in bug 585924

Seeing as wget does this, I see it as legit; however, the better solution is to link against libiconv.
Comment 6 Anthony Basile gentoo-dev 2016-07-11 11:28:25 UTC
@base-system, looks good to me, may I commit?
Comment 7 SpanKY gentoo-dev 2016-07-17 14:50:04 UTC
(In reply to Anthony Basile from comment #6)

OK