Giter Site home page Giter Site logo

need ppc64le support about luajit2 HOT 3 OPEN

openresty avatar openresty commented on July 23, 2024
need ppc64le support

from luajit2.

Comments (3)

agentzh avatar agentzh commented on July 23, 2024 4

yeah, we'll look into it. Thanks for the reminder.

from luajit2.

seth-priya avatar seth-priya commented on July 23, 2024

@agentzh I have responded to your queries on #77 , could you please have a look ? Thank you!

from luajit2.

defanator avatar defanator commented on July 23, 2024

@agentzh what's the current state with ppc64 support in LuaJIT2?

The recent code (v2.1-20190507-206-gfe08842) fails to build on ppc64le without the following patch:

diff --git a/src/lib_jit.c b/src/lib_jit.c
index e60ccac..1bf67a7 100644
--- a/src/lib_jit.c
+++ b/src/lib_jit.c
@@ -150,10 +150,10 @@ LJLIB_CF(jit_attach)
 
 LJLIB_CF(jit_prngstate)
 {
+  int i;
   GCtab *cur = lj_tab_new(L, 8, 0);
 
 #if LJ_HASJIT
-  int i;
   jit_State *J = L2J(L);
 
   /* The old state. */
@@ -201,7 +201,7 @@ LJLIB_CF(jit_prngstate)
     J->prng = prng;
   }
 #else
-  for (int i = 1; i <= 8; i++)
+  for (i = 1; i <= 8; i++)
     setintV(lj_tab_setint(L, cur, i), 0);
 #endif
   settabV(L, L->top++, cur);
diff --git a/src/lj_ccallback.c b/src/lj_ccallback.c
index 3dbf1e9..aaf3934 100644
--- a/src/lj_ccallback.c
+++ b/src/lj_ccallback.c
@@ -226,7 +226,7 @@ static void *callback_mcode_init(global_State *g, uint32_t *page)
   MSize slot;
 #if LJ_ARCH_PPC_ELFV2
   // Needs to be in sync with lj_vm_ffi_callback.
-  lua_assert(CALLBACK_MCODE_SIZE == 4096);
+  lj_assertG(CALLBACK_MCODE_SIZE == 4096);
   for (slot = 0; slot < CALLBACK_MAX_SLOT; slot++) {
     *p = PPCI_B | (((page+CALLBACK_MAX_SLOT-p) & 0x00ffffffu) << 2);
     p++;

But even when it builds without issues, luajit fails to start occasionally:

-bash-4.2$ luajit
LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2021 Mike Pall. https://luajit.org/
JIT: OFF
> 
-bash-4.2$ luajit
luajit: cannot create state: not enough memory
-bash-4.2$ luajit
LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2021 Mike Pall. https://luajit.org/
JIT: OFF
> 
-bash-4.2$ luajit
luajit: cannot create state: not enough memory
-bash-4.2$ luajit
LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2021 Mike Pall. https://luajit.org/
JIT: OFF
> 
-bash-4.2$ luajit
luajit: cannot create state: not enough memory

Plenty of memory available though:

-bash-4.2$ head -3 /proc/meminfo 
MemTotal:       33504576 kB
MemFree:        27553024 kB
MemAvailable:   30952256 kB

(ipcs also doesn't show anything meaningful)

Target system is RHEL 7.4 (Linux 3.10.0-693.21.1.el7.ppc64le), gcc 4.8.5 20150623 (Red Hat 4.8.5-16).

from luajit2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.