Sign in Join

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

Mailing lists / fpc-devel / 2009-03

fpc binary for OpenBSD 4.4

8 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Constantine Cusulos

I would like to compile fpc on my OpenBSD4.4/i386 system. The buildfaq (http://www.stack.nl/~marcov/buildfaq.pdf) requires to have a usable fpc binary in order to compile fpc source.

OpenBSD has emulation for binaries from linux and FreeBSD so i got the corresponding binaries from Ubuntu/i386 and FreeBSD/i386. Emulation didn't work. That means that i was not able to use the freepascal compiler on my system with either of those binaries.

Is there a way i can compile fpc on OpenBSD4.4/i386?

Reply by email

Marco van de Voort
to Constantine Cusulos

In our previous episode, Constantine Cusulos said:

Show quoted text 8 lines
I would like to compile fpc on my OpenBSD4.4/i386 system. The buildfaq (http://www.stack.nl/~marcov/buildfaq.pdf) requires to have a usable fpc binary in order to compile fpc source. OpenBSD has emulation for binaries from linux and FreeBSD so i got the corresponding binaries from Ubuntu/i386 and FreeBSD/i386. Emulation didn't work. That means that i was not able to use the freepascal compiler on my system with either of those binaries.

This has been mentioned before:
http://bugs.freepascal.org/view.php?id=10342

It seems like the OpenBSD emulation modes are not working anymore or not complete.

Is there a way i can compile fpc on OpenBSD4.4/i386?

At the moment, no. Getting to the bottom of the emulation modes (asking on OpenBSD lists) would be the best solution.

Reply by email

Daniël Mantione
to Constantine Cusulos: I would like to compile fpc on my OpenBSD4.4/i386 system. The buildfaq…

Op Fri, 13 Mar 2009, schreef Constantine Cusulos:

Show quoted text 10 lines
I would like to compile fpc on my OpenBSD4.4/i386 system. The buildfaq (http://www.stack.nl/~marcov/buildfaq.pdf) requires to have a usable fpc binary in order to compile fpc source. OpenBSD has emulation for binaries from linux and FreeBSD so i got the corresponding binaries from Ubuntu/i386 and FreeBSD/i386. Emulation didn't work. That means that i was not able to use the freepascal compiler on my system with either of those binaries. Is there a way i can compile fpc on OpenBSD4.4/i386?

The OpenBSD code in the rtlis unmaintained, perhaps Marco can give an idea about the state of that code. Since many platform specific code is shared with FreeBSD & Darwin, it can be brought back to life with relative ease.

If a bootstrap compiler is missing it may be possible to compile an OpenBSD execitable on another system. If all else fails, the assembler files can be generated on a Linux system, transfered to OpenBSD and assembled/linked there. But this has almost never been necessary.

Daniël

Reply by email

Marco van de Voort
to Daniël Mantione

In our previous episode, Dani�l Mantione said:

> Is there a way i can compile fpc on OpenBSD4.4/i386? The OpenBSD code in the rtlis unmaintained, perhaps Marco can give an idea about the state of that code.

There is none. OpenBSD was never ported to 2.x. Moreover, when the previous port was done, OpenBSD was still a.out, and a major version older.

The best way would be to start fresh.

Reply by email

Tomas Hajny
Constantine Cusulos wrote 10 lines
I would like to compile fpc on my OpenBSD4.4/i386 system. The buildfaq (http://www.stack.nl/~marcov/buildfaq.pdf) requires to have a usable fpc binary in order to compile fpc source. OpenBSD has emulation for binaries from linux and FreeBSD so i got the corresponding binaries from Ubuntu/i386 and FreeBSD/i386. Emulation didn't work. That means that i was not able to use the freepascal compiler on my system with either of those binaries. Is there a way i can compile fpc on OpenBSD4.4/i386?

Well, do you ask whether there's a way you can compile fpc _on_ OpenBSD, or create fpc _for_ that OpenBSD? For the former the answer is probably "no" (if you tried the emulation and it didn't work). If your goal is "just" having fpc working on your platform at the end, you can build it on one of the supported platforms (e.g. Linux or FreeBSD). There are two ways for doing it (I believe there's some information on cross-compilation on our Wiki among others). One way is using assembler (as) and linker (ld) running on the source platform (e.g. Linux or FreeBSD) and supporting the target platform (OpenBSD). However, that often requires you to copy some files from the target platform (and you need to find the right ones, etc.), so this may not be the easiest option. The other would be only creating assembler files on the source platform using -s parameter and copying these to the target platform to assemble and link the ppc386/fpc binary there (possibly after adjusting some paths in the linker script).

Tomas

Reply by email

Constantine Cusulos
to Constantine Cusulos: I would like to compile fpc on my OpenBSD4.4/i386 system. The buildfaq…

Before posting here, i asked a question about binary emulation on openbsd-misc (http://marc.info/?l=openbsd-misc&m=123688274008042&w=2). If i combine the answers i got there with a little openbsd-misc archive-searching, i can say that OpenBSD's emulation capabilities are at least problematic nowdays.

So, my answer to my initial question would be, most probably, no.

Regarding a "fresh start", as Marco van de Voort put it, i have found some info in the wiki (namely
http://wiki.freepascal.org/Porting_Free_Pascal and http://wiki.freepascal.org/RTL_development_articles).

@Tomas Hajny

The other would be only creating assembler files on the source platform using -s parameter and copying these to the target platform to assemble and link the ppc386/fpc binary there (possibly after adjusting some paths in the linker script).

I do not fully understand this process. From the fpc man page:

-s Tells the compiler not to call the assembler and linker. Instead, the compiler writes a script, PPAS.BAT under DOS, or ppas.sh under Linux, which can then be executed to produce an executable.

There is not much info beyond that. So, a shell script is produced under linux? That could be a potential problem since OpenBSD uses the korn shell and linux uses the bash shell.

In any case, if anybody has a few pointers on how i could begin a fresh start, please submit them.

Reply by email

Tomas Hajny
Constantine Cusulos wrote 12 lines
Before posting here, i asked a question about binary emulation on openbsd-misc (http://marc.info/?l=openbsd-misc&m=123688274008042&w=2). If i combine the answers i got there with a little openbsd-misc archive-searching, i can say that OpenBSD's emulation capabilities are at least problematic nowdays. So, my answer to my initial question would be, most probably, no. Regarding a "fresh start", as Marco van de Voort put it, i have found some info in the wiki (namely http://wiki.freepascal.org/Porting_Free_Pascal and http://wiki.freepascal.org/RTL_development_articles).

Yes, I believe that this should be the right place to start.

Show quoted text 15 lines
@Tomas Hajny > The other would be only > creating assembler files on the source platform using -s parameter and > copying these to the target platform to assemble and link the ppc386/fpc > binary there (possibly after adjusting some paths in the linker script). I do not fully understand this process. From the fpc man page: -s Tells the compiler not to call the assembler and linker. Instead, the compiler writes a script, PPAS.BAT under DOS, or ppas.sh under Linux, which can then be executed to produce an executable. There is not much info beyond that. So, a shell script is produced under linux? That could be a potential problem since OpenBSD uses the korn shell and linux uses the bash shell.

I don't think this should be a real problem. As far as I know, the differences between Korn shell and bash aren't so dramatic as far as I remember (well, certainly not so big compared to e.g. C shell) and the created shell script is just a simple sequence of invocations of external commands. If this really becomes a problem, you'd need to solve it for native compiler too.

However, the main problem is certainly the non-availability of an (up to date) OpenBSD RTL support; admittedly, I didn't know (or rather remember) that noone touched it since the FPC 1.x times.

Tomas

Reply by email

Tomas Hajny
to Constantine Cusulos: Before posting here, i asked a question about binary emulation on openbsd-misc…

On 13 Mar 09, at 20:57, Constantine Cusulos wrote:

.
.

In any case, if anybody has a few pointers on how i could begin a fresh start, please submit them.

Sorry, I skipped this part yesterday. Considering the fact that there's at least partial support of OpenBSD in the compiler (there may be still some missing bits and pieces, but basically it's there), your best bet is probably starting with the RTL. First, /rtl/Makefile.fpc doesn't include reference to the (already existing) openbsd directory (after adding that reference, you need to regenerate the Makefile file using an up to date fpcmake binary). Second, you need either to fix the current content of that directory (it is not even compilable at the moment as you can easily find using "make all 'OS_TARGET=openbsd' 'OPT=-s'" in directory /rtl/openbsd) or possibly recreate the content of that directory completely based on some similar target like FreeBSD - that's what Marco suggested with his "better start from fresh" and he as the maintainer of the FreeBSD target probably knows very well what is talking about).

Hope this helps

Tomas

Reply by email