Re: [fpc-pascal] fpc 2.7.1 for arm-embedded

2012-02-10 Thread Sven Barth

Am 10.02.2012 16:07, schrieb Koenraad Lelong:

On 10-02-12 15:33, Sven Barth wrote:

Am 10.02.2012 14:46, schrieb Koenraad Lelong:

On 10-02-12 13:58, Sven Barth wrote:

If your "fpc-svn" directory is a real svn checkout you can just do a
"svn diff > your-patch.diff". Alternatively you can use should add
"-aur" as argument to diff (in front of the filenames).


Enclosed the new patch. This all compiles, but needs to be verified and
tested.
Or should I make a bugreport ?


Oh, I didn't know you did other changes as well. Then you should do a
"svn diff rtl/inc/text.inc" and make a bugreport for that :)



http://bugs.freepascal.org/view.php?id=21260

I tagged it "major" because without the patch you can't make a
crosscompiler. Maybe too strong ;-) ?


The other modifications are for the controller I want to use. But I
can't test this until later.


I thought so, but they don't belong to this bug report ;)

Regards,
Sven

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 2.7.1 for arm-embedded

2012-02-10 Thread Koenraad Lelong

On 10-02-12 15:33, Sven Barth wrote:

Am 10.02.2012 14:46, schrieb Koenraad Lelong:

On 10-02-12 13:58, Sven Barth wrote:

If your "fpc-svn" directory is a real svn checkout you can just do a
"svn diff > your-patch.diff". Alternatively you can use should add
"-aur" as argument to diff (in front of the filenames).


Enclosed the new patch. This all compiles, but needs to be verified and
tested.
Or should I make a bugreport ?


Oh, I didn't know you did other changes as well. Then you should do a
"svn diff rtl/inc/text.inc" and make a bugreport for that :)



http://bugs.freepascal.org/view.php?id=21260

I tagged it "major" because without the patch you can't make a 
crosscompiler. Maybe too strong ;-) ?



The other modifications are for the controller I want to use. But I 
can't test this until later.


Koenraad.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 2.7.1 for arm-embedded

2012-02-10 Thread Sven Barth

Am 10.02.2012 14:46, schrieb Koenraad Lelong:

On 10-02-12 13:58, Sven Barth wrote:

If your "fpc-svn" directory is a real svn checkout you can just do a
"svn diff > your-patch.diff". Alternatively you can use should add
"-aur" as argument to diff (in front of the filenames).


Enclosed the new patch. This all compiles, but needs to be verified and
tested.
Or should I make a bugreport ?


Oh, I didn't know you did other changes as well. Then you should do a 
"svn diff rtl/inc/text.inc" and make a bugreport for that :)


Regards,
Sven

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 2.7.1 for arm-embedded

2012-02-10 Thread Koenraad Lelong

On 10-02-12 13:58, Sven Barth wrote:

If your "fpc-svn" directory is a real svn checkout you can just do a
"svn diff > your-patch.diff". Alternatively you can use should add
"-aur" as argument to diff (in front of the filenames).


Enclosed the new patch. This all compiles, but needs to be verified and 
tested.

Or should I make a bugreport ?

Regards,

Koenraad.
Index: fpc-svn/rtl/inc/text.inc
===
--- fpc-svn/rtl/inc/text.inc	(revision 20278)
+++ fpc-svn/rtl/inc/text.inc	(working copy)
@@ -1891,11 +1891,13 @@
 {$endif FPC_WIDESTRING_EQUAL_UNICODESTRING}
 
 
+{$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
 procedure ReadAnsiStrFinal(var t: textrec);
 begin
   { finalise the temp ansistring }
   PAnsiString(@t.userdata[StrPtrIndex])^ := '';
 end;
+{$endif FPC_HAS_FEATURE_ANSISTRINGS}
 
 
 procedure ReadStrCommon(var t: textrec; strdata: pchar; len: sizeint);
@@ -1937,7 +1939,7 @@
   PSizeInt(@t.userdata[BytesReadIndex])^:=0;
 end;
 
-
+{$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
 function fpc_SetupReadStr_Ansistr(const s: ansistring): PText; [public, alias: 'FPC_SETUPREADSTR_ANSISTR']; compilerproc;
 begin
   setupreadstrcommon(ReadWriteStrText);
@@ -1950,6 +1952,7 @@
 end;
 
 function fpc_SetupReadStr_Ansistr_Intern(const s: ansistring): PText; [external name 'FPC_SETUPREADSTR_ANSISTR'];
+{$endif FPC_HAS_FEATURE_ANSISTRINGS}
 
 
 function fpc_SetupReadStr_Shortstr(const s: shortstring): PText; compilerproc;
Index: fpc-svn/compiler/arm/cpuinfo.pas
===
--- fpc-svn/compiler/arm/cpuinfo.pas	(revision 20278)
+++ fpc-svn/compiler/arm/cpuinfo.pas	(working copy)
@@ -74,6 +74,8 @@
   ct_at91sam7xc256,
 		
   { STMicroelectronics }
+  ct_stm32f100rb,
+
   ct_stm32f103rb,
   ct_stm32f103re,
   ct_stm32f103c4t,
@@ -301,6 +303,16 @@
 sramsize:$0001
 ),
 
+  	// ct_stm32f100rb,
+(
+	controllertypestr:'STM32F100RB';
+controllerunitstr:'STM32F103';
+interruptvectors:12;
+flashbase:$0800;
+flashsize:$0002;
+srambase:$2000;
+sramsize:$2000
+),
   	// ct_stm32f103rb,
 (
 	controllertypestr:'STM32F103RB';
Index: fpc-svn/compiler/systems/t_embed.pas
===
--- fpc-svn/compiler/systems/t_embed.pas	(revision 20278)
+++ fpc-svn/compiler/systems/t_embed.pas	(working copy)
@@ -232,6 +232,7 @@
   ct_at91sam7x256,
   ct_at91sam7xc256,
 
+  ct_stm32f100rb,
   ct_stm32f103rb,
   ct_stm32f103re,
   ct_stm32f103c4t,
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] fpc 2.7.1 for arm-embedded

2012-02-10 Thread Sven Barth

Am 10.02.2012 12:41, schrieb Koenraad Lelong:

On 10-02-12 11:30, Jonas Maebe wrote:


Now I see: that compilerproc is only included in the RTL if
FPC_HAS_FEATURE_ANSISTRINGS is defined. The embedded target by default
probably does not include support for ansistrings (since they in turn
depend on the heap manager). One helper for readstr(ansistring) is
however always included in the RTL currently, and the ansistring
assignment it contains results in a helper call (fpc_ansistr_assign)
since the introduction of the new ansistrings with code page support (in
the past it didn't, which is why that did not cause a problem
previously).

So it should be simply a matter of adding some extra {$ifdef
FPC_HAS_FEATURE_ANSISTRINGS} defines around that code.


I think I have it fixed. I modified rtl/inc/text.inc, see the enclosed
file. But how do I make a proper patch ? Now I did this :
diff fpc-svn/rtl/inc/text.inc.org fpc-svn/rtl/inc/text.inc


If your "fpc-svn" directory is a real svn checkout you can just do a 
"svn diff > your-patch.diff". Alternatively you can use should add 
"-aur" as argument to diff (in front of the filenames).


Regards,
Sven

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 2.7.1 for arm-embedded

2012-02-10 Thread Koenraad Lelong

On 10-02-12 08:57, Rainer Stratmann wrote:

This means that there is a simple install solution for Linux?
All in one directory?


I don't understand what you want. An install solution for what ?

Koenraad.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 2.7.1 for arm-embedded

2012-02-10 Thread Koenraad Lelong

On 10-02-12 11:30, Jonas Maebe wrote:


Now I see: that compilerproc is only included in the RTL if
FPC_HAS_FEATURE_ANSISTRINGS is defined. The embedded target by default
probably does not include support for ansistrings (since they in turn
depend on the heap manager). One helper for readstr(ansistring) is
however always included in the RTL currently, and the ansistring
assignment it contains results in a helper call (fpc_ansistr_assign)
since the introduction of the new ansistrings with code page support (in
the past it didn't, which is why that did not cause a problem previously).

So it should be simply a matter of adding some extra {$ifdef
FPC_HAS_FEATURE_ANSISTRINGS} defines around that code.

I think I have it fixed. I modified rtl/inc/text.inc, see the enclosed 
file. But how do I make a proper patch ? Now I did this :

diff fpc-svn/rtl/inc/text.inc.org fpc-svn/rtl/inc/text.inc

I only did make a crosscompiler, so it is not fully tested.
And AFAIK the crosscompiler makes thumb2 code now :-)
Now I have to make an rtl for the processor I'm using.

Thanks.

Koenraad
1893a1894
> {$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
1898a1900
> {$endif FPC_HAS_FEATURE_ANSISTRINGS}
1940c1942
< 
---
> {$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
1952a1955
> {$endif FPC_HAS_FEATURE_ANSISTRINGS}

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] fpc 2.7.1 for arm-embedded

2012-02-10 Thread Jonas Maebe


On 10 Feb 2012, at 08:25, Koenraad Lelong wrote:

make rtl_all FPC=/home/koenraad/devel/fpc-svn/compiler/ppcrossarm  
RELEASE=1

make[1]: Map '/home/koenraad/devel/fpc-svn' wordt binnengegaan
make -C rtl all
make[2]: Map '/home/koenraad/devel/fpc-svn/rtl' wordt binnengegaan
make -C embedded all
make[3]: Map '/home/koenraad/devel/fpc-svn/rtl/embedded' wordt  
binnengegaan

/bin/mkdir -p /home/koenraad/devel/fpc-svn/rtl/units/arm-embedded
/home/koenraad/devel/fpc-svn/compiler/ppcrossarm -Cparmv7m @rtl.cfg - 
Ur -Tembedded -Parm -XParm-none-eabi- -Xr -Ur -Xs -O2 -n -Fi../inc - 
Fi../arm -FD/home/koenraad/CodeSourcery/ 
Sourcery_CodeBench_Lite_for_ARM_EABI/bin -FE. -FU/home/koenraad/ 
devel/fpc-svn/rtl/units/arm-embedded -darm -dRELEASE -CfSoft -Us -Sg  
system.pp
text.inc(1897,3) Fatal: Unknown compilerproc "fpc_ansistr_assign".  
Check if you use the correct run time library.

Fatal: Compilation aborted
make[3]: *** [system.ppu] Fout 1
make[3]: Map '/home/koenraad/devel/fpc-svn/rtl/embedded' wordt  
verlaten

make[2]: *** [embedded_all] Fout 2
make[2]: Map '/home/koenraad/devel/fpc-svn/rtl' wordt verlaten
make[1]: *** [rtl_all] Fout 2
make[1]: Map '/home/koenraad/devel/fpc-svn' wordt verlaten
make: *** [base.build-stamp.arm-embedded] Fout 2

What am I doing wrong ? All suggestions to help resolve this are  
welcomed.


Now I see: that compilerproc is only included in the RTL if  
FPC_HAS_FEATURE_ANSISTRINGS is defined. The embedded target by default  
probably does not include support for ansistrings (since they in turn  
depend on the heap manager). One helper for readstr(ansistring) is  
however always included in the RTL currently, and the ansistring  
assignment it contains results in a helper call (fpc_ansistr_assign)  
since the introduction of the new ansistrings with code page support  
(in the past it didn't, which is why that did not cause a problem  
previously).


So it should be simply a matter of adding some extra {$ifdef  
FPC_HAS_FEATURE_ANSISTRINGS} defines around that code.



Jonas___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] fpc 2.7.1 for arm-embedded

2012-02-09 Thread Rainer Stratmann
Am Friday 10 February 2012 08:25:01 schrieb Koenraad Lelong:
> I did another experiment.
> I make a zip-file with a 2.7.1 compiler and its sources. I installled
> this on a brand new virtual machine with OpenSuse, so no fpc 2.6.0
> available. With this I compiled the compiler itself (no install). This
> went fine, so I expect the installation was OK. ...

This means that there is a simple install solution for Linux?
All in one directory?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 2.7.1 for arm-embedded

2012-02-09 Thread Koenraad Lelong

On 08-02-12 17:31, Koenraad Lelong wrote:

On 08-02-12 15:42, Jonas Maebe wrote:


On 08 Feb 2012, at 15:31, Koenraad Lelong wrote:


After some debugging, I think my compiler does not work. I'm pretty
certain it outputs arm-code in stead of the needed thumb2 code.


The error below indicates the compiler does not get to emitting any kind
of code at all.


What I say above is from a crosscompiler made with 2.6.0.
Below is what I get when I try to make a new crosscompiler, using svn
20278.



I just tried to make a crosscompiler using svn 20278, which fails :



I did another experiment.
I make a zip-file with a 2.7.1 compiler and its sources. I installled 
this on a brand new virtual machine with OpenSuse, so no fpc 2.6.0 
available. With this I compiled the compiler itself (no install). This 
went fine, so I expect the installation was OK. Then I tried to make the 
crosscompiler. This failed with the same error as before :


make rtl_all FPC=/home/koenraad/devel/fpc-svn/compiler/ppcrossarm RELEASE=1
make[1]: Map '/home/koenraad/devel/fpc-svn' wordt binnengegaan
make -C rtl all
make[2]: Map '/home/koenraad/devel/fpc-svn/rtl' wordt binnengegaan
make -C embedded all
make[3]: Map '/home/koenraad/devel/fpc-svn/rtl/embedded' wordt binnengegaan
/bin/mkdir -p /home/koenraad/devel/fpc-svn/rtl/units/arm-embedded
/home/koenraad/devel/fpc-svn/compiler/ppcrossarm -Cparmv7m @rtl.cfg -Ur 
-Tembedded -Parm -XParm-none-eabi- -Xr -Ur -Xs -O2 -n -Fi../inc 
-Fi../arm 
-FD/home/koenraad/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin 
-FE. -FU/home/koenraad/devel/fpc-svn/rtl/units/arm-embedded -darm 
-dRELEASE -CfSoft -Us -Sg system.pp
text.inc(1897,3) Fatal: Unknown compilerproc "fpc_ansistr_assign". Check 
if you use the correct run time library.

Fatal: Compilation aborted
make[3]: *** [system.ppu] Fout 1
make[3]: Map '/home/koenraad/devel/fpc-svn/rtl/embedded' wordt verlaten
make[2]: *** [embedded_all] Fout 2
make[2]: Map '/home/koenraad/devel/fpc-svn/rtl' wordt verlaten
make[1]: *** [rtl_all] Fout 2
make[1]: Map '/home/koenraad/devel/fpc-svn' wordt verlaten
make: *** [base.build-stamp.arm-embedded] Fout 2

What am I doing wrong ? All suggestions to help resolve this are welcomed.

Thanks,

Koenraad Lelong.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal