[Scratchbox-users] Notes on building crosstool compilers and crocodile packages for powerpc (PPC) using scratchbox

Jim Heck jsurf at heckheck.com
Tue Jan 2 20:49:33 EET 2007



Riku Voipio wrote:
>> **5.1. From Scratchbox 1.0.7 on, flex is not regarded as a provided 
>> package when checking debian build deps.  This is fixed with the 
>> following, performed inside scratchbox.
>>     
>  
> The issue here is that flex provides libfl.a, which is arch-specific.
> Therefor some packages fail to build if flex is not installed on target.
> build dependencies of flex are included in doctools devkits, so adding 
> flex to crocodiles' packages to compile is more safe solution.
>
>   
I will try this.  You are saying that there is nothing specifically 
special about the flex that used to be provided in scratchbox, so it is 
essentially safer to build it as a crocodile package?
>> **5.2. For powerpc, the value scratchbox returns for 'uname -m' is 
>> 'powerpc'.  This causes problems when building packages, since the 
>> scripts/makefiles generally expect 'ppc'.  This is fixed by setting the 
>> 'SBOX_UNAME_MACHINE' environment variable to 'ppc'
>>     
>
>   
>> [sbox-ppc603-croc: ~] > export SBOX_UNAME_MACHINE=ppc
>>     
>
> What does uname -m return on real ppc hardware? scratchbox should match
> what the real hardware returns.
>   
On an actual PowerPC system, 'uname -m' returns 'ppc'.  I just confirmed 
this on an PPC 8245 target system.
>   
>> - zlib attempted to create the compiler name for the CC environment 
>> variable using 'dpkg-architecture -qDEB_HOST_GNU_TYPE'.  This resolved 
>> the gcc tool name to 'powerpc-linux-gnu-gcc', but scratchbox for some 
>> reason has the gcc compiler linked to 'powerpc-linux-gcc'.  
>>     
>
> These can be tuned SBOX_CROSS_GCC_PREFIX_LIST in /targets/TARGET.config
>
>
>   
I had tried this, but it didn't seem to work. 

jheck at ubuntu-cross:/scratchbox/users/jheck/targets$ cat 
ppc860-croc.config | grep SBOX_CROSS_GCC_PREFIX_LIST
SBOX_CROSS_GCC_PREFIX_LIST=powerpc-linux-gnu-:powerpc-860-linux-gnu-
jheck at ubuntu-cross:/scratchbox/users/jheck/targets$

Now in the sandbox
[sbox-ppc860-croc: ~] > which powerpc-linux-gcc
/scratchbox/compilers/bin/powerpc-linux-gcc
[sbox-ppc860-croc: ~] > which powerpc-linux-gnu-gcc
[sbox-ppc860-croc: ~] >

It seems that the environment variable doesn't help scratchbox formulate 
the correct tool name.  Instead, the tool name is being found using the 
set of soft links in /scratchbox/compilers/bin, which all are formed as 
'powerpc-linux-TOOL'

Are those links in /scratchbox/compilers/bin dynamically created somehow 
(and if so, what do I need to do trigger that creation), or are they 
just part of the scratchbox distribution?  I could create a whole set of 
the needed ones with '-gnu' on my own, but didn't take that step yet. 

Note that all the other packages didn't have a problem building, since 
they inherited the correct tool names from make via the CC environment 
variable.  The zlib package was different in that the Sarge version of 
the package tried to formulate the toolname itself in its makefile based 
on the target platform (this seems to have changed in more recent 
versions).  Suggestions?

Thanks

-Jim




It seems that the


More information about the Scratchbox-users mailing list