Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 351266 - libtool: install: error: cannot install `libphp5.la' to a directory not ending in /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-build/apache2/libs when emerging php
Summary: libtool: install: error: cannot install `libphp5.la' to a directory not endin...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: High normal with 2 votes (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-10 02:28 UTC by anomaly
Modified: 2011-10-31 16:35 UTC (History)
4 users (show)

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


Attachments
libphp5.la (libphp5.la,18.61 KB, text/plain)
2011-01-10 03:17 UTC, anomaly
Details
build log (build.log.tar.gz,74.90 KB, application/octet-stream)
2011-01-10 03:40 UTC, anomaly
Details

Note You need to log in before you can comment on or make changes to this bug.
Description anomaly 2011-01-10 02:28:02 UTC
Whenever I try to emerge php (I have tried both 5.3.4 and 5.3.5), it dies with the following:  

Build complete.
Don't forget to run 'make test'.

make -j3 INSTALL_ROOT=/var/tmp/portage/dev-lang/php-5.3.5/work/sapis/apache2/ install-sapi
Installing PHP SAPI module:       apache2handler
/usr/lib/apache2/build/instdso.sh SH_LIBTOOL='/usr/bin/libtool' libphp5.la /var/tmp/portage/dev-lang/php-5.3.5/work/sapis/apache2//usr/lib/apache2/modules
/usr/bin/libtool --mode=install cp libphp5.la /var/tmp/portage/dev-lang/php-5.3.5/work/sapis/apache2//usr/lib/apache2/modules/
libtool: install: error: cannot install `libphp5.la' to a directory not ending in /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-build/apache2/libs
apxs:Error: Command failed with rc=65536
.
make: *** [install-sapi] Error 1
emake failed


Reproducible: Always

Steps to Reproduce:
1.  emerge php
2.
3.

Actual Results:  
Build complete.
Don't forget to run 'make test'.

make -j3 INSTALL_ROOT=/var/tmp/portage/dev-lang/php-5.3.5/work/sapis/apache2/ install-sapi
Installing PHP SAPI module:       apache2handler
/usr/lib/apache2/build/instdso.sh SH_LIBTOOL='/usr/bin/libtool' libphp5.la /var/tmp/portage/dev-lang/php-5.3.5/work/sapis/apache2//usr/lib/apache2/modules
/usr/bin/libtool --mode=install cp libphp5.la /var/tmp/portage/dev-lang/php-5.3.5/work/sapis/apache2//usr/lib/apache2/modules/
libtool: install: error: cannot install `libphp5.la' to a directory not ending in /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-build/apache2/libs
apxs:Error: Command failed with rc=65536
.
make: *** [install-sapi] Error 1
emake failed


Expected Results:  
for php to install successfully.

As there isn't already a bug report, I'm guessing other people aren't having the same problem.  I recently performed a system-wide upgrade, but I followed the gcc / php / etc upgrade guides.  Even after an emerge -e world and every single other package on the system going successfullly, php still won't work.



paragon ~ # emerge --info =dev-lang/php-5.3.5
Portage 2.1.9.25 (hardened/linux/x86, gcc-4.4.4, glibc-2.11.2-r3, 2.6.32-hardened-r22 i686)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.32-hardened-r22-i686-Intel-R-_Xeon-TM-_CPU_2.80GHz-with-gentoo-1.12.14
Timestamp of tree: Sun, 09 Jan 2011 23:00:21 +0000
app-shells/bash:     4.1_p7
dev-java/java-config: 1.3.7-r1, 2.1.11-r1
dev-lang/python:     2.4.4-r13, 2.5.4-r2, 2.6.6-r1, 2.7.1, 3.1.3
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.14-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.7.9-r1, 1.9.6-r2, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       3.4.6-r2, 4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs buildpkg distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl alsa apache2 berkdb bzip2 caps cgi chroot cli cracklib crypt curl cxx dedicated dri gdbm gpm hardened hardenedphp iconv imap innodb jpeg libwww mbox modules mudflap mysql ncurses nls nptl nptlonly openmp pam pcre perl php pic png posix pppd python readline sasl session sse ssl sysfs tcpd unicode urandom vhosts x86 xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" 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 ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 intel mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa via vmware nouveau" 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, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Rafał Mużyło 2011-01-10 02:59:15 UTC
Attach full build log and the la file it's complaining about.
Comment 2 anomaly 2011-01-10 03:17:49 UTC
Created attachment 259430 [details]
libphp5.la
Comment 3 anomaly 2011-01-10 03:40:53 UTC
Created attachment 259432 [details]
build log
Comment 4 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-01-10 05:10:29 UTC
I wonder if that error message is about getting over the command line size.

Diego,

is this a libtool limitation or is that .la file just "bogus"?
Comment 5 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-01-10 10:36:21 UTC
Okay first of all I have to say that php in tinderbox is not building because of MySQL issues so I don't have a clue whether I can reproduce this or not, sorry :/

As for the error... libtool is designed not to allow installing a file in a path different from what it has been built against, if it sounds stupid, that's because it generally is.

I think the best bet is making sure to override the libdir both during build and install, rather than just install.
Comment 6 Rafał Mużyło 2011-01-10 13:56:11 UTC
I doubt it's a size problem.
libdir='/var/tmp/portage/dev-lang/php-5.3.5/work/sapis-build/apache2/libs'
doesn't look quite right...then again, perhaps it is.

I'd say try rebuilding your libtool - that part of install process, due to apache quirks, uses system copy.
Comment 7 anomaly 2011-01-10 19:05:50 UTC
I don't know if that last comment was for me or not -- but reinstalling libtool did not make a difference.
Comment 8 anomaly 2011-01-14 19:22:14 UTC
FYI, if I do the following:

Edit /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-build/apache2/libphp5.la and remove the libdir and relink_command lines

Run /usr/lib/apache2/build/instdso.sh SH_LIBTOOL='/usr/bin/libtool' libphp5.la /var/tmp/portage/dev-lang/php-5.3.5/work/sapis/apache2//usr/lib/apache2/modules

Run /usr/bin/libtool --finish

ebuild /path/to/php-5.3.5.ebuild merge

the build will finish and install OK -- it's just the two lines in that la file that kills it.
Comment 9 Patrick ALLAERT 2011-04-19 10:35:48 UTC
Looks exactly the same as #266537

I do have the same problem with dev-lang/php-5.3.6:

make -j3 INSTALL_ROOT=/var/tmp/portage/dev-lang/php-5.3.6/work/sapis/apache2/ install-sapi 
Installing PHP SAPI module:       apache2handler
/usr/lib/apache2/build/instdso.sh SH_LIBTOOL='/usr/bin/libtool' libphp5.la /var/tmp/portage/dev-lang/php-5.3.6/work/sapis/apache2//usr/lib/apache2/modules
/usr/bin/libtool --mode=install cp libphp5.la /var/tmp/portage/dev-lang/php-5.3.6/work/sapis/apache2//usr/lib/apache2/modules/
libtool: install: error: cannot install `libphp5.la' to a directory not ending in /var/tmp/portage/dev-lang/php-5.3.6/work/sapis-build/apache2/libs
apxs:Error: Command failed with rc=65536
.
make: *** [install-sapi] Error 1
emake failed
Comment 10 Patrick ALLAERT 2011-05-09 09:05:45 UTC
Does someone know how to solve this instead of having to manually modify the libphp5.la file?
Comment 11 Patrick ALLAERT 2011-05-23 17:45:59 UTC
No progress so far?
I must manually do the operations as anomaly@... mentioned earlier every time I must compile dev-lang/php.
Comment 12 Ole Markus With (RETIRED) gentoo-dev 2011-05-24 19:23:54 UTC
Sorry Patrick. I cannot reproduce this, and this does not seem to be a wide-spread issue so that makes it difficult for me to figure out exactly what is wrong.
Comment 13 Patrick ALLAERT 2011-05-25 18:32:30 UTC
Hi Ole Markus,

I perfectly understand that.

May I provide you more useful info about my environment?
Would you require an ssh access to my box for further investigation?

I am eager to help as much as possible to fix that issue.

Regards,
Patrick
Comment 14 Matti Bickel (RETIRED) gentoo-dev 2011-08-12 21:28:37 UTC
I've traced this issue to your system putting relink_command in the .la file. The restrictions on $libdir apply only in this case, which is why Ole and myself haven't experienced this issue. I've yet to figure out why the command is missing in my (and probably Ole's) system.

I'll let you know if I can figure this out completely.
Comment 15 Matti Bickel (RETIRED) gentoo-dev 2011-08-17 21:50:37 UTC
Ole: how'd you like a more drastic approach: don't run emake install-sapi at all?
At this point I'm up for just skipping this step and proceed straight to src_install, where I'd just dolib.so libphp5.so from ${WORKDIR}/sapis-build/apache2/.libs - honestly I can't remember why we do the intermediate step with ${WORKDIR}/sapis, but that may be due to me being gone for so long. What do you think? I'll provide a patch + new eblits tomorrow when I'm not half asleep.
Comment 16 Ole Markus With (RETIRED) gentoo-dev 2011-08-18 08:27:48 UTC
(In reply to comment #15)
> Ole: how'd you like a more drastic approach: don't run emake install-sapi at
> all?
> At this point I'm up for just skipping this step and proceed straight to
> src_install, where I'd just dolib.so libphp5.so from
> ${WORKDIR}/sapis-build/apache2/.libs - honestly I can't remember why we do the
> intermediate step with ${WORKDIR}/sapis, but that may be due to me being gone
> for so long. What do you think? I'll provide a patch + new eblits tomorrow when
> I'm not half asleep.

I have no idea why we do that step. You were the one who wrote that ;)
But it seems to me like everything becomes more simple without it.
Comment 17 Matti Bickel (RETIRED) gentoo-dev 2011-08-22 16:55:33 UTC
Well, it's not exactly tomorrow but the patch has found it's way into the php overlay over at http://git.overlays.gentoo.org/gitweb/?p=proj/php.git

Can you please all review/test it and tell me if it solves the bug w/o introducing new issues before i commit it to CVS?

Btw the reason it took so long was me trying to figure out if I can make "make install-sapi" work in case the target will ever do something more than copying the lib around. But I simply gave up facing the libtool black art :|
Comment 18 Ole Markus With (RETIRED) gentoo-dev 2011-08-22 18:02:44 UTC
It looks good to me. How about bumping eblits versions and use it for 5.3.8 that should be out tomorrow? Then we can piggypack testing on the arch team doing security stabilisation. Or would it be too naughty to do this on a security release?
Comment 19 Matti Bickel (RETIRED) gentoo-dev 2011-08-24 08:12:32 UTC
Ah well, with me slacking^Winstalling another gentoo machine we seem to have missed the deadline anyway? Since it only affects the build process and the output /should/ be the same, I think we can safely push this to a later -rX release.
Comment 20 Patrick ALLAERT 2011-10-04 06:20:49 UTC
Hi,

Is there any progress to push this solution to everyone?

Cheers.
Comment 21 Matti Bickel (RETIRED) gentoo-dev 2011-10-31 16:35:28 UTC
I finally applied the fixes from the overlay to php5.4.0beta2, refraining to touch stable packages for now. They will be updated if I'm sure I haven't broken something.

Thanks for your patience!