Snort mailing list archives

Compilation Bug (Solaris 9, Snort 2.0.0, Sun CC)


From: "Roy S. Rapoport" <snort-users () ols inorganic org>
Date: Tue, 20 May 2003 06:34:00 -0700

A casual search of the mailing list did not reveal a previous report of
this problem.

Out of the box, snort compiles w/o problems using gcc (3.2.2) on my
Solaris 9 box.  However, given that SunCC usually produces faster
binaries, I attempted to compile with it, only to encounter
---
cc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../../src
-I../../src/output-plugins -I../../src/detection-plugins
-I../../src/preprocessors  -DBSD_COMP -I/usr/local/mysql/include/mysql
-DENABLE_MYSQL  -xO5 -I/usr/local/include -c `test -f
'sp_pattern_match.c' || echo './'`sp_pattern_match.c
"sp_pattern_match.c", line 254: warning: assignment type mismatch:
        pointer to char "=" pointer to unsigned char
"sp_pattern_match.c", line 293: warning: argument #1 is incompatible
with prototype:
        prototype: pointer to unsigned char : "../../src/bounds.h", line
58
        argument : pointer to char
"sp_pattern_match.c", line 293: warning: argument #2 is incompatible
with prototype:
        prototype: pointer to unsigned char : "../../src/bounds.h", line
58
        argument : pointer to char
"sp_pattern_match.c", line 293: warning: argument #3 is incompatible
with prototype:
        prototype: pointer to unsigned char : "../../src/bounds.h", line
58
        argument : pointer to char
"sp_pattern_match.c", line 329: warning: argument #1 is incompatible
with prototype:
        prototype: pointer to unsigned char : "../../src/bounds.h", line
58
        argument : pointer to char
"sp_pattern_match.c", line 329: warning: argument #2 is incompatible
with prototype:
        prototype: pointer to unsigned char : "../../src/bounds.h", line
58
        argument : pointer to char
"sp_pattern_match.c", line 329: warning: argument #3 is incompatible
with prototype:
        prototype: pointer to unsigned char : "../../src/bounds.h", line
58
        argument : pointer to char
"sp_pattern_match.c", line 810: undefined symbol: __FUNCTION__
"sp_pattern_match.c", line 921: warning: assignment type mismatch:
        pointer to char "=" pointer to unsigned char
"sp_pattern_match.c", line 1289: warning: argument #1 is incompatible
with prototype:
        prototype: pointer to char : "unknown", line 0
        argument : pointer to unsigned char
cc: acomp failed for sp_pattern_match.c
make[3]: *** [sp_pattern_match.o] Error 2
make[3]: Leaving directory
`/usr/local/src/snort-2.0.0/src/detection-plugins'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/snort-2.0.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/snort-2.0.0'
make: *** [all] Error 2
---

The important error there relates to __FUNCTION__, and specifically
these lines in sp_pattern_match.c:
---
#ifdef WIN32
#define __FUNCTION__ "SetUseDoePtr"
#endif 
        LogMessage("%s: No pattern match data found\n", __FUNCTION__);
#ifdef WIN32
#undef __FUNCTION__
#endif 
---

Unfortunately, SunCC doesn't have a __FUNCTION__ macro either.  Removing
the #ifdef/#endif lines and leaving jus 
#define __FUNCTION__ "SetUseDoePtr"

allowed me to continue compiling to this point:
---
cc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../src  -I../src/output-plugins
-I../src/detection-plugins -I../src/preprocessors  -DBSD_COMP
-I/usr/local/mysql/include/mysql -DENABLE_MYSQL  -xO5
-I/usr/local/include -c `test -f 'log.c' || echo './'`log.c
"log.c", line 1578: syntax error before or at: {
"log.c", line 1578: undefined symbol: __tmp
"log.c", line 1578: syntax error before or at: )
"log.c", line 1581: "case" outside switch
"log.c", line 1582: warning: statement not reached
"log.c", line 1584: syntax error before or at: {
"log.c", line 1584: undefined symbol: __tmp
"log.c", line 1584: syntax error before or at: )
"log.c", line 1585: "break" outside loop or switch
"log.c", line 1587: "case" outside switch
"log.c", line 1588: warning: statement not reached
"log.c", line 1590: syntax error before or at: {
"log.c", line 1590: undefined symbol: __tmp
"log.c", line 1590: cannot recover from previous errors
cc: acomp failed for log.c
make[1]: *** [log.o] Error 2
---

Which is where I'm stuck right now.  Suggestions that aren't "use gcc"?

-roy



-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge
_______________________________________________
Snort-users mailing list
Snort-users () lists sourceforge net
Go to this URL to change user options or unsubscribe:
https://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:
http://www.geocrawler.com/redir-sf.php3?list=snort-users


Current thread: