[fpc-pascal] Error when trying to build a crosscompiler for arm

Jeppe Græsdal Johansen jjohan07 at student.aau.dk
Sun Aug 26 14:11:17 CEST 2012


Den 25-08-2012 18:15, Rainer Stratmann skrev:
> Am Saturday 25 August 2012 15:22:59 schrieb Rainer Stratmann:
>> Am Saturday 25 August 2012 14:14:18 schrieb Marco van de Voort:
>>> In our previous episode, Rainer Stratmann said:
>>>> I downloaded the daily source an wanted to build a crosscompiler for
>>>> arm with:
>>>>
>>>> make clean buildbase installbase CROSSINSTALL=1 CROSSOPT="-XParm-elf-"
>>>> OS_TARGET=embedded CPU_TARGET=arm SUBARCH=armv7m
>>> Starting with what compiler?
>> 2.6.0
> I changed the code somehow so that the compiler can continue the compiling.
>
> Now it seems the linker shows errormessages.
> (bad instruction `uxths ....')
>
>
> make[3]: Entering directory `/home/rainer/fpcdaily/fpc/rtl/embedded'
> /bin/mkdir -p /home/rainer/fpcdaily/fpc/rtl/units/arm-embedded
> /home/rainer/fpcdaily/fpc/compiler/ppcrossarm -Cparmv7m
> @rtl.cfg -Ur -Tembedded -Parm -XParm-embedded- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -FE. -FU/home/rainer/fpcdaily/fpc/rtl/units/arm-embedded -darm -dRELEASE -XParm-elf- -Us -Sg
> system.pp
> /home/rainer/fpcdaily/fpc/rtl/units/arm-embedded/system.s: Assembler messages:
> /home/rainer/fpcdaily/fpc/rtl/units/arm-embedded/system.s:16515: Error: bad
> instruction `uxths r0,r0'
> /home/rainer/fpcdaily/fpc/rtl/units/arm-embedded/system.s:16580: Error: bad
> instruction `uxths r1,r1'
> /home/rainer/fpcdaily/fpc/rtl/units/arm-embedded/system.s:16656: Error: bad
> instruction `uxths r3,r3'
> /home/rainer/fpcdaily/fpc/rtl/units/arm-embedded/system.s:16713: Error: bad
> instruction `uxths r1,r1'
> /home/rainer/fpcdaily/fpc/rtl/units/arm-embedded/system.s:16799: Error: bad
> instruction `uxths r1,r1'
> /home/rainer/fpcdaily/fpc/rtl/units/arm-embedded/system.s:16861: Error: bad
> instruction `uxths r1,r1'
> /home/rainer/fpcdaily/fpc/rtl/units/arm-embedded/system.s:27354: Error:
> instruction not allowed in IT block -- `str r0,[r11,#-48]'
> /home/rainer/fpcdaily/fpc/rtl/units/arm-embedded/system.s:27355: Error: thumb
> conditional instruction should be in IT block -- `movne r0,#0'
> /home/rainer/fpcdaily/fpc/rtl/units/arm-embedded/system.s:27377: Error:
> instruction not allowed in IT block -- `str r0,[r11,#-48]'
> /home/rainer/fpcdaily/fpc/rtl/units/arm-embedded/system.s:27378: Error: thumb
> conditional instruction should be in IT block -- `movne r0,#0'
> /home/rainer/fpcdaily/fpc/rtl/units/arm-embedded/system.s:32765: Error: bad
> instruction `uxths r0,r0'
> system.pp(232) Error: Error while assembling exitcode 1
> system.pp(232) Fatal: There were 2 errors compiling module, stopping
> Fatal: Compilation aborted
> make[3]: *** [system.ppu] Fehler 1
> make[3]: Leaving directory `/home/rainer/fpcdaily/fpc/rtl/embedded'
> make[2]: *** [embedded_all] Fehler 2
> make[2]: Leaving directory `/home/rainer/fpcdaily/fpc/rtl'
> make[1]: *** [rtl_all] Fehler 2
> make[1]: Leaving directory `/home/rainer/fpcdaily/fpc'
> make: *** [base.build-stamp.arm-embedded] Fehler 2
> rainer at debian605:~/fpcdaily/fpc$
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
I just checked it out again. It looks like there's bad bug in the 
compiler regarding large set handling. When inserting this on line 473

debugmsg(booltostr(taicpu(p).opcode in 
[A_ADC,A_ADD,A_BIC,A_SUB,A_MUL,A_MVN,A_MOV,A_ORR,A_EOR,A_AND,A_RSB,A_RSC,A_SBC,A_MLA], 
true)+' '+booltostr(MatchInstruction(p, 
[A_ADC,A_ADD,A_BIC,A_SUB,A_MUL,A_MVN,A_MOV,A_ORR,A_EOR,A_AND,A_RSB,A_RSC,A_SBC,A_MLA], 
[C_None], [PF_None]), true), p);

The first condition is false for uxth but for the second it's true. That 
shouldn't happen.

Rainer, just pass CROSSOPT="-O-" for now until this issue is fixed. That 
will disable optimization when building the compiler.



More information about the fpc-pascal mailing list