Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 32444 - apache 2.0.48 fails to compile because SCTP_NODELAY undeclared
Summary: apache 2.0.48 fails to compile because SCTP_NODELAY undeclared
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Web Application Packages Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-31 23:34 UTC by James Cloos
Modified: 2003-12-03 15:01 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
pre-caches failed sctp support (apache-ebuild-sctp.diff,655 bytes, patch)
2003-12-03 11:35 UTC, Blu3
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Cloos 2003-10-31 23:34:57 UTC
~x86, gcc is 3.3.2-r2, glibc is 2.3.2-r8, kernel is clone of linus' bk repo.
Upgrading from apache 2.0.47.

Apache sees that sctp is available, but the compile dies with:

sockopt.c: In function `apr_socket_opt_set':
sockopt.c:257: error: `SCTP_NODELAY' undeclared (first use in this function)
sockopt.c:257: error: (Each undeclared identifier is reported only once
sockopt.c:257: error: for each function it appears in.)
make[4]: *** [sockopt.lo] Error 1
make[4]: Leaving directory `/home/portage/portage/apache-2.0.48/work/httpd-2.0.48/srclib/apr/network_io/unix'


SCTP_NODELAY is defined in /usr/src/linux/include/net/sctp/user.h which is included by /usr/src/linux/include/net/sctp/constants.h, which is included
by /usr/src/linux/include/net/sctp/sctp.h, among others.

I tried putting the /usr/src/linux/include/net/ tree at /usr/include/net
and symlinking sctp.h into /usr/include/netinet, based on what apr looks for, but that did not succeed.

A test of manually running gcc (same args as libtool as invoked by make, but with -save-temps instead of -pipe) shows (in sockopt.i) that sctp.h is not included, hense the failure of my attempt to fix....

Any ideas?
Comment 1 James Cloos 2003-11-01 02:56:09 UTC
After more research I figured out a solution.

Something in the current glibc or kernel triggers apache's sctp support,
but the usermode lib and includes are not installed anywhere.

Solution is to grab the latest release from lksctp.sf.net (a simple econf;emake;einstall
ebuild is all it needs) and install that.  Then apache compiles happily,
presumably with sctp support.
Comment 2 Martin Holzer (RETIRED) gentoo-dev 2003-11-02 07:33:52 UTC
2.0.48 too ?
Comment 3 SpanKY gentoo-dev 2003-11-03 11:05:04 UTC
uhh i wouldnt mess around with /usr/include/{net,netinet} ... those are santized
glibc provider header files which are meant to be the interface between userspace
and the kernel ...

ive seen similar problems with signal.h ... that is, glibc defines the macro
__attribute_used__ as does the linux-2.6 header files ... but the 2.6 header
files dont check to see if __attribute_used__ is already defined so it causes
gcc to print warnings which sometimes causes configure tests to fail ...

if you wish to mess around with 2.6.x header files, then *only* do so with
linux/ and asm/, NEVER touch any other directory ... if you do, the broken
pieces are yours to put together ;)

for now, remove your 2.6.x header files from /usr/include and use the 2.4.x
header files ... if apache emerges just fine, then replace your linux/ and
asm/ directories with links to the 2.6.x header files ... if apache then
fails, edit the linux/compilter-gcc*.h files and put #ifdef macro's around
the __attribute_used__ definition and see if apache works ...

if the answer is 'yep, apache works fine', then from the gentoo stand point
the answer is 'if you use 2.6.x header files then it's your problem to fix
bugs' :)
Comment 4 James Cloos 2003-11-03 14:44:56 UTC
re changing /usr/include:

I did undo the manual changes I made; those were just for testing.
I'll be leaving the rest of it as the glibc et al ebuilds put it.

As for the SCTP_NODELAY bug, the problem is that apr sees sctp support even
though lksctp is not installed.  Installing lksctp is the fix.

I installed  mirror://sourceforge/lksctp/lksctp-tools-2.6.0-test7-0.7.4.tgz
and apache compiled fine.  (I didn't do an ebuild for it, but it is a simple
econf;emake;einstall ebuild; nothing special is required.)
Comment 5 Blu3 2003-11-28 16:16:00 UTC
Please fix the basic Gentoo system so Apache2 will compile and install.  It doesn't work on 2.4-gentoo compiled system nor does it compile with kernel 2.6 headers (for other reasons)
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-28 18:45:59 UTC
the core problem boils down to the fact that your kernel headers in /usr/include{asm,linux} don't match the version for your kernel. This is _very_ important in general. If you are running a 2.6 kernel, then 2.6 headers should be there, and glibc should be compiled for a 2.6 kernel.

I've put in a workaround for the moment that tells apache2 that SCTP is _not_ present, but this will need to be revisited when we start support SCTP (with the 2.6 release).
Comment 7 Blu3 2003-12-01 10:47:09 UTC
Has anybody built a sanitised set of linux-2.6 headers for /usr/include yet?  Copying the files from the /usr/src/linux-xxx results in a mess since a lot of things won't compile and trying to get any help from linux-kernel results in you getting your head ripped off since it's "not their job" to sanitize the headers for userspace.

p.s. copying 2.6 headers to /usr/include doesn't work.
Comment 8 SpanKY gentoo-dev 2003-12-01 10:50:37 UTC
no one has made sanitized 2.6 headers

and i dont know about your claim that 2.6 headers breaks 'a mess of things' ...
it seems that the only real breakage atm is fbconsole ... maybe a few cd related stuff (usually only with kde though) ...
Comment 9 Blu3 2003-12-03 09:00:20 UTC
How best to explain.. replace your /usr/includes with 2.6.0 headers, try recompiling your machine.  base stuff usually works.  most multimedia stuff has problems, from small to large.  it's getting better as some packages are fixed (think modversions.h vs. modsetver.h change) and _some_ kernel developers are sensible and write their headers sensibly.

getting back to the subject on hand, what fix is in to fool apache2?  it still fails on SCTP_NODELAY with the latest of gentoo-sources or 2.6 and fresh syncs.
Comment 10 Blu3 2003-12-03 09:56:48 UTC
# grep sctp /var/tmp/portage/apache-2.0.48-r1/work/httpd-2.0.48/config.cache
ac_cv_header_netinet_sctp_h=${ac_cv_header_netinet_sctp_h=no}
ac_cv_header_netinet_sctp_uio_h=${ac_cv_header_netinet_sctp_uio_h=no}
ac_cv_sctp=${ac_cv_sctp=yes}


notice the last line.  apache still thinks sctp is available.
Comment 11 Blu3 2003-12-03 10:04:06 UTC
# emerge apache

<configure process running>
...
checking if SCTP protocol is supported... yes
...
compile fails
Comment 12 SpanKY gentoo-dev 2003-12-03 10:06:10 UTC
to be honest, i dont think any work is/will be done about this ... perhaps if you
do a lot of the legwork ? ;)

i havent had any problems emerging apache-2.x while using 2.6.x header files ...
but then again, perhaps my installation isnt trying to enable the same options as
yours ...
Comment 13 SpanKY gentoo-dev 2003-12-03 10:43:59 UTC
my machines:
checking if SCTP protocol is supported... no   
and compile works ;)
Comment 14 Blu3 2003-12-03 11:35:14 UTC
Created attachment 21643 [details, diff]
pre-caches failed sctp support

A better fix that actually works ;)

Use:

   echo 'ac_cv_sctp=${ac_cv_sctp=no}' >> ${S}/config.cache
Comment 15 Blu3 2003-12-03 11:44:41 UTC
Just an explanation of things for the record.

In short, the includes were found fine so configure attempted to compile a test program.  Test program worked fine.  Problem is that the SCTP_NODELAY isn't used in the test program so it didn't fail.  That's defined elsewhere in the headers, not in the headers used in the test program.

Thus precaching the global sctp setting instead of the headers setting was more effective.  The configure test procedure tried to be intelligent about things..just didn't have enough data in the test.
Comment 16 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-12-03 15:01:07 UTC
ok blu3, i've added your other fix there.