Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17290 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38701 invoked by uid 1010); 17 Jul 2005 22:53:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 38686 invoked from network); 17 Jul 2005 22:53:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2005 22:53:22 -0000 X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.4/2.6 Received: from ([204.11.219.139:47641] helo=colo.lerdorf.com) by pb1.pair.com (ecelerity HEAD r(6212)) with SMTP id 28/8F-10960-161EAD24 for ; Sun, 17 Jul 2005 18:53:21 -0400 Received: from [192.168.2.106] (c-24-6-1-160.hsd1.ca.comcast.net [24.6.1.160]) (authenticated bits=0) by colo.lerdorf.com (8.13.4/8.13.4/Debian-3) with ESMTP id j6HMrIln002688 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 17 Jul 2005 15:53:18 -0700 Message-ID: <42DAE15D.5010501@lerdorf.com> Date: Sun, 17 Jul 2005 15:53:17 -0700 User-Agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals X-Enigmail-Version: 0.91.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Need to inherit apxs compiler flags From: rasmus@lerdorf.com (Rasmus Lerdorf) I spent a couple of hours today tracking down some very odd things I was seeing calling sapi_get_stat() from an extension. The symptom was that the stat struct I was getting back looked messed up and shifted, as if there was a binary compatibility mismatch. I chased a number of things until I realized that the Debian version of Apache is compiled using -D_FILE_OFFSET_BITS=64 which turns regular stat() into a stat64() call. That means that Apache is doing a stat64(), but PHP and any phpized extensions are doing regular stat() calls. So I think we need to trickle the "apxs -q CFLAGS" flags down into the PHP build and into phpize. On this Debian box I get: 3:47pm colo:~> apxs -q CFLAGS -DLINUX=22 -DEAPI -DTARGET="apache" -DHAVE_SET_DUMPABLE -DDB_DBM_HSEARCH=1 -DDEV_RANDOM=/dev/random -DUSE_HSREGEX -O1 -g -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 Anybody see a better way to solve this? -Rasmus