Sign in Join

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

Mailing lists / fpc-devel / 2021-02

Making $FPCABI work as expected for embedded targets

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Michael Ring

There is an issue with compiling code for armv7em, we may compile with hardfloat support or without. The compiled files are link-incompatible as ABI is different so mixing them is a bad thing.

I played arround with $FPCABI in fpc.cfg but found out that it is always set to 'default' because the parameter -Ca is not parsed on firstpass and fpc.cfg is evaluated immediately after firstpass and for that reason my entries that contain '$FPCABI' get discarded.

I use those entries in fpc.cfg:

-Fu/Users/ring/fpcupdeluxe-embedded/fpc/units/arm-embedded/$FPCSUBARCH/$FPCABI/rtl -Fu/Users/ring/fpcupdeluxe-embedded/fpc/units/arm-embedded/$FPCSUBARCH/$FPCABI/packages

To solve this I have made -Ca a first-pass option:

diff --git a/compiler/options.pas b/compiler/options.pas index 4bf2bf35f5..c410d9d4b0 100644
--- a/compiler/options.pas
+++ b/compiler/options.pas
@@ -1118,6 +1118,7 @@ begin
           ((length(opt)>1) and (opt[2] in ['i','d','v','T','u','n','X','l','U'])) or
           ((length(opt)>3) and (opt[2]='F') and (opt[3]='e')) or            ((length(opt)>3) and (opt[2]='C') and (opt[3]='p')) or +          ((length(opt)>3) and (opt[2]='C') and (opt[3]='a')) or            ((length(opt)>3) and (opt[2]='W') and (opt[3] in ['m','p']))           )
         ) then

and now evaluation of $FPCABI seems to work just fine.

But as I am not that deep in the internals of FPC the question is if my change makes sense or if sonner or later my cat will explode or my Mac will suddenly convert to run Windows... or some other harmfull things will happen with making Ca firstpass.

If this causes no issue, can this please be applied to trunk to make $FPCABI actually work?

Thank you,

Michael

Reply by email

Florian Klämpfl
to Michael Ring
Michael Ring wrote 7 lines
But as I am not that deep in the internals of FPC the question is if my change makes sense or if sonner or later my cat will explode or my Mac will suddenly convert to run Windows... or some other harmfull things will happen with making Ca firstpass. If this causes no issue, can this please be applied to trunk to make $FPCABI actually work?

It should be correct, I added -Cf as well.

Reply by email

Michael Ring
to Florian Klämpfl

I just updated to latest trunk and found out that armv7m and armv7em RTL does not build anymore:

/Library/Developer/CommandLineTools/usr/bin/make -C rtl all /Library/Developer/CommandLineTools/usr/bin/make -C embedded all /Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin/ppcarm -Cparmv7m -Ur -Tembedded -Parm -XParm-none-eabi- -Ur -Xs -O2 -n -Fi../inc -Fi../arm -FD/Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin -FE. -FU/Users/ring/devel/fpc.svn/rtl/units/arm-embedded -vw-n-h-l-d-u-t-p-c- -ap -Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -darm -dRELEASE  -Us -Sg system.pp @system.cfg
softfpu.pp(586,1) Error: Compilation raised exception internally Fatal: Compilation aborted
An unhandled exception occurred at $0000000101503B3A: EAccessViolation: Access violation
  $0000000101503B3A

Reply by email

Michael Ring
to Michael Ring

Code now compiles again, thank you for fixing!

Michael

Michael Ring wrote 21 lines
I just updated to latest trunk and found out that armv7m and armv7em RTL does not build anymore: /Library/Developer/CommandLineTools/usr/bin/make -C rtl all /Library/Developer/CommandLineTools/usr/bin/make -C embedded all /Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin/ppcarm -Cparmv7m -Ur -Tembedded -Parm -XParm-none-eabi- -Ur -Xs -O2 -n -Fi../inc -Fi../arm -FD/Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin -FE. -FU/Users/ring/devel/fpc.svn/rtl/units/arm-embedded -vw-n-h-l-d-u-t-p-c- -ap -Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -darm -dRELEASE  -Us -Sg system.pp @system.cfg softfpu.pp(586,1) Error: Compilation raised exception internally Fatal: Compilation aborted An unhandled exception occurred at $0000000101503B3A: EAccessViolation: Access violation   $0000000101503B3A _______________________________________________ fpc-devel maillist  -  https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email