Since (at least) version 2.0.4, there is an "iconv" USE flag in the ebuild for Git. However, it does not enable libiconv support on uclibc and build fails at link time. Reproducible: Always Steps to Reproduce: 1. emerge -1 >=dev-util/git-2.0.4 2. 3. Actual Results: libgit.a(utf8.o): In function `reencode_string_iconv': utf8.c:(.text.reencode_string_iconv+0xc9): undefined reference to `libiconv' libgit.a(utf8.o): In function `reencode_string_len': utf8.c:(.text.reencode_string_len+0x4f): undefined reference to `libiconv_open' utf8.c:(.text.reencode_string_len+0x78): undefined reference to `libiconv_close' utf8.c:(.text.reencode_string_len+0xd2): undefined reference to `libiconv_open' collect2: error: ld returned 1 exit status Makefile:1982: recipe for target 'git-credential-store' failed make: *** [git-credential-store] Error 1 * ERROR: dev-vcs/git-2.4.6::gentoo failed (compile phase): * emake failed Expected Results: Git installed on system
Created attachment 408616 [details, diff] Ebuild patch Made against git-2.4.6.ebuild (latest stable in Gentoo tree). I have been applying this change since version 2.0.4 in my personal overlay.
I've been dealing with libiconv and libintl by adding the correct entries to /etc/portage/{package.env,env}/ This is hacky, but it beats putting this into a ton of ebuilds. I have yet to think out a good solution for these.
wrt Comment 2, wouldn't it be possible to put the logic which systems need -liconv (or -lintl) into an eclass? With the logic in a common place it would be easier to keep in sync with the corresponding virtuals.
(In reply to Anthony Basile from comment #2) > I've been dealing with libiconv and libintl by adding the correct entries to > /etc/portage/{package.env,env}/ This is hacky, but it beats putting this > into a ton of ebuilds. I have yet to think out a good solution for these. Can I get a copy of your package.env? I continue patching ebuilds in my personal overlay every time a new git version hit stable.
(In reply to René Rhéaume from comment #1) > Created attachment 408616 [details, diff] [details, diff] > Ebuild patch > > Made against git-2.4.6.ebuild (latest stable in Gentoo tree). I have been > applying this change since version 2.0.4 in my personal overlay. This works fine and does not interfere with any other system but uclibc, why hasn't it been commited to the tree yet?
I continue to apply my patch as of git 2.10.2
I too got bitten by this. Emerging dev-vcs/git-2.10.2 on uclibc-hardened, fresh stage3 installation. I have to add this line to /etc/portage/env/libiconv: > NEEDS_LIBICONV=YesPlease And refer to that file in package.env
Still an issue with recent git releases?
No it isn't. errors related to >undefined reference to `libiconv'< all over the place. Fix from #1 is simple, why isn't that used?
(In reply to tt_1 from comment #9) > No it isn't. > > errors related to >undefined reference to `libiconv'< all over the place. > > Fix from #1 is simple, why isn't that used? I was asking in order to avoid fixing something that might have been fixed by upstream meanwhile. I don't have any uclibc systems to test on and on glibc systems this obviously is not an issue. The fix from comment #1 also has a flaw because virtual/libiconv package only pulls dependencies when we are neither on glibc, nor uclibc nor musl.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b79e40dcfe1e580f77830d2fbdf037433c4d81b6 commit b79e40dcfe1e580f77830d2fbdf037433c4d81b6 Author: Lars Wendler <polynomial-c@gentoo.org> AuthorDate: 2019-04-24 11:17:24 +0000 Commit: Lars Wendler <polynomial-c@gentoo.org> CommitDate: 2019-04-24 11:17:42 +0000 dev-vcs/git: Fixed build on uclibc systems with USE="iconv" Thanks-to: René Rhéaume <rene.rheaume@gmail.com> Closes: https://bugs.gentoo.org/557122 Package-Manager: Portage-2.3.64, Repoman-2.3.12 Signed-off-by: Lars Wendler <polynomial-c@gentoo.org> dev-vcs/git/git-2.19.2.ebuild | 4 +++- dev-vcs/git/git-2.20.1.ebuild | 4 +++- dev-vcs/git/git-2.21.0-r1.ebuild | 4 +++- dev-vcs/git/git-2.21.0-r2.ebuild | 4 +++- dev-vcs/git/git-2.21.0.ebuild | 4 +++- dev-vcs/git/git-9999-r1.ebuild | 4 +++- dev-vcs/git/git-9999-r2.ebuild | 4 +++- dev-vcs/git/git-9999-r3.ebuild | 4 +++- dev-vcs/git/git-9999.ebuild | 4 +++- 9 files changed, 27 insertions(+), 9 deletions(-)
(In reply to Lars Wendler (Polynomial-C) from comment #10) > The fix from comment #1 also has a flaw because virtual/libiconv package > only pulls dependencies when we are neither on glibc, nor uclibc nor musl. Any package which uses portable functions declared in iconv.h (iconv_open, iconv, iconv_close) should depend on virtual/libiconv. (FreeBSD's iconv.h declares some other non-portable functions.) It is just unfortunate that many packages are missing this dependency. This command shows that dev-vcs/git has undefined symbols for these functions and should depend on virtual/libiconv: # scanelf -qs "-iconv_open,-iconv,-iconv_close" $(qlist dev-vcs/git | sort) iconv,iconv_close,iconv_open /usr/bin/git iconv,iconv_close,iconv_open /usr/bin/git-receive-pack iconv,iconv_close,iconv_open /usr/bin/git-shell iconv,iconv_close,iconv_open /usr/bin/git-upload-archive iconv,iconv_close,iconv_open /usr/bin/git-upload-pack iconv,iconv_close,iconv_open /usr/libexec/git-core/git iconv,iconv_close,iconv_open /usr/libexec/git-core/git-add iconv,iconv_close,iconv_open /usr/libexec/git-core/git-am ...
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d894ccce70afc5fc9e7b871203ec7253ca4103ad commit d894ccce70afc5fc9e7b871203ec7253ca4103ad Author: Lars Wendler <polynomial-c@gentoo.org> AuthorDate: 2019-04-26 10:02:49 +0000 Commit: Lars Wendler <polynomial-c@gentoo.org> CommitDate: 2019-04-26 10:03:10 +0000 dev-vcs/git: Added virtual/libiconv Bug: https://bugs.gentoo.org/557122 Package-Manager: Portage-2.3.65, Repoman-2.3.12 Signed-off-by: Lars Wendler <polynomial-c@gentoo.org> dev-vcs/git/git-2.19.2.ebuild | 1 + dev-vcs/git/git-2.20.1.ebuild | 1 + dev-vcs/git/git-2.21.0-r1.ebuild | 1 + dev-vcs/git/git-2.21.0-r2.ebuild | 1 + dev-vcs/git/git-2.21.0.ebuild | 1 + dev-vcs/git/git-9999-r1.ebuild | 1 + dev-vcs/git/git-9999-r2.ebuild | 1 + dev-vcs/git/git-9999-r3.ebuild | 1 + dev-vcs/git/git-9999.ebuild | 1 + 9 files changed, 9 insertions(+)