[Click] compile click to powerpc target problem

Joonwoo Park joonwpark81 at gmail.com
Tue Apr 1 08:43:23 EDT 2008


On Mon, Mar 31, 2008 at 08:56:28AM -0600, Leung, Chu wrote:
> Hi Joonwoo,

Chu,

> 
> thanks a lot for your suggestion,
> i did try this,
> actually when i do make menuconfig 
> the patched kernel 2.6.19.2,
> i experimentally unselect most options,
> the kernel hacking is among those unselected.

The click linux patch has some problems for target powerpc.
(target ppc needs pretty hard work, I suppose. so 2.6.24 should handle
it for it, IMHO)
Briefly, I made a extra patch for the powerpc. apply it after as a
second linux patch.
Please try it with the instructions below.

> 
> when i do the configure for the click,
> here is my command:
> 
> ./configure ARCH=ppc --host=ppc-linux --enable-linuxmodule \
> --with-linux=/myDir --enable-tools=host --disable-userlevel

ARCH=powerpc CC=powerpc-softfloat-linux-gnu-gcc
CXX=powerpc-softfloat-linux-gnu-g++ LD=powerpc-softfloat-linux-gnu-ld
./configure --with-linux=/home/jason/click/git/linux-2.6.19.2
--enable-linuxmodule --disable-userlevel
--target=powerpc-softfloat-linux-gnu --host=i686-pc-linux-gnu
--disable-multithread

> 
> and i still got the 2 common reasons for the configure error
> 
> i went over the config.log,
> and one common type of configure error is:
> file not find in asm/ (which is link to asm-ppc)
> 
> the complained missing files can be found in i386, or powerpc dir,
> but not in ppc,
> i did also try changing the target type from ppc to powerpc,
> but there are other types of complains,
> and end up with the same 2 common reasons for the configure error

There weird problem with CONFIG_HIGHMEM=y on powerpc, please turn it off
first.
FYI, I'm attaching my config as well.

> 
> furthermore,
> i also tried all these on an apple machine with powerpc,
> so i no longer needed the cross compile,
> and just did a native compile;
> however, i ended up with the same 2 common reasons
> (also with the kernel make menuconfig options
>  stripped down to almost nothing included)

On the gentoo:
You can get cross compiler for ppc:

$sudo emerge crossdev
$sudo crossdev -t powerpc-softfloat-linux-gnu

And build linux:

$make -j4 ARCH=powerpc CROSS_COMPILE=powerpc-softfloat-linux-gnu-

Finally build click:

$CROSS_COMPILE=powerpc-softfloat-linux-gnu-
LD=powerpc-softfloat-linux-gnu-ld NM=powerpc-softfloat-linux-gnu-nm
ARCH=powerpc make linuxmodule V=1

> 
> are there any doc out there about how to do 
> the proper cross compiling of the click kernel module?

AFAIKS, No. :-(

> 
> thanks and appreciate your help
> regards,
> -chu
> 

Please don't drop CC-ed list next time. :-)

Thanks,
Joonwoo
-------------- next part --------------
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index f7b1227..f5c2f69 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -339,10 +339,10 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
 {
 	switch (size) {
 	case 4:
-		return __cmpxchg_u32(ptr, old, new);
+		return __cmpxchg_u32((volatile unsigned int*)ptr, old, new);
 #ifdef CONFIG_PPC64
 	case 8:
-		return __cmpxchg_u64(ptr, old, new);
+		return __cmpxchg_u64((volatile unsigned long*)ptr, old, new);
 #endif
 	}
 	__cmpxchg_called_with_bad_pointer();
diff --git a/include/net/checksum.h b/include/net/checksum.h
index e3ea7cc..abeae74 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -31,7 +31,7 @@ unsigned int csum_and_copy_from_user (const unsigned char __user *src, unsigned
 				      int len, int sum, int *err_ptr)
 {
 	if (access_ok(VERIFY_READ, src, len))
-		return csum_partial_copy_from_user(src, dst, len, sum, err_ptr);
+		return csum_partial_copy_from_user((const char*)src, (char*)dst, len, sum, err_ptr);
 
 	if (len)
 		*err_ptr = -EFAULT;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.powerpc.gz
Type: application/octet-stream
Size: 7505 bytes
Desc: not available
Url : https://pdos.csail.mit.edu/pipermail/click/attachments/20080401/92219a73/attachment.obj 


More information about the click mailing list