Mail archive
alpine-aports

Re: [alpine-aports] [PATCH] testing/php7: fix mysqli, mysqlnd and pdo_mysql extensions

From: Timo Teras <timo.teras_at_iki.fi>
Date: Tue, 23 Feb 2016 09:44:29 +0200

On Tue, 23 Feb 2016 09:36:49 +0200
Timo Teras <timo.teras_at_iki.fi> wrote:

> > > Additional diagnostics:
> > >
> > > $ file ./src/php-7.0.3/ext/xml/.libs/xml.so
> > > ./src/php-7.0.3/ext/xml/.libs/xml.so: ELF 32-bit LSB shared
> > > object, Intel 80386, version 1 (SYSV), dynamically linked, not
> > > stripped
> > >
> > > $ ldd ./src/php-7.0.3/ext/xml/.libs/xml.so
> > > ldd: ./src/php-7.0.3/ext/xml/.libs/xml.so: Not a valid dynamic
> > > program
> > >
> > > readelf and other utils display valid data there. So I'm not sure
> > > if this is something in php build, in the toolchain or in musl
> > > dynamic linker.
>
> Sounds like toolchain issue or musl ld.so issue.
>
> Perhaps, I'll then apply the patch without the 'arch' change, and a
> fixes #5111 to the commit log?

strace says:

open("/home/tteras/aports/testing/php7/src/php-7.0.3/modules/xml.so", O_RDONLY|O_LARGEFILE) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240\26\0\0004\0\0\0"..., 936) = 936
mmap2(NULL, 40960, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xe650f000
mmap2(0xe6517000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x7000) = 0xe6517000
mprotect(0xe650f000, 40960, PROT_READ|PROT_WRITE|PROT_EXEC) = -1 EACCES (Permission denied)
munmap(0xe650f000, 40960) = 0
writev(2, [{"ldd: /home/tteras/aports/testing"..., 66}, {": Not a valid dynamic program\n", 30}], 2ldd: /home/tteras/aports/testing/php7/src/php-7.0.3/modules/xml.so: Not a valid dynamic program

After some more investigation, it seems that there's text relocations:

$ scanelf -t /home/tteras/aports/testing/php7/src/php-7.0.3/modules/*.so|grep TEXT
 TYPE TEXTREL FILE
ET_DYN TEXTREL /home/tteras/aports/testing/php7/src/php-7.0.3/modules/bz2.so
ET_DYN TEXTREL /home/tteras/aports/testing/php7/src/php-7.0.3/modules/dom.so
ET_DYN TEXTREL /home/tteras/aports/testing/php7/src/php-7.0.3/modules/intl.so
ET_DYN TEXTREL /home/tteras/aports/testing/php7/src/php-7.0.3/modules/json.so
ET_DYN TEXTREL /home/tteras/aports/testing/php7/src/php-7.0.3/modules/mbstring.so
ET_DYN TEXTREL /home/tteras/aports/testing/php7/src/php-7.0.3/modules/mysqlnd.so
ET_DYN TEXTREL /home/tteras/aports/testing/php7/src/php-7.0.3/modules/pdo.so
ET_DYN TEXTREL /home/tteras/aports/testing/php7/src/php-7.0.3/modules/pgsql.so
ET_DYN TEXTREL /home/tteras/aports/testing/php7/src/php-7.0.3/modules/session.so
ET_DYN TEXTREL /home/tteras/aports/testing/php7/src/php-7.0.3/modules/sockets.so
ET_DYN TEXTREL /home/tteras/aports/testing/php7/src/php-7.0.3/modules/xml.so

This sounds like CFLAGS or namely -fPIC is ignored somehow.

/Timo


---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Tue Feb 23 2016 - 09:44:29 GMT