Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 355771 - sys-kernel/hardened-sources-2.6.36-r9 and 2.6.37-r2 fail to compile for powerpc in mm/memory.c
Summary: sys-kernel/hardened-sources-2.6.36-r9 and 2.6.37-r2 fail to compile for power...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: The Gentoo Linux Hardened Kernel Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-20 23:08 UTC by Tom Lloyd
Modified: 2011-03-12 16:24 UTC (History)
5 users (show)

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


Attachments
Config file for 2.6.36 version (.config,46.38 KB, text/plain)
2011-02-20 23:14 UTC, Tom Lloyd
Details
Full build log for 2.6.37 version (build.log,12.74 KB, text/plain)
2011-02-20 23:15 UTC, Tom Lloyd
Details
emerge --info for target machine (emerge-info,3.74 KB, text/plain)
2011-02-22 21:22 UTC, Tom Lloyd
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Lloyd 2011-02-20 23:08:26 UTC
I've tried building two recent hardened kernels for my ppc box, and the same error has thwarted me in both cases:

  CC      mm/memory.o
mm/memory.c: In function `free_pmd_range':
mm/memory.c:250: error: implicit declaration of function `_AC'
mm/memory.c:250: error: `UL' undeclared (first use in this function)
mm/memory.c:250: error: (Each undeclared identifier is reported only once
mm/memory.c:250: error: for each function it appears in.)
mm/memory.c: In function `free_pgd_range':
mm/memory.c:344: error: `UL' undeclared (first use in this function)
mm/memory.c: In function `free_pgtables':
mm/memory.c:390: error: `UL' undeclared (first use in this function)
make[1]: *** [mm/memory.o] Error 1
make: *** [mm] Error 2

The kernels I've tried are:
* sys-kernel/hardened-sources-2.6.36-r9
* sys-kernel/hardened-sources-2.6.37-r2
Both fail with exactly the above output.

The GCC I'm using is powerpc-gentoo-linux-uclibc-3.4.6, and I suspect that has something to do with it.  Would it be worth merging a powerpc-targeted gcc-4.4?  If so, how would I go about it?

I'll include emerge --info on request, but it doesn't seem relevant here and besides, I've tried compiling this natively on the ppc box and cross-compiling on my x86_64 and I get the same problem.

Reproducible: Always

Steps to Reproduce:
Attempt to build one of the aforementioned kernels.
Comment 1 Tom Lloyd 2011-02-20 23:14:23 UTC
Created attachment 263227 [details]
Config file for 2.6.36 version
Comment 2 Tom Lloyd 2011-02-20 23:15:15 UTC
Created attachment 263229 [details]
Full build log for 2.6.37 version
Comment 3 Anthony Basile gentoo-dev 2011-02-22 16:16:41 UTC
Is this a ppc or ppc64 system?  Please attach your emerge --info.
Comment 4 Tom Lloyd 2011-02-22 21:22:17 UTC
Created attachment 263565 [details]
emerge --info for target machine

It's 32-bit PPC, an Efika (MPC5200B) to be exact.
Comment 5 Anthony Basile gentoo-dev 2011-02-23 21:57:33 UTC
I haven't been giving ppc32 much love, focusing more on ppc64.  Passing it upstream.
Comment 6 Tom Lloyd 2011-02-23 23:32:44 UTC
Upstream to where?  I'd like to stay in contact with my bug.
Comment 7 Anthony Basile gentoo-dev 2011-02-23 23:35:20 UTC
(In reply to comment #6)
> Upstream to where?  I'd like to stay in contact with my bug.
> 

pageexec@freemail.hu
spender@grsecurity.net

You can email syntax errors directly to them.
Comment 8 Gordon Malm (RETIRED) gentoo-dev 2011-02-24 01:44:05 UTC
(In reply to comment #6)
> Upstream to where?  I'd like to stay in contact with my bug.
> 

They are CC'd to this bug. :)
Comment 9 Gordon Malm (RETIRED) gentoo-dev 2011-02-24 01:56:38 UTC
BTW, looks like you just need an:
#include <linux/const.h>

somewhere inherited by memory.c.  probably put it in arch/powerpc/include/asm/pgtable.h to keep it the same as is done for ia64.
Comment 10 PaX Team 2011-02-24 14:01:14 UTC
Tom, can you check that only mm/memory.c needs that extra #include?
Comment 11 Tom Lloyd 2011-02-25 23:35:21 UTC
I can confirm that adding #include <linux/const.h> to arch/powerpc/include/asm/pgtable.h eliminates the build error.
Comment 12 PaX Team 2011-02-26 08:59:37 UTC
(In reply to comment #11)
> I can confirm that adding #include <linux/const.h> to
> arch/powerpc/include/asm/pgtable.h eliminates the build error.

thanks, i released patches yesterday that have the fix, grsec will follow soon i guess ;).

Comment 13 Anthony Basile gentoo-dev 2011-03-12 16:24:37 UTC
This has been fixed in the latest hardened-sources, so I'm closing this bug.