building a .so (shared object) file

This is a discussion on building a .so (shared object) file within the aix forums in Operating Systems category; I am trying to build php-5.2.6 on aix 6.1 using gcc 4.2.2 and cannot get it to generate libphp5.so. Is there a way I can convert the .a and ..la files to a .so? Thanks...

Go Back   Database Forum > Operating Systems > aix

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 11-04-2008, 05:22 PM
Default building a .so (shared object) file

I am trying to build php-5.2.6 on aix 6.1 using gcc 4.2.2 and cannot
get it to generate libphp5.so. Is there a way I can convert the .a and
..la files to a .so?

Thanks
Reply With Quote
  #2  
Old 11-05-2008, 04:58 AM
Default Re: building a .so (shared object) file

Mike Klein wrote:
> I am trying to build php-5.2.6 on aix 6.1 using gcc 4.2.2 and cannot
> get it to generate libphp5.so. Is there a way I can convert the .a and
> .la files to a .so?


Are you sure that you need that?

On AIX, a *.a file may well be a shared library and can be used for
dynamic linking.

What is the result of "ar -t libphp5.a"?

Yours,
Laurenz Albe
Reply With Quote
  #3  
Old 11-05-2008, 11:00 AM
Default Re: building a .so (shared object) file

Laurenz Albe wrote:
> Mike Klein wrote:
>> I am trying to build php-5.2.6 on aix 6.1 using gcc 4.2.2 and cannot
>> get it to generate libphp5.so. Is there a way I can convert the .a and
>> .la files to a .so?

>
> Are you sure that you need that?
>
> On AIX, a *.a file may well be a shared library and can be used for
> dynamic linking.
>
> What is the result of "ar -t libphp5.a"?


My experience of late has been with 5.2.4.

It's entirely likely that the build _is_ generating a .so file,
and it's probably in the .libs directly. however, the php build process
is so mangled that it doesn't properly manage the .a/.la targets, and
fails miserably when you attempt to install.

In addition, the makefile has some problems when it builds an export
list and requires hand modification. My environment required this mod:

BUILD_CLI = nm -pBC $$(echo $(PHP_GLOBAL_OBJS) $(PHP_CLI_OBJS) | sed
's:\([A-Za-z0-9_]*\)\.lo:.libs/\1.o:g') | grep ' [BD] ' | cut -c14- |
sort -u >> php.sym && $(LIBTOOL) --mode=link $(CC) -export-dynamic
$(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS_PROGRAM) $(LDFLAGS)
-Wl,-brtl -Wl,-bEhp.sym $(PHP_RPATHS) $(PHP_GLOBAL_OBJS)
$(PHP_CLI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $(SAPI_CLI_PATH)

With this modification I can get a .libs/libphp5.so build, which I then
manually put into apache2/modules.

I could start a rant about libtool's obfuscation, but I won't. It would
also be nice if the configure command knew how to build Makefiles that
didn't contain lines that were umpteen-million characters long and
non-human readable.

OK, sorry, that _was_ a rant.

As for libphp5.a, it's probably not going to help on AIX because most
programs don't understand how to dynamically load an archive member (an
AIX-specific feature). And the php module is only useful in Apache/et.
al., so it must be a module, not an archive.
Reply With Quote
  #4  
Old 11-05-2008, 12:00 PM
Default Re: building a .so (shared object) file

Gary R. Hook schrieb:

> I could start a rant about libtool's obfuscation, but I won't. It would
> also be nice if the configure command knew how to build Makefiles that
> didn't contain lines that were umpteen-million characters long and
> non-human readable.
>
> OK, sorry, that _was_ a rant.
>


This is simply the truth.
libtool makes complicated things even more complicated.

It is a good performance benchmark for the shell, as libtoolized make
spent much CPU cycles in the shell than within the C/C++ compiler.

--
Uli Link

Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 11:49 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Integrated by bbpixel2009 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.