Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2019-06

AVR target on trunk does not compile for me

9 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Ring

I tried answering a question on the list today and to do so I did my 'first time ever' compile of the avr target.

This is how I tried to build the avr-embedded target on my Mac:

  SUBARCH=avr5; BINUTILSPREFIX=avr- ; CROSSOPT="-O- -gw2 -dDEBUG"   make clean buildbase  CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=avr SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=$BINUTILSPREFIX
OPT="-XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/" || exit 1

and failed miserably:

/Users/ring/devel/fpc-avr/compiler/ppcrossavr -Cpavr5 -Ur -Tembedded -Pavr -XPavr- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../avr -FE. -FU/Users/ring/devel/fpc-avr/rtl/units/avr-embedded -XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/ -davr -dRELEASE -O- -gw2 -dDEBUG  -Us -Sg system.pp @system.cfg
/Users/ring/devel/fpc-avr/rtl/units/avr-embedded/system.s: Assembler messages:
/Users/ring/devel/fpc-avr/rtl/units/avr-embedded/system.s:90477: Error: value of 68582 too large for field of 2 bytes at 4713 /Users/ring/devel/fpc-avr/rtl/units/avr-embedded/system.s:90485: Error: value of 68582 too large for field of 2 bytes at 4731

.....

tons of more error messages....

I then switched to Christo's branch on github, used exactly the same commands and ended up with a successful build. Is there a chance to get the trunk for avr building again?

https://github.com/ccrause/freepascal

Michael

Reply by email

Christo Crause
to Michael Ring
PM Michael Ring wrote 19 lines
I tried answering a question on the list today and to do so I did my 'first time ever' compile of the avr target. This is how I tried to build the avr-embedded target on my Mac: SUBARCH=avr5; BINUTILSPREFIX=avr- ; CROSSOPT="-O- -gw2 -dDEBUG" make clean buildbase CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=avr SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=$BINUTILSPREFIX OPT="-XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/" || exit 1 [snip] /Users/ring/devel/fpc-avr/rtl/units/avr-embedded/system.s: Assembler messages: /Users/ring/devel/fpc-avr/rtl/units/avr-embedded/system.s:90477: Error: value of 68582 too large for field of 2 bytes at 4713 /Users/ring/devel/fpc-avr/rtl/units/avr-embedded/system.s:90485: Error: value of 68582 too large for field of 2 bytes at 4731

The compiler picks dwarf3 by default to avoid this type of problem, see also

Try building without specifying -gw2 in CROSSOPT.

Reply by email

Michael Ring
to Christo Crause

Thank you, not using -gw2 did the trick for avr5.

Is this issue also known to you? I am trying to build avr6 support:

  BINUTILSPREFIX=avr- ; CROSSOPT="-O- -g -dDEBUG"   SUBARCH=avr6
  make clean buildbase  CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=avr SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=$BINUTILSPREFIX
OPT="-XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/" || exit 1   sudo make installbase CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=avr SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=$BINUTILSPREFIX
INSTALL_UNITDIR=/usr/local/lib/fpc/3.3.1/units/avr-embedded/$SUBARCH/rtl || exit 1

results in:

/bin/mkdir -p /Users/ring/devel/fpc-avr/rtl/units/avr-embedded /Users/ring/devel/fpc-avr/compiler/ppcrossavr -Cpavr6 -Ur -Tembedded -Pavr -XPavr- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../avr -FE. -FU/Users/ring/devel/fpc-avr/rtl/units/avr-embedded -XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/ -davr -dRELEASE -O- -g -dDEBUG  -Us -Sg system.pp @system.cfg
system.pp(293,1) Fatal: Internal error -1413909275

Michael

Christo Crause wrote 36 lines
On Sun, Jun 2, 2019 at 4:51 PM Michael Ring < > wrote: I tried answering a question on the list today and to do so I did my 'first time ever' compile of the avr target. This is how I tried to build the avr-embedded target on my Mac:    SUBARCH=avr5; BINUTILSPREFIX=avr- ; CROSSOPT="-O- -gw2 -dDEBUG"    make clean buildbase  CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=avr SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=$BINUTILSPREFIX OPT="-XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/" || exit 1 [snip] /Users/ring/devel/fpc-avr/rtl/units/avr-embedded/system.s: Assembler messages: /Users/ring/devel/fpc-avr/rtl/units/avr-embedded/system.s:90477: Error: value of 68582 too large for field of 2 bytes at 4713 /Users/ring/devel/fpc-avr/rtl/units/avr-embedded/system.s:90485: Error: value of 68582 too large for field of 2 bytes at 4731 The compiler picks dwarf3 by default to avoid this type of problem, see also Try building without specifying -gw2 in CROSSOPT. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Christo Crause
to Michael Ring
AM Michael Ring wrote 24 lines
Is this issue also known to you? I am trying to build avr6 support: BINUTILSPREFIX=avr- ; CROSSOPT="-O- -g -dDEBUG" SUBARCH=avr6 make clean buildbase CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=avr SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=$BINUTILSPREFIX OPT="-XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/" || exit 1 sudo make installbase CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=avr SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=$BINUTILSPREFIX INSTALL_UNITDIR=/usr/local/lib/fpc/3.3.1/units/avr-embedded/$SUBARCH/rtl || exit 1 results in: /bin/mkdir -p /Users/ring/devel/fpc-avr/rtl/units/avr-embedded /Users/ring/devel/fpc-avr/compiler/ppcrossavr -Cpavr6 -Ur -Tembedded -Pavr -XPavr- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../avr -FE. -FU/Users/ring/devel/fpc-avr/rtl/units/avr-embedded -XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/ -davr -dRELEASE -O- -g -dDEBUG -Us -Sg system.pp @system.cfg system.pp(293,1) Fatal: Internal error -1413909275 Michael

Hi Michael,

I haven't noticed this issue before, because I don't often build the RTL with debug info for avr6. I can confirm that this happens for me too: ~/fpc/3.3.1/compiler/ppcrossavr -Cpavr6 -Ur -Tembedded -Pavr -XPavr- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../avr -FE.
-FU~/fpc/3.3.1/rtl/units/avr-embedded -davr -dDEBUG -Us -Sg system.pp @system.cfg -g
system.pp(293,1) Fatal: Internal error -1413909275 Fatal: Compilation aborted

Reply by email

Jeppe Johansen
to Michael Ring: Thank you, not using -gw2 did the trick for avr5. Is this issue also known to you? I am…

Probably because of the missing softfpu support. It's failing while writing debug info for floating point stuff in variants.

It will be fixed some day :)

Michael Ring wrote 70 lines
Thank you, not using -gw2 did the trick for avr5. Is this issue also known to you? I am trying to build avr6 support:   BINUTILSPREFIX=avr- ; CROSSOPT="-O- -g -dDEBUG"   SUBARCH=avr6   make clean buildbase  CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=avr SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=$BINUTILSPREFIX OPT="-XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/" || exit 1   sudo make installbase CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=avr SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=$BINUTILSPREFIX INSTALL_UNITDIR=/usr/local/lib/fpc/3.3.1/units/avr-embedded/$SUBARCH/rtl || exit 1 results in: /bin/mkdir -p /Users/ring/devel/fpc-avr/rtl/units/avr-embedded /Users/ring/devel/fpc-avr/compiler/ppcrossavr -Cpavr6 -Ur -Tembedded -Pavr -XPavr- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../avr -FE. -FU/Users/ring/devel/fpc-avr/rtl/units/avr-embedded -XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/ -davr -dRELEASE -O- -g -dDEBUG  -Us -Sg system.pp @system.cfg system.pp(293,1) Fatal: Internal error -1413909275 Michael Am 02.06.19 um 17:56 schrieb Christo Crause: > > On Sun, Jun 2, 2019 at 4:51 PM Michael Ring < > > wrote: > > I tried answering a question on the list today and to do so I did my > 'first time ever' compile of the avr target. > > This is how I tried to build the avr-embedded target on my Mac: > >    SUBARCH=avr5; BINUTILSPREFIX=avr- ; CROSSOPT="-O- -gw2 -dDEBUG" >    make clean buildbase  CROSSINSTALL=1 OS_TARGET=embedded > CPU_TARGET=avr SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" > BINUTILSPREFIX=$BINUTILSPREFIX > OPT="-XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/" || > exit 1 > > [snip] > /Users/ring/devel/fpc-avr/rtl/units/avr-embedded/system.s: Assembler > messages: > /Users/ring/devel/fpc-avr/rtl/units/avr-embedded/system.s:90477: > Error: > value of 68582 too large for field of 2 bytes at 4713 > /Users/ring/devel/fpc-avr/rtl/units/avr-embedded/system.s:90485: > Error: > value of 68582 too large for field of 2 bytes at 4731 > > > The compiler picks dwarf3 by default to avoid this type of problem, > see also > > > Try building without specifying -gw2 in CROSSOPT. > > _______________________________________________ > fpc-devel maillist > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Michael Ring
to Jeppe Johansen

I set CROSSOPT to empty, after this change avr6 builds. BUT:

What made me wonder was that avr5 builds fine, it should be affected by the same SOFTFPU issue.

I did a quick grep through the fpc sources and found no obviously missing defines for avr6.

However, a grep for avr revealed this code snippet in rtl/embedded/system.cfg:

# AVR6 has normally more memory, so enable more functions #ifdef CPUAVR6
-SfANSISTRINGS
-SfWIDESTRINGS
-SfDYNARRAYS
-SfTHREADING
-SfVARIANTS
-SfOBJECTS
-SfCOMMANDARGS
-SfRANDOM
-SfRESOURCES
#endif

The build works find with -g when I remove -SfVARIANTS

I am also wondering if CPUAVR is set when CPUAVR6 is set (I guess so), if this is true then -SfOBJECTS can also be removed from the CPUAVR6 Define as it is already in the CPUAVR define

Last question: Is avr6 the only subarch that has enough memory for enabling strings? I am a Noob when it comes to avr, but I guess there should be more subarchs that have more memory, I today saw some ATTINY Chips with 32kB of Flash....

Michael

Jeppe Johansen wrote 79 lines
Probably because of the missing softfpu support. It's failing while writing debug info for floating point stuff in variants. It will be fixed some day :) On 6/2/19 10:54 PM, Michael Ring wrote: > > Thank you, not using -gw2 did the trick for avr5. > > Is this issue also known to you? I am trying to build avr6 support: > >   BINUTILSPREFIX=avr- ; CROSSOPT="-O- -g -dDEBUG" >   SUBARCH=avr6 >   make clean buildbase  CROSSINSTALL=1 OS_TARGET=embedded > CPU_TARGET=avr SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" > BINUTILSPREFIX=$BINUTILSPREFIX > OPT="-XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/" || exit 1 >   sudo make installbase CROSSINSTALL=1 OS_TARGET=embedded > CPU_TARGET=avr SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" > BINUTILSPREFIX=$BINUTILSPREFIX > INSTALL_UNITDIR=/usr/local/lib/fpc/3.3.1/units/avr-embedded/$SUBARCH/rtl > || exit 1 > > results in: > > /bin/mkdir -p /Users/ring/devel/fpc-avr/rtl/units/avr-embedded > /Users/ring/devel/fpc-avr/compiler/ppcrossavr -Cpavr6 -Ur -Tembedded > -Pavr -XPavr- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../avr -FE. > -FU/Users/ring/devel/fpc-avr/rtl/units/avr-embedded > -XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/ -davr > -dRELEASE -O- -g -dDEBUG  -Us -Sg system.pp @system.cfg > system.pp(293,1) Fatal: Internal error -1413909275 > > Michael > > Am 02.06.19 um 17:56 schrieb Christo Crause: >> >> On Sun, Jun 2, 2019 at 4:51 PM Michael Ring < >> > wrote: >> >> I tried answering a question on the list today and to do so I >> did my >> 'first time ever' compile of the avr target. >> >> This is how I tried to build the avr-embedded target on my Mac: >> >>    SUBARCH=avr5; BINUTILSPREFIX=avr- ; CROSSOPT="-O- -gw2 -dDEBUG" >>    make clean buildbase  CROSSINSTALL=1 OS_TARGET=embedded >> CPU_TARGET=avr SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" >> BINUTILSPREFIX=$BINUTILSPREFIX >> OPT="-XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/" >> || exit 1 >> >> [snip] >> /Users/ring/devel/fpc-avr/rtl/units/avr-embedded/system.s: >> Assembler >> messages: >> /Users/ring/devel/fpc-avr/rtl/units/avr-embedded/system.s:90477: >> Error: >> value of 68582 too large for field of 2 bytes at 4713 >> /Users/ring/devel/fpc-avr/rtl/units/avr-embedded/system.s:90485: >> Error: >> value of 68582 too large for field of 2 bytes at 4731 >> >> >> The compiler picks dwarf3 by default to avoid this type of problem, >> see also >> >> >> Try building without specifying -gw2 in CROSSOPT. >> >> _______________________________________________ >> fpc-devel maillist >> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel > > _______________________________________________ > fpc-devel maillist > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Christo Crause
to Michael Ring
PM Michael Ring wrote 7 lines
Last question: Is avr6 the only subarch that has enough memory for enabling strings? I am a Noob when it comes to avr, but I guess there should be more subarchs that have more memory, I today saw some ATTINY Chips with 32kB of Flash.... Michael

One could enable extra string functionality (at least ansistring) for avr5 and avr51. It doesn't add to the final compiled size if one doesn't use the functionality. It does pull in a substantial amount of code once you start using it (2 - 4 KB in a very simple test, depends of course on the number of different types of string conversions).

Reply by email

Florian Klämpfl
to Christo Crause
Christo Crause wrote 13 lines
On Mon, Jun 3, 2019 at 12:00 PM Michael Ring < > wrote: Last question: Is avr6 the only subarch that has enough memory for enabling strings? I am a Noob when it comes to avr, but I guess there should be more subarchs that have more memory, I today saw some ATTINY Chips with 32kB of Flash.... Michael One could enable extra string functionality (at least ansistring) for avr5 and avr51. It doesn't add to the final compiled size if one doesn't use the functionality.  It does pull in a substantial amount of code once you start using it (2 - 4 KB in a very simple test, depends of course on the number of different types of string conversions).

Ansistrings require exceptions and their init code pulls in some significant amount of code ...

Reply by email

Florian Klämpfl
to Michael Ring: I set CROSSOPT to empty, after this change avr6 builds. BUT: What made me wonder was that…
Michael Ring wrote 25 lines
I set CROSSOPT to empty, after this change avr6 builds. BUT: What made me wonder was that avr5 builds fine, it should be affected by the same SOFTFPU issue. I did a quick grep through the fpc sources and found no obviously missing defines for avr6. However, a grep for avr revealed this code snippet in rtl/embedded/system.cfg: # AVR6 has normally more memory, so enable more functions #ifdef CPUAVR6 -SfANSISTRINGS -SfWIDESTRINGS -SfDYNARRAYS -SfTHREADING -SfVARIANTS -SfOBJECTS -SfCOMMANDARGS -SfRANDOM -SfRESOURCES #endif The build works find with -g when I remove -SfVARIANTS I am also wondering if CPUAVR is set when CPUAVR6 is set (I guess so),

Yes.

if this is true then -SfOBJECTS can also be removed from the CPUAVR6 Define as it is already in the CPUAVR define

This is true indeed.

Last question: Is avr6 the only subarch that has enough memory for enabling strings? I am a Noob when it comes to avr, but I guess there should be more subarchs that have more memory, I today saw some ATTINY Chips with 32kB of Flash....

It depends on the particular controller type and it is a rough estimation when it should be enabled. In practice, one should recompile the rtl with the needed settings.

Reply by email