Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 928072 - dev-lang/php-8.{1,2,3} fails to build under musl/llvm profile
Summary: dev-lang/php-8.{1,2,3} fails to build under musl/llvm profile
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM64 Linux
: Normal normal (vote)
Assignee: PHP Bugs
URL: https://github.com/php/php-src/issues...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-28 21:33 UTC by frank
Modified: 2024-04-09 13:51 UTC (History)
2 users (show)

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


Attachments
emerge --info (emerge-info.txt,15.25 KB, text/plain)
2024-03-29 21:43 UTC, frank
Details
build log (build.log,659.73 KB, text/plain)
2024-03-29 21:43 UTC, frank
Details

Note You need to log in before you can comment on or make changes to this bug.
Description frank 2024-03-28 21:33:31 UTC
/bin/sh /var/tmp/portage/dev-lang/php-8.2.15/work/sapis-build/cli/libtool --silent --preserve-dup-deps --tag CC --mode=compile clang -Imain/streams/ -
I/var/tmp/portage/dev-lang/php-8.2.15/work/sapis-build/cli/main/streams/ -I/var/tmp/portage/dev-lang/php-8.2.15/work/sapis-build/cli/include -I/var/tm
p/portage/dev-lang/php-8.2.15/work/sapis-build/cli/main -I/var/tmp/portage/dev-lang/php-8.2.15/work/sapis-build/cli -I/var/tmp/portage/dev-lang/php-8.
2.15/work/sapis-build/cli/ext/date/lib -I/usr/include/libxml2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/var/tmp/portage/dev-lang/php-8.2.15/
work/sapis-build/cli/ext/mbstring/libmbfl -I/var/tmp/portage/dev-lang/php-8.2.15/work/sapis-build/cli/ext/mbstring/libmbfl/mbfl -I/usr/include/postgre
sql-16 -I/var/tmp/portage/dev-lang/php-8.2.15/work/sapis-build/cli/TSRM -I/var/tmp/portage/dev-lang/php-8.2.15/work/sapis-build/cli/Zend  -D_GNU_SOURC
E  -fno-common -Wstrict-prototypes -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -O2 -pipe -fvisibility=hidden -DZEND_SIG
NALS   -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /var/tmp/portage/dev-lang/php-8.2.15/work/sapis-build/cli/main/streams/cast.c -o main/streams/cast.lo  -
MMD -MF main/streams/cast.dep -MT main/streams/cast.lo
/var/tmp/portage/dev-lang/php-8.2.15/work/sapis-build/cli/main/streams/cast.c:139:2: error: incompatible function pointer types
      initializing 'cookie_seek_function_t *' (aka 'int (*)(void *, long *, int)') with an expression of type 'int (void *, zend_off_t, int)'
      (aka 'int (void *, long, int)') [-Wincompatible-function-pointer-types]
  139 |         stream_cookie_seeker, stream_cookie_closer
      |         ^~~~~~~~~~~~~~~~~~~~
1 error generated.

reprocucible by untarring stage3-arm64-musl-llvm, chrooting and emerging any php version...
Comment 1 Mike Gilbert gentoo-dev 2024-03-29 20:59:20 UTC
Please provide emerge --info and attach a full build log.
Comment 2 frank 2024-03-29 21:43:04 UTC
Created attachment 889024 [details]
emerge --info
Comment 3 frank 2024-03-29 21:43:47 UTC
Created attachment 889025 [details]
build log
Comment 4 Michael Orlitzky gentoo-dev 2024-04-01 00:53:30 UTC
There's an upstream report already. It looks like CPPFLAGS="${CPPFLAGS} -D_LARGEFILE64_SOURCE" might work around the issue, but I don't have a musl system to test on yet.
Comment 5 frank 2024-04-01 07:53:46 UTC
I can confirm that the workaround works.
I've found that report too however i didn't understand the issue and blindly applied the patch from the last post which didn't work...
Comment 6 Michael Orlitzky gentoo-dev 2024-04-08 13:55:41 UTC
There's an official upstream patch now, can you give it a try?

https://patch-diff.githubusercontent.com/raw/php/php-src/pull/13890.patch

If it fixes the issue, I'll backport it.
Comment 7 frank 2024-04-08 15:42:15 UTC
it applies and works fine with dev-lang/php-8.2.15
Comment 8 Larry the Git Cow gentoo-dev 2024-04-09 13:51:23 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ccc5cdc89ecf3ad501acfa34650e63b3329e18da

commit ccc5cdc89ecf3ad501acfa34650e63b3329e18da
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2024-04-09 13:08:47 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2024-04-09 13:50:55 +0000

    dev-lang/php: fix a failing test and a musl compatibility issue
    
    Closes: https://bugs.gentoo.org/927461
    Closes: https://bugs.gentoo.org/928072
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 dev-lang/php/files/fix-musl-llvm.patch | 37 ++++++++++++++++++++++++++++++++++
 dev-lang/php/php-8.1.27-r2.ebuild      |  5 +++--
 dev-lang/php/php-8.2.17.ebuild         |  7 +++++++
 dev-lang/php/php-8.3.4.ebuild          |  7 +++++++
 4 files changed, 54 insertions(+), 2 deletions(-)