Firewall Wizards mailing list archives

FW-1/OPSEC : compiling lea_filter.c on solaris - anyone?


From: Carl Brewer <carl () bl echidna id au>
Date: Fri, 31 May 2002 21:08:43 +1000


After spending many hours banging my head against the FW-1 NG OPSEC
SDK, I give up :)

I'm trying to compile the example 'lea_filter.c",
but am getting fails at link-time that I cannot
seem to work out (where does the function c::c live?!)

Here's my makefile (unashamedly stolen from somewhere on the
'net ...) :

{171} : m Makefile
#
# Makefile for opsec applications
#
#
# set the executable name
#
EXE_NAME = lea_filter
EXE_NAME_DYN    =   lea_filter_dyn

#
# define the object (*.o) files that compose the executable
#

OBJ_FILES = lea_filter.o
#OBJ_FILES = lea_filter.o

#
# set compiler (CC) and linker (LD)
#

CC = gcc
#CC = g++
#LD = $(CC) -E
LD = $(CC)

#
# set 'PKG_DIR' to points to the OPSEC SDK package directory
#

PKG_DIR = ../../../../sdk_devel/pkg_rel

#
# set 'LIB_DIR' to point to the directory that contains the libraries
# this should be one of: release.static, release.dynamic, debug.static, debug.dynamic
#

LIB_DIR  = $(PKG_DIR)/lib/release.static
#LIB_DIR  = $(PKG_DIR)/lib/debug.static

#
# Static (release or debug) libraries required for link
#

STATIC_LIBS = \
        -lopsec \
        -lsicauth -lsic \
        -lcp_policy \
        -lskey \
        -lndb \
        -lckpssl -lcpcert \
        -lcpcryptutil -lcpprng \
        -lcpbcrypt -lcpca \
        -lasn1cpp \
        -lcpopenssl \
        -lEncode -lComUtils \
        -lResolve -lDataStruct \
        -lOS \
        -lcpprod50 \
        -lAppUtils -lEventUtils \
        -lCPMIBase501 -lCPMIClient501 -lCPSrvIS -lEncode -lResolver -lcp_policy \
        -lcpcert -lcpprng -llogfilter -lobjlibclient -lopsecext

#
# Dynamic (release or debug) libraries required for link
#

DYNAMIC_LIBS = \
        -lopsec \
        -lcpsic \
        -lsicauth -lsic \
        -lcp_policy \
        -lskey \
        -lndb \
        -lckpssl -lcpcert \
        -lcpcryptutil -lcpprng \
        -lcpbcrypt -lcpca \
        -lcpopenssl \
        -lEncode -lComUtils \
        -lResolve -lDataStruct \
        -lOS -lEventUtils -lResolver \
        -lcpprod50

#
# set system libraries and CFLAGS
#

LIBS = -lthread -lposix4 -lresolv -lsocket -lnsl -ldl -lintl -lm -lc -lw -lkstat -lkvm -lelf

CFLAGS += -g -DDEBUG -DUNIXOS -I$(PKG_DIR)/include

#
# compilations and link commands
#

#$(ARCH) %.o: %.c # $(CC) $(CFLAGS) -c -o $@ $*.c


$(EXE_NAME): $(OBJ_FILES)
        $(LD) $(CFLAGS)  -L$(LIB_DIR) -o $@ $(OBJ_FILES) $(STATIC_LIBS) $(LIBS)

$(EXE_NAME_DYN): $(OBJ_FILES)
        $(LD) $(CFLAGS)  -L$(LIB_DIR_DYN) -o $@ $(OBJ_FILES) $(DYNAMIC_LIBS) $(LIBS)


clean:
        rm *.o $(EXE_NAME) $(EXE_NAME_DYN)





And this is what I see at compile/link time :

{180} : make
gcc -g -DDEBUG -DUNIXOS -I../../../../sdk_devel/pkg_rel/include -L../../../../sdk_devel/pkg_rel/lib/release.static -o lea_filter lea_filter.o -lopsec -lsicauth -lsic -lcp_policy -lskey -lndb -lckpssl -lcpcert -lcpcryptutil -lcpprng -lcpbcrypt -lcpca -lasn1cpp -lcpopenssl -lEncode -lComUtils -lResolve -lDataStruct -lOS -lcpprod50 -lAppUtils -lEventUtils -lCPMIBase501 -lCPMIClient501 -lCPSrvIS -lEncode -lResolver -lcp_policy -lcpcert -lcpprng -llogfilter -lobjlibclient -lopsecext -lthread -lposix4 -lresolv -lsocket -lnsl -ldl -lintl -lm -lc -lw -lkstat -lkvm -lelf Undefined first referenced
 symbol                             in file
c::c(N6, (int0_t)) ../../../../sdk_devel/pkg_rel/lib/release.static/libckpssl.a(ckpssl_rsakeys.o) uniq_id_get_object ../../../../sdk_devel/pkg_rel/lib/release.static/libEventUtils.a(Reactor.o) uniq_id_iterate ../../../../sdk_devel/pkg_rel/lib/release.static/libEventUtils.a(Reactor.o) __1cG__CrunSregister_exit_code6FpG_v_v_ ../../../../sdk_devel/pkg_rel/lib/release.static/libsicauth.a(sslca_cache.o) uniq_id_add_object ../../../../sdk_devel/pkg_rel/lib/release.static/libEventUtils.a(Reactor.o) __1c2k6Fpv_v_ ../../../../sdk_devel/pkg_rel/lib/release.static/libsicauth.a(auth_sslca_obj.o) __1cG__CrunKpure_error6F_v_ ../../../../sdk_devel/pkg_rel/lib/release.static/libcpcert.a(fwPubKey.o) __1cG__CrunMex_rethrow_q6F_v_ ../../../../sdk_devel/pkg_rel/lib/release.static/libsicauth.a(auth_sslca_obj.o) uniq_id_increase_table ../../../../sdk_devel/pkg_rel/lib/release.static/libEventUtils.a(Reactor.o) __1cG__CrunIex_alloc6FI_pv_ ../../../../sdk_devel/pkg_rel/lib/release.static/libAppUtils.a(RTComm.o) uniq_id_del_object ../../../../sdk_devel/pkg_rel/lib/release.static/libEventUtils.a(Reactor.o) c::c(n6, (int0_t)) ../../../../sdk_devel/pkg_rel/lib/release.static/libsicauth.a(auth_sslca_obj.o) __1cG__CrunIex_throw6Fpvpkn0AQstatic_type_info_pF1_v_v_ ../../../../sdk_devel/pkg_rel/lib/release.static/libAppUtils.a(RTComm.o) uniq_id_create_table ../../../../sdk_devel/pkg_rel/lib/release.static/libEventUtils.a(Reactor.o) __1c2K6Fpv_v_ ../../../../sdk_devel/pkg_rel/lib/release.static/libckpssl.a(ckpssl_rsakeys.o) uniq_id_destroy_table ../../../../sdk_devel/pkg_rel/lib/release.static/libEventUtils.a(Reactor.o)
ld: fatal: Symbol referencing errors. No output written to lea_filter
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `lea_filter'


I know this is a pretty simple compiler/linker issue, but I'm
stuffed if I can track down the "c::c" symbol in any of
the static or dynamic libraries in the OPSEC kit.  The other
stuff I can probably (eventually) get to link in the right
order (does linking order matter anymore?  I'm using gcc 2.95.2).
I've got all the static libraries in the link list, so I
can't see why they wouldn't be showing up.  I don't -think-
I need to link the static and dynamic libraries?

Does anyone have a working makefile to compile this (or
any other of the OPSEC examples?) on Solaris or Linux?

thanks

Carl

_______________________________________________
firewall-wizards mailing list
firewall-wizards () nfr com
http://list.nfr.com/mailman/listinfo/firewall-wizards


Current thread: