Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 913527 - dev-lang/php-8.2.9 fails to build with LTO
Summary: dev-lang/php-8.2.9 fails to build with LTO
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2023-09-02 19:21 UTC by stefan11111
Modified: 2023-09-07 18:58 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,463.27 KB, text/plain)
2023-09-02 20:32 UTC, stefan11111
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stefan11111 2023-09-02 19:21:00 UTC
>/var/tmp/portage/dev-lang/php-8.2.9/work/sapis-build/cli/Zend/zend_execute.c: In function 'zend_vm_call_opcode_handler':
>/var/tmp/portage/dev-lang/php-8.2.9/work/sapis-build/cli/Zend/zend_execute.c:103:36: error: global register variable follows a function definition
>  103 |   register const zend_op* volatile opline __asm__(ZEND_VM_IP_GLOBAL_REG);
>      |                                    ^
>/var/tmp/portage/dev-lang/php-8.2.9/work/sapis-build/cli/Zend/zend_execute.c:71:40: error: global register variable follows a function definition
>   71 |   register zend_execute_data* volatile execute_data __asm__(ZEND_VM_FP_GLOBAL_REG);
>      |                                        ^
>make[1]: *** [/var/tmp/portage/dev-lang/php-8.2.9/temp/cchHuR5f.mk:272: /var/tmp/portage/dev-lang/php-8.2.9/temp/ccajLcyz.ltrans90.ltrans.o] Error 1
>make[1]: *** Waiting for unfinished jobs....
>lto-wrapper: fatal error: make returned 2 exit status
>compilation terminated.
>/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
>collect2: error: ld returned 1 exit status
>make: *** [Makefile:269: sapi/cli/php] Error 1
>make: Leaving directory '/var/tmp/portage/dev-lang/php-8.2.9/work/sapis-build/cli'

emerge --info:

>Portage 3.0.51 (python 3.11.5-final-0, default/linux/amd64/17.1/no-multilib, gcc-13, glibc-2.38-r1, 6.4.10-gentoo x86_64)
>=================================================================
>System uname: Linux-6.4.10-gentoo-x86_64-Intel-R-_Core-TM-_i5-7400_CPU_@_3.00GHz-with-glibc2.38
>KiB Mem:     8123244 total,    608944 free
>KiB Swap:   16777212 total,  16710652 free
>Timestamp of repository gentoo: Thu, 31 Aug 2023 23:00:01 +0000
>Head commit of repository gentoo: 780796232dbd5a903a4d622808c64a88aa68d1a0
>Head commit of repository gentoo-static: b220537760d6a06378c2142e216fc6644183ce19
>
>Timestamp of repository guru: Wed, 30 Aug 2023 05:50:03 +0000
>Head commit of repository guru: 60584733ba11b2cb28f7e7c2c89185f033456427
>
>Timestamp of repository khoverlay: Thu, 31 Aug 2023 02:31:50 +0000
>Head commit of repository khoverlay: 87698e6fefc866eec5fdfd233029fc0e7bd482ba
>
>Timestamp of repository libressl: Tue, 29 Aug 2023 23:51:03 +0000
>Head commit of repository libressl: 676b53877619b7f5cf1a9d75bf49e4755751a286
>
>Head commit of repository librewolf: 9fd9f4571ae3b188dc1e994d587467ce43ed1f13
>
>Timestamp of repository palemoon: Tue, 29 Aug 2023 15:50:44 +0000
>Head commit of repository palemoon: 4c81588a68a0c708bb4e156dfeded7af4f88a3ec
>
>Timestamp of repository steam-overlay: Wed, 23 Aug 2023 07:46:41 +0000
>Head commit of repository steam-overlay: f99709b5ad1cef25a18763987742b5e07cd1e649
>
>Head commit of repository stefan_overlay: 5b875edbfa98a6286b3b88d20e5506962eba7b84
>
>sh bash 5.2_p15-r6
>ld GNU ld (Gentoo 2.41 p2) 2.41.0
>app-misc/pax-utils:        1.3.7::gentoo
>app-shells/bash:           5.2_p15-r6::gentoo
>dev-lang/perl:             5.38.0-r1::gentoo
>dev-lang/python:           2.7.18_p16-r1::libressl, 3.11.5::libressl
>dev-util/cmake:            3.27.4::gentoo
>dev-util/meson:            1.2.1-r1::gentoo
>sys-apps/baselayout:       2.14::gentoo
>sys-apps/openrc:           0.49::gentoo
>sys-apps/sandbox:          2.38::gentoo
>sys-devel/autoconf:        2.13-r8::gentoo, 2.71-r7::gentoo
>sys-devel/automake:        1.16.5-r1::gentoo
>sys-devel/binutils:        2.41-r1::gentoo
>sys-devel/binutils-config: 5.5::gentoo
>sys-devel/gcc:             13.2.1_p20230826::gentoo
>sys-devel/gcc-config:      2.11::gentoo
>sys-devel/libtool:         2.4.7-r1::gentoo
>sys-devel/make:            4.4.1-r1::gentoo
>sys-kernel/linux-headers:  6.5::gentoo (virtual/os-headers)
>sys-libs/glibc:            2.38-r1::gentoo
>Repositories:
>
>gentoo
>    location: /var/db/repos/gentoo
>    sync-type: rsync
>    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
>    priority: -1000
>    volatile: False
>    sync-rsync-verify-metamanifest: yes
>    sync-rsync-extra-opts: 
>    sync-rsync-verify-max-age: 24
>    sync-rsync-verify-jobs: 1
>
>gentoo-static
>    location: /var/db/repos/gentoo-static
>    sync-type: git
>    sync-uri: https://github.com/NeddySeagoon/gentoo-static.git
>    masters: gentoo
>    volatile: False
>
>guru
>    location: /var/db/repos/guru
>    sync-type: git
>    sync-uri: https://github.com/gentoo-mirror/guru.git
>    masters: gentoo
>    volatile: False
>
>khoverlay
>    location: /var/db/repos/khoverlay
>    sync-type: git
>    sync-uri: https://github.com/gentoo-mirror/khoverlay.git
>    masters: gentoo
>    volatile: False
>
>libressl
>    location: /var/db/repos/libressl
>    sync-type: git
>    sync-uri: https://github.com/gentoo-mirror/libressl.git
>    masters: gentoo
>    volatile: False
>
>librewolf
>    location: /var/db/repos/librewolf
>    sync-type: git
>    sync-uri: https://codeberg.org/librewolf/gentoo.git
>    masters: gentoo
>    volatile: False
>
>palemoon
>    location: /var/db/repos/palemoon
>    sync-type: git
>    sync-uri: https://github.com/gentoo-mirror/palemoon.git
>    masters: gentoo
>    volatile: False
>
>steam-overlay
>    location: /var/db/repos/steam-overlay
>    sync-type: git
>    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
>    masters: gentoo
>    volatile: False
>
>stefan_overlay
>    location: /var/db/repos/stefan_overlay
>    sync-type: git
>    sync-uri: https://github.com/stefan11111/stefan_overlay.git
>    masters: gentoo
>    volatile: False
>
>ACCEPT_KEYWORDS="amd64 ~amd64"
>ACCEPT_LICENSE="@FREE"
>CBUILD="x86_64-pc-linux-gnu"
>CFLAGS="-O2 -pipe -march=native -flto=4"
>CHOST="x86_64-pc-linux-gnu"
>CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
>CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
>CXXFLAGS="-O2 -pipe -march=native -flto=4"
>DISTDIR="/var/cache/distfiles"
>ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
>FCFLAGS="-O2 -pipe -march=native -flto=4"
>FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
>FFLAGS="-O2 -pipe -march=native -flto=4"
>GENTOO_MIRRORS="http://ftp.romnet.org/gentoo/ http://mirrors.xservers.ro/gentoo/ http://bloodnoc.org/~roy/olde-distfiles/"
>INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /lib/udev /usr/share/icons /usr/share/applications /usr/share/gtk-3.0/emoji /usr/lib64/palemoon/gtk2"
>LANG="en_US.utf8"
>LDFLAGS="-Wl,-O1 -Wl,--as-needed"
>LEX="flex"
>MAKEOPTS="-j4"
>PKGDIR="/var/cache/binpkgs"
>PORTAGE_CONFIGROOT="/"
>PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
>PORTAGE_TMPDIR="/var/tmp"
>SHELL="/bin/bash"
>USE="X alsa amd64 asm git grub ipv6 jit jumbo-build libressl lto man minimal native-symlinks olde-gentoo rsync-verify split-usr ssl strip test-rust threads verify-sig" ABI_X86="64" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="libressl" ELIBC="glibc" FFTOOLS="aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart sidxindex trasher" GRUB_PLATFORMS="efi-64" KERNEL="linux" LUA_SINGLE_TARGET="luajit" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="nvidia"
>Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

Also tried with COMMON_FLAGS="-O3 -pipe -march=native -ftree-vectorize -ffast-math -funswitch-loops -fuse-linker-plugin -flto=4 -fdevirtualize-at-ltrans -fno-plt -fno-semantic-interposition -fno-common -falign-functions=32 -fgraphite-identity -floop-nest-optimize"
The error is the same.
Comment 1 Mike Gilbert gentoo-dev 2023-09-02 19:43:27 UTC
You should always attach the full build log when reporting a build failure.
Comment 2 stefan11111 2023-09-02 20:32:43 UTC
Created attachment 869279 [details]
build.log
Comment 3 stefan11111 2023-09-02 20:33:32 UTC
USE flags:
USE="cli curl gd ipv6 jit pcntl posix readline sockets ssl threads truetype xml zip zlib -acl -apache2 -apparmor -argon2 -avif -bcmath -berkdb -bzip2 -calendar -cdb -cgi -cjk -ctype -debug -embed -enchant -exif -ffi -fileinfo -filter -firebird -flatfile -fpm -ftp -gdbm -gmp -iconv -imap -inifile -intl -iodbc -kerberos -ldap -ldap-sasl -libedit -lmdb -mhash -mssql -mysql -mysqli -nls -oci8-instant-client -odbc -opcache -pdo -phar -phpdbg -postgres -qdbm (-selinux) -session -session-mm -sharedmem -simplexml -snmp -soap -sodium -spell -sqlite -systemd -sysvipc -test -tidy -tokenizer -tokyocabinet -unicode -valgrind -webp -xmlreader -xmlwriter -xpm -xslt"
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-07 10:42:04 UTC
Please ansifilter logs in future.

This was supposed to be fixed by the changes in bug 866683.
Comment 5 Michael Orlitzky gentoo-dev 2023-09-07 15:43:46 UTC
My fix for this was,

  if is-flagq -flto; then
    # https://bugs.gentoo.org/866683                                        
    our_conf+=( --disable-gcc-global-regs )
  fi

but it's not being applied here. I see in emerge --info,

  CFLAGS="-O2 -pipe -march=native -flto=4"

So I guess I need to also check for -flto=*
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-07 15:46:50 UTC
My own preference would just be to `filter-lto` given upstream clearly don't test it in CI.
Comment 7 Larry the Git Cow gentoo-dev 2023-09-07 18:58:36 UTC
The bug has been closed via the following commit(s):

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

commit 3a0a1c5bbced336389c9dd8569215daa4d9347f5
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2023-09-07 18:52:27 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2023-09-07 18:52:27 +0000

    dev-lang/php: filter LTO flags
    
    This is a better fix for bug 866683 (and now 913527).
    
    Closes: https://bugs.gentoo.org/913527
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 dev-lang/php/php-8.0.30.ebuild | 8 +++-----
 dev-lang/php/php-8.1.21.ebuild | 8 +++-----
 dev-lang/php/php-8.2.9.ebuild  | 8 +++-----
 3 files changed, 9 insertions(+), 15 deletions(-)