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: 2021-11-12 10:22 UTC
From: lin dot a dot yang at intel dot com Assigned:
Status: Open Package: *Compile Issues
PHP Version: 8.0.12 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

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.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Jan 18 08:03:18 2022 UTC