Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 9c50f36

Browse files
Jb Aviatignisf
authored andcommitted
Do not embed debug symbols in macOS libraries
This dramatically lowers the produced binary size.
1 parent fe8bb9f commit 9c50f36

4 files changed

Lines changed: 38 additions & 13 deletions

patches/0001-Build-a-standalone-static-library.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
From d10394091dcd5bdc623c456243e49966f22e1f71 Mon Sep 17 00:00:00 2001
1+
From b042a96f069c0fd35adbceb43bd9db78f8420008 Mon Sep 17 00:00:00 2001
22
From: Petko Bordjukov <bordjukov@gmail.com>
33
Date: Mon, 25 Jul 2016 00:00:19 +0300
4-
Subject: [PATCH 1/3] Build a standalone static library
4+
Subject: [PATCH 1/4] Build a standalone static library
55

66
---
77
gypfiles/standalone.gypi | 3 +++
88
1 file changed, 3 insertions(+)
99

1010
diff --git a/gypfiles/standalone.gypi b/gypfiles/standalone.gypi
11-
index 6599bb8..c81ae2c 100644
11+
index 6599bb8351..c81ae2caa0 100644
1212
--- a/gypfiles/standalone.gypi
1313
+++ b/gypfiles/standalone.gypi
1414
@@ -531,6 +531,9 @@
@@ -22,5 +22,5 @@ index 6599bb8..c81ae2c 100644
2222
'defines!': [
2323
'DEBUG',
2424
--
25-
2.10.0
25+
2.11.1
2626

patches/0002-Don-t-compile-unnecessary-stuff.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
From 785a8197ebefd37592f15f0b23c13a44faa5c239 Mon Sep 17 00:00:00 2001
1+
From 78d8850d13bf24b0c07e6470f4af5a3cee7289df Mon Sep 17 00:00:00 2001
22
From: Petko Bordjukov <bordjukov@gmail.com>
33
Date: Sat, 15 Oct 2016 15:05:01 +0300
4-
Subject: [PATCH 2/3] Don't compile unnecessary stuff
4+
Subject: [PATCH 2/4] Don't compile unnecessary stuff
55

66
---
77
Makefile | 7 +------
88
gypfiles/all.gyp | 33 +--------------------------------
99
2 files changed, 2 insertions(+), 38 deletions(-)
1010

1111
diff --git a/Makefile b/Makefile
12-
index a6d4d13..bd73b13 100644
12+
index a6d4d135da..bd73b13263 100644
1313
--- a/Makefile
1414
+++ b/Makefile
1515
@@ -258,12 +258,7 @@ GYPFILES = third_party/icu/icu.gypi third_party/icu/icu.gyp \
@@ -27,7 +27,7 @@ index a6d4d13..bd73b13 100644
2727
# If vtunejit=on, the v8vtune.gyp will be appended.
2828
ifeq ($(vtunejit), on)
2929
diff --git a/gypfiles/all.gyp b/gypfiles/all.gyp
30-
index 6b4ef82..9b02b4d 100644
30+
index 6b4ef82d69..9b02b4d305 100644
3131
--- a/gypfiles/all.gyp
3232
+++ b/gypfiles/all.gyp
3333
@@ -15,38 +15,7 @@
@@ -71,5 +71,5 @@ index 6b4ef82..9b02b4d 100644
7171
}
7272
]
7373
--
74-
2.10.0
74+
2.11.1
7575

patches/0003-Use-the-fPIC-flag-for-the-static-library.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
From cd49967fd692ad4ec76e6d40a35118dfcc9b2029 Mon Sep 17 00:00:00 2001
1+
From 4792a3b2cca0ac92fef185c4f7394e3580d8ac23 Mon Sep 17 00:00:00 2001
22
From: Petko Bordjukov <bordjukov@gmail.com>
33
Date: Mon, 25 Jul 2016 00:05:47 +0300
4-
Subject: [PATCH 3/3] Use the -fPIC flag for the static library
4+
Subject: [PATCH 3/4] Use the -fPIC flag for the static library
55

66
---
77
gypfiles/standalone.gypi | 2 +-
88
1 file changed, 1 insertion(+), 1 deletion(-)
99

1010
diff --git a/gypfiles/standalone.gypi b/gypfiles/standalone.gypi
11-
index c81ae2c..b3e4d67 100644
11+
index c81ae2caa0..b3e4d67a6e 100644
1212
--- a/gypfiles/standalone.gypi
1313
+++ b/gypfiles/standalone.gypi
1414
@@ -803,7 +803,7 @@
@@ -21,5 +21,5 @@ index c81ae2c..b3e4d67 100644
2121
}],
2222
[ 'clang==0 and coverage==1', {
2323
--
24-
2.10.0
24+
2.11.1
2525

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From ca12923b30009a29f4be8b93d44bdccf0cce44a0 Mon Sep 17 00:00:00 2001
2+
From: Jb Aviat <jb@sqreen.io>
3+
Date: Mon, 27 Feb 2017 11:14:42 +0200
4+
Subject: [PATCH 4/4] Do not embed debug symbols in macOS libraries
5+
6+
This lowers dramatically the produced binary size
7+
---
8+
gypfiles/standalone.gypi | 1 +
9+
1 file changed, 1 insertion(+)
10+
11+
diff --git a/gypfiles/standalone.gypi b/gypfiles/standalone.gypi
12+
index b3e4d67a6e..e9ed2437a7 100644
13+
--- a/gypfiles/standalone.gypi
14+
+++ b/gypfiles/standalone.gypi
15+
@@ -1062,6 +1062,7 @@
16+
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
17+
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
18+
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
19+
+ 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO', # No -gdwarf-2
20+
# GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
21+
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
22+
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
23+
--
24+
2.11.1
25+

0 commit comments

Comments
 (0)