[fpc-devel] Compile problem arm-embedded on trunk (and possible solution)
Michael Ring
mail at michael-ring.org
Sun Dec 30 17:34:12 CET 2012
Hi,
I am currently thinking about switching development from PIC-based
microcontrollers (based on mikroe compilers) to ARM Cortex-M3/4
controllers because they seem to be supported by fpc.
I have compiled latest binutils for arm based on instructions from the
wiki ( ./configure --target=arm-linux --prefix=/opt/embarm/
--program-prefix=arm-embedded- --disable-werror)
on my mac and then have checked out fpc-trunk ( svn co
http://svn.freepascal.org/svn/fpc/trunk fpc)
After starting up the compile (based on installed fpc-2.6.0) I end up
with those error messages:
make clean buildbase installbase CROSSINSTALL=1 OS_TARGET=embedded
CPU_TARGET=arm SUBARCH=armv7m
.......
/Users/ring/devel/fpc/compiler/ppcrossarm -Cparmv7m @rtl.cfg -Ur
-Tembedded -Parm -XParm-embedded- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm
-FE. -FU/Users/ring/devel/fpc/rtl/units/arm-embedded -darm -dRELEASE
-I../objpas ../objpas/objpas.pp
objpas.pp(253,15) Error: Identifier not found "UniqueString"
objpas.pp(259,15) Error: Identifier not found "UniqueString"
objpas.pp(265,15) Error: Identifier not found "UniqueString"
objpas.pp(624) Fatal: There were 3 errors compiling module, stopping
Fatal: Compilation aborted
make[3]: *** [objpas.ppu] Error 1
make[2]: *** [embedded_all] Error 2
make[1]: *** [rtl_all] Error 2
make: *** [base.build-stamp.arm-embedded] Error 2
UniqueString seems to be an Ansistring function and on fpc-pacal I found
a post about a similar problem (Thread name is 'fpc 2.7.1 for
arm-embedded'), the solution there was to add:
{$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
arround the code that breaks the build. I did this and now the cross
compiler compiles just fine
My question now is did I fix the problem correctly and if yes, could
someone please apply the patch to trunk?
Thank you,
Michael
Index: rtl/objpas/objpas.pp
===================================================================
--- rtl/objpas/objpas.pp (revision 23253)
+++ rtl/objpas/objpas.pp (working copy)
@@ -87,11 +87,13 @@
Function ParamStr(Param : Integer) : Ansistring;
{$endif FPC_HAS_FEATURE_COMMANDARGS}
+{$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
{$ifdef FPC_HAS_FEATURE_FILEIO}
Procedure MkDir(s:ansistring);overload;
Procedure RmDir(s:ansistring);overload;
Procedure ChDir(s:ansistring);overload;
{$endif FPC_HAS_FEATURE_FILEIO}
+{$endif FPC_HAS_FEATURE_ANSISTRINGS}
{****************************************************************************
Resource strings.
@@ -243,7 +245,7 @@
end;
{$endif FPC_HAS_FEATURE_COMMANDARGS}
-
+{$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
{$ifdef FPC_HAS_FEATURE_FILEIO}
{ xxDirPChar procedures can adjust directory separators in supplied
string (at least
Windows implementation does so). Therefore full copy of argument is
needed,
@@ -266,6 +268,7 @@
ChDirpchar(pchar(s),length(s));
end;
{$endif FPC_HAS_FEATURE_FILEIO}
+{$endif FPC_HAS_FEATURE_ANSISTRINGS}
{$ifdef FPC_HAS_FEATURE_RESOURCES}
{ ---------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20121230/926c7dd9/attachment.html>
More information about the fpc-devel
mailing list