tags:

views:

25

answers:

1

I get following error:

ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `libtcnative-1.la'
Current working directory /yogeshk/tomcat-native-1.1.16-src/jni/native
*** Error code 1
The following command caused the error:
otarget=`echo all-recursive | sed s/-recursive//`; \
list='src os/unix '; \
for i in $list; do \
    if test -f "$i/Makefile"; then \
        target="$otarget"; \
        echo "Making $target in $i"; \
        if test "$i" = "."; then \
            made_local=yes; \
            target="local-$target"; \
        fi; \
        (cd $i && make $target) || exit 1; \
    fi; \
done; \
        if test "$otarget" = "all" && test -z "libtcnative-1.la"; then \
    made_local=yes; \
fi; \
if test "$made_local" != "yes"; then \
    make "local-$otarget" || exit 1; \
fi
make: Fatal error: Command failed for target `all-recursive'

I have downloaded and compiled APR and OpenSSL libraries. And following ./configure command ran successfully.

./configure  --with-java-home=/yogeshk/jdk64build/jdk --with-apr=/yogeshk/apr --with-ssl=/yogeshk/openssl
A: 

Looks like an option is missing. "man gcc" shows:

 -mimpure-text
     -mimpure-text, used in addition to -shared, tells the
     compiler to not pass -z text to the linker when linking
     a shared object.  Using this option, you can link
     position-dependent code into a shared object.

     -mimpure-text suppresses the ``relocations remain
     against allocatable but non-writable sections'' linker
     error message.  However, the necessary relocations will
     trigger copy-on-write, and the shared object is not
     actually shared across processes.  Instead of using
     -mimpure-text, you should compile all source code with
     -fpic or -fPIC.

     This option is only available on SunOS and Solaris.
jlliagre
where do I add -fPIC option, to make or while configuring ?
YoK
I would just edit the generated Makefiles and add -fPIC where it is missing.
jlliagre