summaryrefslogtreecommitdiff
path: root/debian/patches/illumos-spec.diff
blob: fea5f99dabb7d6c075cec6c7e85f7b57b13475fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Index: gcc-9.git/src/gcc/config/sol2.h
===================================================================
--- gcc-9.git.orig/src/gcc/config/sol2.h
+++ gcc-9.git/src/gcc/config/sol2.h
@@ -161,12 +161,12 @@ along with GCC; see the file COPYING3.
 #undef LIB_SPEC
 #define LIB_SPEC \
   "%{!symbolic:\
-     %{pthreads|pthread:-lpthread} \
-     %{p|pg:-ldl} -lc}"
+     %{pthreads|pthread:} \
+     %{p|pg:} -lc}"
 
 #ifndef CROSS_DIRECTORY_STRUCTURE
 #undef MD_EXEC_PREFIX
-#define MD_EXEC_PREFIX "/usr/ccs/bin/"
+#define MD_EXEC_PREFIX "/usr/bin/"
 #endif
 
 /* Enable constructor priorities if the configured linker supports it.  */
@@ -302,9 +302,7 @@ along with GCC; see the file COPYING3.
 #define LINK_ARCH32_SPEC_BASE \
   "%{G:-G} \
    %{YP,*} \
-   %{R*} \
-   %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp%R/lib:%R/usr/lib} \
-	   %{!p:%{!pg:-Y P,%R/lib:%R/usr/lib}}}"
+   %{R*}"
 
 #undef LINK_ARCH32_SPEC
 #define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE
@@ -315,9 +313,7 @@ along with GCC; see the file COPYING3.
 #define LINK_ARCH64_SPEC_BASE \
   "%{G:-G} \
    %{YP,*} \
-   %{R*} \
-   %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "}	\
-	   %{!p:%{!pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "}}}"
+   %{R*}"
 
 #undef LINK_ARCH64_SPEC
 #ifndef USE_GLD
Index: gcc-9.git/src/gcc/gcc.c
===================================================================
--- gcc-9.git.orig/src/gcc/gcc.c
+++ gcc-9.git/src/gcc/gcc.c
@@ -1559,7 +1559,17 @@ static const char *gcc_libexec_prefix;
 /* Default prefixes to attach to command names.  */
 
 #ifndef STANDARD_STARTFILE_PREFIX_1
-#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+/* This is a radical hack. In Debian (and Dyson) we should have all development libraries
+   under /usr/lib. But in Dyson there is at least libc.so under /lib. It is in there
+   specially for the sunld, which does not understand the GNU ld's linker script
+   found under disguise libc.so under /usr/lib. That linker script automatically
+   add other libraries as needed, like libsocket, libiconv, libssp, etc.
+   Unfortunately, if /lib goes first, the linker will find normal libc.so under /lib
+   and will miss the libraries we need on Dyson. This is not the case when
+   we use already built and installed gcc, but happens when buildting the gcc
+   package, namely with stage1 compiler xgcc.
+*/
+#define STANDARD_STARTFILE_PREFIX_1 ""
 #endif
 #ifndef STANDARD_STARTFILE_PREFIX_2
 #define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"