php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81614 PHP 8.0.12 build failed with PGO
Submitted: 2021-11-12 06:48 UTC Modified: 2024-07-19 21:28 UTC
Votes:3
Avg. Score:2.3 ± 0.9
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: lin dot a dot yang at intel dot com Assigned: cmb (profile)
Status: Closed Package: *Compile Issues
PHP Version: 8.0.12 OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lin dot a dot yang at intel dot com
New email:
PHP Version: OS:

 

 [2021-11-12 06:48 UTC] lin dot a dot yang at intel dot com
Description:
------------
I tried to build php-fpm 8.0.12 with gcc 9.3.0 to enable PGO optimization. 

$ gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0

The commands I used show as below.

$ make prof-gen -j
# run workload
$ make prof-clean
$ make prof-use -j

However, "make prof-use -j" complain a lot of warning about cannot found profile count data file .gcda file on the expected location.

/opt/pkb/git/hhvm-perf/php-src/Zend/zend_extensions.c: In function 'zend_extensions_op_array_persist':
/opt/pkb/git/hhvm-perf/php-src/Zend/zend_extensions.c:338:1: warning: '/home/build/php-src/Zend/.libs/zend_extensions.gcda' profile count data file not found [-Wmissing-profile]

Above example shows that it search gcda file in php-src/Zend/.libs/zend_extensions.gcda. But I only found this corresponding file in php-src/Zend/zend_extensions.gcda, not in .libs directory.

$ ls /home/build/php-src/Zend/.libs/zend_extensions.gcda
ls: cannot access '/home/build/php-src/Zend/.libs/zend_extensions.gcda': No such file or directory
$ ls /home/build/php-src/Zend/zend_extensions.gcda
/home/build/php-src/Zend/zend_extensions.gcda

If manually move gcda file to the .libs directory, it will give another kind of warning about not found the profile counter inside those gcda files. The php build process can be completed if ignore those warnings, but php and php-fpm binary generated will fail to run any script.

Really appreiate any suggestion aobut how to fix this issue.




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-11-12 10:22 UTC] nikic@php.net
Dropping --silent from the libtool call:

/bin/bash /home/nikic/php/php-src-fast/libtool --preserve-dup-deps --tag CC --mode=compile cc -Iext/standard/ -I/home/nikic/php/php-src-fast/ext/standard/ -I/home/nikic/php/php-src-fast/include -I/home/nikic/php/php-src-fast/main -I/home/nikic/php/php-src-fast -I/usr/include/valgrind -I/home/nikic/php/php-src-fast/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/home/nikic/php/php-src-fast/ext/mbstring/libmbfl -I/home/nikic/php/php-src-fast/ext/mbstring/libmbfl/mbfl -I/home/nikic/php/php-src-fast/TSRM -I/home/nikic/php/php-src-fast/Zend    -fno-common -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS -fprofile-use  -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /home/nikic/php/php-src-fast/ext/standard/string.c -o ext/standard/string.lo  -MMD -MF ext/standard/string.dep -MT ext/standard/string.lo
 cc -Iext/standard/ -I/home/nikic/php/php-src-fast/ext/standard/ -I/home/nikic/php/php-src-fast/include -I/home/nikic/php/php-src-fast/main -I/home/nikic/php/php-src-fast -I/usr/include/valgrind -I/home/nikic/php/php-src-fast/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/home/nikic/php/php-src-fast/ext/mbstring/libmbfl -I/home/nikic/php/php-src-fast/ext/mbstring/libmbfl/mbfl -I/home/nikic/php/php-src-fast/TSRM -I/home/nikic/php/php-src-fast/Zend -fno-common -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS -fprofile-use -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /home/nikic/php/php-src-fast/ext/standard/string.c -MMD -MF ext/standard/string.dep -MT ext/standard/string.lo  -fPIC -DPIC -o ext/standard/.libs/string.o
/home/nikic/php/php-src-fast/ext/standard/string.c: In function ‘zif_utf8_decode’:
/home/nikic/php/php-src-fast/ext/standard/string.c:6196:1: warning: ‘/home/nikic/php/php-src-fast/ext/standard/.libs/string.gcda’ profile count data file not found [-Wmissing-profile]
 6196 | }
      | ^
 cc -Iext/standard/ -I/home/nikic/php/php-src-fast/ext/standard/ -I/home/nikic/php/php-src-fast/include -I/home/nikic/php/php-src-fast/main -I/home/nikic/php/php-src-fast -I/usr/include/valgrind -I/home/nikic/php/php-src-fast/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/home/nikic/php/php-src-fast/ext/mbstring/libmbfl -I/home/nikic/php/php-src-fast/ext/mbstring/libmbfl/mbfl -I/home/nikic/php/php-src-fast/TSRM -I/home/nikic/php/php-src-fast/Zend -fno-common -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS -fprofile-use -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /home/nikic/php/php-src-fast/ext/standard/string.c -MMD -MF ext/standard/string.dep -MT ext/standard/string.lo -o ext/standard/string.o >/dev/null 2>&1

Looks like it runs cc twice, and the first time it will rewrite the output location to .libs, which is where it will also look for .gcda files.
 [2021-12-28 02:30 UTC] steven dot l dot wang at linux dot intel dot com
It seems to me that the warning messages can be ignored. The following is copy-paste from the gcov document. So if a .gcda file is missing, it probably means that the corresponding object file is not built into the PHP execute binary. By the way, may I know what workload you run? The PHP binary I built can work. But I just run some very simple workload before building it.

--------------------------------------------------------------------------------
The .gcda count data file is generated when a program containing object files built with the GCC -fprofile-arcs option is executed. A separate .gcda file is created for each object file compiled with this option. It contains arc transition counts, value profile counts, and some summary information.
 [2022-03-24 03:06 UTC] steven dot l dot wang at linux dot intel dot com
There is a workaround. I find that it works with GCC 7.

gcc --version
gcc (Ubuntu 7.5.0-6ubuntu2) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

gcov --version
gcov (Ubuntu 7.5.0-6ubuntu2) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.
 [2022-03-31 08:11 UTC] steven dot l dot wang at linux dot intel dot com
Actually, the warning messages can be ignored. Libtool is used to build the binaries and the libraries. All files in .lib directory are for building the shared libraries. For the modules that are not configured to build as a shared library, libtool still compiles the .c files and puts the .o files in .lib directory. Because those modules are not configured to build as a shared library, there are no .gcda generated in .lib directory. That is why the warning messages are shown up.

So, I suggest that we can close this bug.
 [2024-07-19 21:28 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2024-07-19 21:28 UTC] cmb@php.net
Per the comment above, I'm closing this ticket.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 02 14:01:29 2024 UTC