# Strip unused sections in Solaris.
# https://llvm.org/bugs/show_bug.cgi?id=24641
--- Makefile.rules 2014-11-04 16:35:15.000000000 -0800
+++ Makefile.rules 2015-07-17 18:28:25.379220132 -0700
@@ -638,9 +638,12 @@
ifeq ($(HOST_OS),Darwin)
LD.Flags += -Wl,-dead_strip
else
- ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
+ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW SunOS))
LD.Flags += -Wl,--gc-sections
endif
+ ifeq ($(HOST_OS), $(filter $(HOST_OS), SunOS))
+ LD.Flags += -Wl,-z -Wl,discard-unused=sections
+ endif
endif
endif