Add support for SunOS function/data sections and associated
authorEric Christopher <echristo@gmail.com>
Tue, 3 Mar 2015 20:54:29 +0000 (20:54 +0000)
committerEric Christopher <echristo@gmail.com>
Tue, 3 Mar 2015 20:54:29 +0000 (20:54 +0000)
section gc.

Patch by Bill Rushmore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231128 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile.rules

index c8c971f6b2810e5aa3d7942d0c7af35de5c85c22..24cac3b376590b06aafa34bf3a3c81cddbb33e71 100644 (file)
@@ -631,6 +631,9 @@ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
 ifneq ($(HOST_OS),Darwin)
 ifneq ($(HOST_ARCH),Mips)
   CXX.Flags += -ffunction-sections -fdata-sections
+  ifeq ($(HOST_OS),SunOS)
+      CXX.Flags += -falign-functions=8
+  endif
 endif
 endif
 endif
@@ -638,8 +641,12 @@ ifndef NO_DEAD_STRIP
   ifeq ($(HOST_OS),Darwin)
     LD.Flags += -Wl,-dead_strip
   else
-    ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
-      LD.Flags += -Wl,--gc-sections
+    ifeq ($(HOST_OS),SunOS)
+      LD.Flags += -Wl,-z -Wl,discard-unused=sections
+    else
+      ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
+        LD.Flags += -Wl,--gc-sections
+      endif
     endif
   endif
 endif