Glibc 2.1 and MPC 8xx
Hello,
Thanks to Wolfgang Denk and Leif Lindholm regarding my problems with the interrupt vectors.
I examined even better what was happening and it is probably a faulty device driver causing the strange crasses.
At least the application is always running in the driver when it crashes......... So a stupid user error 8-).
Anyway I am now trying to get the system to run on a self contained Glibc2.1 system that will eventually be running from
flash. I have a lot of applications crassing all over. I believe it is due to the cache size assumption made in Glibc2.1 that so many have mentioned in the past few weeks. Does any one have a quick-hack-patch for fixing this before I start to hack up a
code I do not understand the least 8-)? Are there any other known problems with Glibc 2.1?
Thanks,
K.D.
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]
Quoted 10 lines · [email protected] wrote:
Hello,
Thanks to Wolfgang Denk and Leif Lindholm regarding my problems with the interrupt vectors.
I examined even better what was happening and it is probably a faulty device driver causing the strange crasses.
At least the application is always running in the driver when it crashes......... So a stupid user error 8-).
Quoted 8 lines
Anyway I am now trying to get the system to run on a self contained Glibc2.1 system that will eventually be running from
flash. I have a lot of applications crassing all over. I believe it is due to the cache size assumption made in Glibc2.1 that so many have mentioned in the past few weeks. Does any one have a quick-hack-patch for fixing this before I start to hack up a
code I do not understand the least 8-)? Are there any other known problems with Glibc 2.1?
Apply this diff, and simply move sysdeps/powerpc/memset.S out of the way for now:
sysdeps/powerpc/dl-machine.c renamed from glibc-2.1.1/sysdeps/powerpc/dl-machine.c +4 -0
@@ -250,7 +250,11 @@PowerPC processors have line sizes of exactly 32 bytes. */ size_modified = lazy ? rel_offset_words :PLT_INITIAL_ENTRY_WORDS ; +#ifdef PPC_CACHELINESIZE_32 for (i =0 ; i < size_modified; i+=8 ) +#else + for (i = 0; i < size_modified; i+= 4) +#endif PPC_DCBST (plt + i);PPC_DCBST (plt + size_modified -1 );PPC_SYNC ;
This did the trick for me.
If you want to use soft floats (you will have to compile all libraries and programs with -msoft-float) you should pipe this diff into the attached script (standing in sysdeps/powerpc):
sysdeps/powerpc/Dist renamed from glibc-2.1.1/sysdeps/powerpc/Dist +0 -4
@@ -1,7 +1,3 @@ dl-machine.c dl-start.S -fenv_const.c -fenv_libc.h ppc-mcount.S -fe_nomask.c -t_sqrt.c
sysdeps/powerpc/Makefile renamed from glibc-2.1.1/sysdeps/powerpc/Makefile +0 -4
@@ -1,7 +1,3 @@ -ifeq ($(subdir),math) -libm-support += fenv_const fe_nomask t_sqrt -endif - ifeq ($(subdir),gmon) sysdep_routines += ppc-mcount endif
There was also a PPC linker bug mentioned on the glibc list a while ago, which was said to be fixed in CVS, but I haven't checked this out yet as I have enough trouble debugging kernel problems right now.
//Marcus
Signature · 4 lines
-------------------------------+------------------------------------
Marcus Sundberg | http://www.stacken.kth.se/~mackan/
Royal Institute of Technology | Phone: +46 707 295404
Stockholm, Sweden | E-Mail: [email protected]#!/bin/sh
FPUFILES="
Versionsbits/fenv.hbits/mathdef.hbits/mathinline.he_sqrt.ce_sqrtf.cfclrexcpt.cfe_nomask.cfegetenv.cfegetround.cfeholdexcpt.cfenv_const.cfenv_libc.hfesetenv.cfesetround.cfeupdateenv.cfgetexcptflg.cfpu_control.hfraiseexcpt.cfsetexcptflg.cftestexcept.cs_copysign.Ss_copysignf.Ss_fabs.Ss_fabsf.Ss_fmax.Ss_fmaxf.Ss_fmin.Ss_fminf.Ss_isnan.cs_isnanf.Ss_lrint.cs_lrintf.Ss_rint.cs_rintf.ct_sqrt.cw_sqrt.cw_sqrtf.c
"
FPUDISTFILES="fenv_const.cfenv_libc.hfe_nomask.ct_sqrt.c
"
MAKEFILE='-ifeq ($(subdir),math)
-libm-support += fenv_const fe_nomask t_sqrt
-endif'
patch -p1
cd sysdeps/powerpc #|| exit 1
mkdir -p fpu/bits || exit 2
for a in $FPUFILES; do
mv "$a" "fpu/$a" && echo "Moved $a -> fpu/$a"
done
fail=
for a in $FPUDISTFILES; do
echo "$a" >> fpu/Dist || fail=1
done
test "$fail" || echo "Created fpu/Dist"
echo "$MAKEFILE" >fpu/Makefile && echo "Created fpu/Makefile"