Re: [fpc-pascal] Using arm-embedded-fpc

2013-10-26 Thread Koenraad Lelong

op 24-10-13 13:41, Koenraad Lelong schreef:

But I'm unable to locate where that '--build-id' is generated for the
linker-commandline. If that is removed (only for arm-embedded ?), the
build-id will not be generated, so no wasted memory.


Hi,

I found where the '--build-id' is defined : /etc/fpc.cfg
Is this standard ? Or is this something the OpenSuse packager of fpc added ?
I modified it to :
# --
# Use BuildId by default
# --
#IFNDEF EMBEDDED
-k--build-id
#ENDIF

Then is works. Could fpcmkcfg do this, as I understand that this is what 
generates a standard fpc.cfg when installing fpc ?


Koenraad

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


Re: [fpc-pascal] Using arm-embedded-fpc

2013-10-26 Thread Sven Barth
Am 26.10.2013 11:39 schrieb Koenraad Lelong fpasc...@de-brouwerij.be:

 op 24-10-13 13:41, Koenraad Lelong schreef:

 But I'm unable to locate where that '--build-id' is generated for the
 linker-commandline. If that is removed (only for arm-embedded ?), the
 build-id will not be generated, so no wasted memory.

 Hi,

 I found where the '--build-id' is defined : /etc/fpc.cfg
 Is this standard ? Or is this something the OpenSuse packager of fpc
added ?

AFAIK we don't have this in the config by default (also -k is for passing
options to the linker).

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

Re: [fpc-pascal] Using arm-embedded-fpc

2013-10-26 Thread Florian Klämpfl
Am 26.10.2013 11:37, schrieb Koenraad Lelong:
 op 24-10-13 13:41, Koenraad Lelong schreef:
 But I'm unable to locate where that '--build-id' is generated for the
 linker-commandline. If that is removed (only for arm-embedded ?), the
 build-id will not be generated, so no wasted memory.

 Hi,
 
 I found where the '--build-id' is defined : /etc/fpc.cfg
 Is this standard ? Or is this something the OpenSuse packager of fpc
 added ?
 I modified it to :
 # --
 # Use BuildId by default
 # --
 #IFNDEF EMBEDDED
 -k--build-id
 #ENDIF
 
 Then is works. Could fpcmkcfg do this, as I understand that this is what
 generates a standard fpc.cfg when installing fpc ?

The FPC standard installer does not write it, seems to come from Suse.
At least I committed a change so it is put into flash if there is one.

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


Re: [fpc-pascal] Using arm-embedded-fpc

2013-10-24 Thread Koenraad Lelong

op 23-10-13 21:51, Florian Klämpfl schreef:

Am 23.10.2013 20:01, schrieb Michael Ring:

This article describes what build-id does:

https://fedoraproject.org/wiki/Releases/FeatureBuildId

your fix should get applied to trunk, the gnu-build section should end
up somewhere, best place is flash, it will not get used anyway.


Well, the best would be if it ended up nowhere because it eats only
flash memory.


Hi,

I modified t_embed.pas to not include that line in link.res :
.note.gnu.build-id : { *(.note.gnu.build-id) } flash

But I'm unable to locate where that '--build-id' is generated for the 
linker-commandline. If that is removed (only for arm-embedded ?), the 
build-id will not be generated, so no wasted memory.


Regards,

Koenraad.

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


Re: [fpc-pascal] Using arm-embedded-fpc

2013-10-23 Thread Tomas Hajny
On Wed, October 23, 2013 11:23, Koenraad Lelong wrote:
 Hi,

 Searching the mail from this list it seems there are a number of people
 that use fpc to compile for arm-embedded.
 .
 .
 fpc@linux-npjb:~/src-arm-fpc fpc -Parm -Tembedded -Wplpc2124 tled
 Free Pascal Compiler version 2.7.1 [2013/10/23] for arm
 Copyright (c) 1993-2013 by Florian Klaempfl and others
 Target OS: Embedded
 Compiling tled1.pp
 Assembling program
 Linking tled1
 /usr/bin/arm-embedded-ld: error: no memory region specified for loadable
 section `.note.gnu.build-id'
 tled1.pp(54,4) Error: Error while linking
 .
 .
 fpc@linux-npjb:~/src-arm-fpc arm-embedded-ld link.res
 fpc@linux-npjb:~/src-arm-fpc ls -l
 total 312
 -rwxr-xr-x 1 fpc users 357294 okt 23 09:33 a.out
 -rw-r--r-- 1 fpc users867 okt 23 09:31 link.res
 -rw-r--r-- 1 fpc users   3164 okt 23 09:31 tled1.o
 -rw-r--r-- 1 fpc users   1187 okt 23 08:55 tled1.pp

 That seems to work. Dissassembling a.out seems to produce a valid
 assembly source. I also tried this with binutils-2.21.1 with the same
 problem.
 Is there a way to see what parameters fpc generates to invoke the linker ?

Are you aware of compiler option -s (or -sh, but that is the default for
-s if I remember correctly)?

Tomas


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


Re: [fpc-pascal] Using arm-embedded-fpc

2013-10-23 Thread Koenraad Lelong

op 23-10-13 11:33, Tomas Hajny schreef:

On Wed, October 23, 2013 11:23, Koenraad Lelong wrote:

...


Are you aware of compiler option -s (or -sh, but that is the default for
-s if I remember correctly)?

Tomas


Hi Tomas,

fpc@linux:~/src-arm-fpc fpc -Parm -Tembedded -Wplpc2124 -sh tled1.pp
Free Pascal Compiler version 2.7.1 [2013/10/23] for arm
Copyright (c) 1993-2013 by Florian Klaempfl and others
Target OS: Embedded
Compiling tled1.pp
tled1.pp(54,4) Fatal: Can't open executable tled1.elf
Fatal: Compilation aborted
Error: /usr/bin/ppcrossarm returned an error exitcode (normal if you did 
not specify a source file to be compiled)


fpc@linux:~/src-arm-fpc ls -l
total 16
-rw-r--r-- 1 fpc users  867 okt 23 11:55 link.res
-rw-r--r-- 1 fpc users 1187 okt 23 10:33 tled1.pp
-rw-r--r-- 1 fpc users 4710 okt 23 11:55 tled1.s

tled1.s seems the assembly-file of the source. link.res is the same as 
the one I get when I don't use -sh.


Thanks anyway.

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


Re: [fpc-pascal] Using arm-embedded-fpc

2013-10-23 Thread Carsten Bager
Have a look at this file
http://freepascal.dk/files/fpcarm7.tgz
This is a 2.05 compiler, but I am still using it in produktion.
This is an old package that uses LPC2138 as target.
Now a days we use LPC2368 and LPC 2387 as target.
The compiler produce good code.
Regards
Carsten


 On Wed, October 23, 2013 11:23, Koenraad Lelong wrote:
  Hi,
 
  Searching the mail from this list it seems there are a number of people
  that use fpc to compile for arm-embedded.
  .
  .
  fpc@linux-npjb:~/src-arm-fpc fpc -Parm -Tembedded -Wplpc2124 tled
  Free Pascal Compiler version 2.7.1 [2013/10/23] for arm
  Copyright (c) 1993-2013 by Florian Klaempfl and others
  Target OS: Embedded
  Compiling tled1.pp
  Assembling program
  Linking tled1
  /usr/bin/arm-embedded-ld: error: no memory region specified for loadable
  section `.note.gnu.build-id'
  tled1.pp(54,4) Error: Error while linking
  .
  .
  fpc@linux-npjb:~/src-arm-fpc arm-embedded-ld link.res
  fpc@linux-npjb:~/src-arm-fpc ls -l
  total 312
  -rwxr-xr-x 1 fpc users 357294 okt 23 09:33 a.out
  -rw-r--r-- 1 fpc users867 okt 23 09:31 link.res
  -rw-r--r-- 1 fpc users   3164 okt 23 09:31 tled1.o
  -rw-r--r-- 1 fpc users   1187 okt 23 08:55 tled1.pp
 
  That seems to work. Dissassembling a.out seems to produce a valid
  assembly source. I also tried this with binutils-2.21.1 with the same
  problem.
  Is there a way to see what parameters fpc generates to invoke the linker ?
 
 Are you aware of compiler option -s (or -sh, but that is the default for
 -s if I remember correctly)?
 
 Tomas
 
 
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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


Re: [fpc-pascal] Using arm-embedded-fpc

2013-10-23 Thread Koenraad Lelong

op 23-10-13 12:09, Carsten Bager schreef:

Have a look at this file
http://freepascal.dk/files/fpcarm7.tgz
This is a 2.05 compiler, but I am still using it in produktion.
This is an old package that uses LPC2138 as target.
Now a days we use LPC2368 and LPC 2387 as target.
The compiler produce good code.
Regards
Carsten


Hi Carsten,

Unfortunately, my target will be STM32. I used the lpc to follow the 
wiki. Once I get that working I hope the STM32 will be working also. And 
I would like to use fpc 2.7.1 because I know that this version has 
enhanced interrupt-handling. I mean, it's easy to use interrupts, at 
least, I think, reading the sources of the cross-compiler. I once had a 
working STM32 cross-compiler but there you had to be very carefull when 
you defined interrupt-routines.


Thanks anyway.

Koenraad Lelong.

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


Re: [fpc-pascal] Using arm-embedded-fpc

2013-10-23 Thread Carsten Bager
 Hi Carsten,

 Unfortunately, my target will be STM32. I used the lpc to follow the
 wiki. Once I get that working I hope the STM32 will be working also. And
 I would like to use fpc 2.7.1 because I know that this version has
 enhanced interrupt-handling. I mean, it's easy to use interrupts, at
 least, I think, reading the sources of the cross-compiler. I once had a
 working STM32 cross-compiler but there you had to be very carefull when
 you defined interrupt-routines.

 Thanks anyway.

Hi Koenraad
I always write interrupt handling in assembler and then (if necessary) call an 
normal pascal
procedure. This way I can controle how stack and memory issues are handled.
I find i hard to believe that the compiler 2.71 can fulfil all your needs in 
that area.
Regards
Carsten

Med venlig hilsen
Carsten Bager

BEAS A/S
Brørupvænget 10
DK-7650 Bøvlingbjerg
Tlf. : +45 9788 5222 Fax : +45 9788 5434
www.beas.dk


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


Re: [fpc-pascal] Using arm-embedded-fpc

2013-10-23 Thread Jonas Maebe


On 23 Oct 2013, at 12:05, Koenraad Lelong wrote:


fpc@linux:~/src-arm-fpc fpc -Parm -Tembedded -Wplpc2124 -sh tled1.pp
Free Pascal Compiler version 2.7.1 [2013/10/23] for arm
Copyright (c) 1993-2013 by Florian Klaempfl and others
Target OS: Embedded
Compiling tled1.pp
tled1.pp(54,4) Fatal: Can't open executable tled1.elf
Fatal: Compilation aborted
Error: /usr/bin/ppcrossarm returned an error exitcode (normal if you  
did not specify a source file to be compiled)


Can you try again after applying the attached patch?


Jonas


embedded_nolink.patch
Description: Binary data


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

Re: [fpc-pascal] Using arm-embedded-fpc

2013-10-23 Thread Koenraad Lelong

op 23-10-13 13:54, Jonas Maebe schreef:


On 23 Oct 2013, at 12:05, Koenraad Lelong wrote:


fpc@linux:~/src-arm-fpc fpc -Parm -Tembedded -Wplpc2124 -sh tled1.pp
Free Pascal Compiler version 2.7.1 [2013/10/23] for arm
Copyright (c) 1993-2013 by Florian Klaempfl and others
Target OS: Embedded
Compiling tled1.pp
tled1.pp(54,4) Fatal: Can't open executable tled1.elf
Fatal: Compilation aborted
Error: /usr/bin/ppcrossarm returned an error exitcode (normal if you
did not specify a source file to be compiled)


Can you try again after applying the attached patch?


Jonas


Thanks Jonas,

Now I can use -sh. The resulting ppas.sh :

#!/bin/sh
DoExitAsm ()
{ echo An error occurred while assembling $1; exit 1; }
DoExitLink ()
{ echo An error occurred while linking $1; exit 1; }
echo Assembling program
/usr/bin/arm-embedded-as -mfpu=softvfp -o tled1.o tled1.s
if [ $? != 0 ]; then DoExitAsm program; fi
rm tled1.s
echo Linking tled1
OFS=$IFS
IFS=

/usr/bin/arm-embedded-ld -g  --build-id   --gc-sections  -L. -o 
tled1.elf -T link.res

if [ $? != 0 ]; then DoExitLink tled1; fi
IFS=$OFS
echo Linking tled1
OFS=$IFS
IFS=

/usr/bin/arm-embedded-objcopy -O ihex tled1.elf tled1.hex
if [ $? != 0 ]; then DoExitLink tled1; fi
IFS=$OFS

Tinkering with it I found --build-id gives my problem. If that is 
removed, there are no errors.

But I also analyzed link.res :
SEARCH_DIR(/usr/lib/fpc/2.7.1/units/arm-embedded/rtl/)
SEARCH_DIR(/usr/lib/fpc/2.7.1/)
INPUT (
tled1.o
/usr/lib/fpc/2.7.1/units/arm-embedded/rtl/system.o
/usr/lib/fpc/2.7.1/units/arm-embedded/rtl/lpc21x4.o
)
ENTRY(_START)
MEMORY
{
flash : ORIGIN = 0x, LENGTH = 0x0004
ram : ORIGIN = 0x4000, LENGTH = 0x4000
}
_stack_top = 0x40004000;
SECTIONS
{
 .text :
{
_text_start = .;
KEEP(*(.init, .init.*))
*(.text, .text.*)
*(.strings)
*(.rodata, .rodata.*)
*(.comment)
_etext = .;
} flash
.note.gnu.build-id : { *(.note.gnu.build-id) }
.data :
{
_data = .;
*(.data, .data.*)
KEEP (*(.fpc .fpc.n_version .fpc.n_links))
_edata = .;
} ram AT flash
.bss :
{
_bss_start = .;
*(.bss, .bss.*)
*(COMMON)
} ram
. = ALIGN(4);
_bss_end = . ;
}
_end = .;


Deducing from the error-message :
/usr/bin/arm-embedded-ld: error: no memory region specified for loadable 
section `.note.gnu.build-id'


in ppas.sh I modified the line
.note.gnu.build-id : { *(.note.gnu.build-id) }
to
.note.gnu.build-id : { *(.note.gnu.build-id) } flash

Then ppas.sh reports no errors.

I modified compiler/systems/t_embed.pas to have that line, and then the 
compilation of tled1 without -sh produces a tled1.elf. And the 
disassembled tled1.elf seems to be the program when comparing with a 
saved tled1.s.


So, is it safe to include that 'flash' to the linking script via the 
compiler ? Did I find a bug, or am I doing something wrong ?


Thanks for your support.

Koenraad

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


Re: [fpc-pascal] Using arm-embedded-fpc

2013-10-23 Thread Jeppe Græsdal Johansen

Den 23-10-2013 13:15, Carsten Bager skrev:

Hi Carsten,

Unfortunately, my target will be STM32. I used the lpc to follow the
wiki. Once I get that working I hope the STM32 will be working also. And
I would like to use fpc 2.7.1 because I know that this version has
enhanced interrupt-handling. I mean, it's easy to use interrupts, at
least, I think, reading the sources of the cross-compiler. I once had a
working STM32 cross-compiler but there you had to be very carefull when
you defined interrupt-routines.

Thanks anyway.

Hi Koenraad
I always write interrupt handling in assembler and then (if necessary) call an 
normal pascal
procedure. This way I can controle how stack and memory issues are handled.
I find i hard to believe that the compiler 2.71 can fulfil all your needs in 
that area.
Regards
Carsten

It can. And quite elegantly if I should say so :)

It now uses weak linking. Try to take a look at some of the Cortex-M* 
targets. The ARM RTL's haven't been converted yet, but I see no reason 
why they shouldn't be upgraded either. The new solution saves space and 
basically can't get any more efficient.

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


Re: [fpc-pascal] Using arm-embedded-fpc

2013-10-23 Thread Michael Ring
I think I remember that we had a discussion on build-id before, it did 
not work on linux but I thought that Florian has created a fix and I 
think I have verified that it works after that on my linux system.


Are you on Linux? And using trunk compiler? If you do not use trunk then 
please try to use it, hopefully the fix is in there.


Michael


Am 23.10.13 17:58, schrieb Koenraad Lelong:

op 23-10-13 13:54, Jonas Maebe schreef:


On 23 Oct 2013, at 12:05, Koenraad Lelong wrote:


fpc@linux:~/src-arm-fpc fpc -Parm -Tembedded -Wplpc2124 -sh tled1.pp
Free Pascal Compiler version 2.7.1 [2013/10/23] for arm
Copyright (c) 1993-2013 by Florian Klaempfl and others
Target OS: Embedded
Compiling tled1.pp
tled1.pp(54,4) Fatal: Can't open executable tled1.elf
Fatal: Compilation aborted
Error: /usr/bin/ppcrossarm returned an error exitcode (normal if you
did not specify a source file to be compiled)


Can you try again after applying the attached patch?


Jonas


Thanks Jonas,

Now I can use -sh. The resulting ppas.sh :

#!/bin/sh
DoExitAsm ()
{ echo An error occurred while assembling $1; exit 1; }
DoExitLink ()
{ echo An error occurred while linking $1; exit 1; }
echo Assembling program
/usr/bin/arm-embedded-as -mfpu=softvfp -o tled1.o tled1.s
if [ $? != 0 ]; then DoExitAsm program; fi
rm tled1.s
echo Linking tled1
OFS=$IFS
IFS=

/usr/bin/arm-embedded-ld -g  --build-id   --gc-sections  -L. -o 
tled1.elf -T link.res

if [ $? != 0 ]; then DoExitLink tled1; fi
IFS=$OFS
echo Linking tled1
OFS=$IFS
IFS=

/usr/bin/arm-embedded-objcopy -O ihex tled1.elf tled1.hex
if [ $? != 0 ]; then DoExitLink tled1; fi
IFS=$OFS

Tinkering with it I found --build-id gives my problem. If that is 
removed, there are no errors.

But I also analyzed link.res :
SEARCH_DIR(/usr/lib/fpc/2.7.1/units/arm-embedded/rtl/)
SEARCH_DIR(/usr/lib/fpc/2.7.1/)
INPUT (
tled1.o
/usr/lib/fpc/2.7.1/units/arm-embedded/rtl/system.o
/usr/lib/fpc/2.7.1/units/arm-embedded/rtl/lpc21x4.o
)
ENTRY(_START)
MEMORY
{
flash : ORIGIN = 0x, LENGTH = 0x0004
ram : ORIGIN = 0x4000, LENGTH = 0x4000
}
_stack_top = 0x40004000;
SECTIONS
{
 .text :
{
_text_start = .;
KEEP(*(.init, .init.*))
*(.text, .text.*)
*(.strings)
*(.rodata, .rodata.*)
*(.comment)
_etext = .;
} flash
.note.gnu.build-id : { *(.note.gnu.build-id) }
.data :
{
_data = .;
*(.data, .data.*)
KEEP (*(.fpc .fpc.n_version .fpc.n_links))
_edata = .;
} ram AT flash
.bss :
{
_bss_start = .;
*(.bss, .bss.*)
*(COMMON)
} ram
. = ALIGN(4);
_bss_end = . ;
}
_end = .;


Deducing from the error-message :
/usr/bin/arm-embedded-ld: error: no memory region specified for 
loadable section `.note.gnu.build-id'


in ppas.sh I modified the line
.note.gnu.build-id : { *(.note.gnu.build-id) }
to
.note.gnu.build-id : { *(.note.gnu.build-id) } flash

Then ppas.sh reports no errors.

I modified compiler/systems/t_embed.pas to have that line, and then 
the compilation of tled1 without -sh produces a tled1.elf. And the 
disassembled tled1.elf seems to be the program when comparing with a 
saved tled1.s.


So, is it safe to include that 'flash' to the linking script via the 
compiler ? Did I find a bug, or am I doing something wrong ?


Thanks for your support.

Koenraad

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



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


Re: [fpc-pascal] Using arm-embedded-fpc

2013-10-23 Thread Michael Ring

This article describes what build-id does:

https://fedoraproject.org/wiki/Releases/FeatureBuildId

your fix should get applied to trunk, the gnu-build section should end 
up somewhere, best place is flash, it will not get used anyway.


Michael


Am 23.10.13 19:33, schrieb Michael Ring:
I think I remember that we had a discussion on build-id before, it did 
not work on linux but I thought that Florian has created a fix and I 
think I have verified that it works after that on my linux system.


Are you on Linux? And using trunk compiler? If you do not use trunk 
then please try to use it, hopefully the fix is in there.


Michael


Am 23.10.13 17:58, schrieb Koenraad Lelong:

op 23-10-13 13:54, Jonas Maebe schreef:


On 23 Oct 2013, at 12:05, Koenraad Lelong wrote:


fpc@linux:~/src-arm-fpc fpc -Parm -Tembedded -Wplpc2124 -sh tled1.pp
Free Pascal Compiler version 2.7.1 [2013/10/23] for arm
Copyright (c) 1993-2013 by Florian Klaempfl and others
Target OS: Embedded
Compiling tled1.pp
tled1.pp(54,4) Fatal: Can't open executable tled1.elf
Fatal: Compilation aborted
Error: /usr/bin/ppcrossarm returned an error exitcode (normal if you
did not specify a source file to be compiled)


Can you try again after applying the attached patch?


Jonas


Thanks Jonas,

Now I can use -sh. The resulting ppas.sh :

#!/bin/sh
DoExitAsm ()
{ echo An error occurred while assembling $1; exit 1; }
DoExitLink ()
{ echo An error occurred while linking $1; exit 1; }
echo Assembling program
/usr/bin/arm-embedded-as -mfpu=softvfp -o tled1.o tled1.s
if [ $? != 0 ]; then DoExitAsm program; fi
rm tled1.s
echo Linking tled1
OFS=$IFS
IFS=

/usr/bin/arm-embedded-ld -g  --build-id   --gc-sections  -L. -o 
tled1.elf -T link.res

if [ $? != 0 ]; then DoExitLink tled1; fi
IFS=$OFS
echo Linking tled1
OFS=$IFS
IFS=

/usr/bin/arm-embedded-objcopy -O ihex tled1.elf tled1.hex
if [ $? != 0 ]; then DoExitLink tled1; fi
IFS=$OFS

Tinkering with it I found --build-id gives my problem. If that is 
removed, there are no errors.

But I also analyzed link.res :
SEARCH_DIR(/usr/lib/fpc/2.7.1/units/arm-embedded/rtl/)
SEARCH_DIR(/usr/lib/fpc/2.7.1/)
INPUT (
tled1.o
/usr/lib/fpc/2.7.1/units/arm-embedded/rtl/system.o
/usr/lib/fpc/2.7.1/units/arm-embedded/rtl/lpc21x4.o
)
ENTRY(_START)
MEMORY
{
flash : ORIGIN = 0x, LENGTH = 0x0004
ram : ORIGIN = 0x4000, LENGTH = 0x4000
}
_stack_top = 0x40004000;
SECTIONS
{
 .text :
{
_text_start = .;
KEEP(*(.init, .init.*))
*(.text, .text.*)
*(.strings)
*(.rodata, .rodata.*)
*(.comment)
_etext = .;
} flash
.note.gnu.build-id : { *(.note.gnu.build-id) }
.data :
{
_data = .;
*(.data, .data.*)
KEEP (*(.fpc .fpc.n_version .fpc.n_links))
_edata = .;
} ram AT flash
.bss :
{
_bss_start = .;
*(.bss, .bss.*)
*(COMMON)
} ram
. = ALIGN(4);
_bss_end = . ;
}
_end = .;


Deducing from the error-message :
/usr/bin/arm-embedded-ld: error: no memory region specified for 
loadable section `.note.gnu.build-id'


in ppas.sh I modified the line
.note.gnu.build-id : { *(.note.gnu.build-id) }
to
.note.gnu.build-id : { *(.note.gnu.build-id) } flash

Then ppas.sh reports no errors.

I modified compiler/systems/t_embed.pas to have that line, and then 
the compilation of tled1 without -sh produces a tled1.elf. And the 
disassembled tled1.elf seems to be the program when comparing with a 
saved tled1.s.


So, is it safe to include that 'flash' to the linking script via the 
compiler ? Did I find a bug, or am I doing something wrong ?


Thanks for your support.

Koenraad

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



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



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


Re: [fpc-pascal] Using arm-embedded-fpc

2013-10-23 Thread Koenraad Lelong

op 23-10-13 19:33, Michael Ring schreef:

I think I remember that we had a discussion on build-id before, it did
not work on linux but I thought that Florian has created a fix and I
think I have verified that it works after that on my linux system.

Are you on Linux? And using trunk compiler? If you do not use trunk then
please try to use it, hopefully the fix is in there.

Michael


Michael,

I downloaded it this morning, svn trunk. And I'm working on linux.
There was indeed a discussion (started jan 23, by me), but I never could 
compile an application, actually link the application, it was the same 
error. Today I looked into it again, and I hope I found a solution.


Regards,

Koenraad.

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


Re: [fpc-pascal] Using arm-embedded-fpc

2013-10-23 Thread Florian Klämpfl
Am 23.10.2013 20:01, schrieb Michael Ring:
 This article describes what build-id does:
 
 https://fedoraproject.org/wiki/Releases/FeatureBuildId
 
 your fix should get applied to trunk, the gnu-build section should end
 up somewhere, best place is flash, it will not get used anyway.

Well, the best would be if it ended up nowhere because it eats only
flash memory.

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