From d6582d4aed8779fcb903f5eb3ad5d802289a0cf5 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Sat, 6 Aug 2022 13:23:43 -0700
Subject: [PATCH 4/5] solaris: Remove unnecessary gcc / gnu ld vs sun studio
 differences

Unfortunately one with_gnu_ld reference remains, otherwise we could remove the
configure support for determining with_gnu_ld.
---
 src/makefiles/Makefile.solaris |  9 +--------
 src/Makefile.shlib             | 12 ++----------
 2 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/src/makefiles/Makefile.solaris b/src/makefiles/Makefile.solaris
index 5496edcafc1..acdf44cc0f2 100644
--- a/src/makefiles/Makefile.solaris
+++ b/src/makefiles/Makefile.solaris
@@ -1,21 +1,14 @@
 # src/makefiles/Makefile.solaris
 
 AROPT = crs
+rpath = -Wl,-rpath,'$(rpathdir)'
 
 ifeq ($(with_gnu_ld), yes)
 export_dynamic = -Wl,-E
-rpath = -Wl,-rpath,'$(rpathdir)'
-else
-rpath = -Wl,-R'$(rpathdir)'
 endif
 
-
 # Rule for building a shared library from a single .o file
 %.so: %.o
-ifeq ($(GCC), yes)
 	$(CC) $(CFLAGS) $< $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@
-else
-	$(CC) $(CFLAGS) $< $(LDFLAGS) $(LDFLAGS_SL) -G -o $@
-endif
 
 sqlmansect = 5sql
diff --git a/src/Makefile.shlib b/src/Makefile.shlib
index 2396bc247e5..2af6192f0f3 100644
--- a/src/Makefile.shlib
+++ b/src/Makefile.shlib
@@ -188,17 +188,9 @@ ifeq ($(PORTNAME), linux)
 endif
 
 ifeq ($(PORTNAME), solaris)
-  ifeq ($(GCC), yes)
-    LINK.shared		= $(COMPILER) -shared -Wl,-Bsymbolic
-  else
-    LINK.shared		= $(COMPILER) -G -Bsymbolic
-  endif
+  LINK.shared		= $(COMPILER) -shared -Wl,-Bsymbolic
   ifdef soname
-    ifeq ($(with_gnu_ld), yes)
-      LINK.shared	+= -Wl,-soname,$(soname)
-    else
-      LINK.shared	+= -h $(soname)
-    endif
+    LINK.shared	+= -Wl,-soname,$(soname)
   endif
 endif
 
-- 
2.37.0.3.g30cc8d0f14

