<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-15">
Hi,<br>
<br>
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.<br>
<br>
I have compiled latest binutils for arm based on instructions from
the wiki (
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-15">
./configure --target=arm-linux --prefix=/opt/embarm/
--program-prefix=arm-embedded- --disable-werror) <br>
<br>
on my mac and then have checked out fpc-trunk (
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-15">
<span class="kw2">svn co</span> http:<span class="sy0">//</span>svn.freepascal.org<span
class="sy0">/</span>svn<span class="sy0">/</span>fpc<span
class="sy0">/</span>trunk fpc)<br>
<br>
After starting up the compile (based on installed fpc-2.6.0) I end
up with those error messages:<br>
<br>
make clean buildbase installbase CROSSINSTALL=1 OS_TARGET=embedded
CPU_TARGET=arm SUBARCH=armv7m<br>
.......<br>
/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 <br>
objpas.pp(253,15) Error: Identifier not found "UniqueString"<br>
objpas.pp(259,15) Error: Identifier not found "UniqueString"<br>
objpas.pp(265,15) Error: Identifier not found "UniqueString"<br>
objpas.pp(624) Fatal: There were 3 errors compiling module, stopping<br>
Fatal: Compilation aborted<br>
make[3]: *** [objpas.ppu] Error 1<br>
make[2]: *** [embedded_all] Error 2<br>
make[1]: *** [rtl_all] Error 2<br>
make: *** [base.build-stamp.arm-embedded] Error 2<br>
<br>
<br>
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:<br>
<br>
{$ifdef FPC_HAS_FEATURE_ANSISTRINGS}<br>
<br>
arround the code that breaks the build. I did this and now the cross
compiler compiles just fine<br>
<br>
My question now is did I fix the problem correctly and if yes, could
someone please apply the patch to trunk?<br>
<br>
Thank you,<br>
<br>
Michael<br>
<br>
<br>
Index: rtl/objpas/objpas.pp<br>
===================================================================<br>
--- rtl/objpas/objpas.pp (revision 23253)<br>
+++ rtl/objpas/objpas.pp (working copy)<br>
@@ -87,11 +87,13 @@<br>
Function ParamStr(Param : Integer) : Ansistring;<br>
{$endif FPC_HAS_FEATURE_COMMANDARGS}<br>
<br>
+{$ifdef FPC_HAS_FEATURE_ANSISTRINGS}<br>
{$ifdef FPC_HAS_FEATURE_FILEIO}<br>
Procedure MkDir(s:ansistring);overload;<br>
Procedure RmDir(s:ansistring);overload;<br>
Procedure ChDir(s:ansistring);overload;<br>
{$endif FPC_HAS_FEATURE_FILEIO}<br>
+{$endif FPC_HAS_FEATURE_ANSISTRINGS}<br>
<br>
{****************************************************************************<br>
Resource strings.<br>
@@ -243,7 +245,7 @@<br>
end;<br>
{$endif FPC_HAS_FEATURE_COMMANDARGS}<br>
<br>
-<br>
+{$ifdef FPC_HAS_FEATURE_ANSISTRINGS}<br>
{$ifdef FPC_HAS_FEATURE_FILEIO}<br>
{ xxDirPChar procedures can adjust directory separators in supplied
string (at least<br>
Windows implementation does so). Therefore full copy of argument
is needed,<br>
@@ -266,6 +268,7 @@<br>
ChDirpchar(pchar(s),length(s));<br>
end;<br>
{$endif FPC_HAS_FEATURE_FILEIO}<br>
+{$endif FPC_HAS_FEATURE_ANSISTRINGS}<br>
<br>
{$ifdef FPC_HAS_FEATURE_RESOURCES}<br>
{
---------------------------------------------------------------------<br>
<br>
<br>
<br>
<br>
</body>
</html>