[fpc-pascal] Building for Arduino

Christo Crause christo.crause at gmail.com
Sun Jul 7 21:45:14 CEST 2024


On Sun, Jul 7, 2024 at 8:15 PM Adriaan van Os via fpc-pascal <
fpc-pascal at lists.freepascal.org> wrote:

> Christo Crause via fpc-pascal wrote:
>
> > The level of support for AVR in 3.0.4 was rudimentary, only atmega128 is
> > supported in the MakeFIle.  The  support for AVR is still improving with
> > time so use either the development branch, or the latest release version
> > (if you prefer release versions).  The bootstrap compiler required is
> > determined by the source version, not the cross target.
>
> Thanks for the reply. With fpc-3.2.2 and
>
> make clean crossall FPC=/usr/local/lib/fpc/3.2.2/ppcx64 OS_TARGET=embedded
> CPU_TARGET=avr
> SUBARCH=avr5 BINUTILSPREFIX=avr- CROSSOPT="-O3 -XX -CX -v"
>
> I get an assembler error
>
> /Users/adriaan/fpc-3.2.2/compiler/ppcrossavr -Cpavr5 -Ur -Tembedded -Pavr
> -XPavr- -Xr -Ur -Xs -O2
> -n -Fi../inc -Fi../avr -FE.
> -FU/Users/adriaan/fpc-3.2.2/rtl/units/avr-embedded -davr -dRELEASE -O3
> -XX -CX -v  -Us -Sg system.pp @system.cfg
> /Users/adriaan/fpc-3.2.2/rtl/units/avr-embedded/system.s: Assembler
> messages:
> /Users/adriaan/fpc-3.2.2/rtl/units/avr-embedded/system.s:28783: Error: `)'
> required
> /Users/adriaan/fpc-3.2.2/rtl/units/avr-embedded/system.s:28783: Error:
> garbage at end of line
>
> where the offended assembly line in system.s reads
>
> ldi     r20,lo8(gs(FPC_FINALIZE)
>
> and avr-as was built from gnu-binutils version 2.17.
>
> Is there a minimal gnu-binutils version required ?
>
> Regards,
>
> Adriaan van Os
>

The assembly line you showed above is obviously missing a closing
parenthesis, so the error from avr-as is correct.  I tested building
ppcrosssavr 3.2.2 with all your cross options and added -a to retain the
generated assembler source. This worked fine and line 28783 from system.s
has balanced parentheses: ldi r20,lo8(gs(FPC_FINALIZE))

Somehow that line got truncated when you were building the cross compiler,
but I have no idea what could have caused that.

PS. My avr binutils version is 2.26 - old, but your version is about 10
years older still.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20240707/43b2df12/attachment.htm>


More information about the fpc-pascal mailing list