Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 557122 - >=dev-vcs/git-2.0.4 : add libiconv support on sys-libs/uclibc
Summary: >=dev-vcs/git-2.0.4 : add libiconv support on sys-libs/uclibc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: uclibc-porting
  Show dependency tree
 
Reported: 2015-08-09 12:03 UTC by René Rhéaume
Modified: 2019-04-26 10:03 UTC (History)
3 users (show)

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


Attachments
Ebuild patch (git-2.4.6.ebuild.patch,781 bytes, patch)
2015-08-09 12:08 UTC, René Rhéaume
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description René Rhéaume 2015-08-09 12:03:25 UTC
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
Comment 1 René Rhéaume 2015-08-09 12:08:19 UTC
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.
Comment 2 Anthony Basile gentoo-dev 2016-03-01 09:49:36 UTC
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.
Comment 3 Felix Janda 2016-04-02 21:35:33 UTC
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.
Comment 4 René Rhéaume 2016-05-29 00:31:13 UTC
(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.
Comment 5 tt_1 2016-12-26 21:05:35 UTC
(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?
Comment 6 René Rhéaume 2017-01-28 07:56:24 UTC
I continue to apply my patch as of git 2.10.2
Comment 7 Pandu POLUAN 2017-02-20 20:48:24 UTC
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
Comment 8 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-04-20 19:21:01 UTC
Still an issue with recent git releases?
Comment 9 tt_1 2019-04-21 15:09:43 UTC
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?
Comment 10 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-04-24 11:11:59 UTC
(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.
Comment 11 Larry the Git Cow gentoo-dev 2019-04-24 11:17:49 UTC
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(-)
Comment 12 Arfrever Frehtes Taifersar Arahesis 2019-04-25 19:49:25 UTC
(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
...
Comment 13 Larry the Git Cow gentoo-dev 2019-04-26 10:03:16 UTC
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(+)