> -----Original Message----- > From: Mickael Istria [mailto:[EMAIL PROTECTED] > Sent: 30 August 2007 13:33 > To: Peter Pearse > Subject: Re: Scratchbox & arm-2007q1-10-arm-none-linux-gnueabi > > Peter Pearse wrote: > > > > > > > >> -----Original Message----- > >> From: Mickael Istria [mailto:[EMAIL PROTECTED] > >> Sent: 29 August 2007 14:06 > >> To: Peter Pearse > >> Subject: Scratchbox & arm-2007q1-10-arm-none-linux-gnueabi > >> > >> Hello, > >> > >> I have been trying for several days to install 2007q1 codesourcery > >> toolchain for use in Scratchbox. > >> I get an error (due to unsafe directory for cross > >> compilation...) when I try to compile anything, > >> > > > > CodeSourcery introduced this feature at a customers requesy..... > > > > The latest version allows you to turn the feature off by > providing the > > switch > > > > -Wno-poison-system-directories > > > > e.g. in scratchbox > > > > gcc -Wno-poison-system-directories my.c > > > > If you're building packages you'll have to work this into the CFLAGS > > somewhere in the > > build scripts. > > > > I haven't tried it myself since I had already rebuilt the toolchain > > myself. > > > > Let me know how it goes. > > > > If the switch does not work I'll look out my toolchain build > > instructions...... > > > > > >> and a > >> SegFault when I try to execute it. > >> > > > > Is "it" the application that you compiled or the toolchain? > > > > If the application - I don't know how you manged to get it to build! > > Presumably some non ARM libraries got linked in. > > > > > > > >> I saw on ARM wiki that you succeeded to build this toolchain. > >> Could you please give me more details about how you achieved > >> this accomplishment it (if you remember ;)? I may have > >> several configuration issues, but my network works well. > >> > >> Thank you very much > >> > >> Mickael > >> > >> > > Hello, > > I tried to run gcc with option -Wno-poison-system-directories > (I had to > hach sb-toolchain-extras script). > > It did not change anything, I hace a "# ERROR: with canonical name: > arm-none-eabi" in my build conf. > I think that the tool that generate conf files for toolchain > is based on > some no-more-respected name standards from Codesourcery. > > It is the time for me to learn how to write a good config > file... Could > you please send me the file you used as an example? Or do you know any > documentation that clearly describes those files? > > Thank you > Mickael > Mickael Just to make sure.
I am assuming you are NOT asking me how to build the latest CodeSourcery toolchain under scratchbox. I am assuming you are asking me how to intall and use the latest binary CodeSourcery toolchain as a scratchbox "foreign" toolchain. a) The bit that makes your binaries segfault: Since the initial 2007q1 release the CodeSourcery toolchain includes not only the libraries for the armel target but also for thumb2, marbell-f and armv4t targets. The scratchbox sb-toolchain-extras/confhelper/create_toolchain_conf.py cn get confused by this and configure the toolchain to use the wrong libraries e.g. the thumb2 ones instead of the armel ones. Of source these wont run on an armel target. The solution I use is to remove all directories named thumb2, marvell-f or armv4t from the toolchain immediately after installing it in /scratchbox compilers and before starting the foreign toolchain installation process. b) The bit that will cause you trouble if you use any package building scripts: This is the poisoning warning which I have already described in my previous mails. Below is a log of building the hello world app using the latest CodeSourcery toolchain installed as a foreign toolchain. I used an ARM board as sbrshd target - hopefully the model as described at http://www.linux-arm.org/LinuxDevTools/ScratchBoxQEMU also works - I was too lazy to reconstitute that setup..... If you are actually trying to build the CodeSourcery toolchain from source let me know. I'll try to find my notes - but why bother? Peter ---------------- LOG ------------- [My comments] [ CodeSourcery tools:: gcc version] [sbox-CS-2007q1: ~/hello-world] > gcc --version sbox-arm-none-linux-gnueabi-gcc (CodeSourcery Sourcery G++ Lite 2007q1-21) 4.2.0 20070413 (prerelease) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [ Make the hello world app - note the poisoning warnings] [sbox-CS-2007q1: ~/hello-world] > make make all-am make[1]: Entering directory `/home/doubleme/hello-world' if gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT main.o -MD -MP -MF ".deps/main.Tpo" -c -o main.o main.c; \ then mv -f ".deps/main.Tpo" ".deps/main.Po"; else rm -f ".deps/main.Tpo"; exit 1; fi cc1: warning: include location "/usr/include" is unsafe for cross-compilation gcc -g -O2 -o hello main.o /scratchbox/compilers/CS-2007q1/bin/../lib/gcc/arm-none-linux-gnueabi/4. 2.0/../../../../arm-none-linux-gnueabi/bin/ld: warning: library search path "/usr/local/lib" is unsafe for cross-compilation /scratchbox/compilers/CS-2007q1/bin/../lib/gcc/arm-none-linux-gnueabi/4. 2.0/../../../../arm-none-linux-gnueabi/bin/ld: warning: library search path "/lib" is unsafe for cross-compilation /scratchbox/compilers/CS-2007q1/bin/../lib/gcc/arm-none-linux-gnueabi/4. 2.0/../../../../arm-none-linux-gnueabi/bin/ld: warning: library search path "/usr/lib" is unsafe for cross-compilation make[1]: Leaving directory `/home/doubleme/hello-world' [ Run it on my hardware ] [sbox-CS-2007q1: ~/hello-world] > ./hello Hello World! [ Now edit the Makefile to add the -Wno-poison-system-directories option] [sbox-CS-2007q1: ~/hello-world] > vim Makefile [sbox-CS-2007q1: ~/hello-world] > grep poison Makefile CFLAGS = -g -O2 -Wno-poison-system-directories [ Makes with no warnings] [sbox-CS-2007q1: ~/hello-world] > make clean test -z "hello" || rm -f hello rm -f *.o [sbox-CS-2007q1: ~/hello-world] > make make all-am make[1]: Entering directory `/home/doubleme/hello-world' if gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wno-poison-system-directories -MT main.o -MD -MP -MF ".deps/main.Tpo" -c -o main.o main.c; \ then mv -f ".deps/main.Tpo" ".deps/main.Po"; else rm -f ".deps/main.Tpo"; exit 1; fi gcc -g -O2 -Wno-poison-system-directories -o hello main.o make[1]: Leaving directory `/home/doubleme/hello-world' [ And still runs on the hardware ] [sbox-CS-2007q1: ~/hello-world] > ./hello Hello World! -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. _______________________________________________ Scratchbox-users mailing list [email protected] http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users
