error compiling sched.c with current 2.6 bk

Hollis Blanchard hollisb at us.ibm.com
Wed Oct 15 05:46:38 EST 2003


On Tuesday, Oct 14, 2003, at 14:07 US/Central, Patrick Mansfield wrote:
>
> I'm getting the following compile error with a 2.6 bk tree as of today
> (bk://source.scl.ameslab.gov/linux-2.5).
>
> kernel/sched.c: In function `wait_task_inactive':
> kernel/sched.c:551: `asm' operand requires impossible reload
> kernel/sched.c:289: `asm' operand requires impossible reload
> make[1]: *** [kernel/sched.o] Error 1
>
> Looks like the compiler doesn't like the code in
> include/linux/compiler-gcc.h.

Yup, you found it. The workaround is this:

@@ -13,5 +13,5 @@
     shouldn't recognize the original var, and make assumptions about it
*/
  #define RELOC_HIDE(ptr, off)                                   \
    ({ unsigned long __ptr;                                      \
-    __asm__ ("" : "=g"(__ptr) : "0"(ptr));             \
+    __asm__ ("" : "=r"(__ptr) : "0"(ptr));             \
      (typeof(ptr)) (__ptr + (off)); })

> What are the accepted versions of gcc for compiling the 2.6 kernel
> with ppc?
> I can't find anything in the archives or elsewhere, but I am new to
> ppc.
>
> I have:
>
> [elm3b86 patman]$ /opt/cross/bin/powerpc64-linux-gcc -v
> Reading specs from /opt/cross/lib/gcc-lib/powerpc64-linux/3.2/specs
> Configured with:
> /usr/src/packages/BUILD/cross-ppc64-gcc-3.2/gcc-3.2/configure
> --enable-languages=c,c++,f77 --prefix=/opt/cross
> --host=powerpc-suse-linux
> --target=powerpc64-linux --enable-threads=posix --disable-nls
> --enable-shared
> --with-headers=/usr/src/packages/BUILD/cross-ppc64-gcc-3.2/include-
> ppc64-glibc-2.2.5
> Thread model: posix
> gcc version 3.2

The real solution is a newer gcc (although really 3.2 was fine for
kernel compiles before this, in my experience...). I don't know the
exact version needed (someone else may chime in here), but I think you
need at least gcc 3.3.

--
Hollis Blanchard
IBM Linux Technology Center


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list