Replies: 1 comment
|
I have found a solution which seems to work fine for my case and that is using UPD: |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello
I came across what I beleive is either a misconfiguration on my side or an incorrect behaviour of xmake. I seek for help, please.
On Manjaro (and probably Arch), the system Lua package has 2 shared libraries: liblua.so and liblua++.so, presumably with mangled/demangled names for C/C++ linkage.
When xmake compiles a simple project with
add_requires("lua", { system = true }), it links the resulting executable or library against both lua libs.In certain scenarios this causes SEGFAULT crashes of the app when the code uses
luaL_error()function. My guess is that the longjmp instruction that happens underneath, goes to the address space of the wrong library.I have set up a minimal reproducible scenario here: https://github.com/rws-git/xmake-luapp. The app has an executable and a lib. The scenario is as follows:
luaL_dofile("luapp.lua")lpp = require('xmake-luapp')andpcall(function() lpp.dummy(3) end)dummy()functions callsluaL_errorpcallAnd don't mind, that the files have .c extension. Originally, I encountered same issue with a C++ project, so I need to use g++.
Below are some screenshots of the problem. First, the xmake build and run:

Second, manual compilation with only one system Lua lib linkage and successful run:

All reactions