projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0da6f39
)
meson: use -f{function,data}-sections for optimized builds
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Mon, 24 Apr 2017 23:28:04 +0000
(19:28 -0400)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Mon, 24 Apr 2017 23:28:04 +0000
(19:28 -0400)
meson.build
patch
|
blob
|
history
diff --git
a/meson.build
b/meson.build
index
a4c93de
..
949f636
100644
(file)
--- a/
meson.build
+++ b/
meson.build
@@
-303,6
+303,21
@@
foreach arg : ['-Wl,-z,relro',
endif
endforeach
+if get_option('buildtype') != 'debug'
+ foreach arg : ['-ffunction-sections',
+ '-fdata-sections']
+ if cc.has_argument(arg)
+ add_project_arguments(arg, language : 'c')
+ endif
+ endforeach
+
+ foreach arg : ['-Wl,--gc-sections']
+ if cc.has_argument(arg)
+ add_project_link_arguments(arg, language : 'c')
+ endif
+ endforeach
+endif
+
cpp = ' '.join(cc.cmd_array()) + ' -E'
#####################################################################