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

luajit: using dynamic buildmode reduces package size with about 50% #10848

Closed
mikma opened this issue Dec 20, 2019 · 0 comments · Fixed by #11027
Closed

luajit: using dynamic buildmode reduces package size with about 50% #10848

mikma opened this issue Dec 20, 2019 · 0 comments · Fixed by #11027

Comments

@mikma
Copy link

mikma commented Dec 20, 2019

By using dynamic buildmode the size of the package can be reduced with about 50%. Both the ipk size and the size of the installed files.

Without patch:

# ls -l `opkg files luajit|grep /`
-rwxr-xr-x    1 root     root        405739 Dec 20 00:18 /usr/bin/luajit
lrwxrwxrwx    1 root     root            22 Dec 20 18:11 /usr/lib/libluajit-5.1.so -> libluajit-5.1.so.2.1.0
lrwxrwxrwx    1 root     root            22 Dec 20 18:11 /usr/lib/libluajit-5.1.so.2 -> libluajit-5.1.so.2.1.0
-rwxr-xr-x    1 root     root        413787 Dec 20 00:18 /usr/lib/libluajit-5.1.so.2.1.0

With patch:

# ls -l `opkg files luajit|grep /`
-rwxr-xr-x    1 root     root         20515 Dec 18 07:44 /usr/bin/luajit
lrwxrwxrwx    1 root     root            22 Dec 20 18:13 /usr/lib/libluajit-5.1.so -> libluajit-5.1.so.2.1.0
lrwxrwxrwx    1 root     root            22 Dec 20 18:13 /usr/lib/libluajit-5.1.so.2 -> libluajit-5.1.so.2.1.0
-rwxr-xr-x    1 root     root        413787 Dec 18 07:44 /usr/lib/libluajit-5.1.so.2.1.0

Patch:

--- a/src/Makefile	2019-12-20 18:00:47.022569373 +0000
+++ b/src/Makefile	2019-12-20 18:00:59.102541964 +0000
@@ -71,14 +71,14 @@
 # as dynamic mode.
 #
 # Mixed mode creates a static + dynamic library and a statically linked luajit.
-BUILDMODE= mixed
+#BUILDMODE= mixed
 #
 # Static mode creates a static library and a statically linked luajit.
 #BUILDMODE= static
 #
 # Dynamic mode creates a dynamic library and a dynamically linked luajit.
 # Note: this executable will only run when the library is installed!
-#BUILDMODE= dynamic
+BUILDMODE= dynamic
 #
 ##############################################################################
 
neheb added a commit to neheb/packages that referenced this issue Jan 15, 2020
Reduces package size with about 50%

Fixes: openwrt#10848

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Lienol pushed a commit to Lienol/openwrt-packages that referenced this issue Jun 7, 2021
Reduces package size with about 50%

Fixes: openwrt/packages#10848

Signed-off-by: Rosen Penev <rosenp@gmail.com>
neheb added a commit that referenced this issue Jul 15, 2021
Reduces package size with about 50%

Fixes: #10848

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit d948759)
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 a pull request may close this issue.

1 participant