Sign in Join

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

Mailing lists / fpc-pascal / 2016-01

building arm cross compiler on FreeBSD

9 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Marc Santhoff

Hi,

I'm stuck while trying to build a cross compiler for ARM on FreeBSD. The compiler does not know any arm target. FreeBSD is running on some arm platforms (e.g. beagleboard), but it seems the combination is not implemented in fpc.

Is that correct?

How can I build a build a cross compiler running on FreeBSD compiling for ARM?

TIA,
Marc

Marc Santhoff

Reply by email

Jonas Maebe
to Marc Santhoff
Marc Santhoff wrote
I'm stuck while trying to build a cross compiler for ARM on FreeBSD. The compiler does not know any arm target.

The compiler always only knows all targets for a single architecture. Unless you have a native ARM or a cross-compiler for ARM, it's normal that it doesn't know any ARM targets (just like a native ARM or cross-compiler for ARM doesn't know any non-ARM targets).

Show quoted text 5 lines
FreeBSD is running on some arm platforms (e.g. beagleboard), but it seems the combination is not implemented in fpc. Is that correct?

Yes.

How can I build a build a cross compiler running on FreeBSD compiling for ARM?

Try adding OS_TARGET=embedded to your "make all CPU_TARGET=arm" invocation in the top level directory (assuming you've set up your environment for cross-compiling to embedded).

Jonas

Reply by email

Marc Santhoff
to Jonas Maebe
Jonas Maebe wrote
OS_TARGET=embedded

No, doesn'r do. The error message talks about the assemble, maybe it is the binuitls variant installed?

gmake[3]: Entering directory `/usr/p1/home/marc/program/fpc-cross/src/fpc/rtl/embedded' /usr/local/bin/gmkdir -p /usr/p1/home/marc/program/fpc-cross/src/fpc/rtl/units/arm-embedded /usr/p1/home/marc/program/fpc-cross/src/fpc/compiler/ppcrossarm -Cparmv7m @rtl.cfg -Ur -Tembedded -Parm -XParm-embedded- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -FE. -FU/usr/p1/home/marc/program/fpc-cross/src/fpc/rtl/units/arm-embedded -darm -dRELEASE -XParm-elf- -Us -Sg system.pp Assembler messages:
Error: unknown architecture `armv7-m'

Error: unrecognized option -march=armv7-m
system.pp(285) Error: Error while assembling exitcode 1 system.pp(285) Fatal: There were 2 errors compiling module, stopping Fatal: Compilation aborted

If I try directly:

arm-elf-as -march=armv7-m

Assembler messages:
Error: unknown architecture `armv7-m'

lpkg|grep arm

arm-elf-binutils-2.17

Which version of binutils is needed or what's going worng otherwise?

Marc

Marc Santhoff

Reply by email

Tomas Hajny
to Jonas Maebe: The compiler always only knows all targets for a single architecture. Unless you have a…
Jonas Maebe wrote
On 09/01/16 23:27, Marc Santhoff wrote:

Hi Jonas,

> I'm stuck while trying to build a cross compiler for ARM on FreeBSD. The > compiler does not know any arm target.

.
.

> FreeBSD is running on some arm > platforms (e.g. beagleboard), but it seems the combination is not > implemented in fpc.

.
.

Show quoted text 6 lines
> How can I build a build a cross compiler running on FreeBSD compiling > for ARM? Try adding OS_TARGET=embedded to your "make all CPU_TARGET=arm" invocation in the top level directory (assuming you've set up your environment for cross-compiling to embedded).

I know next to nothing about target embedded or ARM, but the original poster seems to have asked for support of FreeBSD on ARM (which is indeed not available in FPC at the moment as far as I can see, although I would guess that the existing support for Darwin on ARM together with the existing support of FreeBSD on i386 and x86_64 might be a good starting point). Was your suggestion meant just as the first step on the way towards adding support for this target on ARM (would the ARM cross-compiler not having even a start for the requested target really help him in this case?)? Or have I missed something?

Tomas

Reply by email

Michael Ring
to Marc Santhoff: No, doesn'r do. The error message talks about the assemble, maybe it is the binuitls…

Perhaps you should build your own binutils, it seems that the version you are using right now does not properly support armv7-m architecture.

download

ftp://ftp.gnu.org/gnu/binutils/binutils-2.25.1.tar.gz

|extract, create an empty directory and do:|
||
|../binutils-2.25.1/configure --target=arm-none-eabi --disable-multilib --program-prefix=arm-none-eabi-|
||
|sudo make install will install the tools to /usr/local| ||
||
or try this version from freshports:

https://www.freshports.org/devel/gcc-arm-embedded/

It also builds gcc, which of course you do not need.

Michael

Marc Santhoff wrote 29 lines
On Sa, 2016-01-09 at 23:44 +0100, Jonas Maebe wrote: > OS_TARGET=embedded No, doesn'r do. The error message talks about the assemble, maybe it is the binuitls variant installed? gmake[3]: Entering directory `/usr/p1/home/marc/program/fpc-cross/src/fpc/rtl/embedded' /usr/local/bin/gmkdir -p /usr/p1/home/marc/program/fpc-cross/src/fpc/rtl/units/arm-embedded /usr/p1/home/marc/program/fpc-cross/src/fpc/compiler/ppcrossarm -Cparmv7m @rtl.cfg -Ur -Tembedded -Parm -XParm-embedded- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -FE. -FU/usr/p1/home/marc/program/fpc-cross/src/fpc/rtl/units/arm-embedded -darm -dRELEASE -XParm-elf- -Us -Sg system.pp Assembler messages: Error: unknown architecture `armv7-m' Error: unrecognized option -march=armv7-m system.pp(285) Error: Error while assembling exitcode 1 system.pp(285) Fatal: There were 2 errors compiling module, stopping Fatal: Compilation aborted If I try directly: > arm-elf-as -march=armv7-m Assembler messages: Error: unknown architecture `armv7-m' > lpkg|grep arm arm-elf-binutils-2.17 Which version of binutils is needed or what's going worng otherwise? Marc

Reply by email

Jonas Maebe
to Tomas Hajny: . . . . I know next to nothing about target embedded or ARM, but the original poster…
Tomas Hajny wrote 11 lines
On Sat, January 9, 2016 23:44, Jonas Maebe wrote: > On 09/01/16 23:27, Marc Santhoff wrote: >> How can I build a build a cross compiler running on FreeBSD compiling >> for ARM? > Try adding OS_TARGET=embedded to your "make all CPU_TARGET=arm" > invocation in the top level directory (assuming you've set up your > environment for cross-compiling to embedded). I know next to nothing about target embedded or ARM, but the original poster seems to have asked for support of FreeBSD on ARM

His previous messages were about embedded development for ARM. I interpreted "I'm stuck while trying to build a cross compiler for ARM on FreeBSD" as (a cross compiler for ARM) (on FreeBSD) rather than (a cross compiler) (for ARM on FreeBSD), especially given the last sentence from his mail quoted above..

My guess was that the reason he was asking, was that if you do a "make all CPU_TARGET=arm" at the top level to get an ARM cross-compiler, the Makefile will default to $(OS_SOURCE)/$(CPU_TARGET), which will indeed result in complaints about FreeBSD/ARM not being supported if you do it on FreeBSD.

Jonas

Reply by email

Tomas Hajny
to Jonas Maebe
Jonas Maebe wrote 18 lines
Tomas Hajny wrote: > On Sat, January 9, 2016 23:44, Jonas Maebe wrote: >> On 09/01/16 23:27, Marc Santhoff wrote: > >>> How can I build a build a cross compiler running on FreeBSD compiling >>> for ARM? >> Try adding OS_TARGET=embedded to your "make all CPU_TARGET=arm" >> invocation in the top level directory (assuming you've set up your >> environment for cross-compiling to embedded). > > I know next to nothing about target embedded or ARM, but the original > poster seems to have asked for support of FreeBSD on ARM His previous messages were about embedded development for ARM. I interpreted "I'm stuck while trying to build a cross compiler for ARM on FreeBSD" as (a cross compiler for ARM) (on FreeBSD) rather than (a cross compiler) (for ARM on FreeBSD), especially given the last sentence from his mail quoted above..

That's what I guessed from your response. Nevertheless, the message also contained an explicit note of running FreeBSD on his device. I checked it and FreeBSD seems to support the device according to Internet sources indeed.

It's up to the original poster to clarify whether he intends to target FreeBSD on his device, or whether he was interested in creating programs for the device without an operating system.

Show quoted text 5 lines
My guess was that the reason he was asking, was that if you do a "make all CPU_TARGET=arm" at the top level to get an ARM cross-compiler, the Makefile will default to $(OS_SOURCE)/$(CPU_TARGET), which will indeed result in complaints about FreeBSD/ARM not being supported if you do it on FreeBSD.

Yes, I think so as well, but it might be exactly the thing he was interested in.

Tomas

Reply by email

Marc Santhoff
to Tomas Hajny
Tomas Hajny wrote 19 lines
On Sun, January 10, 2016 12:57, Jonas Maebe wrote: > Tomas Hajny wrote: >> On Sat, January 9, 2016 23:44, Jonas Maebe wrote: >>> On 09/01/16 23:27, Marc Santhoff wrote: > His previous messages were about embedded development for ARM. I > interpreted "I'm stuck while trying to build a cross compiler for ARM on > FreeBSD" as (a cross compiler for ARM) (on FreeBSD) rather than (a cross > compiler) (for ARM on FreeBSD), especially given the last sentence from > his mail quoted above.. That's what I guessed from your response. Nevertheless, the message also contained an explicit note of running FreeBSD on his device. I checked it and FreeBSD seems to support the device according to Internet sources indeed. It's up to the original poster to clarify whether he intends to target FreeBSD on his device, or whether he was interested in creating programs for the device without an operating system.

Jonas is right. Compiling a cross compiler with target arm embedded on a system running freebsd.

Marc Santhoff

Reply by email