Skip to content

Commit

Permalink
devel/lua-language-server: fix build on powerpc*
Browse files Browse the repository at this point in the history
In file included from 3rd/bee.lua/binding/lua_thread.cpp:2:
In file included from 3rd/bee.lua/bee/thread/lockqueue.h:5:
3rd/bee.lua/bee/thread/spinlock.h:22:6: error: unsupport platform
    #error unsupport platform
     ^
3rd/bee.lua/bee/thread/spinlock.h:34:21: error: use of undeclared identifier 'cpu_relax'
                    cpu_relax();
  • Loading branch information
pkubaj committed Sep 13, 2022
1 parent 6fe9cfe commit 8e2c64a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
4 changes: 3 additions & 1 deletion devel/lua-language-server/Makefile
Expand Up @@ -11,7 +11,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE

LIB_DEPENDS= libinotify.so:devel/libinotify

USES= lua:build ninja:make
USES= dos2unix lua:build ninja:make
USE_GITHUB= yes
GH_ACCOUNT= sumneko
GH_TUPLE= actboy168:bee.lua:301ad60:bee/3rd/bee.lua \
Expand All @@ -22,6 +22,8 @@ GH_TUPLE= actboy168:bee.lua:301ad60:bee/3rd/bee.lua \
sqmedeiros:lpeglabel:b5d7638:lpeglabel/3rd/lpeglabel

BINARY_ALIAS= gcc=${CC}
DOS2UNIX_FILES= 3rd/bee.lua/bee/thread/spinlock.h \
3rd/luamake/3rd/bee.lua/bee/thread/spinlock.h
SUB_FILES= lua-language-server
PLIST_FILES= bin/lua-language-server \
${DATADIR_REL}/bin/lua-language-server \
Expand Down
@@ -0,0 +1,11 @@
--- 3rd/bee.lua/bee/thread/spinlock.h.orig 2022-09-13 00:54:42 UTC
+++ 3rd/bee.lua/bee/thread/spinlock.h
@@ -18,6 +18,8 @@
asm volatile ("div %0, %0, zero" : "=r" (dummy));
asm volatile ("" ::: "memory");
}}
+#elif defined(__powerpc__)
+ namespace bee { inline void cpu_relax() { asm volatile("ori 0,0,0" ::: "memory"); }}
#else
#error unsupport platform
#endif
@@ -0,0 +1,11 @@
--- 3rd/luamake/3rd/bee.lua/bee/thread/spinlock.h.orig 2022-09-13 00:54:31 UTC
+++ 3rd/luamake/3rd/bee.lua/bee/thread/spinlock.h
@@ -18,6 +18,8 @@
asm volatile ("div %0, %0, zero" : "=r" (dummy));
asm volatile ("" ::: "memory");
}}
+#elif defined(__powerpc__)
+ namespace bee { inline void cpu_relax() { asm volatile("ori 0,0,0" ::: "memory"); }}
#else
#error unsupport platform
#endif

0 comments on commit 8e2c64a

Please sign in to comment.