[uClibc] building an arm-be toolchain

Mark Rakes mrakes at vivato.net
Tue Aug 19 18:19:07 UTC 2003


[self-answering]

> you need '-mbig-endian' in your CFLAGS for this to work.
hmmm....Erik's change to Rules.mak should have done this.
Are you sure you picked up the most recent changes?

>> I'm also a little bit confused about the ARCH-Variable.
>> If i would like to build an arm-be toolchain, do i have
>> to set this to arm or armbe?
I think it's more of a clarity issue, since the toolchain
doesn't fully work big-endian, even if you define
'armeb/armbe', without '-mbig-endian' (and maybe '-EB' too).
Hopefully this is a temporary thing, and gcc 3.4/3.5/???
will just do 'the right thing(TM)', and any/all kludges can
just go away.

Since we use a linker that does big-endian by default, we
use 'armeb_XXX' currently, so that there is a visual clue.
YMMV

-mark


> other info that might help:
> -top of CVS binutils actually understands arm*b targets for ld,
> 	and can link big-endian by default.
> -I did a bunch of work to make gcc generate big-endian code by default,
> 	but didn't quite do enough, as I still ended up needing
> 	'-mbig-endian' in order for the optimizers to generate be code.
>
> hth,
> -mark
>
>
> On Tuesday, August 19, 2003, at 02:55  AM, Frank Meerkoetter wrote:
> <edit>
>> Thanks for your quick help, but i still have a problem building the
>> toolchain.
>>
>> This is what i did:
>> $ cd /home/frank
>> $ cvs -z3 -d:pserver:anonymous at uclibc.org:/var/cvs co toolchain
>> $ cvs -z3 -d:pserver:anonymous at uclibc.org:/var/cvs co uClibc
>> $ tar cvyf uClibc-snapshot.tar.bz2 uClibc/
>>
>> Then i modified gcc-3.2.3/Makefile so that ARCH is set to "arm"
>> and the CVS-Version is used.
>> ...
>> $(DL_DIR)/$(UCLIBC_SOURCE):
>> #   $(WGET) -P $(DL_DIR) $(UCLIBC_SITE)/$(UCLIBC_SOURCE)
>>     cp /home/frank/$(UCLIBC_SOURCE) $(DL_DIR)
>> ...
>>
>> Then i tried to build it:
>> $ make
>>
>> [ uClibc Configuration queries me for the Target Processor  
>> Type/Endianness ]
>> [ which i set to "Generic Arm" and "Big Endian" ]
>>
>> [... make output ...]
>> make -C ldso;
>> make[3]: Entering directory  
>> `/home/frank/toolchain/gcc-3.2.3/build_arm/uClibc/ld
>> so/ldso'
>> echo "const char *_dl_progname=\""ld-uClibc.so.0"\";" > _dl_progname.h
>> echo "#include \"arm/elfinterp.c\"" >> _dl_progname.h
>> /home/frank/toolchain/gcc-3.2.3/toolchain_arm/bin/arm-uclibc-gcc   
>> -Wall -Wstrict    -prototypes -Wno-trigraphs -fno-strict-aliasing   
>> -fstrict-aliasing -Os     -fPIC     -DUCLIBC_TARGET_PREFIX=\"/\"  
>> -DUCLIBC_DEVEL_PREFIX=\""/home/frank/toolchain/gcc     
>> -3.2.3/toolchain_arm"\"  
>> -DUCLIBC_BUILD_DIR=\"/home/frank/toolchain/gcc-3.2.3/bui     
>> ld_arm/uClibc\" -fno-builtin -nostdinc -I../../ldso/include -I.  
>> -I../../include      
>> -I/home/frank/toolchain/gcc-3.2.3/toolchain_arm/lib/gcc-lib/arm- 
>> linux/3.2.3/incl    ude -I../libdl -c arm/resolve.S -o arm/resolve.o
>> /home/frank/toolchain/gcc-3.2.3/toolchain_arm/bin/arm-uclibc-strip -x  
>> -R .note -    R .comment arm/resolve.o
>> /home/frank/toolchain/gcc-3.2.3/toolchain_arm/bin/arm-uclibc-gcc   
>> -Wall -Wstrict    -prototypes -Wno-trigraphs -fno-strict-aliasing   
>> -fstrict-aliasing -Os     -fPIC     -DUCLIBC_TARGET_PREFIX=\"/\"  
>> -DUCLIBC_DEVEL_PREFIX=\""/home/frank/toolchain/gcc     
>> -3.2.3/toolchain_arm"\"  
>> -DUCLIBC_BUILD_DIR=\"/home/frank/toolchain/gcc-3.2.3/bui     
>> ld_arm/uClibc\" -fno-builtin -nostdinc -I../../ldso/include -I.  
>> -I../../include      
>> -I/home/frank/toolchain/gcc-3.2.3/toolchain_arm/lib/gcc-lib/arm- 
>> linux/3.2.3/incl    ude -I../libdl -c ldso.c -o ldso.o
>> /home/frank/toolchain/gcc-3.2.3/toolchain_arm/bin/arm-uclibc-strip -x  
>> -R .note -    R .comment ldso.o
>> /home/frank/toolchain/gcc-3.2.3/toolchain_arm/bin/arm-uclibc-ld "-EB"  
>> -shared --    warn-common --export-dynamic --sort-common -z combreloc  
>> --discard-locals --disca    rd-all -s -e _dl_boot  
>> -soname=ld-uClibc.so.0 \
>>         -o ld-uClibc-0.9.20.so arm/resolve.o ldso.o  
>> /home/frank/toolchain/gcc-3.     
>> 2.3/toolchain_arm/lib/gcc-lib/arm-linux/3.2.3/libgcc.a;
>> /home/frank/toolchain/gcc-3.2.3/toolchain_arm/bin/arm-uclibc-ld:  
>> arm/resolve.o:     compiled for a little endian system and target is  
>> big endian
>> File in wrong format: failed to merge target specific data of file  
>> arm/resolve.o
>> /home/frank/toolchain/gcc-3.2.3/toolchain_arm/bin/arm-uclibc-ld:  
>> ldso.o: compile    d for a little endian system and target is big  
>> endian
>> File in wrong format: failed to merge target specific data of file  
>> ldso.o
>> make[3]: *** [lib] Segmentation fault
>> make[3]: Leaving directory  
>> `/home/frank/toolchain/gcc-3.2.3/build_arm/uClibc/ldso/ldso'
>> make[2]: *** [all] Error 2
>> make[2]: Leaving directory  
>> `/home/frank/toolchain/gcc-3.2.3/build_arm/uClibc/ldso'
>> make[1]: *** [_dir_ldso] Error 2
>> make[1]: Leaving directory  
>> `/home/frank/toolchain/gcc-3.2.3/build_arm/uClibc'
>> make: ***  
>> [/home/frank/toolchain/gcc-3.2.3/build_arm/uClibc/lib/libc.a] Error 2
>>
>>
>>
>>
>> Frank




More information about the uClibc mailing list