From 0b5c72d9ba00c6dceafb6880ece4d2ea02d9a24a Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Sat, 20 Nov 2004 03:52:00 +0000
Subject: [PATCH] On some HPUX versions/hardware, it seems we need to include
 libgcc.a in the regression test shared libraries.

---
 src/makefiles/Makefile.hpux | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/makefiles/Makefile.hpux b/src/makefiles/Makefile.hpux
index 4c407105582..f8be012b9fa 100644
--- a/src/makefiles/Makefile.hpux
+++ b/src/makefiles/Makefile.hpux
@@ -53,10 +53,18 @@ endif
 # Rule for building shared libs (currently used only for regression test
 # shlib ... should go away, since this is not really enough knowledge)
 %$(DLSUFFIX): %.o
-ifeq ($(with_gnu_ld), yes)
-	$(CC) $(LDFLAGS) -shared -o $@ $<
+ifeq ($(GCC), yes)
+  ifeq ($(with_gnu_ld), yes)
+	$(CC) $(LDFLAGS) -shared -o $@ $< `$(CC) $(LDFLAGS) -print-libgcc-file-name`
+  else
+	$(LD) -b -o $@ $< `$(CC) $(LDFLAGS) -print-libgcc-file-name`
+  endif
 else
+  ifeq ($(with_gnu_ld), yes)
+	$(CC) $(LDFLAGS) -shared -o $@ $<
+  else
 	$(LD) -b -o $@ $<
+  endif
 endif
 
 sqlmansect = 5
-- 
GitLab