#1 2016-01-22 14:30:33

dexter
Member
Registered: 2015-04-24
Posts: 53

FPC Crosscompile i386/win32 -> powerpc/aix

Hi,

I am able to crosscompile i386/win32 -> i386/linux my mORMot application.

Is it planned to support powerpc/aix?


Edit:
I'm compiling under FPC 3.1.1
It fails on line 225 of file Synopse.inc:  {$ASMMODE INTEL} // as Delphi expects, and I use to write

I tried to define PUREPASCAL, it did not help.

Last edited by dexter (2016-01-22 17:16:27)

Offline

#2 2016-01-23 07:31:40

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: FPC Crosscompile i386/win32 -> powerpc/aix

You could try using the following trick:

Inside Synopse.inc, inside the section for FPC (e.g. at line 200), add:

{$ifdef CPUPOWERPC}
{$define CPUARM}
{$endif}

If all goes well, mORMot should compile ....

Last edited by AOG (2016-01-23 07:32:17)

Offline

#3 2016-01-23 10:11:18

dexter
Member
Registered: 2015-04-24
Posts: 53

Re: FPC Crosscompile i386/win32 -> powerpc/aix

Fails as well, now in SynCommons:

function GetTickCount64: Int64;
begin
  result := SynFPCLinux.GetTickCount64; // <-- here, saying unknown identifier SynFPCLinux
end;

SynFPCLinux is included only when $Linux is defined.

Offline

#4 2016-01-23 10:56:12

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: FPC Crosscompile i386/win32 -> powerpc/aix

Well ... the next trick will obviously be:

{$ifdef AIX}
{$define Linux}
{$endif}

But if this will work .... unlikely ....

Offline

#5 2016-01-23 11:28:26

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,218
Website

Re: FPC Crosscompile i386/win32 -> powerpc/aix

Isn't there a FPC global conditional, which we may use instead of LINUX for SynFPCLinux, for all POSIX functions?

Online

#6 2016-01-23 12:44:14

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: FPC Crosscompile i386/win32 -> powerpc/aix

You can get all macros by doing :

fpc -va
or
'anycompiler' -va

Linux/unix related defines:

Macro defined: LINUX
Macro defined: UNIX
Macro defined: HASUNIX
Macro defined: BSD
Macro defined: HASUNIX

AFAIK, AIX has Linux and Unix defined !

Offline

#7 2016-01-23 13:13:15

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,218
Website

Re: FPC Crosscompile i386/win32 -> powerpc/aix

I doubt AIX has LINUX defined, this it is not Linux based at all.
See http://wiki.freepascal.org/FPC_AIX_Port
and https://en.wikipedia.org/wiki/IBM_AIX
But HASUNIX and UNIX are probably defined for this OS.

What about the "Linux Affinity" program?
http://www-03.ibm.com/systems/power/sof … linux.html

Online

#8 2016-01-23 13:52:51

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: FPC Crosscompile i386/win32 -> powerpc/aix

Mmmm ... I just build a crosscompiler Win -> powerpc/aix.
It states (ppcrossppc.exe -va) : Unix and Linux.
But its definitely not Linux (also according to your links).
?

Offline

#9 2016-01-23 14:12:23

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,218
Website

Re: FPC Crosscompile i386/win32 -> powerpc/aix

So perhaps we may try to replace most LINUX conditionals for FPC specific code to UNIX...

Online

#10 2016-01-23 15:04:51

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: FPC Crosscompile i386/win32 -> powerpc/aix

I personally would very much welcome that !

Would make compilation for Darwin easier !
Darwin = Unix.
Darwin != Linux.

Offline

#11 2016-01-23 15:50:49

dexter
Member
Registered: 2015-04-24
Posts: 53

Re: FPC Crosscompile i386/win32 -> powerpc/aix

ab wrote:

So perhaps we may try to replace most LINUX conditionals for FPC specific code to UNIX...

Agree, would be very good!

Let us know please when it's done, so we can test it.

Offline

#12 2021-02-02 16:20:20

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,218
Website

Re: FPC Crosscompile i386/win32 -> powerpc/aix

For mORMot 2, I have just made a huge refactoring of all Operating-Systems conditionals.

The LINUX conditional was very confusing, and has been renamed as OSPOSIX, which is the opposite of OSWINDOWS.
Then we have OSLINUX OSBSD OSDARWIN OSANDROID and more specific OSBSDDARWIN for OSBSD+OSDARWIN, and OSOPENBSD and OSFREEBSD.
So we don't depend on FPC conditionals any more.

Check https://github.com/synopse/mORMot2/commit/d80ccccb3507

Feedback is welcome!

Online

#13 2021-02-11 20:09:55

PascalDragon
Member
From: Germany
Registered: 2016-06-01
Posts: 12

Re: FPC Crosscompile i386/win32 -> powerpc/aix

ab wrote:

The LINUX conditional was very confusing, and has been renamed as OSPOSIX, which is the opposite of OSWINDOWS.

Please note that by assuming that OSPOSIX is the opposite of OSWINDOWS you're precluding the use of systems that are neither, but would be able to use mORMot in theory (mainly modern OS/2 systems like eComStation and modern Amigas like AROS or MorphOS). If you don't want to support them right away it would be better to simple error out with an $error in the $else case instead of having undefined behavior for them. FPC's define for POSIX compatible systems is indeed UNIX.


Free Pascal Compiler Core developer

Offline

Board footer

Powered by FluxBB