Patches for aports can be sent to this list

6 2

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

Valery Kartel
Details
Message ID
<1456138588-28811-1-git-send-email-valery.kartel@gmail.com>
Sender timestamp
1456138588
DKIM signature
missing
Download raw message
Patch: +5 -4
- mysqli and pdo_mysql now uses system libmysqlclient library
- mysqlnd now has mysqli as a backend
---
 testing/php7/APKBUILD | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/testing/php7/APKBUILD b/testing/php7/APKBUILD
index 72e889c..260befe 100644
--- a/testing/php7/APKBUILD
+++ b/testing/php7/APKBUILD
@@ -3,10 +3,10 @@
 pkgname=php7
 _pkgreal=php
 pkgver=7.0.3
-pkgrel=0
+pkgrel=1
 pkgdesc="The PHP language runtime engine - 7th branch"
 url="http://www.php.net/"
-arch="x86_64 armhf"
+arch="all"
 license="PHP-3"
 options="textrels"
 depends="$pkgname-common"
@@ -148,7 +148,8 @@ _build() {
 		--with-mcrypt=shared \
 		--with-sqlite3=shared --with-pdo-sqlite=shared \
 		--with-pdo-dblib=shared \
-		--with-mysqli=shared,mysqlnd --enable-mysqlnd=shared --with-pdo-mysql=shared --with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,/usr/bin/mysql_config \
+		--enable-mysqlnd=shared --with-pdo-mysql=shared,/usr/bin/mysql_config --with-mysql-sock=/run/mysqld/mysqld.sock \
 		--with-pgsql=shared --with-pdo-pgsql=shared \
 		--with-unixODBC=shared,/usr -with-pdo-odbc=shared,unixODBC,/usr \
 		--with-dbmaker=shared \
@@ -356,7 +357,7 @@ ldap()		{ _mv_ext ldap; }
 mbstring()	{ _mv_ext mbstring; }
 mcrypt()	{ _mv_ext mcrypt; }
 mysqli()	{ _mv_ext mysqli; }
-mysqlnd()	{ _mv_ext mysqlnd; }
+mysqlnd()	{ _mv_ext mysqlnd $pkgname-mysqli; }
 odbc()		{ _mv_ext odbc; }
 opcache()	{ _mv_ext opcache; }
 openssl()	{ _mv_ext openssl; }
-- 
2.7.1



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Timo Teras
Details
Message ID
<20160223091121.133f6b7d@vostro.util.wtbts.net>
In-Reply-To
<1456138588-28811-1-git-send-email-valery.kartel@gmail.com> (view parent)
Sender timestamp
1456211481
DKIM signature
missing
Download raw message
On Mon, 22 Feb 2016 12:56:28 +0200
Valery Kartel <valery.kartel@gmail.com> wrote:

> - mysqli and pdo_mysql now uses system libmysqlclient library
> - mysqlnd now has mysqli as a backend

does this fix #5111 also?

>  testing/php7/APKBUILD | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/testing/php7/APKBUILD b/testing/php7/APKBUILD
> index 72e889c..260befe 100644
> --- a/testing/php7/APKBUILD
> +++ b/testing/php7/APKBUILD
> @@ -3,10 +3,10 @@
>  pkgname=php7
>  _pkgreal=php
>  pkgver=7.0.3
> -pkgrel=0
> +pkgrel=1
>  pkgdesc="The PHP language runtime engine - 7th branch"
>  url="http://www.php.net/"
> -arch="x86_64 armhf"
> +arch="all"

x86 build still failed with:

...
Installing PEAR
environment:      /home/tteras/aports/testing/php7/pkg/php7/usr/share/php7/
PHP Warning:  PHP Startup: Unable to load dynamic library
'/home/tteras/aports/testing/php7/src/php-7.0.3/modules/xml.so' - Error
loading shared
library /home/tteras/aports/testing/php7/src/php-7.0.3/modules/xml.so:
Permission denied in Unknown on line 0 [PEAR] xml extension is
required /home/tteras/aports/testing/php7/src/php-7.0.3/build/shtool
install -c
ext/phar/phar.phar /home/tteras/aports/testing/php7/pkg/php7/usr/bin ln
-s -f phar.phar /home/tteras/aports/testing/php7/pkg/php7/usr/bin/phar
Installing PDO
headers:          /home/tteras/aports/testing/php7/pkg/php7/usr/include/php7/ext/pdo/
sed: /home/tteras/aports/testing/php7/pkg/php7/usr/bin/pear: No such
file or directory
sed: /home/tteras/aports/testing/php7/pkg/php7/usr/bin/peardev: No such
file or directory
sed: /home/tteras/aports/testing/php7/pkg/php7/usr/bin/pecl: No such
file or directory
>>> php7*: Running split function dev...
mv: can't rename
'/home/tteras/aports/testing/php7/pkg/php7/usr/bin/peardev': No such
file or directory

...

>>> php7*: Running postcheck for php7-fpm
>>> php7*: Running split function pear...
mv: can't rename
'/home/tteras/aports/testing/php7/pkg/php7/usr/bin/pecl': No such file
or directory mv: can't rename
'/home/tteras/aports/testing/php7/pkg/php7/usr/bin/pear': No such file
or directory mv: can't rename
'/home/tteras/aports/testing/php7/pkg/php7/etc/php7/pear.conf': No such
file or directory
>>> ERROR: php7-pear*: pear failed
>>> ERROR: php7*: prepare_subpackages failed
>>> ERROR: php7: all failed
>>> php7: Uninstalling dependencies...


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.

/Timo


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Valery Kartel
Details
Message ID
<CAKTwcDM8Tds7xm9QnJFGYCQhwp_3TunMR7k4OXF_hY-vrGDvfA@mail.gmail.com>
In-Reply-To
<20160223091121.133f6b7d@vostro.util.wtbts.net> (view parent)
Sender timestamp
1456212416
DKIM signature
missing
Download raw message
2016-02-23 9:11 GMT+02:00 Timo Teras <timo.teras@iki.fi>:

> On Mon, 22 Feb 2016 12:56:28 +0200
> Valery Kartel <valery.kartel@gmail.com> wrote:
>
> > - mysqli and pdo_mysql now uses system libmysqlclient library
> > - mysqlnd now has mysqli as a backend
>
> does this fix #5111 also?
>

Yes, it fixes this


x86 build still failed with:
>
> ...
> Installing PEAR
> environment:      /home/tteras/aports/testing/php7/pkg/php7/usr/share/php7/
> PHP Warning:  PHP Startup: Unable to load dynamic library
> '/home/tteras/aports/testing/php7/src/php-7.0.3/modules/xml.so' - Error
> loading shared
> library /home/tteras/aports/testing/php7/src/php-7.0.3/modules/xml.so:
> Permission denied in Unknown on line 0 [PEAR] xml extension is
> required /home/tteras/aports/testing/php7/src/php-7.0.3/build/shtool
>

Just have no idea, why it's done well on my system and fails on your ...

What kind of virtualization and kernel flavour do you use for your
development ?

install -c
> ext/phar/phar.phar /home/tteras/aports/testing/php7/pkg/php7/usr/bin ln
> -s -f phar.phar /home/tteras/aports/testing/php7/pkg/php7/usr/bin/phar
> Installing PDO
> headers:
> /home/tteras/aports/testing/php7/pkg/php7/usr/include/php7/ext/pdo/
> sed: /home/tteras/aports/testing/php7/pkg/php7/usr/bin/pear: No such
> file or directory
> sed: /home/tteras/aports/testing/php7/pkg/php7/usr/bin/peardev: No such
> file or directory
> sed: /home/tteras/aports/testing/php7/pkg/php7/usr/bin/pecl: No such
> file or directory
> >>> php7*: Running split function dev...
> mv: can't rename
> '/home/tteras/aports/testing/php7/pkg/php7/usr/bin/peardev': No such
> file or directory
>
> ...
>
> >>> php7*: Running postcheck for php7-fpm
> >>> php7*: Running split function pear...
> mv: can't rename
> '/home/tteras/aports/testing/php7/pkg/php7/usr/bin/pecl': No such file
> or directory mv: can't rename
> '/home/tteras/aports/testing/php7/pkg/php7/usr/bin/pear': No such file
> or directory mv: can't rename
> '/home/tteras/aports/testing/php7/pkg/php7/etc/php7/pear.conf': No such
> file or directory
> >>> ERROR: php7-pear*: pear failed
> >>> ERROR: php7*: prepare_subpackages failed
> >>> ERROR: php7: all failed
> >>> php7: Uninstalling dependencies...
>
>
> 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.
>
> /Timo
>
Valery Kartel
Details
Message ID
<CAKTwcDNur7=fYSKzOCXw4AzU+7qJeWsM_eL-OQjWaHuK-vcVug@mail.gmail.com>
In-Reply-To
<20160223091121.133f6b7d@vostro.util.wtbts.net> (view parent)
Sender timestamp
1456212684
DKIM signature
missing
Download raw message
And about pear installation code (xml.so extension loading). I just
copy-pasted it from main/php without any changes.


x86 build still failed with:
>
> ...
> Installing PEAR
> environment:      /home/tteras/aports/testing/php7/pkg/php7/usr/share/php7/
> PHP Warning:  PHP Startup: Unable to load dynamic library
> '/home/tteras/aports/testing/php7/src/php-7.0.3/modules/xml.so' - Error
> loading shared
> library /home/tteras/aports/testing/php7/src/php-7.0.3/modules/xml.so:
> Permission denied in Unknown on line 0 [PEAR] xml extension is
> required /home/tteras/aports/testing/php7/src/php-7.0.3/build/shtool
>
Timo Teras
Details
Message ID
<20160223093649.798077c1@vostro.util.wtbts.net>
In-Reply-To
<CAKTwcDM8Tds7xm9QnJFGYCQhwp_3TunMR7k4OXF_hY-vrGDvfA@mail.gmail.com> (view parent)
Sender timestamp
1456213009
DKIM signature
missing
Download raw message
On Tue, 23 Feb 2016 09:26:56 +0200
Valery Kartel <valery.kartel@gmail.com> wrote:

> 2016-02-23 9:11 GMT+02:00 Timo Teras <timo.teras@iki.fi>:
> 
> > On Mon, 22 Feb 2016 12:56:28 +0200
> > Valery Kartel <valery.kartel@gmail.com> wrote:
> >  
> > > - mysqli and pdo_mysql now uses system libmysqlclient library
> > > - mysqlnd now has mysqli as a backend  
> >
> > does this fix #5111 also?  
> 
> Yes, it fixes this

Ok. Good.

> x86 build still failed with:
> >
> > ...
> > Installing PEAR
> > environment:      /home/tteras/aports/testing/php7/pkg/php7/usr/share/php7/
> > PHP Warning:  PHP Startup: Unable to load dynamic library
> > '/home/tteras/aports/testing/php7/src/php-7.0.3/modules/xml.so' -
> > Error loading shared
> > library /home/tteras/aports/testing/php7/src/php-7.0.3/modules/xml.so:
> > Permission denied in Unknown on line 0 [PEAR] xml extension is
> > required /home/tteras/aports/testing/php7/src/php-7.0.3/build/shtool
> >  
> 
> Just have no idea, why it's done well on my system and fails on
> your ...
> 
> What kind of virtualization and kernel flavour do you use for your
> development ?

LXC on official builder. grsec kernel, edge x86 alpine. Nothing special.

> > 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?


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Valery Kartel
Details
Message ID
<CAKTwcDNVU7+vpULLNK1J58F4fvGtamrgkn-8foR_LLuTYimPCQ@mail.gmail.com>
In-Reply-To
<20160223093649.798077c1@vostro.util.wtbts.net> (view parent)
Sender timestamp
1456213243
DKIM signature
missing
Download raw message
Ok. And I'll try to reproduce it on lxc and grsec.

LXC on official builder. grsec kernel, edge x86 alpine. Nothing special.
>
> 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?
>
Timo Teras
Details
Message ID
<20160223094429.2298ed02@vostro.util.wtbts.net>
In-Reply-To
<20160223093649.798077c1@vostro.util.wtbts.net> (view parent)
Sender timestamp
1456213469
DKIM signature
missing
Download raw message
On Tue, 23 Feb 2016 09:36:49 +0200
Timo Teras <timo.teras@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@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---