php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42318 problem with nm not finding object files
Submitted: 2007-08-16 13:04 UTC Modified: 2008-09-01 13:15 UTC
Votes:7
Avg. Score:3.3 ± 1.3
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:2 (66.7%)
From: rainer dot tammer at schulergroup dot com Assigned: dmitry (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.2CVS-2007-08-17 OS: AIX 5.2/5.3
Private report: No CVE-ID: None
 [2007-08-16 13:04 UTC] rainer dot tammer at schulergroup dot com
Description:
------------
During the AIX build nm could not find the .o files.



Reproduce code:
---------------
export CC=cc_r
export CXX=xlC_r
./configure \
  --disable-ipv6 \
  --with-libxml-dir=/usr/local \
  --with-mysql=/usr/local/mysql \
  --with-apxs=/usr/local/apache/bin/apxs \
  --with-zlib=/opt/freeware \
  --with-jpeg-dir=/opt/freeware \
  --with-png-dir=/opt/freeware \
  --with-gd \
  --enable-gd-native-ttf \
  --enable-mbstring \
  --with-curl=/usr/local \
  --enable-ftp


Expected result:
----------------
On recent AIX systems the .o files are placed in .libs/xxx.o

./sapi/cgi/config9.m4

BUILD_CGI="... | sed 's/\([A-Za-z0-9_]*\)\.lo/\1.o/g'\` | ...
-> change
BUILD_CGI="... | sed 's/\([A-Za-z0-9_]*\)\.lo/.libs\/\1.o/g'\` | ...

./sapi/cli/config.m4

BUILD_CLI="... | sed 's/\([A-Za-z0-9_]*\)\.lo/\1.o/g'\` | ...
-> change
BUILD_CLI="... | sed 's/\([A-Za-z0-9_]*\)\.lo/.libs\/\1.o/g'\` | ...

With the above changes (and a newly generated configre) the build completes withot errors.

Is this an acceptable solution to the build problem ??

Bye
  Rainer

Actual result:
--------------
N/A

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-16 13:36 UTC] jani@php.net
What exactly was the error you got? And has this worked in earlier AIX systems with exactly same way of building it?
 [2007-08-16 14:25 UTC] rainer dot tammer at schulergroup dot com
Hello,
I started building PHP from 5.2 on. The error is present in 5.2.1 - 5.2.3.

I will build 5.2.3 from the unmodified source. As soon as the build is finished I will post the exact error message.

I use XL C/C++ 8.0 and libtool 1.5.x. I tested this on AIX 5.2 and 5.3. This are currently the only supported AIX versions. AIX 5.1 and 4.x is desupported.


Bye
  Rainer
 [2007-08-16 15:54 UTC] rainer dot tammer at schulergroup dot com
Hello,
this is the error message:

nv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm  -o sapi/cli/php
nm: ext/libxml/libxml.o: 0654-200 Cannot open the specified file.
nm: A file or directory in the path name does not exist.
nm: ext/pcre/pcrelib/pcre_chartables.o: 0654-200 Cannot open the specified file.
nm: A file or directory in the path name does not exist.
nm: ext/pcre/pcrelib/pcre_ucp_searchfuncs.o: 0654-200 Cannot open the specified file.
nm: A file or directory in the path name does not exist.
nm: ext/pcre/pcrelib/pcre_compile.o: 0654-200 Cannot open the specified file.
nm: A file or directory in the path name does not exist.
nm: ext/pcre/pcrelib/pcre_config.o: 0654-200 Cannot open the specified file.
nm: A file or directory in the path name does not exist.
nm: ext/pcre/pcrelib/pcre_exec.o: 0654-200 Cannot open the specified file.
nm: A file or directory in the path name does not exist.
nm: ext/pcre/pcrelib/pcre_fullinfo.o: 0654-200 Cannot open the specified file.
nm: A file or directory in the path name does not exist.
nm: ext/pcre/pcrelib/pcre_get.o: 0654-200 Cannot open the specified file.
nm: A file or directory in the path name does not exist.

With the proposed fix the nm command works correctly.

Bye
  Rainer Tammer
 [2007-08-16 22:26 UTC] jani@php.net
Before we continue with any fixes, try the latest CVS snapshot first:
http://snaps.php.net/php5.2-latest.tar.gz 

Also, some systems are known to ship with broken sed/awk.
Make sure you use GNU ones. Also, you'd have better luck by using also gcc instead..
 [2007-08-16 22:32 UTC] jani@php.net
And on second check: Assigning to Dmitry who broke this with his commit to fix (!) AIX build. Dmitry:

cvs diff -r1.17.2.1 -r1.17.2.2 sapi/cgi/config9.m4
cvs diff -r1.22 -r1.22.2.1 sapi/cli/config.m4

 [2007-08-16 22:34 UTC] jani@php.net
Or not really broke but tried to fix. First fix was ok but for some reason Dmitry removed the .libs part of it, perhaps he knows why..
 [2007-08-17 06:20 UTC] rainer dot tammer at schulergroup dot com
Hello,
I will try the snapshot - no problem.

I think that this is a bit AIX / tools dependent.
On newer AIX systems (AIX 5.2/5.3) with AIX Toolbox libtool 1.5.x 
the .libs is needed.

I will also try to build PHP with gcc. Maybe this has some influence on the problem.

Libtool 1.5.8 and 1.5.24 defines the following on AIX:

# The name of the directory that contains temporary libtool files.
objdir=.libs

So ... this seams to be libtool related.

Bye
  Rainer Tammer
 [2007-08-17 07:13 UTC] rainer dot tammer at schulergroup dot com
Hello,
the CVS snapshot does not change this problem (compiler xl c/c++).
But to be sure I will also test gcc 3.3
Bye
  Rainer
 [2007-08-17 08:13 UTC] rainer dot tammer at schulergroup dot com
Hello,
its the same problem with gcc 3.3:

nm: ext/libxml/libxml.o: 0654-200 Cannot open the specified file.
nm: A file or directory in the path name does not exist.
nm: ext/pcre/pcrelib/pcre_chartables.o: 0654-200 Cannot open the specified file.
nm: A file or directory in the path name does not exist.
nm: ext/pcre/pcrelib/pcre_ucp_searchfuncs.o: 0654-200 Cannot open the specified file.
nm: A file or directory in the path name does not exist.


Bye
  Rainer
 [2007-08-22 15:33 UTC] tony2001@php.net
So this is just a warning from AIX nm?
PHP builds and runs ok after that, am I right?
 [2007-08-22 15:49 UTC] rainer dot tammer at schulergroup dot com
Hello,
yes nm -BCpg does not find the files. 

With the suggested fix nm does find all necessary file an works OK.

I have tested the fix on AIX 5.2 and AIX 5.3 with IBM XL C/C++ 8.0 and gcc 3.3.

Bye
  Rainer
 [2007-08-23 06:07 UTC] rainer dot tammer at schulergroup dot com
Hello,
just a quick note: The fix to the two config files (sapi/cgi/config9.m4 / sapi/cli/config.m4) only affects AIX !!
Bye
  Rainer
 [2007-08-23 14:45 UTC] jani@php.net
Dmitry, can you give some info about why you reverted your fix?
 [2007-09-05 15:48 UTC] dmitry@php.net
I've just recompiled PHP-5.2.4 on AIX 5.1 with gcc without problems.
I don't have any ".libs" directories, however in boundled libtool I have "objdir=.libs".

I have no idea what is wrong on your (or my) AIX system and how to support both.

Try to build CLI and CGI without "--with-apxs".
 [2007-09-06 06:15 UTC] rainer dot tammer at schulergroup dot com
Hello,
first of all AIX 5.1 is no longer supported.

I tested the build on AIX 5.2 and 5.3 with IBM xlC/C++ 8.0 and with gcc 3.3.2. It looks like the .libs directory only appears if you build for apache (--with-apxs) and sapi/cgi; sapi/cli.

If you need another test I can try almost every combination with the following OS versions / compilers:

* AIX 5.2 and AIX 5.3
* xlC/C++ 6.0; 8.0; and 9.0
* gcc 3.3.2; gcc 4.0.0

Bye
  Rainer
 [2007-09-26 15:45 UTC] ppryor at pobox dot com
I have the same problem on AIX 5.2 with gcc when I compiled with --apxs and --enable-cli. However it does not cause any problems and it is just an annoyance.

However, I will find out when I use phpize and build PECL extension to dynamically load into php under Apache 1.3. I believe (not yet proven) that I will have to insert the following line in config.m4 for PECL extensions:

EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-bI:/usr/HTTPServer/libexec/libphp5.exp"

And the first line of the libphp5.exp contains:

#!/usr/HTTPServer/libexec/libphp5.so
<followed by external symbols generated with nm>

In order to have PECL extension loaded without causing Apache to core dump. I don't see libphp5.exp created and this is what we may need under AIX 5.2.

Generally under AIX 4.x (not sure if its true of AIX 5.x) the dynamically loaded libraries need to reference other dynamically loaded libraries where they can resolve symbols (forward linking) by adding a header that you can inspect with dump -H. Example follows for oci8:

$ dump -H oci8.so

oci8.so:

                        ***Loader Section***
                      Loader Header Information
VERSION#         #SYMtableENT     #RELOCent        LENidSTR
0x00000001       0x000000b0       0x000001a5       0x00000079       

#IMPfilID        OFFidSTR         LENstrTBL        OFFstrTBL
0x00000004       0x0000245c       0x00000ba6       0x000024d5       


                        ***Import File Strings***
INDEX  PATH                          BASE                MEMBER              
0      /ora01/app/oracle/product/8.1.7/lib:/usr/lib:/lib                                         
1                                    libc.a              shr.o               
2      /usr/HTTPServer/libexec       libphp4.so                              
3                                    libclntsh.a         shr.o               

You see index number 2, the absolute path for libphp4.so is in /usr/HTTPServer/libexec.

I hope this clears up somewhat. And I hope this issue will be fixed for AIX releases definitely (I feel that my config.m4 hack is not quite the right way to do it, through, but it works).

Paul.
 [2007-11-28 22:59 UTC] bduncan8 at yahoo dot com
Using gcc 4 on AIX 5.3 and trying to compile PHP 5.2.5

When running make there are many messages about nm not finding files.

If make install is attempted it completely fails.  If I skip make install I can copy over the libphp5.so and get apache to return phpinfo() output but I have my doubts about being able to install pecl extensions I need like ibm-db2 and informix.

It doesn't seem like there has been any official resolution proposed ... is this being looked at still?

Thanks.
 [2007-11-29 10:29 UTC] rainer dot tammer at schulergroup dot com
Hello,
with my suggested patch to the two configure files the errors will be gone. I have checked this on all 5.2.x releases.

In sapi/cgi/config9.m4 and sapi/cli/config.m4

...
case $host_alias in
      *aix*)
change
  ... sed 's/\([A-Za-z0-9_]*\)\.lo/\1.o/g'\` ...
to
  ... sed 's/\([A-Za-z0-9_]*\)\.lo/.libs\/\1.o/g'\` ...

Do not forget to call utoconf to regenerate the configure script after the change.

It looks like you only need this patch if you user the --with-apxs configure switch.


Bye
  Rainer
 [2008-07-17 01:20 UTC] jani@php.net
Dmitry, you never answered my question why you reverted your fix?

[16 Aug 2007 10:32pm UTC] jani@php.net

And on second check: Assigning to Dmitry who broke this with his commit
to fix (!) AIX build. Dmitry:

cvs diff -r1.17.2.1 -r1.17.2.2 sapi/cgi/config9.m4
cvs diff -r1.22 -r1.22.2.1 sapi/cli/config.m4

[16 Aug 2007 10:34pm UTC] jani@php.net

Or not really broke but tried to fix. First fix was ok but for some
reason Dmitry removed the .libs part of it, perhaps he knows why..


 [2008-08-28 07:41 UTC] dmitry@php.net
I was never able to reproduce this build failure. The "fixed" configs worked fine for me on AIX, however build doesn't work with ".libs". I assume something may be different in libtools in different systems. For now I have access only to AIX 5.1.

I'll able to fix the bug if somebody gives me access to AIX 5.2/5.3.
 [2008-08-28 07:49 UTC] rainer dot tammer at schulergroup dot com
Hello,
the problem only exists if you build the dso for Apache.
If you only build php (stand alone) then you do not need the .libs directory. I am using libtool 1.5.20 (bundled with PHP).

I have access to AIX 5.2 / 5.3 / 6.1 (maybe 5.1 / 4.3.3 very old dev environment).

Regarding the access to an newer AIX machine:
The problem is the access from the internet. If you like we can switch to pm an we can discuss this problem.

Bye
  Rainer
 [2008-08-28 09:02 UTC] dmitry@php.net
I can understand you troubles with CLI, but I'm wondered, how you can have problems with CGI if you build DSO for Apache.
 [2008-08-28 14:24 UTC] rainer dot tammer at schulergroup dot com
Hello,
just to clarify:

The .libs is only in use when you build DSO (in my case for Apache). If I do not build with DSO then the build runs just fine (php + cgi will be build). If I build with DSO then the php build is OK too (with the modified files).

Bye
  Rainer
 [2008-09-01 13:15 UTC] dmitry@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 13:01:29 2024 UTC