Re: [uClinux-dev] Busybox and arm7tdmi

2009-06-01 Thread Jeff Bacon
Erwin,

  Sorry, I guess my previous post was kind of confusing and didn't
tell the whole story.

  First I was using the GCC 4.2.1 toolchain from the snapgear website,
and for whatever reason compiling without the DISABLE_XIP flag set (in
config.arch) produced non-working binaries. I attributed this to XIP
issues for this toolchain, so I worked on getting the system up and
running with the DISABLE_XIP flag set, and this worked. Then after
some postings from others on this mailing list I decided to downgrade
to the 3.4.4 toolchain, but I wanted to make sure that I hadn't
affected anything by switching to this older toolchain, meaning I
wanted to get a stable system up and running with the DISABLE_XIP flag
set like before. Now that I have this working, I have commented out
DISABLE_XIP in config.arch (so now I have PIC binaries) and
re-compiled and everything is still working (so my issue previously
was in the GCC 4.2.1 toolchain).

As for why busybox wasn't working previously with libgcc.a's PIC code,
its because I had DISABLE_XIP active when compiling, meaning that I
was missing the linker directives  += -D__PIC__ -fpic
-msingle-pic-base when I compiled it, which I believe is needed for
PIC code to execute properly.

-JB

On Sun, May 31, 2009 at 3:21 AM, Erwin Authried ea...@softsys.co.at wrote:
 Am Samstag, den 30.05.2009, 23:12 -0400 schrieb Jeff Bacon:
 Erwin,

    You were absolutely correct. After going over EVERYTHING with a
 fine-tooth comb I found the issue.

 The gcc 3.4.4 toolchain from the snapgear website used the -fPIC
 option when libgcc.a was compiled for the toolchain. When I ran the
 nm utility on that file to look at all the symbols I found several
 that had _GLOBAL_OFFSET_TABLE_ listed.

 When I compared those entries with the map file for the busybox
 binary, I found that a single file in the libbb directory (xatonum.c)
 generated code that referenced one of these libgcc built-ins that
 utilized the GOT (_udivdi3 for those interested). All other libgcc.a
 references were ok.

 So I looked a little further at this file and it turns out that there
 is something in my settings SOMEWHERE for ULONG_MAX and ULLONG_MAX
 that caused the wrong set of function definitions to be included in
 the compilation. Long story short, if I force the secondary set of
 function definitions in that file, the code generates properly and
 busybox links correctly with the proper load-to-ram flag being set
 from elf2flt. I tested it out on my platform and it worked!

 On to your second point Erwin, you are correct again, I will NOT want
 to run BB from RAM in the end. After reading through the mailing list
 at all the horror stories with arm7tdmi + XIP, I decided that I first
 wanted to get a system up and running and configured properly without
 messing with any XIP stuff, then once I was satisfied with that, I
 would apply the XIP patches and attempt to replicate my known good
 system using XIP instead. This way if any issue crop up I know that
 it's due to XIP issues and not misconfigurations.

 I'm not sure what you are referring to, but I have made the opposite
 experience. I have always used PIC without any trouble. There was just
 one special application where I had to use non-pic code recently, and
 this made trouble with elf2flt, as you know.

 If you are talking about true XIP (=text segment executed directly in
 flash), this may be slightly more complicated. But this isn't a
 requirement to use pic code, and often you can't use that anyway because
 the flash is too slow or the filesystem is compressed to save space. But
 even without that, the text segment is shared in ram if multiple
 instances of the same application are running.

 -Erwin


___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[uClinux-dev] missing files (tsystem.h:90:19: error: stdio.h: No such file or directory, ....)

2009-06-01 Thread Tess K
Hi!


Does anybody know why I am always getting this error, no matter what version of 
gcc, uClinux, uClibc I am using?
Can anybody suggest a solution?

 In file included from 
/home/markus/Desktop/another_try/gcc-4.1.1/gcc/crtstuff.c:68:
/home/markus/Desktop/another_try/gcc-4.1.1/gcc/tsystem.h:90:19: error: stdio.h: 
No such file or directory
/home/markus/Desktop/another_try/gcc-4.1.1/gcc/tsystem.h:93:23: error: 
sys/types.h: No such file or directory
/home/markus/Desktop/another_try/gcc-4.1.1/gcc/tsystem.h:96:19: error: errno.h: 
No such file or directory
/home/markus/Desktop/another_try/gcc-4.1.1/gcc/tsystem.h:103:20: error: 
string.h: No such file or directory
/home/markus/Desktop/another_try/gcc-4.1.1/gcc/tsystem.h:104:20: error: 
stdlib.h: No such file or directory
/home/markus/Desktop/another_try/gcc-4.1.1/gcc/tsystem.h:105:20: error: 
unistd.h: No such file or directory
/home/markus/Desktop/another_try/gcc-4.1.1/gcc/tsystem.h:111:18: error: time.h: 
No such file or directory
make[4]: *** [crtbegin.o] Error 1
make[4]: Leaving directory `/home/markus/Desktop/another_try/arm-elf-gcc/gcc'
make[3]: *** [extra] Error 2
make[3]: Leaving directory `/home/markus/Desktop/another_try/arm-elf-gcc/gcc'
make[2]: *** [stmp-multilib] Error 2
make[2]: Leaving directory `/home/markus/Desktop/another_try/arm-elf-gcc/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/home/markus/Desktop/another_try/arm-elf-gcc'
make: *** [all] Error 2


Any help appreciated! 


  ___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Re: [uClinux-dev] [PATCH] ld-elf2flt: make sure to cleanup tmp linker script

2009-06-01 Thread David McCullough

Jivin Mike Frysinger lays it down ...
 Rather than putting the `rm` at the end of the script before the normal
 exit point, create a trap to automatically delete the script when exiting.
 This way the linker script gets cleaned up whenever there is an error as
 well.  Otherwise every link invocation that ends in a failure could leave
 behind crap.  On my system, i found almost 2 million of these suckers in
 my /tmp dir.
 
 Signed-off-by: Mike Frysinger vap...@gentoo.org

Applied,

Thanks,
Davidm


 ---
  ld-elf2flt.in |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/ld-elf2flt.in b/ld-elf2flt.in
 index 32eb7e0..91e1ccb 100644
 --- a/ld-elf2flt.in
 +++ b/ld-elf2flt.in
 @@ -107,6 +107,7 @@ then
   [ $VERBOSE = y ]  set -x
   ARG1=$ARG1 $FINAL_ONLY
   NEWLDSCRIPT=`mktemp /tmp/flt-XX`
 + trap 'rm -f $NEWLDSCRIPT' EXIT
   SEDOP= -e s/^R_RODAT// -e /^W_RODAT/d
   OBJCOPYOP=
   if [ $MOVDAT ]
 @@ -225,7 +226,6 @@ then
fi
   fi
   [ $RFILE = $OFILE.gdb ] || rm -f $RFILE  # not needed for 
 any reason
 - rm -f $NEWLDSCRIPT
   exit 0
   fi
  
 -- 
 1.6.3.1
 
 ___
 uClinux-dev mailing list
 uClinux-dev@uclinux.org
 http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
 This message was resent by uclinux-dev@uclinux.org
 To unsubscribe see:
 http://mailman.uclinux.org/mailman/options/uclinux-dev
 

-- 
David McCullough,  david_mccullo...@securecomputing.com,  Ph:+61 734352815
McAfee - SnapGear  http://www.snapgear.comhttp://www.uCdot.org
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev