Solved

Compile Mod Security 2.5.9 on Solaris 10

Posted on 2009-04-06
11
1,844 Views
Last Modified: 2013-12-21
Hi,
I am using Apache 2.0.63 which came installed with Solaris 10 (SPARC)

Some problems here when I tried to do a make. My options for configure was:
CC=/usr/sfw/bin/gcc CXX=/usr/sfw/bin/g++ ./configure --with-apxs=/usr/apache2/bin/apxs  --with-apr=
error was:
  :
  :
# make
/var/apache2/build/libtool --silent --mode=compile /opt/SUNWspro/bin/cc -prefer-pic -xO3 -xarch=v8 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff -xO4 -DSSL_EXPERIMENTAL -DSSL_ENGINE  -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/apache2/include  -I/usr/apache2/include   -I/usr/apache2/include -I/usr/sfw/include -O2 -g -Wall -I/usr/apache2/include -I/usr/local/include -I/usr/local/include/libxml2  -c -o mod_security2.lo mod_security2.c && touch mod_security2.slo
/var/apache2/build/libtool: line 1279: /opt/SUNWspro/bin/cc: No such file or directory
apxs:Error: Command failed with rc=65536
.
*** Error code 1
The following command caused the error:
src=""; \
for f in mod_security2 apache2_config apache2_io apache2_util  re re_operators re_actions re_tfns re_variables  msc_logging msc_xml msc_multipart modsecurity msc_parsers msc_util msc_pcre  persist_dbm msc_reqbody pdf_protect msc_geo acmp msc_lua msc_release; do \
        src="$src $f.c"; \
done; \
rm -f msc_test msc_test.o msc_test.lo msc_test.slo; \
build/apxs-wrapper -c -I/usr/apache2/include    -I/usr/local/include -I/usr/local/include/libxml2   -L/usr/local/lib -R/usr/local/lib -lpcre -L/usr/local/lib -R/usr/local/lib -lxml2 -lz -lpthread -liconv -lm -lsocket -lnsl  -Wc,-O2 -Wc,-g -Wc,-Wall  $src
make: Fatal error: Command failed for target `mod_security2.la'

Open in new window

0
Comment
Question by:QLJ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 1

Author Comment

by:QLJ
ID: 24075901
i made a mistake as I pointed to the wrong path for gcc. Once corrected, I got a new set of error msgs
:
:
cc: unrecognized option `-Xa'
cc: unrecognized option `-KPIC'
cc: language O4 not recognized
cc: msc_lua.c: linker input file unused because linking not done
/var/apache2/build/libtool --silent --mode=compile /opt/SUNWspro/bin/cc -prefer-pic -xO3 -xarch=v8 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff -xO4 -DSSL_EXPERIMENTAL -DSSL_ENGINE  -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/apache2/include  -I/usr/apache2/include   -I/usr/apache2/include -I/usr/sfw/include -O2 -g -Wall -I/usr/apache2/include -I/usr/local/include -I/usr/local/include/libxml2  -c -o msc_release.lo msc_release.c && touch msc_release.slo
cc: unrecognized option `-Xa'
cc: unrecognized option `-KPIC'
cc: language O4 not recognized
cc: msc_release.c: linker input file unused because linking not done
/var/apache2/build/libtool --silent --mode=link /opt/SUNWspro/bin/cc -o mod_security2.la -R/usr/local/lib -R/usr/local/lib  -L/usr/local/lib -L/usr/local/lib -lpcre -lxml2 -lz -lpthread -liconv -lm -lsocket -lnsl -rpath /usr/apache2/libexec -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: open failed: No such file or directory
apxs:Error: Command failed with rc=65536
.
*** Error code 1
The following command caused the error:
src=""; \
for f in mod_security2 apache2_config apache2_io apache2_util  re re_operators re_actions re_tfns re_variables  msc_logging msc_xml msc_multipart modsecurity msc_parsers msc_util msc_pcre  persist_dbm msc_reqbody pdf_protect msc_geo acmp msc_lua msc_release; do \
        src="$src $f.c"; \
done; \
rm -f msc_test msc_test.o msc_test.lo msc_test.slo; \
build/apxs-wrapper -c -I/usr/apache2/include    -I/usr/local/include -I/usr/local/include/libxml2   -L/usr/local/lib -R/usr/local/lib -lpcre -L/usr/local/lib -R/usr/local/lib -lxml2 -lz -lpthread -liconv -lm -lsocket -lnsl  -Wc,-O2 -Wc,-g -Wc,-Wall  $src
make: Fatal error: Command failed for target `mod_security2.la'

Open in new window

0
 
LVL 22

Expert Comment

by:blu
ID: 24076339
Well, the problem is your first statement. You need to compile the apache mods in the same manner
used by the apache executable. That is the whole reason for having libtool, after, to get the options and
choices to match.  So, you cannot use gcc to compile the mod, you need to use Sun Studio.

You can get it for free. There are several links on Sun's website. Here is one:
http://developers.sun.com/sunstudio/downloads/
0
 
LVL 1

Author Comment

by:QLJ
ID: 24085164
I am having major problems getting sun studio to run. Is there a way i can run sunstudio's compiler at cmd line?

Appreciate all guidance.. am a newbie with sunstudio.
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 22

Expert Comment

by:blu
ID: 24085689
Actually, your last question confuses me, because the only way I ever run sunstudio compilers is from
the command line. So, yes, of course, you can run it from the command line. Just set your path appropriately and then type "cc".  You may be having problems with your path, because you may have more than on "cc" on your path.
0
 
LVL 1

Author Comment

by:QLJ
ID: 24086707
hi blu, evidently, i have never used sunstudio before. ;)

1) I can't seem to find the CC with SunStudio (default path?)
2) sample command to use to compile at the command line.
0
 
LVL 22

Expert Comment

by:blu
ID: 24088129
Usually, the Sun Studio compilers install in /opt, in SUNWspro. So, the full path to the c compiler would be /opt/SUNWspro/bin/cc and for the C++ compiler, /opt/SUNWspro/bin/CC.
The simplest command to compile a c program would be

/opt/SUNWspro/bin/cc   -o main main.c
0
 
LVL 1

Author Comment

by:QLJ
ID: 24127714
I hate to say this, but it doesn't seem to be working right - for the SunStudio method of running /opt/SUNWspro/bin/cc   -o modsecurity modsecurity.c

By the way, the documentation in modsecurity website did  say to compile using ./configure
http://www.modsecurity.org/documentation/modsecurity-apache/2.5.9/modsecurity2-apache-reference.html#installation

Is there a reason or anyway to troubleshoot why I cant get it to work on mine?
0
 
LVL 22

Expert Comment

by:blu
ID: 24129111
I didn't say not to compile with configure, I just said to use the Sun Studio compiler. just add /opt/SUNWspro/bin to
the beginning of your path before you call configure, and otherwise proceed as you would normally.
0
 
LVL 1

Author Comment

by:QLJ
ID: 24135360
Whoops.. totally misinterpreted..
well, i tried adding /opt/SUNWspro/bin to path. I now have a different error set:

# make
/var/apache2/build/libtool --silent --mode=compile /opt/SUNWspro/bin/cc -prefer-pic -xO3 -xarch=v8 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff -xO4 -DSSL_EXPERIMENTAL -DSSL_ENGINE  -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/apache2/include  -I/usr/apache2/include   -I/usr/apache2/include -I/usr/sfw/include -O2 -g -Wall -I/usr/apache2/include -I/usr/local/include -I/usr/local/include/libxml2  -c -o mod_security2.lo mod_security2.c && touch mod_security2.slo
cc: illegal option -Wall
apxs:Error: Command failed with rc=65536
0
 
LVL 1

Author Comment

by:QLJ
ID: 24153753
ok, i solved it... just went into the Makefile and deleted all -Wall

Problem is, would there be any implications if i do that?rything looks ok so far...
0
 
LVL 22

Accepted Solution

by:
blu earned 80 total points
ID: 24156091
If it worked, then there is no implications. The "-Wall" flag simply tells gcc to not print any warnings and be
more quiet. So, it doesn't effect the resulting object file, just the compilation noise. If you didn't see any
worisome warnings that got you upset, then everything is fine.
0

Featured Post

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question