Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 38357 - sysklogd compile fails with 2.6 headers
Summary: sysklogd compile fails with 2.6 headers
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Tim Yamin (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on: 31285
Blocks:
  Show dependency tree
 
Reported: 2004-01-15 16:56 UTC by Matt Taylor
Modified: 2004-02-07 16:43 UTC (History)
2 users (show)

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


Attachments
Initial header patch (sysklogd-2.6headers-initial.patch,7.42 KB, patch)
2004-01-19 12:46 UTC, Tim Yamin (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Taylor 2004-01-15 16:56:32 UTC
# emerge sysklogd
Calculating dependencies ...done!
>>> emerge (1 of 1) app-admin/sysklogd-1.4.1-r10 to /
>>> md5 src_uri ;-) sysklogd-1.4.1.tar.gz
>>> Unpacking source...
>>> Unpacking sysklogd-1.4.1.tar.gz to /var/tmp/portage/sysklogd-1.4.1-r10/work
 * Applying sysklogd-1.4.1-SO_BSDCOMPAT.patch...                                         [ ok ]
>>> Source unpacked.
gcc  -march=athlon -O3 -pipe -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce -DSYSLOG_INET -DSYSLOG_UNIXAF -DNO_SCCS -DFSSTND -DSYSLOGD_PIDNAME=\"syslogd.pid\"  -c syslogd.c
gcc  -march=athlon -O3 -pipe -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce -c pidfile.c
gcc  -march=athlon -O3 -pipe -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce -DFSSTND   -c klogd.c
gcc  -march=athlon -O3 -pipe -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce -DALLOW_KERNEL_LOGGING -c syslog.c
gcc  -march=athlon -O3 -pipe -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce -DFSSTND  -c ksym.c
gcc  -march=athlon -O3 -pipe -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce -DFSSTND  -c ksym_mod.c
In file included from /usr/include/linux/sched.h:12,
                 from /usr/include/linux/module.h:10,
                 from ksym_mod.c:96:
/usr/include/linux/jiffies.h:16: error: syntax error before "jiffies_64"
/usr/include/linux/jiffies.h:20: error: syntax error before "get_jiffies_64"
gcc  -o syslogd syslogd.o pidfile.o
In file included from /usr/include/linux/sched.h:21,
                 from /usr/include/linux/module.h:10,
                 from ksym_mod.c:96:
/usr/include/asm/mmu.h:13: error: field `sem' has incomplete type
In file included from /usr/include/linux/signal.h:6,
                 from /usr/include/linux/sched.h:25,
                 from /usr/include/linux/module.h:10,
                 from ksym_mod.c:96:
/usr/include/asm/signal.h:29: error: conflicting types for `sigset_t'
/usr/include/sys/select.h:38: error: previous declaration of `sigset_t'
/usr/include/asm/signal.h:158: error: redefinition of `struct sigaction'
/usr/include/asm/signal.h:173: error: redefinition of `struct sigaltstack'
In file included from /usr/include/asm/siginfo.h:4,
                 from /usr/include/linux/signal.h:7,
                 from /usr/include/linux/sched.h:25,
                 from /usr/include/linux/module.h:10,
                 from ksym_mod.c:96:
/usr/include/asm-generic/siginfo.h:7: error: redefinition of `union sigval'
/usr/include/asm-generic/siginfo.h:35: error: redefinition of `struct siginfo'
/usr/include/asm-generic/siginfo.h:70: error: syntax error before "clock_t"
/usr/include/asm-generic/siginfo.h:87: error: syntax error before '}' token
/usr/include/asm-generic/siginfo.h:88: error: syntax error before '}' token
/usr/include/asm-generic/siginfo.h:242: error: redefinition of `struct sigevent'
In file included from /usr/include/linux/sched.h:29,
                 from /usr/include/linux/module.h:10,
                 from ksym_mod.c:96:
/usr/include/linux/completion.h:15: error: syntax error before "wait_queue_head_t"
/usr/include/linux/completion.h: In function `init_completion':
/usr/include/linux/completion.h:26: error: dereferencing pointer to incomplete type
/usr/include/linux/completion.h:27: error: dereferencing pointer to incomplete type
In file included from /usr/include/linux/sched.h:30,
                 from /usr/include/linux/module.h:10,
                 from ksym_mod.c:96:
/usr/include/linux/pid.h: At top level:
/usr/include/linux/pid.h:18: error: field `task_list' has incomplete type
/usr/include/linux/pid.h:19: error: field `hash_chain' has incomplete type
/usr/include/linux/pid.h:24: error: field `pid_chain' has incomplete type
In file included from /usr/include/linux/sched.h:102,
                 from /usr/include/linux/module.h:10,
                 from ksym_mod.c:96:
/usr/include/linux/timer.h:11: error: field `entry' has incomplete type
In file included from ksym_mod.c:96:
/usr/include/linux/module.h:190: error: field `list' has incomplete type
ksym_mod.c:98: warning: `struct kernel_sym' declared inside parameter list
ksym_mod.c:98: warning: its scope is only this definition or declaration, which is probably not what you want
ksym_mod.c:140: error: field `module_info' has incomplete type
ksym_mod.c: In function `InitMsyms':
ksym_mod.c:209: warning: passing arg 1 of `get_kernel_syms' from incompatible pointer type
ksym_mod.c:223: error: invalid application of `sizeof' to an incomplete type
ksym_mod.c:231: warning: passing arg 1 of `get_kernel_syms' from incompatible pointer type
ksym_mod.c:247: error: dereferencing pointer to incomplete type
ksym_mod.c:247: error: dereferencing pointer to incomplete type
ksym_mod.c:254: error: increment of pointer to unknown structure
ksym_mod.c:254: error: arithmetic on pointer to an incomplete type
ksym_mod.c: In function `LookupModuleSymbol':
ksym_mod.c:583: error: structure has no member named `size'
ksym_mod.c:608: error: structure has no member named `size'
ksym_mod.c:620: error: structure has no member named `size'
make: *** [ksym_mod.o] Error 1

!!! ERROR: app-admin/sysklogd-1.4.1-r10 failed.
!!! Function src_compile, Line 36, Exitcode 2
!!! (no error message)


Reproducible: Always
Steps to Reproduce:




Portage 2.0.49-r21 (default-x86-1.4, gcc-3.3.2, glibc-2.3.3_pre20031222-r0,
2.4.22-gentoo-r2)
=================================================================
System uname: 2.4.22-gentoo-r2 i686 AMD Athlon(tm) processor
Gentoo Base System version 1.4.3.12
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon -O3 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=athlon -O3 -pipe -fomit-frame-pointer"
DISTDIR="/mnt/linuxback/portage/distfiles"
FEATURES="autoaddcvs ccache digest sandbox strict userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/mnt/linuxback/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="3dnow X apm avi berkdb crypt cups dvd encode foomaticdb gdbm gif gnome gpm
gtk gtk2 imlib jpeg libg++ libwww mad mikmod mmx motif mpeg ncurses nptl
oggvorbis opengl oss pam pdflib perl pic png python readline sdl slang spell ssl
svga tcpd truetype x86 xml2 xmms xv zlib"
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2004-01-19 09:36:18 UTC
Phosphan, had a look yet?  Ill only get to it in a few days.
Comment 2 Tim Yamin (RETIRED) gentoo-dev 2004-01-19 12:45:26 UTC
I've had a look at the source, and at the headers, and things look quite nasty. Firstly, your first problems occur with jiffies.h [ 2.4 " Why did it work? " reason: it wasn't there before... ]: although that can be fixed by doing some hacky types.h redefinitions.

Then eventually you hit some problems on <linux/time.h> and <linux/types.h>: these can be resolved as well. You'll enter redefinition hell with <asm/siginfo.h> as well; but that can also be fixed, although the code is quite messy for that.

I'll attach a diff for both the headers and the C file. It's messy, but it works - it's incompatible with 2.4 headers, or even 2.6 headers so I've #ifdef'ed sections out to make sure the right headers are being used.

The problem is that even though I've managed to fix the headers, the whole thing needs rewriting for 2.6 as quite a few structures are just no longer there in 2.6: ``size'', ``get_kernel_syms'' and ``module_info'' are just some examples - if somebody could find me some API documentation for the new 2.6 module system I'd be happy to rewrite the code but I can't find anything so far so I'm stuck...
Comment 3 Tim Yamin (RETIRED) gentoo-dev 2004-01-19 12:46:21 UTC
Created attachment 24093 [details, diff]
Initial header patch
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2004-01-25 04:57:09 UTC
Err, got confused with names there it seems =)

Anyhow a few issues:
1) Is '#include <asm/mach-generic/mach_mpspec.h>' the only way to fix
that issue?
2) How about just using LINUX_VERSION_CODE, and not adding GENTOO_26_CODE?
3) This:
--
-extern u64 jiffies_64;
+extern unsigned long long jiffies_64;
--
Won't it work with __u64?

For the rest I cannot see another way, and it 
Comment 5 Tim Yamin (RETIRED) gentoo-dev 2004-01-25 06:44:06 UTC
1: I think so. It's a generic header; thus it should work properly. I think the way it's done in the kernel is to have the mach locations defined at maketime, but as mach-generic is generic and will probably always be there, I don't see any problems with it.

2: No; because that tests for our patchset that can happily compile and that it's OK to do those fixes; the kernel level is needed later on for one if the #ifndefs.

3: In fact, I think there is: shifting the __u64 code out of the "#ifdef KERNEL" and removing that __STRICT_ANSI__ as well [ not sure why it's there; it won't conflict with anything, I think ] for asm-* and changing u64 -> __u64 would probably do it.

> For the rest I cannot see another way, and it 

4: Not sure what to reply to that, you forgot to finish your sentence. I'll try and get the sysklogd code a rewrite some time next week...
Comment 6 Tim Yamin (RETIRED) gentoo-dev 2004-02-07 16:43:18 UTC
OK, fixed in CVS. Thanks.