[erlang-questions] Port of Erlang (19.2) on AIX
Mikael Pettersson
mikpelinux@REDACTED
Sun Jan 15 10:58:26 CET 2017
REIX, Tony writes:
>
> Hi,
>
> I'd like to port Erlang/OTP on AIX.
>
> After browsing several files and ReadMe files in the source and on Erlang web-site, it seems to me that AIX is not yet handled by Erlang.
>
> I've already started to look at the code. And it appears that there is some assembler code for PowerPC, probably for Linux.
>
> However, browsing the code, I see that it talks of ELF (AIX is XCOFF) and of AIX. I'm quite lost.
> Moreover, I've read that only 32bit Linux/PowerPC is handled. No 64bits. Correct ?
>
> I'd like to find information about:
> - which parts must be modified/extended for handling AIX (XCOFF) ?
> - which parts must be modified/extended for handling 64bit in addition to PowerPC 32bit ?
The Erlang/OTP VM should build without using any of that assembly code. What you need is:
- a POSIX environment (see HOWTO/INSTALL.md)
- a decent ANSI-C or better yet ISO-C compiler, GCC is preferred
- a libc with pthreads (even that might be optional, c.f. Windows, but might need configure-time overrides)
- a termcap or ncurses library (optional but useful for the Erlang shell; --without-termcap if you don't have it)
Note that the VM builds for Windows which is PE-COFF, so there is no hard dependency on ELF.
HiPE (the native code stuff) does work on 64-bit PowerPC, but the runtime support is written for Linux (ELF)
and some older MacOS so would need updating for XCOFF and the AIX assembler, and re-validation for however
the AIX ABI looks these days. Just pass --disable-hipe when configuring and ignore that for now.
Threading uses ordinary pthreads. --disable-threads if the AIX threads are too different.
Threading and SMP support wants atomics. That's a bit of a mess, using GCC inline assembly code
and fallbacks using (I think) pthreads synchronization primitives and/or libatomic. Either way, that code
should build and work without any use of inline assembly code. Try --disable-threads --disable-smp-support
for an initial, basic, but functioning VM.
More information about the erlang-questions
mailing list