You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
8.3.0 build fails on centos 8 with mbstring related error #12774
/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `mb_utf16be_to_wchar' with pointer equality in `ext/mbstring/libmbfl/filters/mbfilter_utf16.o' can not be used when making an executable; recompile with -fPIE and relink with -pie
collect2: error: ld returned 1 exit status
This is actually this issue: https://sourceware.org/bugzilla/show_bug.cgi?id=23169
That was fixed in binutils 2.31, but CentOS8 uses version 2.30 which is old (almost 6 years: Jan 2018).
I don't know how to work around this, it's not like we can check via a macro the binutils version but we could in principle test during configure if this is broken (although I prefer not to)...
In any case I really recommend you to use a modern toolchain.
Reacted by Ilija Tovilo, Gina Peter Banyard and lazybench
So all users of Centos8 / Almalinux 8 / Rockylinux 8 should just resign to not using PHP 8.3 and newer because of a compiler bug that you are very well capable of bypassing so far much easier than an entire family of users removing an integral part of the original OS with a plethora of unexpected consequences ?
Why should I spend my free time in the weekend providing a workaround for an oerating system that the company is dropping support for, and shipping the operating system with a known compiler bug? Makes no sense to me.
So all users of Centos8 / Almalinux 8 / Rockylinux 8 should just resign to not using PHP 8.3 and newer because of a compiler bug that you are very well capable of bypassing so far much easier than an entire family of users removing an integral part of the original OS with a plethora of unexpected consequences ?
Or, hear me out, they discover here default binutils is too old in their EOL os, so they install and enable newer devtoolset with recent binutils and happily build php 8.3 using that.
Reacted by Nora Dossche, wheakerd and Gina Peter Banyard
I wouldn't recommend installing a newer gcc just like that. I did and it turned up braking other things that were dynamically linked to the older library but were being given the new one even when installed purposefully with this in mind and even when reinstalled/recompiled with the newer gcc .. it became hell.
But hey.. maybe it was just me and some setting I mishandled or the fact that not all of the software is on the latests available versions (because we need it to be like that due to some old code still working on older versions and because Centos itself does not work well with the latest versions)
Yahoo Mail: Search, Organize, Conquer
On Thu, Mar 28, 2024 at 3:11 PM, Steven ***@***.***> wrote:
In Almalinux 8 it is possible to add newer gcc for example by dnf install gcc-toolset-13 and build PHP 8.3 with mbstring against it.
Thank you jirikmik, you saved me a lot of headaches.
To follow up with that, so you don't have to look it up - after installing the toolset you can use this command to run make:
scl enable gcc-toolset-13 make
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
Using the toolset doesn't replace the GCC already installed, it sets up its own environment. While I am still testing things, the compile went through without problems (PHP 8.3.4 on AlmaLinux 8.9) and I am not getting any issues so far after compiling without specifying the GCC directly from the compiled php binary.
For others doing research on getting past this issue and wishing to do some research, here are a few links:
Workaround if you don't want to install gcc-toolset-* : configure with --enable-mbstring=shared
this issue occured only if mbstring is not compiled as a shared extension (you also need to add extension=mbstring.so to your php.ini) @remicollet : that's why you never encounter this issue since you provide a shared extension
Workaround if you don't want to install gcc-toolset-* : configure with --enable-mbstring=shared this issue occured only if mbstring is not compiled as a shared extension (you also need to add extension=mbstring.so to your php.ini) @remicollet : that's why you never encounter this issue since you provide a shared extension
Thank you @gdegoulet .. this was by far the best and easiest option to make it work.
I tried compiling php 8.4.2, and had this error using gcc 12, gcc 8 and probably the same with gcc 4 if not more errors:-
dynamic STT_GNU_IFUNC symbol mb_utf16be_to_wchar' with pointer equality in ext/mbstring/libmbfl/filters/mbfilter_utf16.o'
Using --enable-mbstring=shared fixed this, many thanks for @gdegoulet.
Activity
ndossche commentedon Nov 24, 2023
This is actually this issue: https://sourceware.org/bugzilla/show_bug.cgi?id=23169
That was fixed in binutils 2.31, but CentOS8 uses version 2.30 which is old (almost 6 years: Jan 2018).
I don't know how to work around this, it's not like we can check via a macro the binutils version but we could in principle test during configure if this is broken (although I prefer not to)...
In any case I really recommend you to use a modern toolchain.
Girgias commentedon Nov 27, 2023
I am going to close this as this is not a bug in PHP.
wheakerd commentedon Jan 8, 2024
Remove binutils from Centos 8 stream and remove them from https://ftp.gnu.org/gnu/binutils/ Compile and install the latest source code from Zhongla. This will solve this problem.
remicollet commentedon Jan 9, 2024
Notice: I'm used to build all PHP versions (up to 8.3) on EL-7, EL-8 and EL-9, and never encounter this issue.
If you need recent versions, simply use https://rpms.remirepo.net/wizard/
nstiac commentedon Feb 3, 2024
So all users of Centos8 / Almalinux 8 / Rockylinux 8 should just resign to not using PHP 8.3 and newer because of a compiler bug that you are very well capable of bypassing so far much easier than an entire family of users removing an integral part of the original OS with a plethora of unexpected consequences ?
ndossche commentedon Feb 3, 2024
Why should I spend my free time in the weekend providing a workaround for an oerating system that the company is dropping support for, and shipping the operating system with a known compiler bug? Makes no sense to me.
In any case, feel free to provide a PR.
Xerkus commentedon Feb 4, 2024
Or, hear me out, they discover here default binutils is too old in their EOL os, so they install and enable newer devtoolset with recent binutils and happily build php 8.3 using that.
jirikmik commentedon Feb 23, 2024
In Almalinux 8 it is possible to add newer gcc for example by
dnf install gcc-toolset-13and build PHP 8.3 with mbstring against it.
stevenhfotofix commentedon Mar 28, 2024
Thank you jirikmik, you saved me a lot of headaches.
To follow up with that, so you don't have to look it up - after installing the toolset you can use this command to run make:
scl enable gcc-toolset-13 makenstiac commentedon Mar 28, 2024
stevenhfotofix commentedon Mar 28, 2024
Using the toolset doesn't replace the GCC already installed, it sets up its own environment. While I am still testing things, the compile went through without problems (PHP 8.3.4 on AlmaLinux 8.9) and I am not getting any issues so far after compiling without specifying the GCC directly from the compiled php binary.
For others doing research on getting past this issue and wishing to do some research, here are a few links:
More details about Software Collections
https://access.redhat.com/documentation/en-us/red_hat_software_collections/3/html/packaging_guide/sect-enabling_the_software_collection
The toolset jirikmik referred to:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/developing_c_and_cpp_applications_in_rhel_8/additional-toolsets-for-development_developing-applications
gdegoulet commentedon Jun 6, 2024
Workaround if you don't want to install gcc-toolset-* : configure with --enable-mbstring=shared
this issue occured only if mbstring is not compiled as a shared extension (you also need to add extension=mbstring.so to your php.ini)
@remicollet : that's why you never encounter this issue since you provide a shared extension
nstiac commentedon Aug 17, 2024
Thank you @gdegoulet .. this was by far the best and easiest option to make it work.
Modified php building for buggy rhel-8 toolchain
Fixed various php compilation problems:
Fixed various php compilation problems:
InputOutputZ commentedon Jan 13, 2025
I tried compiling php 8.4.2, and had this error using gcc 12, gcc 8 and probably the same with gcc 4 if not more errors:-
dynamic STT_GNU_IFUNC symbol
mb_utf16be_to_wchar' with pointer equality inext/mbstring/libmbfl/filters/mbfilter_utf16.o'Using --enable-mbstring=shared fixed this, many thanks for @gdegoulet.