aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2020-11-26 13:01:30 +0100
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2020-11-26 13:01:30 +0100
commit55ebb0d6fb06e9e5407c4b382b66ce86c48ecaf6 (patch)
treef712e9ccaf078fa4a800d07f246b11efb23bb8af /gcc
parent2762cb1df686fc1ebcee23c7c4f0f6e8bf5a6abc (diff)
downloadgcc-55ebb0d6fb06e9e5407c4b382b66ce86c48ecaf6.zip
gcc-55ebb0d6fb06e9e5407c4b382b66ce86c48ecaf6.tar.gz
gcc-55ebb0d6fb06e9e5407c4b382b66ce86c48ecaf6.tar.bz2
ada: c++: Get rid of libposix4, librt on Solaris
I recently noticed that neither libposix4 nor librt are needed on Solaris 11 any longer: * libposix4 was renamed to librt in Solaris 7 back in 1998. * librt was folded into libc in the OpenSolaris timeframe, leaving librt only as a filter on libc. Thus, it's no longer needed on either Solaris 11 or Illumos. The following patch removes both uses. At the same time, Ada's use of libthread has gone: it was folded into libc in Solaris 10 already. TIME_LIBRARY and friends in g++ are likewise removed: Solaris was the only user. Bootstrapped without regressions on i386-pc-solaris2.11, sparc-sun-solaris2.11, and x86_64-pc-linux-gnu. 2020-11-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> gcc/cp: * g++spec.c (TIMELIB, TIME_LIBRARY): Remove. (lang_specific_driver): Remove TIME_LIBRARY handling. gcc: * config/sol2.h (TIME_LIBRARY): Remove. libstdc++-v3: * acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Remove libposix4 references. <solaris*>: Don't use -lrt any longer. * configure: Regenerate. * doc/xml/manual/configure.xml (--enable-libstdcxx-time=OPTION): Remove libposix4 reference. gcc/ada: * Makefile.rtl <sparc*-sun-solaris*> (THREADSLIB): Remove. (MISCLIB): Remove -lposix4. <*86-*-solaris2*>: Likewise. * libgnarl/s-osinte__solaris.ads (System.OS_Interface): Remove -lposix4 -lthread.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/Makefile.rtl6
-rw-r--r--gcc/ada/libgnarl/s-osinte__solaris.ads3
-rw-r--r--gcc/config/sol2.h3
-rw-r--r--gcc/cp/g++spec.c33
4 files changed, 5 insertions, 40 deletions
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index 97792b4..1809bdb 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -1674,8 +1674,7 @@ ifeq ($(strip $(filter-out sparc% sun solaris%,$(target_cpu) $(target_vendor) $(
endif
EH_MECHANISM=-gcc
- THREADSLIB = -lposix4 -lthread
- MISCLIB = -lposix4 -lnsl -lsocket
+ MISCLIB = -lnsl -lsocket
SO_OPTS = -Wl,-h,
GNATLIB_SHARED = gnatlib-shared-dual
GMEM_LIB = gmemlib
@@ -1728,8 +1727,7 @@ ifeq ($(strip $(filter-out %86 %x86_64 solaris2%,$(target_cpu) $(target_os))),)
EXTRA_GNATRTL_NONTASKING_OBJS += $(TRASYM_DWARF_UNIX_OBJS)
EH_MECHANISM=-gcc
- THREADSLIB = -lposix4 -lthread
- MISCLIB = -lposix4 -lnsl -lsocket
+ MISCLIB = -lnsl -lsocket
SO_OPTS = -Wl,-h,
GNATLIB_SHARED = gnatlib-shared-dual
GMEM_LIB = gmemlib
diff --git a/gcc/ada/libgnarl/s-osinte__solaris.ads b/gcc/ada/libgnarl/s-osinte__solaris.ads
index b3faa10..b9d6b88 100644
--- a/gcc/ada/libgnarl/s-osinte__solaris.ads
+++ b/gcc/ada/libgnarl/s-osinte__solaris.ads
@@ -45,9 +45,6 @@ with Ada.Unchecked_Conversion;
package System.OS_Interface is
pragma Preelaborate;
- pragma Linker_Options ("-lposix4");
- pragma Linker_Options ("-lthread");
-
subtype int is Interfaces.C.int;
subtype short is Interfaces.C.short;
subtype long is Interfaces.C.long;
diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
index 91b4602..7a21f22 100644
--- a/gcc/config/sol2.h
+++ b/gcc/config/sol2.h
@@ -381,9 +381,6 @@ along with GCC; see the file COPYING3. If not see
{ "endfile_vtv", ENDFILE_VTV_SPEC }, \
SUBTARGET_CPU_EXTRA_SPECS
-/* C++11 programs need -lrt for nanosleep. */
-#define TIME_LIBRARY "rt"
-
#ifndef USE_GLD
/* With Sun ld, -rdynamic is a no-op. */
#define RDYNAMIC_SPEC ""
diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c
index 0ab63bc..0f17148 100644
--- a/gcc/cp/g++spec.c
+++ b/gcc/cp/g++spec.c
@@ -27,12 +27,10 @@ along with GCC; see the file COPYING3. If not see
#define LANGSPEC (1<<1)
/* This bit is set if they did `-lm' or `-lmath'. */
#define MATHLIB (1<<2)
-/* This bit is set if they did `-lrt' or equivalent. */
-#define TIMELIB (1<<3)
/* This bit is set if they did `-lc'. */
-#define WITHLIBC (1<<4)
+#define WITHLIBC (1<<3)
/* Skip this option. */
-#define SKIPOPT (1<<5)
+#define SKIPOPT (1<<4)
#ifndef MATH_LIBRARY
#define MATH_LIBRARY "m"
@@ -41,10 +39,6 @@ along with GCC; see the file COPYING3. If not see
#define MATH_LIBRARY_PROFILE MATH_LIBRARY
#endif
-#ifndef TIME_LIBRARY
-#define TIME_LIBRARY ""
-#endif
-
#ifndef LIBSTDCXX
#define LIBSTDCXX "stdc++"
#endif
@@ -95,15 +89,12 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
const struct cl_decoded_option *saw_libc = NULL;
/* An array used to flag each argument that needs a bit set for
- LANGSPEC, MATHLIB, TIMELIB, or WITHLIBC. */
+ LANGSPEC, MATHLIB, or WITHLIBC. */
int *args;
/* By default, we throw on the math library if we have one. */
int need_math = (MATH_LIBRARY[0] != '\0');
- /* By default, we throw on the time library if we have one. */
- int need_time = (TIME_LIBRARY[0] != '\0');
-
/* True if we saw -static. */
int static_link = 0;
@@ -147,11 +138,6 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
args[i] |= MATHLIB;
need_math = 0;
}
- else if (strcmp (arg, TIME_LIBRARY) == 0)
- {
- args[i] |= TIMELIB;
- need_time = 0;
- }
else if (strcmp (arg, "c") == 0)
args[i] |= WITHLIBC;
else
@@ -285,12 +271,6 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
saw_math = &decoded_options[i];
}
- if (!saw_time && (args[i] & TIMELIB) && library > 0)
- {
- --j;
- saw_time = &decoded_options[i];
- }
-
if (!saw_libc && (args[i] & WITHLIBC) && library > 0)
{
--j;
@@ -377,13 +357,6 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
}
if (saw_time)
new_decoded_options[j++] = *saw_time;
- else if (library > 0 && need_time)
- {
- generate_option (OPT_l, TIME_LIBRARY, 1, CL_DRIVER,
- &new_decoded_options[j]);
- added_libraries++;
- j++;
- }
if (saw_libc)
new_decoded_options[j++] = *saw_libc;
if (shared_libgcc && !static_link)