Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Klibc emerge problems [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
KeyserZero
n00b
n00b


Joined: 21 Mar 2005
Posts: 68

PostPosted: Tue Jan 17, 2006 2:30 pm    Post subject: Klibc emerge problems [Solved] Reply with quote

Hey all!

I would like to install klibc under ppc!

1.
Code:
emerge sync


2.

Download the patch from https://bugs.gentoo.org/show_bug.cgi?id=112742 and apply it into the klibc ebuild

3.
Code:
emerge klibc


And then emerge runs into an error
Code:
gcc -Wp,-MT,fork.o,-MD,./.fork.o.d -Os  -D__KLIBC__=1 -D__KLIBC_MINOR__=1 -nostdlib -nostdinc -iwithprefix include -I../include/arch/ppc -I../include/bits32 -I../include -I/usr/src/linux/include -I/usr/src/linux/include2 -I../linux/include -I/usr/src/linux/arch/ppc/include -I./zlib -I./zlib -DWITH_ERRLIST -W -Wall -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline -DDYNAMIC_CRC_TABLE -c -o fork.o fork.c
In file included from ../include/signal.h:13,
                 from fork.c:9:
/usr/src/linux/arch/ppc/include/asm/signal.h:14: error: `BITS_PER_LONG' undeclared here (not in a function)
make[1]: *** [fork.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/klibc-1.1.1/work/klibc-1.1.1/klibc'
make: *** [all] Error 2


Any idea?

Thanks for the help

Greetz
_________________
www.ruby-lang.org


Last edited by KeyserZero on Sat Jan 21, 2006 3:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
iqt
n00b
n00b


Joined: 23 Oct 2002
Posts: 23

PostPosted: Tue Jan 17, 2006 3:06 pm    Post subject: Re: Klibc emerge problems Reply with quote

Are you compiling against 2.6.15 ? --> https://bugs.gentoo.org/show_bug.cgi?id=112742#c3

Dirk
Back to top
View user's profile Send private message
KeyserZero
n00b
n00b


Joined: 21 Mar 2005
Posts: 68

PostPosted: Tue Jan 17, 2006 4:06 pm    Post subject: Reply with quote

Yes, i'm running 2.6.15

So i have the same problem as in the bug report

Quote:
Compiling against 2.6.15, klibc-1.1.1-ppc-2.6.14.patch seems to improve the
situation but we still hit:

gcc -Wp,-MT,fork.o,-MD,./.fork.o.d -Os -D__KLIBC__=1 -D__KLIBC_MINOR__=1
-nostdlib -nostd inc -iwithprefix include -I../include/arch/ppc
-I../include/bits32 -I../include -I/usr/src /linux/include
-I/usr/src/linux/include2 -I../linux/include -I/usr/src/linux/arch/ppc/incl ude
-I./zlib -I./zlib -DWITH_ERRLIST -W -Wall -Wpointer-arith -Wwrite-strings
-Wstrict-pro totypes -Winline -DDYNAMIC_CRC_TABLE -c -o fork.o fork.c
In file included from ../include/signal.h:13,
from fork.c:9:
/usr/src/linux/arch/ppc/include/asm/signal.h:14: error:
‘BITS_PER_LONG’ undeclared here (n ot in a function)


But in the bug report isn't a way to fix the problem.

So any ideas?

Greetz
_________________
www.ruby-lang.org
Back to top
View user's profile Send private message
hiyuh
n00b
n00b


Joined: 18 Jan 2006
Posts: 11
Location: Japan

PostPosted: Wed Jan 18, 2006 2:50 pm    Post subject: Reply with quote

Here is my stupid work-around way as Symlink+MagicNumberExpansion.
It is ONLY compilation fixing for ARCH=ppc w/ 2.6.15 or so and klibc-1.1.1.
And then, I had NO CHECKING whether it work.

~/scripts/lack_header_adm-ppc.sh
Code:

#!/bin/bash
LACK_HEADERS="asm-compat.h atomic.h auxvec.h \
        bitops.h bug.h byteorder.h \
        cache.h cputable.h cputime.h current.h div64.h \
        elf.h errno.h \
        fcntl.h \
        hardirq.h hw_irq.h \
        ioctl.h ioctls.h ipcbuf.h irq.h \
        linkage.h local.h \
        mman.h module.h \
        param.h percpu.h poll.h posix_types.h processor.h ptrace.h \
        reg.h resource.h rwsem.h \
        seccomp.h semaphore.h sembuf.h siginfo.h signal.h socket.h sockios.h stat.h string.h synch.h \
        termios.h termbits.h thread_info.h timex.h topology.h types.h \
        uaccess.h unistd.h"
PATCH_FILE="${HOME}/scripts/lack_headers.patch"
KERNEL_DIR="/usr/src/linux"

do_symlink ()
{
        cd ${KERNEL_DIR}/include/asm-ppc ;
        for SYM_TARGET in ${LACK_HEADERS} ;
        do
                echo "Symlink: `ls -l ../asm-powerpc/${SYM_TARGET}`." ;
                ln -s ../asm-powerpc/${SYM_TARGET} ${SYM_TARGET} ;
        done ;
        # Stupid unionfs header file in out of kernel directory. :/
        #ln -s /usr/include/asm/segment.h segment.h ;
}

do_unsymlink ()
{
        cd ${KERNEL_DIR}/include/asm-ppc ;
        for UNSYM_TARGET in `ls -l | grep ^l | awk '{print $9}'` ;
        do
                echo "Unsymlink: `ls -l ${UNSYM_TARGET}`." ;
                rm ${UNSYM_TARGET} ;
        done ;
}

do_patch ()
{
        cd ${KERNEL_DIR}/include/asm-powerpc ;
        #patch -p1 -l --dry-run < ${PATCH_FILE} ;
        patch -p1 -l < ${PATCH_FILE} ;
}

do_unpatch ()
{
        cd ${KERNEL_DIR}/include/asm-powerpc ;
        #patch -p1 -l -R --dry-run < ${PATCH_FILE} ;
        patch -p1 -l -R < ${PATCH_FILE} ;
}

case $1 in
        fix)
                do_symlink ;
                do_patch ;
        ;;
        unfix)
                do_unpatch ;
                do_unsymlink ;
        ;;
        *)
                echo "Select \"fix\" or \"unfix\"." ;
        ;;
esac ;


~/scripts/lack_header.patch
Code:

--- asm/signal.h.orig   2006-01-18 03:16:50.000000000 +0900
+++ asm/signal.h        2006-01-18 03:17:18.000000000 +0900
@@ -5,7 +5,7 @@
 #include <linux/config.h>

 #define _NSIG          64
-#define _NSIG_BPW      BITS_PER_LONG
+#define _NSIG_BPW      32
 #define _NSIG_WORDS    (_NSIG / _NSIG_BPW)

 typedef unsigned long old_sigset_t;             /* at least 32 bits */


Then do like that after the kernel build.:
Code:

 # ~/scripts/lack_headers_arm-ppc.sh fix
 # emerge =dev-libs/klibc-1.1.1
 # ~/scripts/lack_headers_arm-ppc.sh unfix
Back to top
View user's profile Send private message
KeyserZero
n00b
n00b


Joined: 21 Mar 2005
Posts: 68

PostPosted: Wed Jan 18, 2006 3:14 pm    Post subject: Reply with quote

Hey!

Yep, i have done the same.

I have changed the BITS_PER_LONG to 32 as well but you have add a nice shell script =)

I hope i can release a patch to fix this in a better way soon.

Thanks

Greetz
_________________
www.ruby-lang.org
Back to top
View user's profile Send private message
hiyuh
n00b
n00b


Joined: 18 Jan 2006
Posts: 11
Location: Japan

PostPosted: Sat Jan 21, 2006 6:55 am    Post subject: Reply with quote

See also this report at bugzilla.
More correct way is here.
https://bugs.gentoo.org/show_bug.cgi?id=112742

KeyserZero:
And then, your problem will be solved,
please add [solved] or so to the title.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum