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
Building PHP 8.2.11 on ARM (32-bit) using mold 2.2.0 as linker fails with following errors (shortened for readability):
/bin/sh /home/users/builder/rpm/BUILD/php-8.2.11/libtool --silent --preserve-dup-deps --tag CC --mode=link /usr/libexec/icecc/bin/g++ -shared ... -o ext/intl/intl.la ... -Wl,-fuse-ld=mold ...mold: error: ext/intl/msgformat/.libs/msgformat_helpers.o:(.ARM.extab): R_ARM_PREL31 relocation at offset 0x0 against symbol `__gxx_personality_v0' can not be used; recompile with -fPIC mold: error: ext/intl/msgformat/.libs/msgformat_helpers.o:(.ARM.extab): R_ARM_PREL31 relocation at offset 0x28 against symbol `__gxx_personality_v0' can not be used; recompile with -fPIC mold: error: ext/intl/msgformat/.libs/msgformat_helpers.o:(.ARM.extab.text._ZNSt6vectorIN6icu_7311FormattableESaIS1_EE17_M_default_appendEj): R_ARM_PREL31 relocation at offset 0x0 against symbol `__gxx_personality_v0' can not be used; recompile with -fPIC mold: error: ext/intl/breakiterator/.libs/codepointiterator_internal.o:(.ARM.extab): R_ARM_PREL31 relocation at offset 0xc against symbol `__gxx_personality_v0' can not be used; recompile with -fPIC...
How it works with binutils is not clear to me, however the reason why it fails with mold is somewhat hidden by the use of --silent flag passed to libtool. If it's dropped then that's the exact command being run by libtool:
Even though C++ compiler was passed to libtool invocation, C compiler was used for linking in the end. For linking libtool prefers compiler set with --tag:
# Commands used to build a shared archive.
archive_cmds="\$CC -shared \$pic_flag \$compiler_flags \$libobjs \$deplibs \$wl-soname \$wl\$soname -o \$lib"
$CC evaluates to compiler determined during configure time and follows settings for current --tag so either C compiler for --tag=CC or C++ compiler for --tag=CXX. Unfortunately PHP is using single global --tag setting:
Since all compile/link commands already have logic for using either C or C++ compiler in libtool invocation I think it would be reasonable to drop global --tag parameter and shift it to individual libtool invocations so it matches with expected compiler.
PHP Version
PHP 8.2.11
Operating System
PLD Linux
The text was updated successfully, but these errors were encountered:
Global --tag=CC defined in configure.ac is not correct in all cases. For example
linking objects that were compiled from C++ sources needs to be done with C++
compiler, however for link mode libtool will prefer compiler indicated with
--tag.
FixesphpGH-12349
Global --tag=CC defined in configure.ac is not correct in all cases. For example
linking objects that were compiled from C++ sources needs to be done with C++
compiler, however for link mode libtool will prefer compiler indicated with
--tag.
FixesphpGH-12349
Description
Building
PHP 8.2.11
onARM (32-bit)
usingmold 2.2.0
as linker fails with following errors (shortened for readability):How it works with
binutils
is not clear to me, however the reason why it fails withmold
is somewhat hidden by the use of--silent
flag passed tolibtool
. If it's dropped then that's the exact command being run bylibtool
:Even though C++ compiler was passed to
libtool
invocation, C compiler was used for linking in the end. For linkinglibtool
prefers compiler set with--tag
:$CC
evaluates to compiler determined duringconfigure
time and follows settings for current--tag
so either C compiler for--tag=CC
or C++ compiler for--tag=CXX
. UnfortunatelyPHP
is using single global--tag
setting:php-src/configure.ac
Line 1575 in bdc87b0
Since all compile/link commands already have logic for using either C or C++ compiler in
libtool
invocation I think it would be reasonable to drop global--tag
parameter and shift it to individuallibtool
invocations so it matches with expected compiler.PHP Version
PHP 8.2.11
Operating System
PLD Linux
The text was updated successfully, but these errors were encountered: