Cross compilation: Difference between revisions

m
syntax highlighting fixup automation
mNo edit summary
m (syntax highlighting fixup automation)
 
Line 39:
instance the Linux binaries of Phix are always compiled on Windows by throwing the following at "p -c -norun p32.exu"
(with a similar p64.exu for 64bit, and formats PE32 and PE64 for the reverse trick):
<!--<langsyntaxhighlight Phixlang="phix">(phixonline)-->
<span style="color: #000000;">format</span> <span style="color: #000000;">ELF32</span>
<span style="color: #008080;">include</span> <span style="color: #000000;">p</span><span style="color: #0000FF;">.</span><span style="color: #000000;">exw</span>
<!--</langsyntaxhighlight>-->
The platform() and machine_bits() builtins can be explictly used as runtime tests to vary code by platform.
The compiler tries hard to avoid emitting unnecessary binary, which is likely to be more successful when those routines are used as plainly as possible, without any and/or parts to the conditional. Likewise #ilASM{} aka inline assembly can contain guards
10,327

edits