Compile Apache in 64bit on Sun Studio 11

Hello,

This seems like a painfully simple proposition - compile the Apache httpd server so that 64 bit shared libraries are created (ELFCLASS64)

Does anyone know of a URL or recipe for this?

This attempt is on a Sparc system (v440) with Solaris 10 6/06

My configure:

./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --enable-cache --enable-mem-cache --with-mpm=prefork --enable-so --enable-suexec --libdir=/usr/local/apache2/lib/sparcv9

I set my (seemingly) significant environment variables:

LDFLAGS=-L/usr/sfw/lib/sparcv9 -L/usr/lib/sparcv9 -R/usr/sfw/lib/sparcv9 -R/usr/lib/sparcv9

LD_LIBRARY_PATH_64=/usr/sfw/lib/sparcv9:/usr/local/lib/sparcv9:/usr/lib/sparcv9 :/usr/openwin/lib/sparcv9:/usr/dt/lib/sparcv9

CXXFLAGS=-fast -xarch=v9b

CFLAGS=-fast -xarch=v9b

If I recall from several years back (recalling a 64-bit compile of Apache httpd 1.3.x) I had to modify the libtool produced by configure....but other than adding "-64" to the /usr/ccs/bin/ld invokation, I'm not sure what else to do.

The final failing error was:

[cms 548] httpd-2.2.3 > /home/builds/httpd-2.2.3/srclib/apr/libtool --silent --mode=link /opt/SUNWspro/bin/cc-fast -xarch=v9b-L/home/builds/httpd-2.2.3/srclib/apr-util/xml/expat/lib -L/usr/sfw/lib/sparcv9 -L/usr/lib/sparcv9 -R/usr/sfw/lib/sparcv9 -R/usr/lib/sparcv9 -o httpd modules.lo buildmark.o -fast -export-dynamic server/libmain.la modules/http/libmod_http.la modules/mappers/libmod_so.la server/mpm/prefork/libprefork.la os/unix/libos.la /home/builds/httpd-2.2.3/srclib/pcre/libpcre.la /home/builds/httpd-2.2.3/srclib/apr-util/libaprutil-1.la /home/builds/httpd-2.2.3/srclib/apr-util/xml/expat/lib/libexpat.la /home/builds/httpd-2.2.3/srclib/apr/libapr-1.la -luuid -lsendfile -lrt -lsocket -lnsl -lpthread

cc: Warning: -xarch=native has been explicitly specified, or implicitly specified by a macro option, -xarch=native on this architecture implies -xarch=v8plusb which generates code that does not run on pre UltraSPARC III processors

ld: fatal: file .libs/modules.o: wrong ELF class: ELFCLASS64

ld: fatal: File processing errors. No output written to .libs/httpd

...and my thoughts were "Of course it's ELFCLASS64 - that's what I wanted!!"

I checked all of the previous libraries created and the output is such as seen below:

[cms 552] .libs > file modules.o modules.o:ELF 64-bit MSB relocatable SPARCV9 Version 1, UltraSPARC3 Extensions Required

Again, this is what I want.

Does anyone know where in the apache httpd build I should indicate I want to link 64-bit libraries?

This seems so simple - Grr!

Thanks,

Phil

[2727 byte] By [philforrest] at [2007-11-26 10:24:13]
# 1

> /home/builds/httpd-2.2.3/srclib/apr/libtool --silent --mode=link /opt/SUNWspro/bin/cc -fast -xarch=v9b ... -o httpd modules.lo buildmark.o -fast ...

You have stomped on a common problem - second -fast expands into -xarch=v9plus that overrides your -xarch=v9b setting, resulting in 32bit linking.

You should analyze this configure/libtool combo and understand where this second -fast goes from. Then just replace/add -xarch=v9b there.

regards,

__Fedor.

SFV at 2007-7-7 2:26:06 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
Wow - never would have guessed that. I'll check for the second -fast.Thanks so much for the response,Phil
philforrest at 2007-7-7 2:26:06 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
A future version of Sun Studio should include the -m32 and -m64 flags like gcc has. That new flag will override any stray -xarch values and reliably give you the 32/64ness that you requested.
ChrisQuenelle at 2007-7-7 2:26:06 > top of Java-index,Development Tools,Solaris and Linux Development Tools...