Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 542296 - sys-block/parted-3.2 with sys-libs/uclibc - ../libparted/.libs/libparted.so: undefined reference to `libiconv'
Summary: sys-block/parted-3.2 with sys-libs/uclibc - ../libparted/.libs/libparted.so: ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo LiveCD Package Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: uclibc-porting
  Show dependency tree
 
Reported: 2015-03-05 19:13 UTC by fariouche
Modified: 2016-01-02 04:09 UTC (History)
2 users (show)

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


Attachments
Properly fix sys-block/parted-3.2-r1 to compile under uclibc (parted-3.2-r1-uclibc-iconv.patch,740 bytes, patch)
2016-01-02 00:50 UTC, Joshua Kinard
Details | Diff
Properly fix sys-block/parted-3.2-r1 to compile under uclibc v2 (parted-3.2-r1-uclibc-iconv.patch,737 bytes, patch)
2016-01-02 01:31 UTC, Joshua Kinard
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description fariouche 2015-03-05 19:13:39 UTC
Hello,

I'm currently running a uclibc amd64 system, and parted does not build:
libtool: link: x86_64-gentoo-linux-uclibc-gcc -std=gnu99 -O2 -march=core2 -mssse3 -mfpmath=sse -fomit-frame-pointer -pipe -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -rdynamic -o .libs/parted command.o parted.o strlist.o ui.o table.o  libver.a ../libparted/.libs/libparted.so -lreadline -ldl -lncurses
../libparted/.libs/libparted.so: warning: This version of __fpending returns bytes remaining in buffer for both narrow and wide streams.  glibc's version returns wide chars in buffer for the wide stream case.
../libparted/.libs/libparted.so: undefined reference to `libiconv'
../libparted/.libs/libparted.so: undefined reference to `libiconv_open'
../libparted/.libs/libparted.so: undefined reference to `libiconv_close'
collect2: error: ld returned 1 exit status


The problem is that with uclibc, the parted's link commandline should include -liconv to use the libiconv library (until iconv is supported in uclibc)

how can I workaround this?

thanks
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2015-03-05 19:22:22 UTC
I guess it would help if you had virtual/libiconv installed.
Comment 2 fariouche 2015-03-05 22:05:04 UTC
I have virtual/libiconv installed

Also, the parted ebuild does not reference libiconv at all...

But maybe the bug is more in parted's makefile than in the ebuild...
Comment 3 Anthony Basile gentoo-dev 2015-03-06 01:29:13 UTC
(In reply to fariouche from comment #2)
> I have virtual/libiconv installed
> 
> Also, the parted ebuild does not reference libiconv at all...
> 
> But maybe the bug is more in parted's makefile than in the ebuild...

Make sure virtual/libiconv pulls in dev-libs/libiconv.  Also, you're going to have to pass LDFLAGS=-liconv.  You can do that by the following steps:

1) echo "sys-block/parted parted.conf" >> /etc/portage/package.env

2) mkdir -p /etc/portage/env

3) echo "LDFLAGS=-liconv" >> /etc/portage/env/parted.conf

This will ensure that the breakout libiconv library is linked in.

I'm not sure why you assigned this to LiveCD but its really for embedded@.  This is an artifact of how i'm building uclibc stages because uclibc's builting iconv sucks.  So I choose the breakout library that's used on bsd systems, ie dev-libs/libiconv.  But then some packages need -liconv added to its flags.

Let me know if this works for you.  I eventually want to get this problem totally fixed.
Comment 4 fariouche 2015-03-06 09:21:07 UTC
Ok, sorry I haven't paid attention to this field.

I've done the test, and it is working (well, linking at least.)
Thanks
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2015-03-06 09:32:42 UTC
(In reply to Anthony Basile from comment #3)
> I'm not sure why you assigned this to LiveCD but its really for embedded@. 

I assign packages to their maintainers, not to whoever happens to be "responsible" for a bug report at any particular stage of its progress. Everyone should, really, because that should make things a lot clearer for everyone. Meanwhile, CC should already include the right people to perhaps fix this particular bug.
Comment 6 Anthony Basile gentoo-dev 2015-03-06 12:56:45 UTC
(In reply to Jeroen Roovers from comment #5)
> (In reply to Anthony Basile from comment #3)
> > I'm not sure why you assigned this to LiveCD but its really for embedded@. 
> 
> I assign packages to their maintainers, not to whoever happens to be
> "responsible" for a bug report at any particular stage of its progress.
> Everyone should, really, because that should make things a lot clearer for
> everyone. Meanwhile, CC should already include the right people to perhaps
> fix this particular bug.

Of course.  I just didn't realize that parted belonged to livecd.  In retorspect, I can see why.
Comment 7 Joshua Kinard gentoo-dev 2016-01-02 00:50:36 UTC
Created attachment 421562 [details, diff]
Properly fix sys-block/parted-3.2-r1 to compile under uclibc

Tested this patch out to make sys-block/parted-3.2-r1 compile under a uclibc environment.  Added a DEPEND to dev-libs/libiconv if USE elibc_uclibc, and used 'append-ldflags' from flag-o-matic to pass -liconv so that the compile completes.

Good to add to the tree?
Comment 8 Anthony Basile gentoo-dev 2016-01-02 00:55:07 UTC
(In reply to Joshua Kinard from comment #7)
> Created attachment 421562 [details, diff] [details, diff]
> Properly fix sys-block/parted-3.2-r1 to compile under uclibc
> 
> Tested this patch out to make sys-block/parted-3.2-r1 compile under a uclibc
> environment.  Added a DEPEND to dev-libs/libiconv if USE elibc_uclibc, and
> used 'append-ldflags' from flag-o-matic to pass -liconv so that the compile
> completes.
> 
> Good to add to the tree?

Hi Josh,

So there are lots of these and I'm all about putting them in the tree but I'm not sure how other people feel about it.  If we want to do it systematically we should start a tracker.
Comment 9 Joshua Kinard gentoo-dev 2016-01-02 00:57:50 UTC
(In reply to Anthony Basile from comment #8)
> (In reply to Joshua Kinard from comment #7)
> > Created attachment 421562 [details, diff] [details, diff] [details, diff]
> > Properly fix sys-block/parted-3.2-r1 to compile under uclibc
> > 
> > Tested this patch out to make sys-block/parted-3.2-r1 compile under a uclibc
> > environment.  Added a DEPEND to dev-libs/libiconv if USE elibc_uclibc, and
> > used 'append-ldflags' from flag-o-matic to pass -liconv so that the compile
> > completes.
> > 
> > Good to add to the tree?
> 
> Hi Josh,
> 
> So there are lots of these and I'm all about putting them in the tree but
> I'm not sure how other people feel about it.  If we want to do it
> systematically we should start a tracker.

Works for me.  That's why I'm hunting down bugs (or opening new ones) and putting proposed fixes there.  That way, any objections can be captured for Google indexing and the like.

What should we call the tracker bug?  sys-libs/uclibc porting, kinda like Bug #430702 for musl?
Comment 10 Joshua Kinard gentoo-dev 2016-01-02 01:14:11 UTC
(In reply to Joshua Kinard from comment #7)
> Created attachment 421562 [details, diff] [details, diff]
> Properly fix sys-block/parted-3.2-r1 to compile under uclibc
> 
> Tested this patch out to make sys-block/parted-3.2-r1 compile under a uclibc
> environment.  Added a DEPEND to dev-libs/libiconv if USE elibc_uclibc, and
> used 'append-ldflags' from flag-o-matic to pass -liconv so that the compile
> completes.
> 
> Good to add to the tree?

Okay, looks like I'm not supposed to use append=ldflags for adding extra libraries, but I think append-libs instead.  Let me test that instead.  It looks like the same approach also allows sys-fs/xfsdump to compile under uclibc as well.
Comment 11 Joshua Kinard gentoo-dev 2016-01-02 01:31:58 UTC
Created attachment 421566 [details, diff]
Properly fix sys-block/parted-3.2-r1 to compile under uclibc v2

v2 of a patch to allow sys-block/parted to build under a uClibc userland.  Only change here is using 'append-libs' from flag-o-matic instead of 'append-ldflags'.
Comment 12 Jeroen Roovers (RETIRED) gentoo-dev 2016-01-02 03:37:35 UTC
Comment on attachment 421566 [details, diff]
Properly fix sys-block/parted-3.2-r1 to compile under uclibc v2

Looks good.
Comment 13 Joshua Kinard gentoo-dev 2016-01-02 04:09:43 UTC
Pushed the changes to the tree.  Thanks!