Comments (2)
luastatic supports both static and dynamic linking.
Here is a complete example:
#!/bin/sh
wget "https://www.lua.org/ftp/lua-5.2.4.tar.gz"
tar -xf lua-5.2.4.tar.gz
cd lua-5.2.4
make posix CC="musl-gcc -static"
echo "print(_VERSION)" > main.lua
CC=musl-gcc luastatic main.lua src/liblua.a -Isrc -static
from luastatic.
Thank you for the quick response. I tried your suggestion and the luastatic compilation command becomes this:
musl-gcc -Os -std=c99 main.lua.c ./liblua.a -rdynamic -lm -ldl -Ilua-5.2.4/src -static -o main
I guess -static
will override the -rdynamic
in this case and the output binary is a static one without any dependency.
Thanks!
from luastatic.
Related Issues (20)
- enhancement: use precompiled lua objects HOT 1
- Handling of command line arguments HOT 1
- Explain last example in readme HOT 1
- lauxlib.h: no such file or directory HOT 4
- luastatic integrated into LuaRocks? HOT 1
- Only working with Lua 5.3 [misunderstanding] HOT 2
- Lua to C-modules HOT 2
- luastatic destroys source file in some configurations HOT 7
- Getting couple of undefined_reference errors HOT 1
- Invoke requireF for C modules HOT 1
- Refuses to build unless the entry point ends in .lua HOT 4
- Including all the modules from other directories HOT 2
- FFI can't access C functions after static linking HOT 11
- Support for LuaJIT Objects HOT 2
- Disable External Lua Module Loading HOT 3
- Should binary be stipped by default? HOT 1
- Could this be statically linked and ran in kernel space? HOT 1
- fix windows related issues HOT 2
- Improvement to documentation HOT 3
- module 'basetool' not found HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luastatic.