Solved

Compile Mod Security 2.5.9 on Solaris 10

Posted on 2009-04-06
11
1,677 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
  • 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
 
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In this article we have discussed the manual scenarios to recover data from Windows 10 through some backup and recovery tools which are offered by it.
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

747 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now