You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Pier P. Fumagalli" <pi...@betaversion.org> on 2001/07/28 20:22:41 UTC

FW: Problems building mod_webapp on Solaris

As requested by Eryq... :)

    Pier


------ Forwarded Message
From: Eryq <er...@zeegee.com>
Organization: ZeeGee Software Inc.
Date: Fri, 27 Jul 2001 15:00:54 -0400
To: Pier Fumagalli <pi...@sun.com>
Subject: Re: Problems building mod_webapp on Solaris

Ok, I figured it out, but this took a lot of
detective work:

When I built Apache originally, it was with the
Sun C compiler.  Apparently, configure decided
that I couldn't build shared libraries.

Which meant that the "apxs" script, which gets
info from Makefile.tmpl, did not have the "ld"
command set:

    my $CFG_LD_SHLIB      = q();          # substituted via Makefile.tmpl

Which meant that the configuration of mod_webapp
had an empty value for APXS_LD_SHLIB in
apache_1.3/Makefile.

Which meant that "libtool", when run, instead of
seeing the compilation command:

    ... gcc mod_webapp.lo ...

saw:

    ... mod_webapp.lo ...

and complained that mod_webapp.lo was not executable.
Tracking this down was no joy!!!  :-)

SOLUTION: reconfigure and rebuild everything with
gcc from the get-go, starting with Apache.  Make
sure the CFG_LD_SHLIB variable gets a sensible
value.  

SUGGESTIONS: Have your Makefile die horribly
if certian key variables like $CFG_LD_SHLIB
are empty.  Turn off libtool's --silent, or at
least make it a configuration option (the problems
become a lot easier to spot if you can see
what libtool is doing).

Please please post this to the appropriate mailing list
so that others can find it.  It's a VERY subtle build
problem, and if you've never used libtool or apxs,
you'll never spot it.

By the way, thank you for building/maintaining
such a useful product.  We are very excited about
moving to Catalina; it looks like it will simplify
our development *immensely*.  :-)

[P.S.  Is there any reason that ServerName is
required for Apache/Catalina WARP connectivity?
We have a load balancing system and, for various
reasons, have been running without ServerName until now].

-- 
Eryq, http://www.zeegee.com/eryq
WANTED:  Schrodinger's Cat.  Dead and/or Alive.

------ End of Forwarded Message


Re: RESOLVED: mod_webapp hanging/core-dumping on Solaris

Posted by "Pier P. Fumagalli" <pi...@betaversion.org>.
Thom Park at tpark@borland.com wrote:

> Hello!
> 
> My tuppence worth on one comment here:
> 
>> 1. Always use gcc.  Always use gcc.  Always use gcc.
>  Why?  Because it's the lowest common denominator.
>  Because the developers are building/testing with it.
>  Because ./configure likes it.  Always use gcc.
> 
> Only do this if your absolutely guaranteed that any libraries that you
> link with have not been compiled with Sun's native C++ compiler ;-)
> 
> There is serious grief in store trying to resolve name-mangled symbols
> between gcc and a C++ library (even with extern "C" used).
> 
> I learned this the hardway :(

If there's a problem with Sun's C++, I bet it's in APR (as mod_webapp relies
100% on it). And it can be fixed (here or there). And I don't quite get why
Sun's and GCC aren't interoperable... They should both spit out ELF on
Solaris...

> Apart from that - excellent job on debugging!

FUCK YEAH... (Ok, I can be somehow happy at this point)

Guys, we need to shoot at the bug I filed today... #2933... It's the only
step which still forbids me to put out a beta-1... :) Can you please check
if it's my setup or it can be reproduced also on yours?

    Pier


RE: RESOLVED: mod_webapp hanging/core-dumping on Solaris

Posted by Thom Park <tp...@borland.com>.
Hello!

My tuppence worth on one comment here:

>1. Always use gcc.  Always use gcc.  Always use gcc.
   Why?  Because it's the lowest common denominator.
   Because the developers are building/testing with it.
   Because ./configure likes it.  Always use gcc.

Only do this if your absolutely guaranteed that any libraries that you
link with have not been compiled with Sun's native C++ compiler ;-)

There is serious grief in store trying to resolve name-mangled symbols
between gcc and a C++ library (even with extern "C" used).

I learned this the hardway :(

Apart from that - excellent job on debugging!

-Thom


Re: RESOLVED: mod_webapp hanging/core-dumping on Solaris

Posted by "Pier P. Fumagalli" <pi...@betaversion.org>.
YEAH! I know there was something wrong with your Apache installation...
Now, we shouldn't have problems also with SHARED_CORE, but now at least I
know what to tackle...

Can you do me another favor and confirm (or not) bug # 2933?

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2933

Thanks :)

    Pier


Eryq at eryq@zeegee.com wrote:

> When Pier told me that he'd never seen libhttpd.ep in his
> own Apache directory, that gave me the first clue: my
> Apache was somehow different from other Solaris builds.
> 
> Here's why.
> Pursuant to this document: http://httpd.apache.org/docs/dso.html
> I did this:
> 
> ./configure --enable-rule=SHARED_CORE ...
> 
> My advice: DO NOT DO THIS, at least not on Solaris with gcc.
> Solaris dynaloading works fine without it.
> For the benefit of others, here is my setup.
> I set up this environment (tcsh syntax):
> 
> setenv CC gcc
> setenv LD_SHLIB gcc
> setenv CFLAGS "-g -fPIC"
> setenv CFLAGS_SHLIB "-g -fPIC"
> 
> Then ran this Apache config:
> 
> ./configure \
> "--with-layout=Apache" \
> "--prefix=/export/home/cs/depot/package/apache_1.3.20" \
> "--enable-module=rewrite" "--enable-shared=rewrite" \
> "--enable-module=so" \
> "$@"
> 
> Then a "make" and "make install".
> The produces a libexec directory containing:
> 
> httpd.exp
> mod_rewrite.so
> 
> I then used "apxs -g" to create a bogus little loadable
> against this, and installed it.  It worked fine.
> Finally, on to mod_webapp.so, and that worked fine.
> 
> LESSONS LEARNED, for the benefit of those whose
> warp connections are causing core dumps:
> 
> 1. Always use gcc.  Always use gcc.  Always use gcc.
>  Why?  Because it's the lowest common denominator.
>  Because the developers are building/testing with it.
>  Because ./configure likes it.  Always use gcc.
> 
> 2. Remember that ./configure scripts pay attention
>  to **environment variables** as well as command-line
>  options.  This is evil and confusing, but that's
>  reality for you.  Setenv CC, LD, etc.
> 
> a. Use gcc as the linker, not ld.
> b. Make sure -fPIC is in the CFLAGS.
> 
> 3. Look at "apxs" and make sure it matches those
>  aforementioned environment variables EXACTLY.
>  Especially look at the "LD" variables.
> 
> 4. You don't need to use SHARED_CORE on Solaris 5.8
>  with mod_webapp.
> 
> 5. After the 3rd recompile, "rm -rf" and start over.
>  You never know what garbage is lying around
>  that "make distclean" didn't get rid of.
> 
> Perhaps some of these advicelets are unnecessary,
> but the combination worked for me.
> Thanks to all who helped.
> 
> Eryq


RESOLVED: mod_webapp hanging/core-dumping on Solaris

Posted by Eryq <er...@zeegee.com>.
When Pier told me that he'd never seen libhttpd.ep in his
own Apache directory, that gave me the first clue: my
Apache was somehow different from other Solaris builds.

Here's why.
Pursuant to this document: http://httpd.apache.org/docs/dso.html
I did this:

	./configure --enable-rule=SHARED_CORE ...

My advice: DO NOT DO THIS, at least not on Solaris with gcc.
Solaris dynaloading works fine without it.
For the benefit of others, here is my setup.
I set up this environment (tcsh syntax):

	setenv CC gcc
	setenv LD_SHLIB gcc
	setenv CFLAGS "-g -fPIC"
	setenv CFLAGS_SHLIB "-g -fPIC"

Then ran this Apache config:

	./configure \
	"--with-layout=Apache" \
	"--prefix=/export/home/cs/depot/package/apache_1.3.20" \
	"--enable-module=rewrite" "--enable-shared=rewrite" \
	"--enable-module=so" \
	"$@"

Then a "make" and "make install".
The produces a libexec directory containing:

	httpd.exp
	mod_rewrite.so

I then used "apxs -g" to create a bogus little loadable
against this, and installed it.  It worked fine.
Finally, on to mod_webapp.so, and that worked fine.

LESSONS LEARNED, for the benefit of those whose
warp connections are causing core dumps:

1. Always use gcc.  Always use gcc.  Always use gcc.
   Why?  Because it's the lowest common denominator.
   Because the developers are building/testing with it.
   Because ./configure likes it.  Always use gcc.

2. Remember that ./configure scripts pay attention
   to **environment variables** as well as command-line
   options.  This is evil and confusing, but that's
   reality for you.  Setenv CC, LD, etc.

	a. Use gcc as the linker, not ld.
	b. Make sure -fPIC is in the CFLAGS.

3. Look at "apxs" and make sure it matches those
   aforementioned environment variables EXACTLY.
   Especially look at the "LD" variables.

4. You don't need to use SHARED_CORE on Solaris 5.8
   with mod_webapp.

5. After the 3rd recompile, "rm -rf" and start over.
   You never know what garbage is lying around
   that "make distclean" didn't get rid of. 

Perhaps some of these advicelets are unnecessary,
but the combination worked for me.
Thanks to all who helped. 

Eryq