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/"