View previous topic :: View next topic |
Author |
Message |
KeyserZero n00b
Joined: 21 Mar 2005 Posts: 68
|
Posted: Tue Jan 17, 2006 2:30 pm Post subject: Klibc emerge problems [Solved] |
|
|
Hey all!
I would like to install klibc under ppc!
1.
2.
Download the patch from https://bugs.gentoo.org/show_bug.cgi?id=112742 and apply it into the klibc ebuild
3.
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 |
|
|
iqt n00b
Joined: 23 Oct 2002 Posts: 23
|
|
Back to top |
|
|
KeyserZero n00b
Joined: 21 Mar 2005 Posts: 68
|
Posted: Tue Jan 17, 2006 4:06 pm Post subject: |
|
|
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 |
|
|
hiyuh n00b
Joined: 18 Jan 2006 Posts: 11 Location: Japan
|
Posted: Wed Jan 18, 2006 2:50 pm Post subject: |
|
|
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 |
|
|
KeyserZero n00b
Joined: 21 Mar 2005 Posts: 68
|
Posted: Wed Jan 18, 2006 3:14 pm Post subject: |
|
|
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 |
|
|
hiyuh n00b
Joined: 18 Jan 2006 Posts: 11 Location: Japan
|
Posted: Sat Jan 21, 2006 6:55 am Post subject: |
|
|
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 |
|
|
|