Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 533666 - dev-lang/php USE=iconv with sys-libs/musl - configure: error: Please reinstall the iconv library.
Summary: dev-lang/php USE=iconv with sys-libs/musl - configure: error: Please reinstal...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PHP Bugs
URL: https://bugs.php.net/bug.php?id=68685
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-27 08:47 UTC by James Taylor
Modified: 2015-01-24 03:30 UTC (History)
0 users

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


Attachments
build.log (file_533666.txt,23.41 KB, text/plain)
2014-12-29 07:56 UTC, James Taylor
Details
configure (file_533666.txt,438.75 KB, text/plain)
2014-12-29 08:04 UTC, James Taylor
Details
configure.in (file_533666.txt,46.61 KB, text/plain)
2014-12-29 08:05 UTC, James Taylor
Details
config.log (file_533666.txt,229.89 KB, text/plain)
2014-12-29 08:08 UTC, James Taylor
Details
php-5.5.20.ebuild.patch (file_533666.txt,619 bytes, patch)
2014-12-30 00:25 UTC, James Taylor
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Taylor 2014-12-27 08:47:59 UTC
musl-libc provides its own iconv, which causes php to error out when it doesn't find libiconv. Build works fine with USE="-iconv"

Error message:

checking for iconv support... yes
configure: error: Please reinstall the iconv library.

Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-27 10:21:09 UTC
1) Please attach the entire build log to this bug report.
2) Please post your `emerge --info' output in a comment.
Comment 2 James Taylor 2014-12-29 07:56:03 UTC
Created attachment 392622 [details]
build.log

Here's the build.log for the failed build. I forgot to add it to the bug report when I originally submitted it :)
Comment 3 James Taylor 2014-12-29 07:58:36 UTC
This is from a successful build.


Portage 2.2.14 (python 2.7.9-final-0, hardened/linux/musl/amd64, gcc-4.8.3, musl-1.1.5-r1, 3.17.4-hardened-r1-nimbus x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.17.4-hardened-r1-nimbus-x86_64-Intel-R-_Xeon-R-_CPU_E5-2680_v2_@_2.80GHz-with-gentoo-2.2
KiB Mem:     1013292 total,    132264 free
KiB Swap:    2097148 total,   1962396 free
Timestamp of tree: Sun, 28 Dec 2014 12:15:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p53
dev-lang/perl:            5.18.2-r2
dev-lang/python:          2.7.9-r1, 3.3.5-r1, 3.4.1
dev-util/ccache:          3.1.9-r4
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4-r99::hardened-dev
sys-apps/sandbox:         2.6-r999::hardened-dev
sys-devel/autoconf:       2.69
sys-devel/automake:       1.13.4
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3-r99::hardened-dev
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.17-r1 (virtual/os-headers)
Repositories: gentoo x-portage hardened-dev nginx-overlay mva jamestr kveer powerdns-overlay
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-gentoo-linux-musl"
CFLAGS="-march=native -O2 -fstack-protector-all -fomit-frame-pointer"
CHOST="x86_64-gentoo-linux-musl"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -fstack-protector-all -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="-a"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://www.gtlib.gatech.edu/pub/gentoo/"
INSTALL_MASK="charset.alias"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /var/lib/layman/hardened-development /var/lib/layman/nginx-overlay /var/lib/layman/mva /var/lib/layman/jamestr /var/lib/layman/kveer /var/lib/layman/powerdns-overlay"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="amd64 bash-completion cli cracklib crypt cxx dlz dri fortran hardened iconv ipv6 mmx modules ncurses nls nptl offensive openmp pax_kernel pcre pic readline session sse sse2 ssl ssse3 tcpd unicode vim-syntax xattr zlib zsh-completion" ABI_X86="64" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="musl" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="dummy fbdev v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

dev-lang/php-5.5.20 was built with the following:
USE="cli crypt ctype curl fileinfo filter fpm gd hash ipv6 json mysql mysqli nls opcache pdo phar posix postgres readline session simplexml sockets sqlite ssl tokenizer unicode xml zlib -apache2 -bcmath -berkdb -bzip2 -calendar -cdb -cgi -cjk -debug -embed -enchant -exif (-firebird) -flatfile (-frontbase) -ftp -gdbm -gmp -iconv -imap -inifile -intl -iodbc -kerberos -ldap -ldap-sasl -libedit -libmysqlclient -mhash -mssql (-oci8-instant-client) -odbc -pcntl -qdbm -recode (-selinux) -sharedmem -snmp -soap -spell (-sybase-ct) (-systemd) -sysvipc -threads -tidy -truetype -vpx -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xslt -zip"
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-29 08:01:20 UTC
It DEPENDs on virtual/libiconv properly already. So what is configure missing? Please attach this file:

configure: error: Please reinstall the iconv library.

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/dev-lang/php-5.5.20/work/sapis-build/cli/config.log
Comment 5 James Taylor 2014-12-29 08:04:47 UTC
Created attachment 392624 [details]
configure
Comment 6 James Taylor 2014-12-29 08:05:20 UTC
Created attachment 392626 [details]
configure.in
Comment 7 James Taylor 2014-12-29 08:08:26 UTC
Created attachment 392628 [details]
config.log

Woops, attached the wrong file >.>
Comment 8 James Taylor 2014-12-29 08:09:38 UTC
sys-libs/musl provides iconv in the main libc.so, so libiconv isn't needed. All appropriate header files are also supplied.
Comment 9 Felix Janda 2014-12-29 11:41:31 UTC
The problem lies in the line

	$(use_with iconv iconv $(use elibc_glibc || echo "${EPREFIX}"/usr))

of the ebuild. (musl also provides iconv in libc.)
Comment 10 Ole Markus With (RETIRED) gentoo-dev 2014-12-29 11:41:31 UTC
I'll try setting up an environment with musl to test this. I skimmed through the macros and it seems like it only checks for headers, but I might have missed something.

You should also file an upstream bug as they might be able to resolve this faster I need to get a patch upstream to fix this anyway.
Comment 11 James Taylor 2014-12-29 12:51:10 UTC
Bugzilla won't let me add this as a "See Also"...

Upstream bug report:
https://bugs.php.net/bug.php?id=68685
Comment 12 Ole Markus With (RETIRED) gentoo-dev 2014-12-29 13:28:13 UTC
(In reply to James Taylor from comment #11)
> Bugzilla won't let me add this as a "See Also"...
> 
> Upstream bug report:
> https://bugs.php.net/bug.php?id=68685

(In reply to Felix Janda from comment #9)
> The problem lies in the line
> 
> 	$(use_with iconv iconv $(use elibc_glibc || echo "${EPREFIX}"/usr))
> 
> of the ebuild. (musl also provides iconv in libc.)

Not really. you won't have elibc_glibc set, I assume, so this will add the flag --with-iconv=/usr which is where it will look for header files. I assume this is correct also for musl.
Comment 13 Felix Janda 2014-12-29 14:37:31 UTC
If a path is given to --with-iconv, php's config script assumes that
iconv is provided via libiconv. If no path is given (and it is enabled),
it assumes that iconv is in libc. Therefore musl should be treated in
the same way as glibc here. (check out PHP_SETUP_ICONV in aclocal.m4.)
Comment 14 Ole Markus With (RETIRED) gentoo-dev 2014-12-29 14:49:21 UTC
(In reply to Felix Janda from comment #13)
> If a path is given to --with-iconv, php's config script assumes that
> iconv is provided via libiconv. If no path is given (and it is enabled),
> it assumes that iconv is in libc. Therefore musl should be treated in
> the same way as glibc here. (check out PHP_SETUP_ICONV in aclocal.m4.)

I see. Then you can try adding elibc_musl to the inner use flag check:
$(use_with iconv iconv $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}"/usr))

If that works, I can just add that check to future ebuilds.
Comment 15 James Taylor 2014-12-29 23:35:55 UTC
the elibc_musl use flag works for me. some other ebuilds already use it to fix building under musl as it is :)
Comment 16 James Taylor 2014-12-30 00:25:55 UTC
Created attachment 392684 [details, diff]
php-5.5.20.ebuild.patch
Comment 17 Ole Markus With (RETIRED) gentoo-dev 2015-01-23 09:16:15 UTC
Patch applied to new ebuilds. Please test.
Comment 18 James Taylor 2015-01-24 03:30:54 UTC
current ebuilds in portage tree fixed the issue. Thanks!