Cross compilation: Difference between revisions
Content added Content deleted
mNo edit summary |
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
||
Line 39: | Line 39: | ||
instance the Linux binaries of Phix are always compiled on Windows by throwing the following at "p -c -norun p32.exu" |
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): |
(with a similar p64.exu for 64bit, and formats PE32 and PE64 for the reverse trick): |
||
<!--< |
<!--<syntaxhighlight lang="phix">(phixonline)--> |
||
<span style="color: #000000;">format</span> <span style="color: #000000;">ELF32</span> |
<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> |
<span style="color: #008080;">include</span> <span style="color: #000000;">p</span><span style="color: #0000FF;">.</span><span style="color: #000000;">exw</span> |
||
<!--</ |
<!--</syntaxhighlight>--> |
||
The platform() and machine_bits() builtins can be explictly used as runtime tests to vary code by platform. |
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 |
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 |