gcc44: remove /usr/lib from rpath
authorJohn Marino <draco@marino.st>
Sat, 24 Mar 2012 08:08:48 +0000 (09:08 +0100)
committerJohn Marino <draco@marino.st>
Sat, 24 Mar 2012 18:17:52 +0000 (19:17 +0100)
The gcc44 specs were unconditionally adding /usr/lib to the rpath, making
it impossible to use the -z nodefaultlibs linker flag.  RTLD will look in
/usr/lib by default as the last priority of the library search path as
long as the object wasn't built with -z nodefaultlibs.

gnu/usr.bin/cc44/cc_prep/config/dragonfly-native.h

index c35c87e..b41e848 100644 (file)
@@ -6,18 +6,19 @@
 #define LIBGCC_SPEC "%{shared: -lgcc_pic} %{!shared: -lgcc}"
 
 #undef LINK_SPEC
-#define LINK_SPEC                                                      \
-    DFBSD_LINK_SPEC "                                                  \
-    %{pg: -L"PREFIX2"/lib/gcc"GCCSHORTVER"/profile                     \
-      %{!static: -rpath /usr/lib/gcc"GCCSHORTVER"/profile              \
-        -rpath-link "PREFIX2"/lib/gcc"GCCSHORTVER"/profile}}           \
-    -L"PREFIX2"/lib/gcc"GCCSHORTVER"                                   \
-    %{!static: -rpath /usr/lib/gcc"GCCSHORTVER" -rpath-link "PREFIX2"/lib/gcc"GCCSHORTVER"}    \
-    %{pg: -L"PREFIX2"/lib/profile                                      \
-      %{!static: -rpath /usr/lib/profile                               \
-        -rpath-link "PREFIX2"/lib/profile}}                            \
-    %{!static: -rpath /usr/lib -rpath-link "PREFIX2"/lib}              \
-  "
+#define LINK_SPEC DFBSD_LINK_SPEC \
+"%{pg: -L"PREFIX2"/lib/gcc"GCCSHORTVER"/profile \
+  %{!static: -rpath /usr/lib/gcc"GCCSHORTVER"/profile} \
+ } \
+ -L"PREFIX2"/lib/gcc"GCCSHORTVER" \
+ %{!static: -rpath /usr/lib/gcc"GCCSHORTVER"} \
+ %{pg: \
+  %{!nostdlib: \
+   %{!nodefaultlibs: -L"PREFIX2"/lib/profile \
+    %{!static: -rpath /usr/lib/profile} \
+   } \
+  } \
+ }"
 
 /*#define TARGET_SYSTEM_ROOT_RELOCATABLE */
 /*#define TARGET_SYSTEM_ROOT           "/"*/