php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41908 CFLAGS="-Os" ./configure --enable-debug fails
Submitted: 2007-07-05 17:06 UTC Modified: 2007-07-06 10:44 UTC
Votes:1
Avg. Score:2.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: christian at hoffie dot info Assigned:
Status: Closed Package: Compile Failure
PHP Version: 5.2.3 OS: Gentoo Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: christian at hoffie dot info
New email:
PHP Version: OS:

 

 [2007-07-05 17:06 UTC] christian at hoffie dot info
Description:
------------
PHP's configure script incorrectly manipulates CFLAGS and CXXFLAGS when running with --enable-debug or --enable-gcov. When CFLAGS or CXXFLAGS contains -Os (optimize for size), the configure script builds a bad list of CFLAGS/CXXFLAGS and as such configure fails in a later stage.
I created a small patch[1] which should solve that, I'm not completely sure whether it's a good idea to remove that -O stuff at all -- does appending -O0 after user-supplied flags not lead to the expected result (building with -O0 and not -O2 for instance)?

[1] http://overlays.gentoo.org/proj/php/browser/patches/php-patches/5.2.3/5.2.3/php5.2.3-configure-Os-fix.patch?rev=1237

Reproduce code:
---------------
CFLAGS="-Os" ./configure --enable-debug
(same if you replace CFLAGS by CXXFLAGS or --enable-debug with --enable-gcov)

Actual result:
--------------
christian@tux /tmp/php-5.2.3 $ env | grep FLAGS
CXXFLAGS=-Os
CFLAGS=-Os
christian@tux /tmp/php-5.2.3 $ ./configure --disable-all --enable-debug
[...]
Configuring libtool
checking build system type... i686-pc-linux-gnu
checking for ld used by gcc... /usr/i686-pc-linux-gnu/bin/ld
checking if the linker (/usr/i686-pc-linux-gnu/bin/ld) is GNU ld... yes
checking for /usr/i686-pc-linux-gnu/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking how to recognise dependent libraries... pass_all
checking for object suffix... configure: error: installation or configuration problem; compiler does not work


Depending on ./configure options the output looks different. For example, with --with-xml you will see a libxml2 failure first.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-06 09:02 UTC] tony2001@php.net
>does appending -O0 after user-supplied flags not lead to the
>expected result (building with -O0 and not -O2 for instance)?

Apparently it doesn't.
What does you config.log say about the reason of the failure?
 [2007-07-06 10:34 UTC] christian at hoffie dot info
>>does appending -O0 after user-supplied flags not lead to the
>>expected result (building with -O0 and not -O2 for instance)?
> Apparently it doesn't.
Don't know if I undestood you correctly -- that CFLAGS manipulation using sed is there because CFLAGS="-O2 -O0" doesn't lead to code being built with -O0, right?

> What does you config.log say about the reason of the failure?

config.log:
[...]
configure:106983: checking for object suffix
configure:106989: gcc -c s -O0 -g -Wall  conftest.c 1>&5
gcc: s: No such file or directory

(this is the last time this message appears and causes the configure run abort; it happens multiple times as expected, as CFLAGS="s" is simply wrong; full config.log at http://home.hoffie.info/php-5.2.3-debug-Os-config.log)
 [2007-07-06 10:44 UTC] tony2001@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:29 2024 UTC