Sign in Join

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

Mailing lists / fpc-pascal / 2015-08

Issue with Linking

50 messages · 9 people · –

Reply by email Subscribe to this list Your subscription

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

Chris Moody

Hi all,

So I reset up my Pi and I was able to get the current version of FPC to get as far as the linking stage, at which point it shows this:

/usr/bin/ld: warning: link.res contains output sections; did you forget -T? /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi':
(.text+0x88): undefined reference to `_fini'
/home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi':
(.text+0x90): undefined reference to `_init'
Dentist.pas(106) Error: Error while linking
Dentist.pas(106) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
Error: /home/pi/fpc-2.6.4/bin/ppcarm returned an error exitcode (normal if you did not specify a source file to be compiled)

I'm not sure how to fix this. If anyone can assist, it would be greatly appreciated.

Thanks once again,

Chris

Karoly Balogh (Charlie/SGR
to Chris Moody

Hi,

Chris Moody wrote
I'm not sure how to fix this. If anyone can assist, it would be greatly appreciated.

You link against the libc (because of the nature of the source you're compiling) but C development files are not installed on your system.

You should probably:
apt-get install libc-dev

at least, but I usually just install the Debian/Raspbian/Ubuntu "build-essential" package, which installs a ton of other libs and useful development tools. (Warning: this might take some space, so only do this if you have a large-enough storage device on your RPi.)

Charlie

Jonas Maebe
to Chris Moody: So I reset up my Pi and I was able to get the current version of FPC to get as far as the…
Chris Moody wrote 18 lines
So I reset up my Pi and I was able to get the current version of FPC to get as far as the linking stage, at which point it shows this: /usr/bin/ld: warning: link.res contains output sections; did you forget -T? /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x88): undefined reference to `_fini' /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x90): undefined reference to `_init' Dentist.pas(106) Error: Error while linking Dentist.pas(106) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Error: /home/pi/fpc-2.6.4/bin/ppcarm returned an error exitcode (normal if you did not specify a source file to be compiled) I'm not sure how to fix this. If anyone can assist, it would be greatly appreciated.

As mentioned several times before, the standard FPC 2.6.4 does not support the Linux distributions for the Raspberry Pi. You get the linker error because FPC has been compiled for ARM EABI (aka "armel") and is looking for the symbols in the ARM EABI startup code (which is probably not installed on your system), while the Raspberry Pi uses ARM EABIHF.

The solution is to use the FPC 2.6.4 from the package repository of your Raspberry Pi Linux distribution, or to compile FPC 3.x instead of FPC 2.6.4 (with OPT=-dFPC_ARMHF while building FPC).

Jonas

Chris Moody
to Karoly Balogh (Charlie/SGR: You link against the libc (because of the nature of the source you're compiling) but C…
Karoly Balogh wrote 20 lines
Hi, On Wed, 19 Aug 2015, Chris Moody wrote: > I'm not sure how to fix this. If anyone can assist, it would be greatly > appreciated. You link against the libc (because of the nature of the source you're compiling) but C development files are not installed on your system. You should probably: apt-get install libc-dev at least, but I usually just install the Debian/Raspbian/Ubuntu "build-essential" package, which installs a ton of other libs and useful development tools. (Warning: this might take some space, so only do this if you have a large-enough storage device on your RPi.) Charlie _______________________________________________

Hi Charlie, thanks for the quick reply.

It seems I have both already:

~ $ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. ~ $ sudo apt-get install libc-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libc6-dev' instead of 'libc-dev'
libc6-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Any other ideas?

Chris

Chris Moody
to Jonas Maebe: As mentioned several times before, the standard FPC 2.6.4 does not support the Linux…
Jonas Maebe wrote 31 lines
On 19/08/15 22:02, Chris Moody wrote: > So I reset up my Pi and I was able to get the current version of FPC to > get as far as the linking stage, at which point it shows this: > > /usr/bin/ld: warning: link.res contains output sections; did you forget -T? > /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In > function `_haltproc_eabi': > (.text+0x88): undefined reference to `_fini' > /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In > function `_haltproc_eabi': > (.text+0x90): undefined reference to `_init' > Dentist.pas(106) Error: Error while linking > Dentist.pas(106) Fatal: There were 1 errors compiling module, stopping > Fatal: Compilation aborted > Error: /home/pi/fpc-2.6.4/bin/ppcarm returned an error exitcode (normal > if you did not specify a source file to be compiled) > > I'm not sure how to fix this. If anyone can assist, it would be greatly > appreciated. As mentioned several times before, the standard FPC 2.6.4 does not support the Linux distributions for the Raspberry Pi. You get the linker error because FPC has been compiled for ARM EABI (aka "armel") and is looking for the symbols in the ARM EABI startup code (which is probably not installed on your system), while the Raspberry Pi uses ARM EABIHF. The solution is to use the FPC 2.6.4 from the package repository of your Raspberry Pi Linux distribution, or to compile FPC 3.x instead of FPC 2.6.4 (with OPT=-dFPC_ARMHF while building FPC). Jonas

Okay I will try to get the 2.6.4, as I'm not sure how to compile the 3.x if I can't compile on the Pi.

Chris Moody
to Graeme Geldenhuys: Doesn't that apply only for the newer Raspberry Pi 2 models? I have Raspberry Pi 1 model…
Graeme Geldenhuys wrote 8 lines
On 2015-08-19 21:12, Jonas Maebe wrote: > while the Raspberry Pi uses ARM EABIHF. Doesn't that apply only for the newer Raspberry Pi 2 models? I have Raspberry Pi 1 model B revision 2, and I believe mine uses ARM EABI. Regards, - Graeme -

How do I verify what mine uses? I've found the directions at http://michellcomputing.co.uk/blog/2014/05/freepascal-2-7-1-on-raspberry-pi/ can't seem to be followed as Thaddy seems to not renewed his domain name.

This makes it unable to get the seed compiler, unless someone else knows of another location? I was unable to find another one.

Chris

Chris Moody
to Chris Moody: How do I verify what mine uses? I've found the directions at…
Chris Moody wrote 19 lines
On 08/19/2015 03:41 PM, Graeme Geldenhuys wrote: > On 2015-08-19 21:12, Jonas Maebe wrote: >> while the Raspberry Pi uses ARM EABIHF. > Doesn't that apply only for the newer Raspberry Pi 2 models? I have > Raspberry Pi 1 model B revision 2, and I believe mine uses ARM EABI. > > Regards, > - Graeme - > How do I verify what mine uses? I've found the directions at http://michellcomputing.co.uk/blog/2014/05/freepascal-2-7-1-on-raspberry-pi/ can't seem to be followed as Thaddy seems to not renewed his domain name. This makes it unable to get the seed compiler, unless someone else knows of another location? I was unable to find another one. Chris

I also was unable to compile version 3.0 on the Pi:

Writing Resource String Table file: fpmkunit.rsj
Assembling fpmkunit
25119 lines compiled, 9.7 sec
30 warning(s) issued
9 note(s) issued
make[4]: Leaving directory
'/home/pi/dentist/release_3_0_0_rc1/fpcsrc/packages/fpmkunit' /home/pi/dentist/release_3_0_0_rc1/fpcsrc/compiler/ppcarm fpmake.pp -Fu/home/pi/dentist/release_3_0_0_rc1/fpcsrc/packages/fpmkunit/units_bs/arm-linux -Fu/home/pi/dentist/release_3_0_0_rc1/fpcsrc/rtl/units/arm-linux Free Pascal Compiler version 3.0.0rc1 [2015/08/19] for arm Copyright (c) 1993-2015 by Florian Klaempfl and others Target OS: Linux for ARMEL
Compiling fpmake.pp
fpmake.pp(16,3) Note: Local variable "T" is assigned but never used Assembling fpmake
Linking fpmake
fpmake.pp(49) Warning: "crti.o" not found, this will probably cause a linking failure
fpmake.pp(49) Warning: "crtbegin.o" not found, this will probably cause a linking failure
fpmake.pp(49) Warning: "crtend.o" not found, this will probably cause a linking failure
fpmake.pp(49) Warning: "crtn.o" not found, this will probably cause a linking failure
/usr/bin/ld: warning: link.res contains output sections; did you forget -T? /home/pi/dentist/release_3_0_0_rc1/fpcsrc/rtl/units/arm-linux/cprt0.o: In function `_haltproc_eabi':
(.text+0x88): undefined reference to `_fini'
/home/pi/dentist/release_3_0_0_rc1/fpcsrc/rtl/units/arm-linux/cprt0.o: In function `_haltproc_eabi':
(.text+0x90): undefined reference to `_init'
fpmake.pp(49) Error: Error while linking
fpmake.pp(49) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
Makefile:1659: recipe for target 'fpmake' failed
make[3]: *** [fpmake] Error 1
make[3]: Leaving directory
'/home/pi/dentist/release_3_0_0_rc1/fpcsrc/packages' Makefile:2616: recipe for target 'packages_smart' failed make[2]: *** [packages_smart] Error 2
make[2]: Leaving directory '/home/pi/dentist/release_3_0_0_rc1/fpcsrc' Makefile:2812: recipe for target 'build-stamp.arm-linux' failed make[1]: *** [build-stamp.arm-linux] Error 2
make[1]: Leaving directory '/home/pi/dentist/release_3_0_0_rc1/fpcsrc' Makefile:2186: recipe for target 'fpcsrc/build-stamp.arm-linux' failed make: *** [fpcsrc/build-stamp.arm-linux] Error 2

This was compiled with FPC 2.6.4, if this helps any.

Thanks,

Chris

Martin Schreiber
to Chris Moody: How do I verify what mine uses? I've found the directions at…
Chris Moody wrote 8 lines
How do I verify what mine uses? I've found the directions at http://michellcomputing.co.uk/blog/2014/05/freepascal-2-7-1-on-raspberry-pi / can't seem to be followed as Thaddy seems to not renewed his domain name. This makes it unable to get the seed compiler, unless someone else knows of another location? I was unable to find another one.

http://sourceforge.net/projects/mseide-msegui/files/fpcarm/

Please remember:

http://mseide-msegui.sourceforge.net/pics/crossarm.png http://sourceforge.net/projects/mseide-msegui/files/fpcrossarm/

Martin

Martin Schreiber
to Jonas Maebe
Jonas Maebe wrote 8 lines
Chris Moody wrote: > Free Pascal Compiler version 3.0.0rc1 [2015/08/19] for arm > Copyright (c) 1993-2015 by Florian Klaempfl and others > Target OS: Linux for ARMEL This means that you probably did not specify OPT=-dFPC_ARMHF while building FPC 3.0.

Where can we find a list of the possible and necessary options for building the Free Pascal compiler? "compiler/README.txt" looks incomplete. How can we find out the possible make targets and its meanings in "compiler" other than analyzing the make file?

Thanks, Martin

Jonas Maebe
to Martin Schreiber
Martin Schreiber wrote
Where can we find a list of the possible and necessary options for building the Free Pascal compiler? "compiler/README.txt" looks incomplete.

The most complete documentation is Marco's buildfaq:

How can we find out the possible make targets and its meanings in "compiler" other than analyzing the make file?

There is no such documentation at this time, although in general adding CPU_TARGET=x OS_TARGET=y is all you need.

The problem Linux/ARM specifically is also that you have to be pretty much an expert at Linux/ARM and know exactly what the capabilities of your ARM hardware are before you can know what you have to build, independent of instructions regarding how to build it (which doesn't mean that instructions regarding how to build it are superfluous, of course).

The reason is that there are so many different incompatible versions of that platform:
* OABI big/little endian
* OABI with AFP big/little endian
* (EABI versions 0 to 5) with softfloat (always little endian)
* ((EABI versions 0 to 5) with softfp) and ((no fpu) or VFPv2 or (VFPv3/4 with (d16 or d32))) (always little endian)
* ((EABI version 5) with hard-float) and (VFPv2 or (VFPv3/4 with (d16 or d32))) (always little endian)

And there are probably already more in the mean time...

Now, OABI is basically unused nowadays and with the EABI targets there are some fairly safe defaults, so even if you don't know the exact VFP unit or what EABI version you have, the compiler and assembler/linker will generally use something by default that works (albeit not necessarily optimal). So it's not as bad as it may seem at first sight from the above list, but it's far from trivial.

Additionally, the ARM port of FPC was the first one that had to support multiple ABIs for the same platform, and as a result has not been implemented in the best way possible, requiring different compiler binaries to target different ABIs (which is why these extra OPT= parameters are required). Changing that also requires overhauling the build system though, as we would have to store units compiled for a different ABI in different directories. There's an svn branch for this (http://svn.freepascal.org/svn/fpc/branches/target-subdir/ ), but fpmake support for this is still missing (the Makefiles already work fine).

Jonas

Graeme Geldenhuys
to Chris Moody: So I reset up my Pi and I was able to get the current version of FPC to get as far as the…

Hi Chris,

I thought you might try the following pre-built FPC ARM compiler created by Paul Breneman - packaged as "EasyfpGUI". He packages everything you need to get started into a single 5.7MB zip archive. It even includes fpGUI and some demo programs (serial debug terminal, fpGUI's visual forms designer, fpGUI alpha IDE).

Visit this URL:

http://www.turbocontrol.com/easyfpgui.htm

...then scroll down to the "ARM systems" section. The first few links are for Linux/ARM systems. All instructions are shown there too.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/
Martin Schreiber
to Jonas Maebe: The most complete documentation is Marco's buildfaq: There is no such documentation at…
Jonas Maebe wrote 8 lines
The problem Linux/ARM specifically is also that you have to be pretty much an expert at Linux/ARM and know exactly what the capabilities of your ARM hardware are before you can know what you have to build, independent of instructions regarding how to build it (which doesn't mean that instructions regarding how to build it are superfluous, of course).

May I suggest to open a section in the Wiki where the necessary settings for different known ARM hardware/software targets are listed, can be approved by the experts and added to "compiler/README.txt" where it can be kept in sync with the corresponding FPC version?
I don't dare to open such a Wiki section myself because I don't know enough about the matter and I don't know if and where the FPC team likes to place such information.

Thanks, Martin

Jonas Maebe
to Martin Schreiber
Martin Schreiber wrote 13 lines
On Thursday 20 August 2015 10:01:03 Jonas Maebe wrote: > > The problem Linux/ARM specifically is also that you have to be pretty > much an expert at Linux/ARM and know exactly what the capabilities of > your ARM hardware are before you can know what you have to build, > independent of instructions regarding how to build it (which doesn't > mean that instructions regarding how to build it are superfluous, of > course). > May I suggest to open a section in the Wiki where the necessary settings for different known ARM hardware/software targets are listed, can be approved by the experts and added to "compiler/README.txt" where it can be kept in sync with the corresponding FPC version?

That is virtually impossible. You can perfectly install a softfp toolchain and libraries on a Raspberry Pi if you want. Or a hardfloat distribution on a Pandaboard that originally came with a softfp Linux version. Even if you would only consider default installations, then I think there is still no one expert enough to know the details about every possible combination of ARM board and version of a particular Linux distribution.

The only thing we can document is how to build the various compiler flavours for different ARM ABIs and hardware features. Which combination you have is something you will always have to figure out for yourself, and is completely unrelated to FPC (FPC uses standard terminology in this respect).

Jonas

Martin Schreiber
to Jonas Maebe
Jonas Maebe wrote 13 lines
> May I suggest to open a section in the Wiki where the necessary settings > for different known ARM hardware/software targets are listed, can be > approved by the experts and added to "compiler/README.txt" where it can > be kept in sync with the corresponding FPC version? That is virtually impossible. You can perfectly install a softfp toolchain and libraries on a Raspberry Pi if you want. Or a hardfloat distribution on a Pandaboard that originally came with a softfp Linux version. Even if you would only consider default installations, then I think there is still no one expert enough to know the details about every possible combination of ARM board and version of a particular Linux distribution.

I don't mean "every possible combination" but known working settings for usual hardware/software targets. Therefore the Wiki where platform supporter can publish there findings in a central place.
I accept that an up-to-date and maintained "compiler/README.txt" is a pipe dream.

Martin

Chris Moody
to Graeme Geldenhuys: I thought you might try the following pre-built FPC ARM compiler created by Paul Breneman…
Graeme Geldenhuys wrote 19 lines
Hi Chris, I thought you might try the following pre-built FPC ARM compiler created by Paul Breneman - packaged as "EasyfpGUI". He packages everything you need to get started into a single 5.7MB zip archive. It even includes fpGUI and some demo programs (serial debug terminal, fpGUI's visual forms designer, fpGUI alpha IDE). Visit this URL: http://www.turbocontrol.com/easyfpgui.htm ...then scroll down to the "ARM systems" section. The first few links are for Linux/ARM systems. All instructions are shown there too. Regards, - Graeme -

Hi Graeme,

Thanks for that. Do you happen to know if you can build console based apps with it also? I have a deadline fast approaching, and at this point seriously considering re-writing the code in a language I know is supported on the Pi.

I had first chosen FreePascal, because Turbo Pascal was the language I fell in love with first, when I was learning to program. However for the issues I've been having I'm really having to re-think if its been worth it.

Chris

Chris Moody
to Martin Schreiber: http://sourceforge.net/projects/mseide-msegui/files/fpcarm/ Please remember:…
Martin Schreiber wrote 11 lines
On Thursday 20 August 2015 00:56:46 Chris Moody wrote: > How do I verify what mine uses? I've found the directions at > http://michellcomputing.co.uk/blog/2014/05/freepascal-2-7-1-on-raspberry-pi > / can't seem to be followed as Thaddy seems to not renewed his domain name. > > This makes it unable to get the seed compiler, unless someone else knows > of another location? I was unable to find another one. > http://sourceforge.net/projects/mseide-msegui/files/fpcarm/

I downloaded the file from this URL and had it overwrite my installed FPC 2.64 files and I still got :

/usr/bin/ld: warning: link.res contains output sections; did you forget -T? /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi':
(.text+0x88): undefined reference to `_fini'
/home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi':
(.text+0x90): undefined reference to `_init'
Dentist.pas(106) Error: Error while linking
Dentist.pas(106) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
Error: /usr/bin/ppcarm returned an error exitcode

I did notice the file I downloaded did not include a new version of ld, so not sure if I did the correct thing or not.

Chris

Jonas Maebe
to Chris Moody: Thanks for that. Do you happen to know if you can build console based apps with it also?…
Chris Moody wrote
Thanks for that. Do you happen to know if you can build console based apps with it also? I have a deadline fast approaching, and at this point seriously considering re-writing the code in a language I know is supported on the Pi.

I still don't understand why you don't simply install FPC 2.6.4 using the package manager of the Linux distribution on your Raspberry Pi. You can't get more supported than that.

Jonas

Chris Moody
to Jonas Maebe: I still don't understand why you don't simply install FPC 2.6.4 using the package manager…
Jonas Maebe wrote 13 lines
On 20/08/15 15:46, Chris Moody wrote: > Thanks for that. Do you happen to know if you can build console based > apps with it also? I have a deadline fast approaching, and at this point > seriously considering re-writing the code in a language I know is > supported on the Pi. I still don't understand why you don't simply install FPC 2.6.4 using the package manager of the Linux distribution on your Raspberry Pi. You can't get more supported than that. Jonas _______________________________________________

Hi Jonas,

I've done that. Still can't compile code due to ld:

Assembling dentist
Linking Dentist
/usr/bin/ld: warning: link.res contains output sections; did you forget -T? /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi':
(.text+0x88): undefined reference to `_fini'
/home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi':
(.text+0x90): undefined reference to `_init'
Dentist.pas(106) Error: Error while linking
Dentist.pas(106) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
Error: /usr/bin/ppcarm returned an error exitcode

That is the result of: fpc Dentist.pas -Fusource/lib -Fu/usr/lib/fpc/2.6.4/units/arm-linux

So I'm not sure where to go from here.

Chris

Graeme Geldenhuys
to Chris Moody
Chris Moody wrote
I've done that. Still can't compile code due to ld:

If you want I can dump my 4GB SD card to a compressed img and make it available for download on my server. It is the stock Raspbian with EasyFPC - thus a working FPC 2.6.2 compiler.

Alternatively, I can email you the copy of ld I have on my RPi - if that will help. I just checked, it is ld v2.2

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/
Jonas Maebe
to Chris Moody: I've done that. Still can't compile code due to ld: Assembling dentist Linking Dentist…
Chris Moody wrote 14 lines
Assembling dentist Linking Dentist /usr/bin/ld: warning: link.res contains output sections; did you forget -T? /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x88): undefined reference to `_fini' /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x90): undefined reference to `_init' Dentist.pas(106) Error: Error while linking Dentist.pas(106) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Error: /usr/bin/ppcarm returned an error exitcode

Does the compiler also say "Target OS: Linux for ARMHF"?

That is the result of: fpc Dentist.pas -Fusource/lib -Fu/usr/lib/fpc/2.6.4/units/arm-linux

If you need -Fu/usr/lib/fpc/2.6.4/units/arm-linux, that means the configuration file (/etc/fpc.cfg) has not been generated properly. It should have been generated when you installed fpc.

Secondly, do you have a file called /usr/lib/arm-linux-gnueabihf/crti.o ? That is the file containing the _init and _fini symbols. FPC for ARMHF will automatically search /usr/lib/arm-linux-gnueabihf/ for that file if libc is linked and add it to the linker script.

If you don't have that file, install the libc6-dev package (sudo apt-get install libc6-dev). I would expect the fpc package to depend on that though.

Jonas

Henry Vermaak
to Chris Moody: I've done that. Still can't compile code due to ld: Assembling dentist Linking Dentist…
Chris Moody wrote 16 lines
Assembling dentist Linking Dentist /usr/bin/ld: warning: link.res contains output sections; did you forget -T? /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x88): undefined reference to `_fini' /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x90): undefined reference to `_init' Dentist.pas(106) Error: Error while linking Dentist.pas(106) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Error: /usr/bin/ppcarm returned an error exitcode That is the result of: fpc Dentist.pas -Fusource/lib -Fu/usr/lib/fpc/2.6.4/units/arm-linux

Those symbols (_fini and _init) are defined in crti.o. Try `locate crti.o`, you'll get something like /usr/lib/{arch-triplet}/crti.o. Add this directory to your fpc options with -Fl. E.g. fpc -Fl/usr/lib/arm-linux-gnueabi

Henry

Chris Moody
to Jonas Maebe: Does the compiler also say "Target OS: Linux for ARMHF"? If you need…
Jonas Maebe wrote 33 lines
On 20/08/15 16:03, Chris Moody wrote: > Assembling dentist > Linking Dentist > /usr/bin/ld: warning: link.res contains output sections; did you forget -T? > /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In > function `_haltproc_eabi': > (.text+0x88): undefined reference to `_fini' > /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In > function `_haltproc_eabi': > (.text+0x90): undefined reference to `_init' > Dentist.pas(106) Error: Error while linking > Dentist.pas(106) Fatal: There were 1 errors compiling module, stopping > Fatal: Compilation aborted > Error: /usr/bin/ppcarm returned an error exitcode Does the compiler also say "Target OS: Linux for ARMHF"? > That is the result of: fpc Dentist.pas -Fusource/lib > -Fu/usr/lib/fpc/2.6.4/units/arm-linux If you need -Fu/usr/lib/fpc/2.6.4/units/arm-linux, that means the configuration file (/etc/fpc.cfg) has not been generated properly. It should have been generated when you installed fpc. Secondly, do you have a file called /usr/lib/arm-linux-gnueabihf/crti.o ? That is the file containing the _init and _fini symbols. FPC for ARMHF will automatically search /usr/lib/arm-linux-gnueabihf/ for that file if libc is linked and add it to the linker script. If you don't have that file, install the libc6-dev package (sudo apt-get install libc6-dev). I would expect the fpc package to depend on that though. Jonas

I see that the target is:

Target OS: Linux for ARMEL

I do have /usr/lib/arm-linux-gnueabihf/crti.o

I don't need to specify -Fu/usr/lib/fpc/2.6.4/units/arm-linux

is the target os the issue?

Chris

Jonas Maebe
to Henry Vermaak: Those symbols (_fini and _init) are defined in crti.o. Try `locate crti.o`, you'll get…
Henry Vermaak wrote
Those symbols (_fini and _init) are defined in crti.o. Try `locate crti.o`, you'll get something like /usr/lib/{arch-triplet}/crti.o. Add this directory to your fpc options with -Fl. E.g. fpc -Fl/usr/lib/arm-linux-gnueabi

Please do not do that. The compiler looks for that file in the correct location. Telling it to look for it in a different location will make it try to link the file for a wrong ABI.

Jonas

Henry Vermaak
to Jonas Maebe
Jonas Maebe wrote 8 lines
On 20/08/15 16:15, Henry Vermaak wrote: > Those symbols (_fini and _init) are defined in crti.o. Try `locate > crti.o`, you'll get something like /usr/lib/{arch-triplet}/crti.o. Add > this directory to your fpc options with -Fl. E.g. fpc > -Fl/usr/lib/arm-linux-gnueabi Please do not do that. The compiler looks for that file in the correct location.

I'm glad that's fixed then. I've had to do this on all my (Debian based) embedded systems, since the compiler never looked in the right place.

Henry

Martin Schreiber
to Chris Moody: I've done that. Still can't compile code due to ld: Assembling dentist Linking Dentist…
Chris Moody wrote 17 lines
I've done that. Still can't compile code due to ld: Assembling dentist Linking Dentist /usr/bin/ld: warning: link.res contains output sections; did you forget -T? /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x88): undefined reference to `_fini' /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x90): undefined reference to `_init' Dentist.pas(106) Error: Error while linking Dentist.pas(106) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Error: /usr/bin/ppcarm returned an error exitcode

I saw that linker error too. A workaround was to add "xlib" to "uses". This needs an installed xlib-devel package, I don't remember the exact name.

Martin

Chris Moody
to Martin Schreiber
Martin Schreiber wrote 21 lines
On Thursday 20 August 2015 16:03:11 Chris Moody wrote: > I've done that. Still can't compile code due to ld: > > Assembling dentist > Linking Dentist > /usr/bin/ld: warning: link.res contains output sections; did you forget -T? > /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In > function `_haltproc_eabi': > (.text+0x88): undefined reference to `_fini' > /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In > function `_haltproc_eabi': > (.text+0x90): undefined reference to `_init' > Dentist.pas(106) Error: Error while linking > Dentist.pas(106) Fatal: There were 1 errors compiling module, stopping > Fatal: Compilation aborted > Error: /usr/bin/ppcarm returned an error exitcode > I saw that linker error too. A workaround was to add "xlib" to "uses". This needs an installed xlib-devel package, I don't remember the exact name. Martin

I'm hoping this is not the solution for me, as this is a console only app. I would assume by the name xlib would make it more for XWindows?

Chris

Chris Moody
to Graeme Geldenhuys: Yes definitely. I just tried with the latest archive from Paul. I could compile and link…
Graeme Geldenhuys wrote 10 lines
On 2015-08-20 14:46, Chris Moody wrote: > Thanks for that. Do you happen to know if you can build console based > apps with it also? Yes definitely. I just tried with the latest archive from Paul. I could compile and link console apps and fpGUI's demo IDE (gui app). Regards, - Graeme -

I think my issue could be that its compiling either for the wrong chip set, or something, as this also failed in the ld stage.

Chris

Jonas Maebe
to Chris Moody: I see that the target is: Target OS: Linux for ARMEL I do have…
Chris Moody wrote 11 lines
> I see that the target is: Target OS: Linux for ARMEL I do have /usr/lib/arm-linux-gnueabihf/crti.o I don't need to specify -Fu/usr/lib/fpc/2.6.4/units/arm-linux is the target os the issue?

Yes, it is. Are you certain that this is with the system-installed compiler, and not with one of the ones that you tried to install or compile yourself? What does "which fpc" and "which ppcarm" show?

Which version of Raspbian do you have? From what I can see in http://archive.raspbian.org/raspbian/dists/stable/main/source/Sources.xz , the fpc package definitely is the Debian one with the hardfloat patches (2.6.4+dfsg-4+rpi1). Of course, they might still have compiled it for softfp, but that would seem weird.

Jonas

PS: your linker is fine and unrelated.

Martin Schreiber
to Chris Moody: I downloaded the file from this URL and had it overwrite my installed FPC 2.64 files and…
Chris Moody wrote 20 lines
> http://sourceforge.net/projects/mseide-msegui/files/fpcarm/ I downloaded the file from this URL and had it overwrite my installed FPC 2.64 files and I still got : /usr/bin/ld: warning: link.res contains output sections; did you forget -T? /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x88): undefined reference to `_fini' /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x90): undefined reference to `_init' Dentist.pas(106) Error: Error while linking Dentist.pas(106) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Error: /usr/bin/ppcarm returned an error exitcode I did notice the file I downloaded did not include a new version of ld, so not sure if I did the correct thing or not.

Probably not, I assume the .fpc.cfg is not correct.

If you like to use the fixes_3_0 compiler:

On the Pi extract fpc_eabihf_3_0_1.tar.gz to /home/pi/fpc/3_0, copy attached .fpc.cfg to /home/pi.

In order to compile your application:
/home/pi/fpc/3_0/eabihf/lib/fpc/3.0.1/ppcarm -Fu<your unit source dir> \ <yourapplication main file>

Did you try the cross compiling environment?

Martin

Graeme Geldenhuys
to Jonas Maebe: Yes, it is. Are you certain that this is with the system-installed compiler, and not with…
Jonas Maebe wrote
Yes, it is. Are you certain that this is with the system-installed compiler

My working FPC 2.6.0 and 2.6.2 also says "Linux for ARMEL".

Incidentally, if I do 'sudo apt-get install <some_package>' I see apt output like "Get: .... <some_package> armel ...."
It can be any package like 'git', 'mc' etc. My Raspbian is from 2012 - no idea how to find out the exact version number.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/
Jonas Maebe
to Graeme Geldenhuys
Graeme Geldenhuys wrote 9 lines
On 2015-08-20 16:01, Jonas Maebe wrote: > > Yes, it is. Are you certain that this is with the system-installed > > compiler My working FPC 2.6.0 and 2.6.2 also says "Linux for ARMEL". Incidentally, if I do 'sudo apt-get install <some_package>' I see apt output like "Get: .... <some_package> armel ...." It can be any package like 'git', 'mc' etc. My Raspbian is from 2012 - no idea how to find out the exact version number.

Ok, in that case it seems that there are in fact non-hard float versions of Raspbian. Your compiler may work because you also installed the ARMEL version of libc6-dev.

That's another thing:
* Chris may also to solve his problem by installing the ARMEL version of libc6-dev (package name: libc6-dev-armel )
* however, if he then compiles his program and gives the compiled binary to a customer, it may not work if they are using an ARM hard-float installation (unless they also install the libc6-dev-armel package). Of course, if compiles it for hard float and the customer has a softfp system, it will also cause problems.

So maybe it would be useful to first determine whether the customer has an armel or armhf system.

Jonas

Chris Moody
to Jonas Maebe
Jonas Maebe wrote 29 lines
On 20/08/15 18:25, Graeme Geldenhuys wrote: > On 2015-08-20 16:01, Jonas Maebe wrote: >>> Yes, it is. Are you certain that this is with the system-installed >>> compiler > My working FPC 2.6.0 and 2.6.2 also says "Linux for ARMEL". > > Incidentally, if I do 'sudo apt-get install <some_package>' I see apt > output like "Get: .... <some_package> armel ...." > It can be any package like 'git', 'mc' etc. My Raspbian is from 2012 - > no idea how to find out the exact version number. Ok, in that case it seems that there are in fact non-hard float versions of Raspbian. Your compiler may work because you also installed the ARMEL version of libc6-dev. That's another thing: * Chris may also to solve his problem by installing the ARMEL version of libc6-dev (package name: libc6-dev-armel ) * however, if he then compiles his program and gives the compiled binary to a customer, it may not work if they are using an ARM hard-float installation (unless they also install the libc6-dev-armel package). Of course, if compiles it for hard float and the customer has a softfp system, it will also cause problems. So maybe it would be useful to first determine whether the customer has an armel or armhf system. Jonas

To further add to the confusion, I found my Raspberry did not have locate installed, so I asked apt-get to get a copy and it obtained:

Unpacking locate (from .../locate_4.4.2-4_armhf.deb) ...

I did locate https://blogs.oracle.com/jtc/entry/is_it_armhf_or_armel and going by Jim's blog I'm running an armhf system.

So I don't know what I have :(.

Chris

Chris Moody
to Jonas Maebe: Yes, it is. Are you certain that this is with the system-installed compiler, and not with…
Jonas Maebe wrote 26 lines
On 20/08/15 16:19, Chris Moody wrote: > I see that the target is: > > Target OS: Linux for ARMEL > > I do have /usr/lib/arm-linux-gnueabihf/crti.o > > I don't need to specify -Fu/usr/lib/fpc/2.6.4/units/arm-linux > > is the target os the issue? Yes, it is. Are you certain that this is with the system-installed compiler, and not with one of the ones that you tried to install or compile yourself? What does "which fpc" and "which ppcarm" show? Which version of Raspbian do you have? From what I can see in http://archive.raspbian.org/raspbian/dists/stable/main/source/Sources.xz , the fpc package definitely is the Debian one with the hardfloat patches (2.6.4+dfsg-4+rpi1). Of course, they might still have compiled it for softfp, but that would seem weird. Jonas PS: your linker is fine and unrelated. _______________________________________________

The current FPC is from apt-get

~ $ which fpc
/usr/bin/fpc
~ $ which ppcarm
/usr/bin/ppcarm

https://www.raspberrypi.org/downloads/raspbian/ << this is the version of Rasbian I just installed a couple of days of ago.

Chris

Jonas Maebe
to Chris Moody
Chris Moody wrote 6 lines
The current FPC is from apt-get ~ $ which fpc /usr/bin/fpc ~ $ which ppcarm /usr/bin/ppcarm

Ok, now please remove and reinstall that compiler (apt-get remove fpc; apt-get install fpc) to ensure it has not been overwritten by any of your experiments.

Next, if you execute
/usr/bin/ppcarm -l nonexistingfile.pp

what is the complete compiler output?

Jonas

Tomas Hajny
to Jonas Maebe: Yes, it is. Are you certain that this is with the system-installed compiler, and not with…
Jonas Maebe wrote
On 20/08/15 16:19, Chris Moody wrote:

Jonas,

> I see that the target is: > > Target OS: Linux for ARMEL

.
.

Show quoted text 5 lines
> is the target os the issue? Yes, it is. Are you certain that this is with the system-installed compiler, and not with one of the ones that you tried to install or compile yourself? What does "which fpc" and "which ppcarm" show?

.
.

I don't want to raise the confusion any further, especially if my knowledge of ARM is zero. However - are you sure that the output of target as displayed by FPC really shows the correct information reflecting the supported ABI? I ask because a trunk cross-compiler built for armeb using make fullcycle shows "Linux for ARMEL" too (just like it does for the real ARMEL version)...

Tomas

Jonas Maebe
to Tomas Hajny
Tomas Hajny wrote
I don't want to raise the confusion any further, especially if my knowledge of ARM is zero. However - are you sure that the output of target as displayed by FPC really shows the correct information reflecting the supported ABI?

$ ./bin/ppcarmhf2 -l noexisting.pp
Free Pascal Compiler version 2.6.4-dfsg+armhf [1970/01/03] for arm Copyright (c) 1993-2014 by Florian Klaempfl and others Target OS: Linux for ARMHF
Compiling noexisting.pp
Fatal: Can't open file "noexisting.pp"

(the weird compiler date is because I built it myself from the Debian sources, and the date on this system is not set)

I ask because a trunk cross-compiler built for armeb using make fullcycle shows "Linux for ARMEL" too (just like it does for the real ARMEL version)...

That's because the default compiler that gets built for PPC_TARGET=arm is ARMEL these days, while originally it was ARMEB. The fullcycle target in the Makefile has not been updated for that.

So yes, this is completely unrelated, as both of those compilers are in fact ARMEL compilers.

Jonas

Chris Moody
to Jonas Maebe: Ok, now please remove and reinstall that compiler (apt-get remove fpc; apt-get install…
Jonas Maebe wrote 20 lines
Chris Moody wrote: > The current FPC is from apt-get > > ~ $ which fpc > /usr/bin/fpc > ~ $ which ppcarm > /usr/bin/ppcarm Ok, now please remove and reinstall that compiler (apt-get remove fpc; apt-get install fpc) to ensure it has not been overwritten by any of your experiments. Next, if you execute /usr/bin/ppcarm -l nonexistingfile.pp what is the complete compiler output? Jonas

~ $ /usr/bin/ppcarm -l nonexistingfile.pp
Free Pascal Compiler version 2.6.4 [2014/03/21] for arm Copyright (c) 1993-2014 by Florian Klaempfl and others Target OS: Linux for ARMEL
Compiling nonexistingfile.pp
Fatal: Can't open file "nonexistingfile.pp"
Fatal: Compilation aborted

Jonas Maebe
to Chris Moody: To further add to the confusion, I found my Raspberry did not have locate installed, so I…
Chris Moody wrote 9 lines
To further add to the confusion, I found my Raspberry did not have locate installed, so I asked apt-get to get a copy and it obtained: Unpacking locate (from .../locate_4.4.2-4_armhf.deb) ... I did locate https://blogs.oracle.com/jtc/entry/is_it_armhf_or_armel and going by Jim's blog I'm running an armhf system. So I don't know what I have :(.

That indeed suggests you have an armhf system. I really don't get why it's installing an ARMEL compiler. Please file a bug with Raspbian about that.

You can bootstrap an armhf 3.0 compiler on an armel system, but it's a bit tricky:
1) install the armel compiler (you already did that
2) build FPC with OPT="-dFPC_ARMHF" FPCMAKEOPT="-dNO_THREADING"

This last parameter removes the libc dependency from fpmake, so it won't need the _init and _fini symbols. It does not remove threading support from the RTL itself, so that's fine.

This way, FPC 3.0 should build successfully, and you should end up with an FPC 3.0 ARMHF compiler. You can verify it by running "./fpcsrc/compiler/ppcarm -l nonexisting.pp" afterwards and checking that it says it targets ARMHF.

If that is the case, install it in a subdirectory of your home directory (make ... install INSTALL_PREFIX=$HOME/somedir), create a symbolic link from $HOME/somedir/bin/ppcarm to $HOME/somedir/lib/fpc/3.0/ppcarm, add $HOME/somedir/bin to the front of your path, and finally add the following lines to ~/.fpc.cfg

#ifdef VER3_0
-Fu/home/pi/somedir/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/home/pi/somedir/lib/fpc/$fpcversion/units/$fpctarget/rtl #endif

That should enable you to use both "fpc" and "ppcarm" to compile programs using this newly built FPC 3.0.

Jonas

Chris Moody
to Jonas Maebe
Jonas Maebe wrote 45 lines
Chris Moody wrote: > To further add to the confusion, I found my Raspberry did not have > locate installed, so I asked apt-get to get a copy and it obtained: > > Unpacking locate (from .../locate_4.4.2-4_armhf.deb) ... > > I did locate https://blogs.oracle.com/jtc/entry/is_it_armhf_or_armel and > going by Jim's blog I'm running an armhf system. > > So I don't know what I have :(. That indeed suggests you have an armhf system. I really don't get why it's installing an ARMEL compiler. Please file a bug with Raspbian about that. You can bootstrap an armhf 3.0 compiler on an armel system, but it's a bit tricky: 1) install the armel compiler (you already did that 2) build FPC with OPT="-dFPC_ARMHF" FPCMAKEOPT="-dNO_THREADING" This last parameter removes the libc dependency from fpmake, so it won't need the _init and _fini symbols. It does not remove threading support from the RTL itself, so that's fine. This way, FPC 3.0 should build successfully, and you should end up with an FPC 3.0 ARMHF compiler. You can verify it by running "./fpcsrc/compiler/ppcarm -l nonexisting.pp" afterwards and checking that it says it targets ARMHF. If that is the case, install it in a subdirectory of your home directory (make ... install INSTALL_PREFIX=$HOME/somedir), create a symbolic link from $HOME/somedir/bin/ppcarm to $HOME/somedir/lib/fpc/3.0/ppcarm, add $HOME/somedir/bin to the front of your path, and finally add the following lines to ~/.fpc.cfg #ifdef VER3_0 -Fu/home/pi/somedir/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/home/pi/somedir/lib/fpc/$fpcversion/units/$fpctarget/rtl #endif That should enable you to use both "fpc" and "ppcarm" to compile programs using this newly built FPC 3.0. Jonas

./ppcarm -l nonexisting.pp
Free Pascal Compiler version 3.0.0rc1 [2015/08/20] for arm Copyright (c) 1993-2015 by Florian Klaempfl and others Target OS: Linux for ARMHF
Compiling nonexisting.pp
Fatal: Cannot open file "nonexisting.pp"
Fatal: Compilation aborted

Yay! thanks for all the help everyone!

Chris

Chris Moody
to Jonas Maebe: That indeed suggests you have an armhf system. I really don't get why it's installing an…
Jonas Maebe wrote 45 lines
Chris Moody wrote: > To further add to the confusion, I found my Raspberry did not have > locate installed, so I asked apt-get to get a copy and it obtained: > > Unpacking locate (from .../locate_4.4.2-4_armhf.deb) ... > > I did locate https://blogs.oracle.com/jtc/entry/is_it_armhf_or_armel and > going by Jim's blog I'm running an armhf system. > > So I don't know what I have :(. That indeed suggests you have an armhf system. I really don't get why it's installing an ARMEL compiler. Please file a bug with Raspbian about that. You can bootstrap an armhf 3.0 compiler on an armel system, but it's a bit tricky: 1) install the armel compiler (you already did that 2) build FPC with OPT="-dFPC_ARMHF" FPCMAKEOPT="-dNO_THREADING" This last parameter removes the libc dependency from fpmake, so it won't need the _init and _fini symbols. It does not remove threading support from the RTL itself, so that's fine. This way, FPC 3.0 should build successfully, and you should end up with an FPC 3.0 ARMHF compiler. You can verify it by running "./fpcsrc/compiler/ppcarm -l nonexisting.pp" afterwards and checking that it says it targets ARMHF. If that is the case, install it in a subdirectory of your home directory (make ... install INSTALL_PREFIX=$HOME/somedir), create a symbolic link from $HOME/somedir/bin/ppcarm to $HOME/somedir/lib/fpc/3.0/ppcarm, add $HOME/somedir/bin to the front of your path, and finally add the following lines to ~/.fpc.cfg #ifdef VER3_0 -Fu/home/pi/somedir/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/home/pi/somedir/lib/fpc/$fpcversion/units/$fpctarget/rtl #endif That should enable you to use both "fpc" and "ppcarm" to compile programs using this newly built FPC 3.0. Jonas

Seems it compiles but still complains about linking.

Free Pascal Compiler version 3.0.0rc1 [2015/08/20] for arm Copyright (c) 1993-2015 by Florian Klaempfl and others Target OS: Linux for ARMHF
<snip>
Assembling dentist
Linking Dentist
Dentist.pas(106) Warning: "crtbegin.o" not found, this will probably cause a linking failure
Dentist.pas(106) Warning: "crtend.o" not found, this will probably cause a linking failure
/usr/bin/ld: warning: link.res contains output sections; did you forget -T? 10358 lines compiled, 8.9 sec
10 warning(s) issued
2 note(s) issued

Thanks for the help Jonas and others!

Chris

Jonas Maebe
to Chris Moody
Chris Moody wrote 12 lines
Seems it compiles but still complains about linking. Free Pascal Compiler version 3.0.0rc1 [2015/08/20] for arm Copyright (c) 1993-2015 by Florian Klaempfl and others Target OS: Linux for ARMHF <snip> Assembling dentist Linking Dentist Dentist.pas(106) Warning: "crtbegin.o" not found, this will probably cause a linking failure Dentist.pas(106) Warning: "crtend.o" not found, this will probably cause a linking failure

These are gcc files. When performing a regular installation of FPC, the path to these files is added to fpc.cfg using the -Fl parameter.

You can manually get this path with
dirname `gcc --print-libgcc-file-name`

Then add -Fl<result_of_the_above> to the "#ifdef VER3_0" section of your .fpc.cfg

Jonas

Florian Klaempfl
to Jonas Maebe
Jonas Maebe wrote 16 lines
Chris Moody wrote: > Seems it compiles but still complains about linking. > > Free Pascal Compiler version 3.0.0rc1 [2015/08/20] for arm > Copyright (c) 1993-2015 by Florian Klaempfl and others > Target OS: Linux for ARMHF > <snip> > Assembling dentist > Linking Dentist > Dentist.pas(106) Warning: "crtbegin.o" not found, this will probably > cause a linking failure > Dentist.pas(106) Warning: "crtend.o" not found, this will probably cause > a linking failure These are gcc files. When performing a regular installation of FPC, the path to these files is added to fpc.cfg using the -Fl parameter.

Actually, FPC has also some default locations hard coded in the compiler.

Chris Moody
to Jonas Maebe: These are gcc files. When performing a regular installation of FPC, the path to these…
Jonas Maebe wrote 26 lines
Chris Moody wrote: > Seems it compiles but still complains about linking. > > Free Pascal Compiler version 3.0.0rc1 [2015/08/20] for arm > Copyright (c) 1993-2015 by Florian Klaempfl and others > Target OS: Linux for ARMHF > <snip> > Assembling dentist > Linking Dentist > Dentist.pas(106) Warning: "crtbegin.o" not found, this will probably > cause a linking failure > Dentist.pas(106) Warning: "crtend.o" not found, this will probably cause > a linking failure These are gcc files. When performing a regular installation of FPC, the path to these files is added to fpc.cfg using the -Fl parameter. You can manually get this path with dirname `gcc --print-libgcc-file-name` Then add -Fl<result_of_the_above> to the "#ifdef VER3_0" section of your .fpc.cfg Jonas

For now I won't worry about it as the code does turn into an executable program. Just thought I would report it, in case anyone was curious.

Chris

Tony Caduto
to Chris Moody: So I reset up my Pi and I was able to get the current version of FPC to get as far as the…

Msmw.amaal

"Chris Moody" wrote 28 lines
Hi all, So I reset up my Pi and I was able to get the current version of FPC to get as far as the linking stage, at which point it shows this: /usr/bin/ld: warning: link.res contains output sections; did you forget -T? /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x88): undefined reference to `_fini' /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x90): undefined reference to `_init' Dentist.pas(106) Error: Error while linking Dentist.pas(106) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Error: /home/pi/fpc-2.6.4/bin/ppcarm returned an error exitcode (normal if you did not specify a source file to be compiled) I'm not sure how to fix this. If anyone can assist, it would be greatly appreciated. Thanks once again, Chris _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal