Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add libmem #5430

Merged
merged 43 commits into from
Oct 14, 2024
Merged

add libmem #5430

merged 43 commits into from
Oct 14, 2024

Conversation

luadebug
Copy link
Contributor

@luadebug luadebug commented Oct 6, 2024

[libmem] add new port

@luadebug luadebug changed the title [libmem] add new port libmem: add package Oct 6, 2024
packages/l/libmem/xmake.lua Outdated Show resolved Hide resolved
packages/l/libmem/xmake.lua Outdated Show resolved Hide resolved
packages/l/libmem/xmake.lua Outdated Show resolved Hide resolved
packages/l/libmem/xmake.lua Outdated Show resolved Hide resolved
@luadebug luadebug requested a review from waruqi October 6, 2024 13:55
packages/l/libmem/xmake.lua Outdated Show resolved Hide resolved
packages/l/libmem/xmake.lua Outdated Show resolved Hide resolved
packages/l/libmem/xmake.lua Outdated Show resolved Hide resolved
packages/l/libmem/xmake.lua Outdated Show resolved Hide resolved
@luadebug luadebug requested a review from waruqi October 6, 2024 21:19
packages/l/libmem/xmake.lua Outdated Show resolved Hide resolved
@luadebug luadebug requested a review from waruqi October 7, 2024 06:49
@luadebug
Copy link
Contributor Author

luadebug commented Oct 7, 2024

I did my best to fulfill requests. But now it have to implement keystone port for xrepo, so we could advance further.

@waruqi
Copy link
Member

waruqi commented Oct 7, 2024

right, we need to add keystone first

@luadebug
Copy link
Contributor Author

luadebug commented Oct 8, 2024

@waruqi Should compile for linux as well now.

@luadebug
Copy link
Contributor Author

luadebug commented Oct 8, 2024

error: @programdir/core/sandbox/modules/os.lua:264: cannot runv(kstool -b x64 "mov rax, 1; ret"), No such file or directory
How come for capstone no such issue persists?
Maybe we need python 3 persisting on system?

@luadebug
Copy link
Contributor Author

luadebug commented Oct 12, 2024

We most likely need to exclude IPhoneOS according to
#5474

on_install("!iphoneos", function (package)

Most likely arm/arm64 is not implemented to work for libmem itself.

@EnergoStalin
Copy link
Contributor

EnergoStalin commented Oct 12, 2024

Hopefully @rdbo would upstream somewhat similiar to this patch since in his cmake build they don't get exported either but seems intended as part of the api.

@waruqi
Copy link
Member

waruqi commented Oct 13, 2024

we can export symbols automatically.

add_rules("utils.symbols.export_all", {export_classes = true})

@waruqi
Copy link
Member

waruqi commented Oct 13, 2024

error: ...es/private/action/require/impl/actions/patch_sources.lua:100: patch(/home/runner/work/xmake-repo/xmake-repo/packages/l/libmem/patches/cxxexport.patch): unmatched checksum!
stack traceback:

@waruqi waruqi closed this Oct 13, 2024
@waruqi waruqi reopened this Oct 13, 2024
@waruqi waruqi closed this Oct 13, 2024
@waruqi waruqi reopened this Oct 13, 2024
@waruqi
Copy link
Member

waruqi commented Oct 13, 2024

github ci 挂了 不知道为啥

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


github ci is down. I don’t know why.

@waruqi waruqi mentioned this pull request Oct 13, 2024
@luadebug
Copy link
Contributor Author

luadebug commented Oct 13, 2024

https://www.githubstatus.com/
Seems stable. You can try to run this PR #5490
(maybe that is 3rd dependency, but I prefer keep leave it as it is now)
Re-run #5488 ?

@waruqi waruqi closed this Oct 13, 2024
@waruqi waruqi reopened this Oct 13, 2024
@EnergoStalin
Copy link
Contributor

Maybe make it more strict only adding is_plat("windows") since other builds working?

Patch
diff --git a/packages/l/libmem/port/xmake.lua b/packages/l/libmem/port/xmake.lua
index b50db9ef..0f80bc20 100644
--- a/packages/l/libmem/port/xmake.lua
+++ b/packages/l/libmem/port/xmake.lua
@@ -8,12 +8,10 @@ target("libmem")
 
     if is_plat("windows") and is_kind("shared") then
         add_rules("utils.symbols.export_all", {export_classes = true, export_filter = function (symbol)
-            if symbol:find("libmem", 1, true) then
-                return true
-            end
+            return symbol:find("libmem", 1, true) and true or false
         end})
     end
-    if is_kind("shared") then
+    if is_plat("windows") or is_kind("shared") then
         add_defines("LM_EXPORT")
     end
 
diff --git a/packages/l/libmem/xmake.lua b/packages/l/libmem/xmake.lua
index 9e07cdd5..ed80ace1 100644
--- a/packages/l/libmem/xmake.lua
+++ b/packages/l/libmem/xmake.lua
@@ -21,7 +21,7 @@ package("libmem")
     end
 
     on_load(function(package)
-        if package:config("shared") then
+        if is_plat("windows") or package:config("shared") then
             package:add("defines", "LM_EXPORT")
         end
     end)

@waruqi waruqi merged commit 795ca3e into xmake-io:dev Oct 14, 2024
67 checks passed
@waruqi
Copy link
Member

waruqi commented Oct 14, 2024

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants