lua-language-server: fix CANNOT_LINK_EXECUTABLE

This commit is contained in:
Aditya Alok 2021-10-27 22:18:39 +05:30
parent 71bb06f4a6
commit 642e701260
No known key found for this signature in database
GPG Key ID: 5A52117417798AC7
4 changed files with 32 additions and 12 deletions

View File

@ -0,0 +1,11 @@
--- lua-language-server/3rd/luamake/compile/ninja/android.ninja 2021-10-27 21:38:40.667928105 +0530
+++ lua-language-server-patch/3rd/luamake/compile/ninja/android.ninja 2021-10-27 21:37:31.217928132 +0530
@@ -116,7 +116,7 @@
build $obj/source_bootstrap/progdir.obj: cxx_source_bootstrap $
3rd/bee.lua/bootstrap/progdir.cpp
rule link_luamake
- command = $cc $in -o $out -lm -ldl -Wl,-E -lstdc++ -s
+ command = $cc $in -o $out -lm -ldl -Wl,-E -lstdc++ -landroid-spawn -s
description = Link Exe $out
build $bin/luamake: link_luamake $obj/source_bootstrap/main.obj $
$obj/source_bootstrap/progdir.obj $obj/source_bee/lua-seri.obj $

View File

@ -1,11 +1,10 @@
--- lua-language-server/3rd/bee.lua/project/common.lua 2021-10-22 15:08:44.191055637 +0530 --- lua-language-server/3rd/bee.lua/project/common.lua 2021-10-22 15:08:44.191055637 +0530
+++ lua-language-server-patch/3rd/bee.lua/project/common.lua 2021-10-25 22:52:35.474777452 +0530 +++ lua-language-server-patch/3rd/bee.lua/project/common.lua 2021-10-27 20:49:53.575106308 +0530
@@ -45,6 +45,8 @@ @@ -45,6 +45,7 @@
} }
}, },
android = { android = {
+ flags ="-fPIC", + ldflags ="-landroid-spawn",
+ ldflags ="-L@TERMUX_PREFIX@/lib -landroid-spawn",
sources = { sources = {
"!bee/**_win.cpp", "!bee/**_win.cpp",
"!bee/**_osx.cpp", "!bee/**_osx.cpp",

View File

@ -13,6 +13,12 @@ TERMUX_PKG_BUILD_IN_SRC=true
# https://github.com/actboy168/bee.lua/blob/32f65b92739fa236d87fc1b2e7617470d47f0355/bee/thread/spinlock.h#L14 # https://github.com/actboy168/bee.lua/blob/32f65b92739fa236d87fc1b2e7617470d47f0355/bee/thread/spinlock.h#L14
TERMUX_PKG_BLACKLISTED_ARCHES="arm,i686" TERMUX_PKG_BLACKLISTED_ARCHES="arm,i686"
termux_step_pre_configure() {
if [ "${TERMUX_ON_DEVICE_BUILD}" = true ]; then
patch --silent -p1 <"${TERMUX_PKG_BUILDER_DIR}"/android.patch.ondevice
fi
}
termux_step_host_build() { termux_step_host_build() {
termux_setup_ninja termux_setup_ninja
@ -20,16 +26,17 @@ termux_step_host_build() {
cp -a "${TERMUX_PKG_SRCDIR}"/3rd/luamake 3rd/ cp -a "${TERMUX_PKG_SRCDIR}"/3rd/luamake 3rd/
cd 3rd/luamake cd 3rd/luamake
if [ "${TERMUX_ON_DEVICE_BUILD}" = true ]; then
sed -i "s/-lstdc++/-lc++_static -lc++abi -landroid-spawn/g" ./compile/ninja/android.ninja
fi
./compile/install.sh ./compile/install.sh
} }
termux_step_make() { termux_step_make() {
sed -i "s%\@FLAGS\@%${CFLAGS} ${CPPFLAGS}%g" "${TERMUX_PKG_BUILDER_DIR}"/make.lua.nopatch
sed -i "s%\@LDFLAGS\@%${LDFLAGS}%g" "${TERMUX_PKG_BUILDER_DIR}"/make.lua.nopatch
patch --silent -p1 <"${TERMUX_PKG_BUILDER_DIR}"/make.lua.nopatch
"${TERMUX_PKG_HOSTBUILD_DIR}"/3rd/luamake/luamake \ "${TERMUX_PKG_HOSTBUILD_DIR}"/3rd/luamake/luamake \
-cc "${CC}" \ -cc "${CC}" \
-flags "${CFLAGS} ${CPPFLAGS}" \
-hostos "android" -hostos "android"
} }

View File

@ -1,15 +1,18 @@
--- a/make.lua 2021-10-22 13:27:28.381004922 +0530 --- lua-language-server/make.lua 2021-10-22 15:07:23.591055667 +0530
+++ b/make.lua 2021-10-22 13:30:47.541004846 +0530 +++ lua-language-server-patch/make.lua 2021-10-27 20:41:28.435106500 +0530
@@ -2,7 +2,7 @@ @@ -2,7 +2,10 @@
local platform = require 'bee.platform' local platform = require 'bee.platform'
local exe = platform.OS == 'Windows' and ".exe" or "" local exe = platform.OS == 'Windows' and ".exe" or ""
-lm.bindir = "bin/"..platform.OS -lm.bindir = "bin/"..platform.OS
+lm.bindir = "bin/Android" +lm.bindir = "bin/Android"
+
+lm.flags = "@FLAGS@"
+lm.ldflags = "@LDFLAGS@"
lm.EXE_DIR = "" lm.EXE_DIR = ""
lm:import "3rd/bee.lua/make.lua" lm:import "3rd/bee.lua/make.lua"
@@ -42,29 +42,7 @@ @@ -42,29 +45,7 @@
output = lm.bindir.."/main.lua", output = lm.bindir.."/main.lua",
} }