Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 42527 - sash-3.6 won't compile against linux-headers-2.6
Summary: sash-3.6 won't compile against linux-headers-2.6
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Tim Yamin (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-22 16:12 UTC by Marc Doughty
Modified: 2004-06-04 18:03 UTC (History)
1 user (show)

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


Attachments
Patch that allows compiling of sash-3.7 on amd64 with linux-headers 2.6 (sash-amd64.patch,345 bytes, patch)
2004-04-27 02:36 UTC, Mikko Tiihonen
Details | Diff
Patch [ See relevant comment... ] (linux-headers-2.6.5-nonSMPExtFS.patch,1.31 KB, patch)
2004-05-11 12:05 UTC, Tim Yamin (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Doughty 2004-02-22 16:12:08 UTC
I unmasked a few packages to build a 'system of the future', when the base is built from 2.6.* headers,  sash-3.6 won't compile. Observed with gcc-3.2.3 and 3.3.3, GLIBC-2.3.2-r9 with NPTL on.

observed against kernel-headers 2.6.1 and 2.6.3.

Also se bug #41675, I think this might be the actual source of the problem.

###

gcc -O2 -pipe -fomit-frame-pointer -mcpu=750 -Wall -Wmissing-prototypes -DHAVE_GZIP=1 -DHAVE_LINUX_ATTR=1 -DHAVE_LINUX_MOUNT=1 -DHAVE_BSD_MOUNT=0 -DMOUNT_TYPE='"ext3"' -DHAVE_READLINE   -c -o cmd_chattr.o cmd_chattr.c
In file included from /usr/include/linux/percpu_counter.h:11,
                 from /usr/include/linux/ext2_fs_sb.h:20,
                 from /usr/include/linux/ext2_fs.h:20,
                 from cmd_chattr.c:15:
/usr/include/linux/percpu.h: In function `__alloc_percpu':
/usr/include/linux/percpu.h:45: error: `GFP_KERNEL' undeclared (first use in this function)
/usr/include/linux/percpu.h:45: error: (Each undeclared identifier is reported only once
/usr/include/linux/percpu.h:45: error: for each function it appears in.)
make: *** [cmd_chattr.o] Error 1

!!! ERROR: app-shells/sash-3.6 failed.
!!! Function src_compile, Line 31, Exitcode 2
!!! (no error message)

./mpd-stager: error: Stage 3 build failure
Comment 1 SpanKY gentoo-dev 2004-02-22 16:22:21 UTC
update your kernel headers

*** This bug has been marked as a duplicate of 35784 ***
Comment 2 Marc Doughty 2004-02-22 17:51:15 UTC
But what I'm trying to say is that I'm compiling this against a 'native' system built this weekend from -2.6.3 headers-. Updating headers isn't possible, I'm building against 'bleeding-edge' headers.

BTW, I'm doing this as part of pre-empting any trouble later, when base systems move to 2.6 headers and start using NPTL.
Comment 3 SpanKY gentoo-dev 2004-02-22 18:01:14 UTC
i said update because you said you used 2.6.1 headers

you *can* update because 2.6.3 is newer than 2.6.1 :P
Comment 4 SpanKY gentoo-dev 2004-02-22 18:07:20 UTC
tim: odd that this works fine on x86 with same exact kernel headers ...

at any rate, cmd_chattr.c includes linux/ext2_fs.h which pulls in linux/ext2_fs_sb.h which pulls in spinlock stuff ...

i think we can #ifdef __KERNEL__ the linux/ext2_fs_sb.h include in linux/ext2_fs.h because the only time that file is needed is in code that already has #ifdef __KERNEL__
Comment 5 Marc Doughty 2004-02-22 18:35:11 UTC
"observed against kernel-headers 2.6.1 and 2.6.3."

just a misunderstanding. I'm doing 2.6.3 builds this weekend, I was the one who actually asked for 2.6.3 headers on Thursday for this specific purpose, to see if the PPC kernel additions made any difference.
Comment 6 Pieter Van den Abeele (RETIRED) gentoo-dev 2004-02-23 02:08:24 UTC
I tried this yesterday on my G5. I observed this sash problem with 2.6.3 headers on ppc too.  
Comment 7 Tim Yamin (RETIRED) gentoo-dev 2004-02-23 08:51:36 UTC
Well, none of these headers have been tried for anything non-X86 because I don't have any PPC hardware :-/

Try adding this at line 3 of /usr/include/linux/percpu.h: "#include <linux/gfp.h>" and see if that helps it.

Mike: Commenting out ext2_fs_sb.h isn't the best thing to do as certain things require them, probably such as sash or ext2fs tools?

Thanks!
Comment 8 Bartosch Pixa (RETIRED) gentoo-dev 2004-02-23 08:56:31 UTC
maybe it's worth looking at the sanitized 2.6 headers the PLD guys are working on.
iirc they are already using them to build their packages on x86/ppc/sparc
Comment 9 SpanKY gentoo-dev 2004-02-23 20:41:33 UTC
that's been covered before and the answer is it's too hard to maintain them so there are no plans to move to them

as for adding linux/gfp.h, that doesnt work:
/usr/include/linux/gfp.h: In function `alloc_pages_node':
/usr/include/linux/gfp.h:69: error: `MAX_ORDER' undeclared (first use in this function)
/usr/include/linux/gfp.h:69: error: (Each undeclared identifier is reported only once

i suggested ifdef-ing out the linux/ext2_fs_sb.h because the only structure defined in it has a member which is a spinlock_t, and we all know that spinlock_t's do not exist in userspace
Comment 10 Marc Doughty 2004-02-23 20:45:57 UTC
Alright, I filed a BUNCH of bugs yesterday of this nature, only to find that my build system was slightly borked. My apologies.

Since then I've cleaned things out and am rebuilding again. The 'sash' bug is real, as is a compile error with mac-fdisk, but I'll be filing a bug for that later as I don't want to stop when I'm so close to a rebuilt system.

In the meantime I've commented-out whatever packages won't compile in my $PORTDIR/profile/<system>/packages file. There's no way mac-fdisk and sash will keep me from a cutting-edge PPC system.
Comment 11 Tim Yamin (RETIRED) gentoo-dev 2004-02-24 09:20:53 UTC
Mike: OK, actually this is because <asm/spinlock.h> only gets included if CONFIG_SMP is set for PPC? Is it [ in /usr/include/linux/autoconf.h ]? Can you just remove the #if CONFIG_SMP #include for <asm/spinlock.h> in <linux/spinlock.h>, that should solve this along with the <linux/gfp.h> addition?
Comment 12 Travis Tilley (RETIRED) gentoo-dev 2004-04-11 15:14:35 UTC
probably a useless comment, but amd64 /also/ needs sanitised headers:

gcc -pipe -O3 -ftracer -pipe -DHAVE_GZIP -DHAVE_EXT2 -DHAVE_READLINE   -c -o cmd_chattr.o cmd_chattr.c
In file included from /usr/include/linux/spinlock.h:16,
                 from /usr/include/linux/blockgroup_lock.h:8,
                 from /usr/include/linux/ext2_fs_sb.h:19,
                 from /usr/include/linux/ext2_fs.h:20,
                 from cmd_chattr.c:15:
/usr/include/asm/processor.h:191: error: syntax error before "u16"
/usr/include/asm/processor.h:193: error: syntax error before "twd"
/usr/include/asm/processor.h:194: error: syntax error before "fop"
/usr/include/asm/processor.h:195: error: syntax error before "rip"
/usr/include/asm/processor.h:196: error: syntax error before "rdp"
/usr/include/asm/processor.h:197: error: syntax error before "mxcsr"
/usr/include/asm/processor.h:198: error: syntax error before "mxcsr_mask"
/usr/include/asm/processor.h:199: error: syntax error before "st_space"
/usr/include/asm/processor.h:200: error: syntax error before "xmm_space"
/usr/include/asm/processor.h:201: error: syntax error before "padding"
/usr/include/asm/processor.h:202: error: syntax error before '}' token
/usr/include/asm/processor.h:205: error: field `fxsave' has incomplete type
/usr/include/asm/processor.h:209: error: syntax error before "u32"
/usr/include/asm/processor.h:211: error: syntax error before "rsp1"
/usr/include/asm/processor.h:212: error: syntax error before "rsp2"
/usr/include/asm/processor.h:213: error: syntax error before "reserved2"
/usr/include/asm/processor.h:214: error: syntax error before "ist"
/usr/include/asm/processor.h:215: error: syntax error before "reserved3"
/usr/include/asm/processor.h:216: error: syntax error before "reserved4"
/usr/include/asm/processor.h:217: error: syntax error before "reserved5"
/usr/include/asm/processor.h:218: error: syntax error before "io_bitmap_base"
/usr/include/asm/processor.h:229: error: syntax error before '}' token
/usr/include/asm/processor.h:254: error: syntax error before "u64"
make: *** [cmd_chattr.o] Error 1

ayanami linux-headers # uname -m
x86_64

i'm using linux-headers 2.6.3-r1, as nothing else allows nptl to compile, and nptl seems to be needed to prevent nautilus 2.6 from segfaulting on amd64 when ntfs or nfs mounts are in /etc/fstab (now is THAT an obscure bug or what?)
Comment 13 SpanKY gentoo-dev 2004-04-12 23:09:08 UTC
upgraded to latest headers and sash works now

thanks tim
Comment 14 Tamran Lengyel 2004-04-17 15:38:17 UTC
OK, perhaps I'm misunderstanding somehow ... but NO 2.6.x version of linux headers will alow ANY version of sash to compile here.  How again is this resolved?

I'm on a dual opteron system (amd64).
Comment 15 Mikko Tiihonen 2004-04-27 02:36:06 UTC
Created attachment 30136 [details, diff]
Patch that allows compiling of sash-3.7 on amd64 with linux-headers 2.6
Comment 16 SpanKY gentoo-dev 2004-05-11 06:43:50 UTC
tim: ok the reason it seems to have 'fixed itself' is because of CONFIG_SMP ...
on x86/ppc it would seem that the default is to define it in autoconf.h which causes
everything to get included properly ...

however, i hit this bug again while messing around on hppa/arm and it's because
the default for them with 2.6.5 headers is to not support SMP
Comment 17 Tim Yamin (RETIRED) gentoo-dev 2004-05-11 12:05:45 UTC
Created attachment 31205 [details, diff]
Patch [ See relevant comment... ]

This should solve the issue; apply the attached patch to your headers and then
change /usr/include/asm/thread_info.h - you need to move the "#define TIF_"
lines [ ignore the _TIF lines ] to the top of the file; just above "#ifdef
__KERNEL__" but below "#define __ASM_FOO_THREAD_INFO_H"...
Comment 18 Pieter Van den Abeele (RETIRED) gentoo-dev 2004-05-12 07:30:41 UTC
With 2.6.5 headers, nptl enabled, gcc3.4 and latest glibc snapshot on ppc32 (dual G5):

In file included from /usr/include/linux/percpu_counter.h:11,
                 from /usr/include/linux/ext2_fs_sb.h:20,
                 from /usr/include/linux/ext2_fs.h:20,
                 from cmd_chattr.c:15:/usr/include/linux/percpu.h: In function `__alloc_percpu':
/usr/include/linux/percpu.h:45: error: `GFP_KERNEL' undeclared (first use in this function)
/usr/include/linux/percpu.h:45: error: (Each undeclared identifier is reported only once
/usr/include/linux/percpu.h:45: error: for each function it appears in.)

make: *** [cmd_chattr.o] Error 1!!! ERROR: app-shells/sash-3.7 failed.!!!

Function src_compile, Line 37, Exitcode 2!!! (no error message)
Comment 19 jack_mort 2004-05-22 04:31:01 UTC
Hi, I had the same compilation issue, and the first patch solved it ! Thanks :-)
Comment 20 SpanKY gentoo-dev 2004-06-01 10:22:35 UTC
2nd patch worked fine over here

ADD IT SUCKA FOO

i need it for the 2.6-only arm ...
Comment 21 Tim Yamin (RETIRED) gentoo-dev 2004-06-04 10:48:26 UTC
In CVS and fixed with linux-headers-2.6.6. This should reach Portage within an hour so if you sync and merge 2.6.6 this issue should go away. If any other architectures are still experiencing this, please reopen this bug. Thanks!
Comment 22 Robert Coie (RETIRED) gentoo-dev 2004-06-04 18:03:43 UTC
Shouldn't sash depend on >=linux-headers-2.6.6 on amd64 at least then?  I just ran
headlong into this trying with 2.6.5, and it would have been nice if emerge -p system told me that the light at the end of the tunnel was another train.