gcc41: remove /usr/lib from rpath
authorJohn Marino <draco@marino.st>
Sat, 24 Mar 2012 08:14:15 +0000 (09:14 +0100)
committerJohn Marino <draco@marino.st>
Sat, 24 Mar 2012 18:20:13 +0000 (19:20 +0100)
The gcc41 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.

Also the __DragonFly__ macro was bumped from 1 to 3.  It's supposed to
reflect the major version of DragonFly.

gnu/usr.bin/cc41/cc_prep/config/dragonfly-spec.h
gnu/usr.bin/cc41/cc_prep/config/dragonfly.h

index e3a2d1d..ea4cc89 100644 (file)
@@ -133,22 +133,16 @@ is built with the --enable-threads configure-time option.}                \
 #define LINK_LIBGCC_SPEC ""
 #define LIBGCC_SPEC "%{shared: -lgcc_pic} %{!shared: -lgcc}"
 
-#define PRE_LIB_SPEC "                                                 \
-  %{pg: -L"PREFIX2"/lib/gcc41/profile                          \
-    %{!static: -rpath /usr/lib/gcc41/profile                           \
-      -rpath-link "PREFIX2"/lib/gcc41/profile}}                        \
-  %{g: -L"PREFIX2"/lib/gcc41/debug                                     \
-    %{!static: -rpath /usr/lib/gcc41/debug                             \
-      -rpath-link "PREFIX2"/lib/gcc41/debug}}                          \
-  -L"PREFIX2"/lib/gcc41                                                        \
-  %{!static: -rpath /usr/lib/gcc41  -rpath-link "PREFIX2"/lib/gcc41}   \
-  %{pg: -L"PREFIX2"/lib/profile                                        \
-    %{!static: -rpath /usr/lib/profile                         \
-      -rpath-link "PREFIX2"/lib/profile}}                              \
-  %{g: -L"PREFIX2"/lib/debug                                           \
-    %{!static: -rpath /usr/lib/debug -rpath-link "PREFIX2"/lib/debug}}         \
-  %{!static: -rpath /usr/lib -rpath-link "PREFIX2"/lib}                \
-  "
+#define PRE_LIB_SPEC \
+" %{pg: -L"PREFIX2"/lib/gcc41/profile \
+   %{!static: -rpath /usr/lib/gcc41/profile} \
+  } \
+  -L"PREFIX2"/lib/gcc41        \
+  %{!static: -rpath /usr/lib/gcc41} \
+  %{pg: -L"PREFIX2"/lib/profile \
+   %{!static: -rpath /usr/lib/profile} \
+  } \
+"
 
 #define DFBSD_LINK_COMMAND_SPEC "\
 %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
index 6cf9297..4e760a3 100644 (file)
@@ -92,4 +92,4 @@ Boston, MA 02111-1307, USA.  */
    program, which avoids race conditions if the program has forked.  */
 #define TARGET_HAS_F_SETLKW
 
-#define        DFBSD_MAJOR     1
+#define        DFBSD_MAJOR     3