Solved

Compile Mod Security 2.5.9 on Solaris 10

Posted on 2009-04-06
11
1,752 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
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.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

919 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

18 Experts available now in Live!

Get 1:1 Help Now