|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80717 Calling minilua during cross-compiling
Submitted: 2021-02-06 13:09 UTC Modified: -
From: mhei at heimpold dot de Assigned:
Status: Open Package: Compile Failure
PHP Version: 8.0.2 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: mhei at heimpold dot de
New email:
PHP Version: OS:


 [2021-02-06 13:09 UTC] mhei at heimpold dot de
During OpenWrt "cross-compiling" for x86_64, we noticed that during the build a minilua compiler is generated and finally invoked. I refer to the following lines
in ext/opcache/jit/Makefile.frag:

  $(builddir)/minilua: $(srcdir)/jit/dynasm/minilua.c
    $(CC) $(srcdir)/jit/dynasm/minilua.c -lm -o $@

  $(builddir)/jit/zend_jit_x86.c: $(srcdir)/jit/zend_jit_x86.dasc $(srcdir)/jit/dynasm/*.lua $(builddir)/minilua
    $(builddir)/minilua $(srcdir)/jit/dynasm/dynasm.lua  $(DASM_FLAGS) -o $@ $(srcdir)/jit/zend_jit_x86.dasc

While this is fine when doing a native build, it fails for "cross-compiling" e.g. due to different used C libraries (e.g. target=musl, host=glibc). Our solution is to convert the $(CC) to $(HOSTCC) which is then passed via environment. Not sure, whether this is the best solution. Also it might need additional makefile magic for none "cross-compiling" environments.


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Sep 23 19:03:37 2021 UTC