Issue #6163: Fixed HP-UX runtime library dir options in distutils.unixcompiler
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
index 129ac8c..2083f82 100644
--- a/Lib/distutils/unixccompiler.py
+++ b/Lib/distutils/unixccompiler.py
@@ -285,7 +285,9 @@
             # MacOSX's linker doesn't understand the -R flag at all
             return "-L" + dir
         elif sys.platform[:5] == "hp-ux":
-            return "+s -L" + dir
+            if "gcc" in compiler or "g++" in compiler:
+                return ["-Wl,+s", "-L" + dir]
+            return ["+s", "-L" + dir]
         elif sys.platform[:7] == "irix646" or sys.platform[:6] == "osf1V5":
             return ["-rpath", dir]
         elif compiler[:3] == "gcc" or compiler[:3] == "g++":