]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Merge branch 'master' into v2.1
authorMike Pall <mike>
Sun, 10 Dec 2023 14:50:14 +0000 (15:50 +0100)
committerMike Pall <mike>
Sun, 10 Dec 2023 14:50:14 +0000 (15:50 +0100)
1  2 
doc/install.html

index 04bfe26d12f30c8e4a302fb34667ffce7e88aa96,7f2e40e455072dfb6941519f38d0c6da7948b918..b6481443144a5453607cf729a3ca24c7bd3e1a4c
@@@ -252,36 -235,28 +252,37 @@@ directory where <tt>luajit.exe</tt> is 
  
  <h2 id="cross">Cross-compiling LuaJIT</h2>
  <p>
 +First, let's clear up some terminology:
 +</p>
 +<ul>
 +<li>Host: This is your development system, usually based on a x64 or x86 CPU.</li>
 +<li>Target: This is the target system you want LuaJIT to run on, e.g. Android/ARM.</li>
 +<li>Toolchain: This comprises a C compiler, linker, assembler and a matching C library.</li>
 +<li>Host (or system) toolchain: This is the toolchain used to build native binaries for your host system.</li>
 +<li>Cross-compile toolchain: This is the toolchain used to build binaries for the target system. They can only be run on the target system.</li>
 +</ul>
 +<p>
  The GNU Makefile-based build system allows cross-compiling on any host
 -for any supported target, as long as both architectures have the same
 -pointer size. If you want to cross-compile to any 32 bit target on an
 -x64 OS, you need to install the multilib development package (e.g.
 -<tt>libc6-dev-i386</tt> on Debian/Ubuntu) and build a 32 bit host part
 -(<tt>HOST_CC="gcc -m32"</tt>). On some distro versions, multilib conflicts
 -with cross-compilers. The workaround is to install the x86 cross-compiler
 -package <tt>gcc-i686-linux-gnu</tt> and use it to build the host part
 -(<tt>HOST_CC=i686-linux-gnu-gcc</tt>).
 +for any supported target:
  </p>
 +<ul>
 +<li>Yes, you need a toolchain for both your host <em>and</em> your target!</li>
 +<li>Both host and target architectures must have the same pointer size.</li>
 +<li>E.g. if you want to cross-compile to a 32 bit target on a 64 bit host, you need to install the multilib development package (e.g. <tt>libc6-dev-i386</tt> on Debian/Ubuntu) and build a 32 bit host part (<tt>HOST_CC="gcc -m32"</tt>).</li>
++<li>On some distro versions, multilib conflicts with cross-compilers. The workaround is to install the x86 cross-compiler package <tt>gcc-i686-linux-gnu</tt> and use it to build the host part (<tt>HOST_CC=i686-linux-gnu-gcc</tt>).</li>
 +<li>64 bit targets always require compilation on a 64 bit host.</li>
 +</ul>
  <p>
  You need to specify <tt>TARGET_SYS</tt> whenever the host OS and the
 -target OS differ, or you'll get assembler or linker errors. E.g. if
 -you're compiling on a Windows or macOS host for embedded Linux or Android,
 -you need to add <tt>TARGET_SYS=Linux</tt> to the examples below. For a
 -minimal target OS, you may need to disable the built-in allocator in
 -<tt>src/Makefile</tt> and use <tt>TARGET_SYS=Other</tt>. Don't forget to
 -specify the same <tt>TARGET_SYS</tt> for the install step, too.
 +target OS differ, or you'll get assembler or linker errors:
  </p>
 +<ul>
 +<li>E.g. if you're compiling on a Windows or macOS host for embedded Linux or Android, you need to add <tt>TARGET_SYS=Linux</tt> to the examples below.</li>
 +<li>For a minimal target OS, you may need to disable the built-in allocator in <tt>src/Makefile</tt> and use <tt>TARGET_SYS=Other</tt>.</li>
 +<li>Don't forget to specify the same <tt>TARGET_SYS</tt> for the install step, too.</li>
 +</ul>
  <p>
 -The examples below only show some popular targets &mdash; please check
 -the comments in <tt>src/Makefile</tt> for more details.
 +Here are some examples where host and target have the same CPU:
  </p>
  <pre class="code">
  # Cross-compile to a 32 bit binary on a multilib x64 OS