Bug 28205 - expat detection broken on lib64 platforms
Summary: expat detection broken on lib64 platforms
Status: RESOLVED FIXED
Alias: None
Product: APR
Classification: Unclassified
Component: APR-util (show other bugs)
Version: 1.5.3
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords:
: 40892 41308 42775 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-04-05 12:38 UTC by Bill Antoniadis
Modified: 2014-08-28 10:43 UTC (History)
4 users (show)



Attachments
add --enable-lib64 option to apr-util configure (9.61 KB, patch)
2005-08-23 19:22 UTC, ast
Details | Diff
Backport to 1.2.8 based on r493791 (9.44 KB, patch)
2007-01-08 12:35 UTC, Ruediger Pluem
Details | Diff
Util patch for version 2.2.4 (9.54 KB, patch)
2007-07-24 12:24 UTC, Jens Brey
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Antoniadis 2004-04-05 12:38:07 UTC
We are getting an error compiling Apache 2.0.48 (and 2.0.49) for a newly
installed SuSe 9.0 64bit (AMD) multiprocessor server.

We are using the default GCC gcc-3.3.1-23, and the default GLIB glibc-2.3.2-90

Following are the configure & make commands:
# ./configure --enable-so --enable-ssl --enable-auth-dbm --with-mpm=worker
--with-ssl=/usr/local/ssl
# make

Following is the error:
...
Making all in support
make[1]: Entering directory `/nas/local_src/TARS/httpd-2.0.49/support'
make[2]: Entering directory `/nas/local_src/TARS/httpd-2.0.49/support'
/nas/local_src/TARS/httpd-2.0.49/srclib/apr/libtool --silent --mode=compile gcc
 -g -O2 -pthread    -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE
-D_SVID_SOURCE -D_GNU_SOURCE -DAP_HAVE_DESIGNATED_INITIALIZER
-I/nas/local_src/TARS/httpd-2.0.49/srclib/apr/include
-I/nas/local_src/TARS/httpd-2.0.49/srclib/apr-util/include -I.
-I/nas/local_src/TARS/httpd-2.0.49/os/unix
-I/nas/local_src/TARS/httpd-2.0.49/server/mpm/worker
-I/nas/local_src/TARS/httpd-2.0.49/modules/http
-I/nas/local_src/TARS/httpd-2.0.49/modules/filters
-I/nas/local_src/TARS/httpd-2.0.49/modules/proxy
-I/nas/local_src/TARS/httpd-2.0.49/include
-I/nas/local_src/TARS/httpd-2.0.49/modules/generators
-I/usr/local/ssl/include/openssl -I/usr/local/ssl/include -prefer-non-pic
-static -c htpasswd.c && touch htpasswd.lo
/nas/local_src/TARS/httpd-2.0.49/srclib/apr/libtool --silent --mode=link gcc  -g
-O2 -pthread    -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE
-D_SVID_SOURCE -D_GNU_SOURCE -DAP_HAVE_DESIGNATED_INITIALIZER
-I/nas/local_src/TARS/httpd-2.0.49/srclib/apr/include
-I/nas/local_src/TARS/httpd-2.0.49/srclib/apr-util/include -I.
-I/nas/local_src/TARS/httpd-2.0.49/os/unix
-I/nas/local_src/TARS/httpd-2.0.49/server/mpm/worker
-I/nas/local_src/TARS/httpd-2.0.49/modules/http
-I/nas/local_src/TARS/httpd-2.0.49/modules/filters
-I/nas/local_src/TARS/httpd-2.0.49/modules/proxy
-I/nas/local_src/TARS/httpd-2.0.49/include
-I/nas/local_src/TARS/httpd-2.0.49/modules/generators
-I/usr/local/ssl/include/openssl -I/usr/local/ssl/include -export-dynamic
-L/usr/local/ssl/lib   -o htpasswd  htpasswd.lo   -lssl -lcrypto
/nas/local_src/TARS/httpd-2.0.49/srclib/pcre/libpcre.la
/nas/local_src/TARS/httpd-2.0.49/srclib/apr-util/libaprutil-0.la -ldb1 -lexpat
/nas/local_src/TARS/httpd-2.0.49/srclib/apr/libapr-0.la -lrt -lm -lcrypt -lnsl
-lpthread -ldl
/usr/lib/libexpat.so: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [htpasswd] Error 1
make[2]: Leaving directory `/nas/local_src/TARS/httpd-2.0.49/support'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/nas/local_src/TARS/httpd-2.0.49/support'
make: *** [all-recursive] Error 1 

Thank you.
Comment 1 Joe Orton 2004-09-09 15:37:54 UTC
This is messy autoconf code, a workaround for this issue is passing
--with-expat=xml/expat to configure.
Comment 2 ast 2005-08-08 23:42:55 UTC
This bug seems to be open more than a year now and I got bitten by this bug
compiling httpd-2.1.6-alpha with tha packaged apr-util 1.1.2.
The workaround is not exactly nice if one wants to use the system installed
expat. Any chance that this bug will eventually be resolved?
Comment 3 Joe Orton 2005-08-09 17:55:08 UTC
It's unlikely to be solved without causing regressions for some people.  This
case is pretty unusual and is SuSE-specific AFAIK: on no other distro that I'm
aware of will you get a 32-bit expat-devel installed on an x86_64 system.
Comment 4 Joe Orton 2005-08-09 17:56:06 UTC
(the other workaround is to remove the 32-bit expat-devel package and leave the
64-bit expat-devel installed: that case works fine)
Comment 5 ast 2005-08-23 19:22:42 UTC
Created attachment 16166 [details]
add --enable-lib64 option to apr-util configure

The problem is neither rare, nor SuSE specific. Using lib64 for 64bit libraries
and lib for 32bit libraries is a convention for bi-arch systems like x86_64.

The patch solves this problem by introducing an '--enable-lib64' option to
apr-util's configure system which causes lib64 to be the (preferred) library
directory when enabled.
Comment 6 Joe Orton 2005-08-23 19:46:44 UTC
I single out SuSE merely to emphasize the limited impact of this bug in practice.

-1 to the patch, that just propagates the brokenness even further. The right fix
is to rewrite the expat detection to work like the Berkeley DB detection. 
Neither "lib" nor "lib64" should be special; e.g. on MIPS platforms you may have
a $prefix/lib, $prefix/lib64 and $prefix/lib32 directory to support the three
different MIPS ABIs.
Comment 7 William A. Rowe Jr. 2006-03-21 19:42:39 UTC
Additional comments and notes on 64 bit porting and linkage at 

  http://gcc.fyxm.net/summit/2003/Porting%20to%2064%20bit.pdf
Comment 8 William A. Rowe Jr. 2006-09-19 19:54:40 UTC
Mass reassign the 44 open apr-bugs to apr bug list
Comment 9 Joe Orton 2006-11-09 02:09:38 UTC
*** Bug 40892 has been marked as a duplicate of this bug. ***
Comment 10 Joe Orton 2007-01-07 09:32:43 UTC
*** Bug 41308 has been marked as a duplicate of this bug. ***
Comment 11 Joe Orton 2007-01-08 10:42:31 UTC
This is now fixed on the trunk:

http://svn.apache.org/viewvc?view=rev&rev=493791

if some people can test this out and post results to dev@ it could get
backported to 1.2.x.
Comment 12 Ruediger Pluem 2007-01-08 12:35:17 UTC
Created attachment 19375 [details]
Backport to 1.2.8 based on r493791

Based on r493791 by Joe I created the attached patch which smoothly applies to
apr-util 1.2.8. I tested this patch successfully with the following
environments:

SuSE 8.1 32 bit with libexpat installed in /usr/lib
SuSE 10.1 64 bit with libexpat installed in /usr/lib (32 bit) and /usr/lib64
(64 bit) and a 64 bit build.
Comment 13 Joe Orton 2007-06-07 02:41:09 UTC
Merged to 1.2.x, thanks to Ruediger:

http://svn.apache.org/viewvc?view=rev&rev=545129
Comment 14 Ruediger Pluem 2007-06-29 15:38:51 UTC
*** Bug 42775 has been marked as a duplicate of this bug. ***
Comment 15 Jens Brey 2007-07-24 12:24:12 UTC
Created attachment 20543 [details]
Util patch for version 2.2.4

This is a new version of file 16166 which works against 2.2.4

See also:
http://blog.chaos-co.de/index.php?/archives/2-Apache-patch-for-libexpat.so-could-not-read-symbols-File-in-wrong-format.html


Have fun,

Jens
Comment 16 Ahab. A. 2010-01-25 09:28:26 UTC
I attempted a 64bit build on Apache 2.2.8 but failed with same error in apr-utils reported in this bug report. The switch --enable-lib64 (for the configure script) does not exist in Apache 2.2.8 which indicates the patch that fixes apr-utils for 64 builds, provided as an attachment here, was not applied to Apache 2.2.8 source. I checked Apache 2.2.9 and did not find --enable-lib64 switch available either. I'm wondering why this patch was not propagated to Apache's main source code so that newer releases of the server will have this fix and will be able to build on 64 bit platforms.
Comment 17 William A. Rowe Jr. 2010-01-25 09:45:46 UTC
There is no purpose nor use to --enable-lib64.

System paths must not be enabled, disabled or explicitly listed in the 
configure scripts, those are an attribute of the system compiler and linker.

Let it do its job.

You are probably missing a package expat-devel.x86_64 which provides something
more than the libexpat.so.n versioned file.  A linker won't find that.
Comment 18 Ahab. A. 2010-01-25 12:45:04 UTC
Some more background information:
Machine: Linux xxxx.xxxx.com 2.6.18-53.1.4.el5 #1 SMP Wed Nov 14 10:37:27 EST 2007 x86_64 x86_64 x86_64 GNU/Linux

I have not found official Apache documentation on how to build the server in 64bit. I'm not even sure if that's a supported platform. 

Here is what I have done:

[testuser@testserver1 httpd-2.2.8]$ export CFLAGS=-m64
[testuser@testserver1 httpd-2.2.8]$ make
Making all in srclib
make[1]: Entering directory `/home/testuser/webservers/httpd-2.2.8/srclib'
Making all in apr
make[2]: Entering directory `/home/testuser/webservers/httpd-2.2.8/srclib/apr'
make[3]: Entering directory `/home/testuser/webservers/httpd-2.2.8/srclib/apr'
make[3]: Nothing to be done for `local-all'.
make[3]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/srclib/apr'
make[2]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/srclib/apr'
Making all in apr-util
make[2]: Entering directory `/home/testuser/webservers/httpd-2.2.8/srclib/apr-util'
make[3]: Entering directory `/home/testuser/webservers/httpd-2.2.8/srclib/apr-util'
make[3]: Nothing to be done for `local-all'.
make[3]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/srclib/apr-util'
make[2]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/srclib/apr-util'
Making all in pcre
make[2]: Entering directory `/home/testuser/webservers/httpd-2.2.8/srclib/pcre'
make[3]: Entering directory `/home/testuser/webservers/httpd-2.2.8/srclib/pcre'
make[3]: Nothing to be done for `local-all'.
make[3]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/srclib/pcre'
make[2]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/srclib/pcre'
make[1]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/srclib'
Making all in os
make[1]: Entering directory `/home/testuser/webservers/httpd-2.2.8/os'
Making all in unix
make[2]: Entering directory `/home/testuser/webservers/httpd-2.2.8/os/unix'
make[3]: Entering directory `/home/testuser/webservers/httpd-2.2.8/os/unix'
make[3]: Nothing to be done for `local-all'.
make[3]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/os/unix'
make[2]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/os/unix'
make[1]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/os'
Making all in server
make[1]: Entering directory `/home/testuser/webservers/httpd-2.2.8/server'
Making all in mpm
make[2]: Entering directory `/home/testuser/webservers/httpd-2.2.8/server/mpm'
Making all in prefork
make[3]: Entering directory `/home/testuser/webservers/httpd-2.2.8/server/mpm/prefork'
make[4]: Entering directory `/home/testuser/webservers/httpd-2.2.8/server/mpm/prefork'
make[4]: Nothing to be done for `local-all'.
make[4]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/server/mpm/prefork'
make[3]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/server/mpm/prefork'
make[2]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/server/mpm'
make[2]: Entering directory `/home/testuser/webservers/httpd-2.2.8/server'
make[2]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/server'
make[1]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/server'
Making all in modules
make[1]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules'
Making all in aaa
make[2]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules/aaa'
make[3]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules/aaa'
make[3]: Nothing to be done for `local-all'.
make[3]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules/aaa'
make[2]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules/aaa'
Making all in filters
make[2]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules/filters'
make[3]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules/filters'
make[3]: Nothing to be done for `local-all'.
make[3]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules/filters'
make[2]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules/filters'
Making all in loggers
make[2]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules/loggers'
make[3]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules/loggers'
make[3]: Nothing to be done for `local-all'.
make[3]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules/loggers'
make[2]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules/loggers'
Making all in metadata
make[2]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules/metadata'
make[3]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules/metadata'
make[3]: Nothing to be done for `local-all'.
make[3]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules/metadata'
make[2]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules/metadata'
Making all in ssl
make[2]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules/ssl'
make[3]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules/ssl'
make[3]: Nothing to be done for `local-all'.
make[3]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules/ssl'
make[2]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules/ssl'
Making all in http
make[2]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules/http'
make[3]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules/http'
make[3]: Nothing to be done for `local-all'.
make[3]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules/http'
make[2]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules/http'
Making all in generators
make[2]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules/generators'
make[3]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules/generators'
make[3]: Nothing to be done for `local-all'.
make[3]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules/generators'
make[2]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules/generators'
Making all in mappers
make[2]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules/mappers'
make[3]: Entering directory `/home/testuser/webservers/httpd-2.2.8/modules/mappers'
make[3]: Nothing to be done for `local-all'.
make[3]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules/mappers'
make[2]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules/mappers'
make[1]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/modules'
Making all in support
make[1]: Entering directory `/home/testuser/webservers/httpd-2.2.8/support'
make[2]: Entering directory `/home/testuser/webservers/httpd-2.2.8/support'
make[2]: Nothing to be done for `local-all'.
make[2]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/support'
make[1]: Leaving directory `/home/testuser/webservers/httpd-2.2.8/support'
make[1]: Entering directory `/home/testuser/webservers/httpd-2.2.8'
gcc -g -O2 -pthread    -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE    -I/home/testuser/webservers/httpd-2.2.8/srclib/pcre -I. -I/home/testuser/webservers/httpd-2.2.8/os/unix -I/home/testuser/webservers/httpd-2.2.8/server/mpm/prefork -I/home/testuser/webservers/httpd-2.2.8/modules/http -I/home/testuser/webservers/httpd-2.2.8/modules/filters -I/home/testuser/webservers/httpd-2.2.8/modules/proxy -I/home/testuser/webservers/httpd-2.2.8/include -I/home/testuser/webservers/httpd-2.2.8/modules/generators -I/home/testuser/webservers/httpd-2.2.8/modules/mappers -I/home/testuser/webservers/httpd-2.2.8/modules/database -I/home/testuser/webservers/httpd-2.2.8/srclib/apr/include -I/home/testuser/webservers/httpd-2.2.8/srclib/apr-util/include -I/home/testuser/webservers/httpd-2.2.8/modules/proxy/../generators -I/usr/kerberos/include -I/home/testuser/webservers/httpd-2.2.8/modules/ssl -I/home/testuser/webservers/httpd-2.2.8/modules/dav/main  -c /home/testuser/webservers/httpd-2.2.8/server/buildmark.c
/home/testuser/webservers/httpd-2.2.8/srclib/apr/libtool --silent --mode=link gcc -g -O2 -pthread        -o httpd  modules.lo buildmark.o -export-dynamic server/libmain.la modules/aaa/libmod_authn_file.la modules/aaa/libmod_authn_default.la modules/aaa/libmod_authz_host.la modules/aaa/libmod_authz_groupfile.la modules/aaa/libmod_authz_user.la modules/aaa/libmod_authz_default.la modules/aaa/libmod_auth_basic.la modules/filters/libmod_include.la modules/filters/libmod_filter.la modules/loggers/libmod_log_config.la modules/metadata/libmod_env.la modules/metadata/libmod_setenvif.la modules/ssl/libmod_ssl.la modules/http/libmod_http.la modules/http/libmod_mime.la modules/generators/libmod_status.la modules/generators/libmod_autoindex.la modules/generators/libmod_asis.la modules/generators/libmod_cgi.la modules/mappers/libmod_negotiation.la modules/mappers/libmod_dir.la modules/mappers/libmod_actions.la modules/mappers/libmod_userdir.la modules/mappers/libmod_alias.la modules/mappers/libmod_so.la server/mpm/prefork/libprefork.la os/unix/libos.la -lm /home/testuser/webservers/httpd-2.2.8/srclib/pcre/libpcre.la /home/testuser/webservers/httpd-2.2.8/srclib/apr-util/libaprutil-1.la -lsqlite3 -lexpat /home/testuser/webservers/httpd-2.2.8/srclib/apr/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl
/home/testuser/webservers/httpd-2.2.8/srclib/apr-util/.libs/libaprutil-1.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[1]: *** [httpd] Error 1
make[1]: Leaving directory `/home/testuser/webservers/httpd-2.2.8'
make: *** [all-recursive] Error 1
Comment 19 William A. Rowe Jr. 2010-01-25 16:34:14 UTC
Don't use export CFLAGS=-m64

Use export CC="gcc -m64" so that the compiler toolchain behaves correctly.
Autoconf is notoriously bad about these flags.

Please don't reopen and use bugzilla as a troubleshooting forum, the discussion
list dev@apr.apache.org can be of assistance.