You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Kirk Rasmussen <kr...@lucasfilm.com> on 2000/09/26 19:25:38 UTC

mod_jk.so build problems with SunOS 5.8

Hi,
I've been able to successfully build a workable mod_jk.so (tomcat v3.2beta4)
binary for Solaris SunOS 5.8 however not by using apxs.  The apxs utility
will build it ok but apache crashes at startup with no error messages and no
core dump.  I did have to deviate from the mod_jk directions a bit to get
past a C #define and dynamic link problem:

apxs -lrt -DSOLARIS -I/usr/java1.1/include -I/usr/java1.1/include/solaris -I
../jk/ -o mod_jk.so -c *.c ../jk/*.c

Without the -lrt option I would get a run-time error while starting up
apache of fdatasync symbol not being found.  The function seems to be in
/usr/lib/librt.so according to the MAN page.  The ldd application shows the
following after building:
ldd mod_jk.so
	librt.so.1 =>	 /usr/lib/librt.so.1
	libaio.so.1 =>	 /usr/lib/libaio.so.1
	libc.so.1 =>	 /usr/lib/libc.so.1
	libdl.so.1 =>	 /usr/lib/libdl.so.1
	/usr/platform/SUNW,Ultra-250/lib/libc_psr.so.1

I'm sort of new to UNIX but this leads me to believe that every symbol
resolved correctly.  The strange thing is I get the same result w/o the -lrt
option but during run-time I get the unresolved symbol error.  Any ideas?

In order to get a working mod_jk.so file I had to use the Makefile.linux
file and tweak it a little for Solaris.  BTW I noticed that apxs is using
gcc for compiling and linking but the Makefile uses cc and ld.  It works but
the mod_jk.so is MUCH larger (almost 6x) than the one generated by apxs.  Is
is statically linking the librt.so library?  

Obviously I (we) would prefer to use the apxs for building Apache modules.
Any ideas?  


Here is the updated makefile:
 
## You need to edit this file - configure later :-)

APACHE_HOME=/usr/local/apache
OS=solaris
APXS=${APACHE_HOME}/bin/apxs

A13_FLAGS=-I${APACHE_HOME}/include

## I assume this one is set up already
JAVA_HOME=/usr/java1.1

JAVA_INCL=-I${JAVA_HOME}/include -I${JAVA_HOME}/include/${OS}
JAVA_LIB=-L${JAVA_HOME}/jre/lib/${ARCH}
-L${JAVA_HOME}/lib/${ARCH}/native_threads

CFLAGS=-DHAVE_CONFIG_H -g -fpic  -DSHARED_MODULE -O2 -D_REENTRANT -pthread
-DLINUX -Wall

JK=../jk/
SRCS=jk_ajp12_worker.c jk_connect.c jk_msg_buff.c jk_util.c jk_ajp13.c \
     jk_jni_worker.c jk_pool.c jk_worker.c jk_ajp13_worker.c jk_lb_worker.c
\
     jk_sockbuf.c  jk_map.c jk_uri_worker_map.c          


OBJS=${patsubst %.c,%.o,${SRCS}}

%.o: ../jk/%.c 
	${CC} -c ${CFLAGS} ${JAVA_INCL} ${A13_FLAGS} $< -o $@ 

.c.o:
	${CC} -c ${CFLAGS} ${JAVA_INCL} ${A13_FLAGS} -I../jk $<

all: mod_jk.so

mod_jk.so: ${OBJS} mod_jk.o
	$(CC) -shared -lrt -o mod_jk.so ${OBJS} mod_jk.o

clean:
	rm *.o *.so



Re: mod_jk.so build problems with SunOS 5.8

Posted by Brian P Millett <bp...@ec-group.com>.
Kirk Rasmussen wrote:

> CFLAGS=-DHAVE_CONFIG_H -g -fpic  -DSHARED_MODULE -O2 -D_REENTRANT -pthread
> -DLINUX -Wall
>

Don't you mean     -DSOLARIS

--
Brian Millett
Enterprise Consulting Group   "Shifts in paradigms
(314) 205-9030               often cause nose bleeds."
bpm@ec-group.com                           Greg Glenn