Re: [mod-security-users] Compiling mod_security 64 bit, sparc
Brought to you by:
victorhora,
zimmerletw
From: MARTIN, J. (ATTSI) <JM...@at...> - 2010-11-12 16:46:43
|
> Please try setting the env variable CC instead of CFLAGS, like "CC=gcc -m64". Also make sure that Makefile has correct CC/CFLAGS variable set before running the gmake. I tried that just now; the CC="gcc -m64" export was not picked up by configure and put in the Makefile. Adding it manually and executing make exhibited the same behavior as before. All of the commands up until the final '-mode=link' work properly; just that link fails. /sites/www-site/APACHE/httpd-2.2.17-worker-niagara-64/build/libtool --silent --mode=link gcc -o mod_security2.la -R/sites/utils/lib/64 -R/usr/lib/sparcv9 -R/sites/utils/lib/64 -R/usr/local/lib -L/sites/utils/lib/64 -L/usr/lib/sparcv9 -L/sites/utils/lib -L/usr/local/lib -lpcre -lxml2 -lz -lpthread -liconv -lm -lsocket -lnsl -rpath /sites/www-site/APACHE/httpd-2.2.17-worker-niagara-64/modules -module -avoid-version msc_release.lo msc_lua.lo acmp.lo msc_geo.lo pdf_protect.lo msc_reqbody.lo persist_dbm.lo msc_pcre.lo msc_util.lo msc_parsers.lo modsecurity.lo msc_multipart.lo msc_xml.lo msc_logging.lo re_variables.lo re_tfns.lo re_actions.lo re_operators.lo re.lo apache2_util.lo apache2_io.lo apache2_config.lo mod_security2.lo ld: fatal: file .libs/msc_release.o: wrong ELF class: ELFCLASS64 $ grep CC Makefile CC = gcc -m64 $(LIBTOOL) --mode=compile $(CC) $(APXS_INCLUDES) $(APXS_CFLAGS) $(CPPFLAGS) $(APR_CFLAGS) $(APU_CFLAGS) -o msc_test.lo -c msc_test.c $(LIBTOOL) --mode=link $(CC) $$objs -o msc_test msc_test.lo $(LDFLAGS) $(LIBS) $(APR_LINK_LD) $(APU_LINK_LD) Thank you, -Jason Martin -- From: Jitha Sreehari [mailto:jit...@gm...] Sent: Thursday, November 11, 2010 8:53 PM To: MARTIN, JASON (ATTSI) Subject: Re: [mod-security-users] Compiling mod_security 64 bit, sparc Please try setting the env variable CC instead of CFLAGS, like "CC=gcc -m64". Also make sure that Makefile has correct CC/CFLAGS variable set before running the gmake. Hello, I am trying to compile mod_security 2.5.12 to work with 64-bit apache 2.2.17 on Solaris 10 SPARC. I've got Apache compiled in 64bit mode, but mod_Security is giving me some trouble with linking, complaining that ELFCLASS64 is the wrong ELF class. Configure line is: ./configure --with-apxs=/sites/www-site/APACHE/httpd-2.2.17-worker-niagara-64/bin/ap xs --with-pcre=/sites/utils --with-apr=/sites/www-site/APACHE/httpd-2.2.17-worker-niagara-64 --with-apu=/sites/www-site/APACHE/httpd-2.2.17-worker-niagara-64 CFLAGS=-m64 LDFLAGS="-R/sites/utils/lib/64 -L/sites/utils/lib/64 -L/usr/lib/sparcv9 -R/usr/lib/sparcv9" Configure finishes properly and then I run make. It gets through all the 'compile' commands and passes -m64 properly, but when it gets to the link stage for mod_Security2.so itself it fails due to wrong ELF class: $ gmake [snip] /sites/www-site/APACHE/httpd-2.2.17-worker-niagara-64/build/libtool --silent --mode=compile gcc -prefer-pic -m64 -mcpu=niagara -mtune=niagara -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -I/sites/utils/include -I/sites/www-site/APACHE/httpd-2.2.17-worker-niagara-64/include -I/sites/www-site/APACHE/httpd-2.2.17-worker-niagara-64/include -I/sites/www-site/APACHE/httpd-2.2.17-worker-niagara-64/include -O2 -g -Wall -DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -I/sites/www-site/APACHE/httpd-2.2.17-worker-niagara-64/include -I/sites/www-site/APACHE/httpd-2.2.17-worker-niagara-64/include -I. -I/sites/src/httpd-2.2.17/srclib/apr/include -I/sites/src/httpd-2.2.17/srclib/apr-util/include -I/sites/src/httpd-2.2.17/srclib/apr-util/xml/expat/lib -I/usr/local/include -I/sites/www-site/OPENSSL/openssl-1.0.0-niagara-64/include -I/usr/sfw/include -I/sites/utils/include -I/usr/local/include/libxml2 -c -o msc_release.lo msc_release.c && touch msc_release.slo [worked] /sites/www-site/APACHE/httpd-2.2.17-worker-niagara-64/build/libtool --silent --mode=link gcc -o mod_security2.la -R/sites/utils/lib/64 -R/usr/lib/sparcv9 -R/sites/utils/lib/64 -R/usr/local/lib -L/sites/utils/lib/64 -L/usr/lib/sparcv9 -L/sites/utils/lib -L/usr/local/lib -lpcre -lxml2 -lz -lpthread -liconv -lm -lsocket -lnsl -rpath /sites/www-site/APACHE/httpd-2.2.17-worker-niagara-64/modules -module -avoid-version msc_release.lo msc_lua.lo acmp.lo msc_geo.lo pdf_protect.lo msc_reqbody.lo persist_dbm.lo msc_pcre.lo msc_util.lo msc_parsers.lo modsecurity.lo msc_multipart.lo msc_xml.lo msc_logging.lo re_variables.lo re_tfns.lo re_actions.lo re_operators.lo re.lo apache2_util.lo apache2_io.lo apache2_config.lo mod_security2.lo libtool: link: warning: library `/sites/utils/lib/64/libpcre.la' was moved. ld: fatal: file .libs/msc_release.o: wrong ELF class: ELFCLASS64 ld: fatal: File processing errors. No output written to .libs/mod_security2.so collect2: ld returned 1 exit status apxs:Error: Command failed with rc=65536 [mode=link failed, notice lack of -m64] Manually rerunning the failed command and adding -m64 appears to work, but I don't understand why make is leaving that option off. I checked apxs and it is returning -m64: /sites/www-site/APACHE/httpd-2.2.17-worker-niagara-64/bin/apxs -q CFLAGS -m64 -mcpu=niagara -mtune=niagara If I add -m64 to LDFLAGS at configure time, apxs-wrapper throws errors about unknown options. Any suggestions on what might resolve this? Thank you, -Jason Martin |