Remove obsolete Solaris 11.3 support

Support for Solaris 11.3 had already been obsoleted in GCC 13.  However,
since the only Solaris system in the cfarm was running 11.3, I've kept
it in tree until now when both Solaris 11.4/SPARC and x86 systems have
been added.

This patch actually removes the Solaris 11.3 support.  Apart from
several minor simplifications, there are two more widespread changes:

* In Solaris 11.4, libsocket and libnsl were folded into libc, so
  there's no longer a need to link them explictly.

* Since Solaris 11.4, Solaris includes all crts needed by gcc (like
  crt1.o and gcrt1.o) with the base system.  All workarounds to provide
  fallbacks can thus go.

Bootstrapped without regressions on i386-pc-solaris2.11 and
sparc-sun-solaris2.11 (as/ld, gas/ld, and gas/gld) as well as Solaris
11.3/x86 to ascertain that version is actually rejected.

2024-04-30  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	c++tools:
	* configure.ac (ax_lib_socket_nsl.m4): Don't sinclude.
	(AX_LIB_SOCKET_NSL): Don't call.
	(NETLIBS): Remove.
	* configure: Regenerate.
	* Makefile.in (NETLIBS): Remove.
	(g++-mapper-server$(exeext)): Remove $(NETLIBS).

	gcc:
	* config.gcc: Move *-*-solaris2.11.[0-3]* to unsupported list.
	<*-*-solaris2*> (default_use_cxa_atexit): Set unconditionally.
	* configure.ac (AX_LIB_SOCKET_NSL): Don't call.
	(NETLIBS): Remove.
	(gcc_cv_ld_aligned_shf_merge): Remove.
	(hidden_linkonce) <i?86-*-solaris2* | x86_64-*-solaris2*>: Remove.
	(gcc_cv_target_dl_iterate_phdr) <*-*-solaris2*>: Always set to yes.
	* Makefile.in (NETLIBS): Remove.
	* configure, config.in, aclocal.m4: Regenerate.
	* config/sol2.h: Don't check HAVE_SOLARIS_CRTS.
	(STARTFILE_SPEC): Remove !HAVE_SOLARIS_CRTS case.
	[USE_GLD] (LINK_EH_SPEC): Remove TARGET_DL_ITERATE_PHDR guard.
	* config/i386/i386.cc (USE_HIDDEN_LINKONCE): Remove guard.
	* varasm.cc (mergeable_string_section): Remove
	HAVE_LD_ALIGNED_SHF_MERGE handling.
	(mergeable_constant_section): Likewise.

	* doc/install.texi (Specific,i?86-*-solaris2*): Reference Solaris
	11.4 only.
	(Specific, *-*-solaris2*): Document Solaris 11.3 removal.  Remove
	11.3 references and caveats.  Update for 11.4.

	gcc/cp:
	* Make-lang.in (cc1plus$(exeext)): Remove $(NETLIBS).

	gcc/objcp:
	* Make-lang.in (cc1objplus$(exeext)): Remove $(NETLIBS).

	gcc/testsuite:
	* lib/target-supports.exp (check_effective_target_pie): Always
	enable on *-*-solaris2*.

	libgcc:
	* configure.ac <*-*-solaris2*> (libgcc_cv_solaris_crts): Remove.
	* config.host <*-*-solaris2*>: Remove !libgcc_cv_solaris_crts
	support.
	* configure, config.in: Regenerate.
	* config/sol2/gmon.c (internal_mcount) [!HAVE_SOLARIS_CRTS]: Remove.
	* config/i386/sol2-c1.S, config/sparc/sol2-c1.S: Remove.
	* config/sol2/t-sol2 (crt1.o, gcrt1.o): Remove.

	libstdc++-v3:
	* testsuite/lib/dg-options.exp (add_options_for_net_ts)
	<*-*-solaris2*>: Don't link with -lsocket -lnsl.
This commit is contained in:
Rainer Orth 2024-05-07 10:45:55 +02:00
parent 9dbff9c055
commit f68e90a0fe
25 changed files with 43 additions and 977 deletions

View File

@ -35,7 +35,6 @@ CXXOPTS := $(CXXFLAGS) $(PICFLAG) -fno-exceptions -fno-rtti
LDFLAGS := @LDFLAGS@
exeext := @EXEEXT@
LIBIBERTY := ../libiberty/libiberty.a
NETLIBS := @NETLIBS@
VERSION.O := ../gcc/version.o
all::
@ -99,7 +98,7 @@ MAPPER.O := server.o resolver.o
CODYLIB = ../libcody/libcody.a
CXXINC += -I$(srcdir)/../libcody -I$(srcdir)/../include -I$(srcdir)/../gcc -I. -I../gcc
g++-mapper-server$(exeext): $(MAPPER.O) $(CODYLIB)
+$(CXX) $(LDFLAGS) $(PICFLAG) $(LD_PICFLAG) -o $@ $^ $(LIBIBERTY) $(NETLIBS)
+$(CXX) $(LDFLAGS) $(PICFLAG) $(LD_PICFLAG) -o $@ $^ $(LIBIBERTY)
# copy to gcc dir so tests there can run
all::../gcc/g++-mapper-server$(exeext)

211
c++tools/configure vendored
View File

@ -622,7 +622,6 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
NETLIBS
get_gcc_base_ver
EGREP
GREP
@ -1670,52 +1669,6 @@ $as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_cxx_check_header_compile
# ac_fn_cxx_try_link LINENO
# -------------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
ac_fn_cxx_try_link ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
rm -f conftest.$ac_objext conftest$ac_exeext
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
test -x conftest$ac_exeext
}; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
# Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
# created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
# interfere with the next link command; also delete a directory that is
# left behind by Apple's compiler. We do this before executing the actions.
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_cxx_try_link
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@ -3766,170 +3719,6 @@ fi
# Solaris needs libsocket and libnsl for socket functions before 11.4.
# libcody uses those.
save_LIBS="$LIBS"
LIBS=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
$as_echo_n "checking for library containing gethostbyname... " >&6; }
if ${ac_cv_search_gethostbyname+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char gethostbyname ();
int
main ()
{
return gethostbyname ();
;
return 0;
}
_ACEOF
for ac_lib in '' nsl; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_search_gethostbyname=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_gethostbyname+:} false; then :
break
fi
done
if ${ac_cv_search_gethostbyname+:} false; then :
else
ac_cv_search_gethostbyname=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
$as_echo "$ac_cv_search_gethostbyname" >&6; }
ac_res=$ac_cv_search_gethostbyname
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
$as_echo_n "checking for library containing socket... " >&6; }
if ${ac_cv_search_socket+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char socket ();
int
main ()
{
return socket ();
;
return 0;
}
_ACEOF
for ac_lib in '' socket; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_search_socket=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_socket+:} false; then :
break
fi
done
if ${ac_cv_search_socket+:} false; then :
else
ac_cv_search_socket=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
$as_echo "$ac_cv_search_socket" >&6; }
ac_res=$ac_cv_search_socket
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
$as_echo_n "checking for socket in -lsocket... " >&6; }
if ${ac_cv_lib_socket_socket+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket -lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char socket ();
int
main ()
{
return socket ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_socket_socket=yes
else
ac_cv_lib_socket_socket=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
$as_echo "$ac_cv_lib_socket_socket" >&6; }
if test "x$ac_cv_lib_socket_socket" = xyes; then :
LIBS="-lsocket -lnsl $LIBS"
fi
fi
NETLIBS="$LIBS"
LIBS="$save_LIBS"
ac_config_headers="$ac_config_headers config.h"
ac_config_files="$ac_config_files Makefile"

View File

@ -22,7 +22,6 @@
# By default g++ uses an in-process mapper.
sinclude(../config/acx.m4)
sinclude(../config/ax_lib_socket_nsl.m4)
AC_INIT(c++tools)
@ -264,15 +263,6 @@ fi
# Determine what GCC version number to use in filesystem paths.
GCC_BASE_VER
# Solaris needs libsocket and libnsl for socket functions before 11.4.
# libcody uses those.
save_LIBS="$LIBS"
LIBS=
AX_LIB_SOCKET_NSL
NETLIBS="$LIBS"
LIBS="$save_LIBS"
AC_SUBST(NETLIBS)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])

View File

@ -447,7 +447,6 @@ CPPINC = -I$(srcdir)/../libcpp/include
CODYLIB = ../libcody/libcody.a
CODYINC = -I$(srcdir)/../libcody
NETLIBS = @NETLIBS@
# Where to find decNumber
enable_decimal_float = @enable_decimal_float@

1
gcc/aclocal.m4 vendored
View File

@ -68,7 +68,6 @@ m4_include([../ltsugar.m4])
m4_include([../ltversion.m4])
m4_include([../lt~obsolete.m4])
m4_include([../config/acx.m4])
m4_include([../config/ax_lib_socket_nsl.m4])
m4_include([../config/cet.m4])
m4_include([../config/codeset.m4])
m4_include([../config/depstand.m4])

View File

@ -271,9 +271,8 @@ case ${target}:`uname -v` in
esac
# Obsolete configurations.
case ${target}${target_min} in
*-*-solaris2.11.[0-3]* \
| ia64*-*-* \
case ${target} in
ia64*-*-* \
| nios2*-*-* \
)
if test "x$enable_obsolete" != xyes; then
@ -288,7 +287,7 @@ esac
# Unsupported targets list. Do not put an entry in this list unless
# it would otherwise be caught by a more permissive pattern. The list
# should be in alphabetical order.
case ${target} in
case ${target}${target_min} in
# Avoid special cases that are not obsolete
arm*-*-*eabi* \
)
@ -325,6 +324,7 @@ case ${target} in
| *-*-solaris2.[0-9] \
| *-*-solaris2.[0-9].* \
| *-*-solaris2.10* \
| *-*-solaris2.11.[0-3]* \
| *-*-sysv* \
| vax-*-vms* \
)
@ -1046,12 +1046,8 @@ case ${target} in
sol2_tm_file_head="elfos.h ${cpu_type}/sysv4.h"
sol2_tm_file_tail="${cpu_type}/sol2.h sol2.h"
sol2_tm_file="${sol2_tm_file_head} ${sol2_tm_file_tail}"
case ${target} in
*-*-solaris2.1[1-9]*)
# __cxa_atexit was introduced in Solaris 11.4.
default_use_cxa_atexit=yes
;;
esac
# __cxa_atexit was introduced in Solaris 11.4.
default_use_cxa_atexit=yes
use_gcc_stdint=wrap
if test x$gnu_ld = xyes; then
tm_file="usegld.h ${tm_file}"

View File

@ -1672,13 +1672,6 @@
#endif
/* Define 0/1 if your linker supports the SHF_MERGE flag with section
alignment > 1. */
#ifndef USED_FOR_TARGET
#undef HAVE_LD_ALIGNED_SHF_MERGE
#endif
/* Define if your linker supports --as-needed/--no-as-needed or equivalent
options. */
#ifndef USED_FOR_TARGET
@ -2560,12 +2553,6 @@
#endif
/* Define 0/1 if your linker supports hidden thunks in linkonce sections. */
#ifndef USED_FOR_TARGET
#undef USE_HIDDEN_LINKONCE
#endif
/* Define to 1 if the 'long long' type is wider than 'long' but still
efficiently supported by the host hardware. */
#ifndef USED_FOR_TARGET

View File

@ -5976,12 +5976,10 @@ ix86_setup_frame_addresses (void)
cfun->machine->accesses_prev_frame = 1;
}
#ifndef USE_HIDDEN_LINKONCE
# if defined(HAVE_GAS_HIDDEN) && (SUPPORTS_ONE_ONLY - 0)
# define USE_HIDDEN_LINKONCE 1
# else
# define USE_HIDDEN_LINKONCE 0
# endif
#if defined(HAVE_GAS_HIDDEN) && (SUPPORTS_ONE_ONLY - 0)
# define USE_HIDDEN_LINKONCE 1
#else
# define USE_HIDDEN_LINKONCE 0
#endif
/* Label count for call and return thunks. It is used to make unique

View File

@ -204,7 +204,7 @@ along with GCC; see the file COPYING3. If not see
%{ansi|std=c*|std=iso9899\\:199409:values-Xc.o%s; :values-Xa.o%s} \
%{std=c90|std=gnu90:values-xpg4.o%s; :values-xpg6.o%s}}}"
#if defined(HAVE_LD_PIE) && defined(HAVE_SOLARIS_CRTS)
#if defined(HAVE_LD_PIE)
#define STARTFILE_CRTBEGIN_SPEC "%{static:crtbegin.o%s; \
shared|" PIE_SPEC ":crtbeginS.o%s; \
:crtbegin.o%s}"
@ -265,7 +265,6 @@ along with GCC; see the file COPYING3. If not see
/* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us. */
#undef STARTFILE_SPEC
#ifdef HAVE_SOLARIS_CRTS
/* Since Solaris 11.4, the OS delivers crt1.o, crti.o, and crtn.o, with a hook
for compiler-dependent stuff like profile handling. */
#define STARTFILE_SPEC "%{!shared:%{!symbolic: \
@ -275,16 +274,8 @@ along with GCC; see the file COPYING3. If not see
:crtp.o%s}}} \
crti.o%s %(startfile_arch) %(startfile_crtbegin) \
%(startfile_vtv)"
#else
#define STARTFILE_SPEC "%{!shared:%{!symbolic: \
%{p:mcrt1.o%s; \
pg:gcrt1.o%s gmon.o%s; \
:crt1.o%s}}} \
crti.o%s %(startfile_arch) %(startfile_crtbegin) \
%(startfile_vtv)"
#endif
#if defined(HAVE_LD_PIE) && defined(HAVE_SOLARIS_CRTS)
#if defined(HAVE_LD_PIE)
#define ENDFILE_CRTEND_SPEC "%{static:crtend.o%s; \
shared|" PIE_SPEC ":crtendS.o%s; \
:crtend.o%s}"
@ -427,14 +418,13 @@ along with GCC; see the file COPYING3. If not see
#endif
#ifdef USE_GLD
/* Solaris 11 build 135+ implements dl_iterate_phdr. GNU ld needs
--eh-frame-hdr to create the required .eh_frame_hdr sections. */
#if defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR)
/* GNU ld needs --eh-frame-hdr to create the required .eh_frame_hdr sections. */
#if defined(HAVE_LD_EH_FRAME_HDR)
#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
#endif /* HAVE_LD_EH_FRAME && TARGET_DL_ITERATE_PHDR */
#endif /* HAVE_LD_EH_FRAME */
#endif
#if defined(HAVE_LD_PIE) && defined(HAVE_SOLARIS_CRTS)
#if defined(HAVE_LD_PIE)
#ifdef USE_GLD
/* Assert -z text by default to match Solaris ld. */
#define LD_PIE_SPEC "-pie %{!mimpure-text:-z text}"

224
gcc/configure vendored
View File

@ -809,7 +809,6 @@ ZSTD_LIB
ZSTD_INCLUDE
DL_LIB
LDEXP_LIB
NETLIBS
EXTRA_GCC_LIBS
GNAT_LIBEXC
COLLECT2_LIBS
@ -10285,170 +10284,6 @@ EXTRA_GCC_LIBS="$LIBS"
LIBS="$save_LIBS"
# Solaris needs libsocket and libnsl for socket functions before 11.4.
# C++ needs those for libcody.
save_LIBS="$LIBS"
LIBS=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
$as_echo_n "checking for library containing gethostbyname... " >&6; }
if ${ac_cv_search_gethostbyname+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char gethostbyname ();
int
main ()
{
return gethostbyname ();
;
return 0;
}
_ACEOF
for ac_lib in '' nsl; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_search_gethostbyname=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_gethostbyname+:} false; then :
break
fi
done
if ${ac_cv_search_gethostbyname+:} false; then :
else
ac_cv_search_gethostbyname=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
$as_echo "$ac_cv_search_gethostbyname" >&6; }
ac_res=$ac_cv_search_gethostbyname
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
$as_echo_n "checking for library containing socket... " >&6; }
if ${ac_cv_search_socket+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char socket ();
int
main ()
{
return socket ();
;
return 0;
}
_ACEOF
for ac_lib in '' socket; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_search_socket=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_socket+:} false; then :
break
fi
done
if ${ac_cv_search_socket+:} false; then :
else
ac_cv_search_socket=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
$as_echo "$ac_cv_search_socket" >&6; }
ac_res=$ac_cv_search_socket
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
$as_echo_n "checking for socket in -lsocket... " >&6; }
if ${ac_cv_lib_socket_socket+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket -lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char socket ();
int
main ()
{
return socket ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_socket_socket=yes
else
ac_cv_lib_socket_socket=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
$as_echo "$ac_cv_lib_socket_socket" >&6; }
if test "x$ac_cv_lib_socket_socket" = xyes; then :
LIBS="-lsocket -lnsl $LIBS"
fi
fi
NETLIBS="$LIBS"
LIBS="$save_LIBS"
# Some systems put ldexp and frexp in libm instead of libc; assume
# they're both in the same place. jcf-dump needs them.
save_LIBS="$LIBS"
@ -21575,7 +21410,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 21578 "configure"
#line 21413 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -21681,7 +21516,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 21684 "configure"
#line 21519 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -27105,23 +26940,6 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
gcc_cv_ld_aligned_shf_merge=yes
case "$target" in
# SHF_MERGE support is broken in Solaris ld up to Solaris 11.3/SPARC for
# alignment > 1.
sparc*-*-solaris2.11*)
if test x"$gnu_ld" = xno \
&& test "$ld_vers_major" -lt 2 && test "$ld_vers_minor" -lt 3159; then
gcc_cv_ld_aligned_shf_merge=no
fi
;;
esac
cat >>confdefs.h <<_ACEOF
#define HAVE_LD_ALIGNED_SHF_MERGE `if test $gcc_cv_ld_aligned_shf_merge = yes; then echo 1; else echo 0; fi`
_ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for COMDAT group support (GNU as)" >&5
$as_echo_n "checking assembler for COMDAT group support (GNU as)... " >&6; }
if ${gcc_cv_as_comdat_group+:} false; then :
@ -27303,35 +27121,6 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
# Restrict this test to Solaris/x86: other targets define this statically.
case "${target}" in
i?86-*-solaris2* | x86_64-*-solaris2*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking support for hidden thunks in linkonce sections" >&5
$as_echo_n "checking support for hidden thunks in linkonce sections... " >&6; }
if test $in_tree_ld = yes || echo "$ld_ver" | grep GNU > /dev/null; then
hidden_linkonce=yes
else
case "${target}" in
# Full support for hidden thunks in linkonce sections only appeared in
# Solaris 11/OpenSolaris.
*-*-solaris2.1[1-9]*)
hidden_linkonce=yes
;;
*)
hidden_linkonce=no
;;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hidden_linkonce" >&5
$as_echo "$hidden_linkonce" >&6; }
cat >>confdefs.h <<_ACEOF
#define USE_HIDDEN_LINKONCE `if test $hidden_linkonce = yes; then echo 1; else echo 0; fi`
_ACEOF
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for line table is_stmt support" >&5
$as_echo_n "checking assembler for line table is_stmt support... " >&6; }
if ${gcc_cv_as_is_stmt+:} false; then :
@ -33631,14 +33420,7 @@ $as_echo_n "checking dl_iterate_phdr in target C library... " >&6; }
gcc_cv_target_dl_iterate_phdr=unknown
case "$target" in
*-*-solaris2*)
# <link.h> needs both a dl_iterate_phdr declaration and support for
# compilation with largefile support.
if grep dl_iterate_phdr $target_header_dir/link.h > /dev/null 2>&1 \
&& grep 'large file capable' $target_header_dir/link.h > /dev/null 2>&1; then
gcc_cv_target_dl_iterate_phdr=yes
else
gcc_cv_target_dl_iterate_phdr=no
fi
gcc_cv_target_dl_iterate_phdr=yes
;;
*-*-dragonfly* | *-*-freebsd*)
if grep dl_iterate_phdr $target_header_dir/sys/link_elf.h > /dev/null 2>&1; then

View File

@ -1434,15 +1434,6 @@ EXTRA_GCC_LIBS="$LIBS"
LIBS="$save_LIBS"
AC_SUBST(EXTRA_GCC_LIBS)
# Solaris needs libsocket and libnsl for socket functions before 11.4.
# C++ needs those for libcody.
save_LIBS="$LIBS"
LIBS=
AX_LIB_SOCKET_NSL
NETLIBS="$LIBS"
LIBS="$save_LIBS"
AC_SUBST(NETLIBS)
# Some systems put ldexp and frexp in libm instead of libc; assume
# they're both in the same place. jcf-dump needs them.
save_LIBS="$LIBS"
@ -3599,21 +3590,6 @@ AC_DEFINE_UNQUOTED(HAVE_GAS_SHF_MERGE,
[`if test $gcc_cv_as_shf_merge = yes; then echo 1; else echo 0; fi`],
[Define 0/1 if your assembler supports marking sections with SHF_MERGE flag.])
gcc_cv_ld_aligned_shf_merge=yes
case "$target" in
# SHF_MERGE support is broken in Solaris ld up to Solaris 11.3/SPARC for
# alignment > 1.
sparc*-*-solaris2.11*)
if test x"$gnu_ld" = xno \
&& test "$ld_vers_major" -lt 2 && test "$ld_vers_minor" -lt 3159; then
gcc_cv_ld_aligned_shf_merge=no
fi
;;
esac
AC_DEFINE_UNQUOTED(HAVE_LD_ALIGNED_SHF_MERGE,
[`if test $gcc_cv_ld_aligned_shf_merge = yes; then echo 1; else echo 0; fi`],
[Define 0/1 if your linker supports the SHF_MERGE flag with section alignment > 1.])
gcc_GAS_CHECK_FEATURE([COMDAT group support (GNU as)],
gcc_cv_as_comdat_group,
[--fatal-warnings],
@ -3723,31 +3699,6 @@ AC_DEFINE_UNQUOTED(HAVE_COMDAT_GROUP,
|| test $gcc_cv_as_comdat_group_group = yes; then echo 1; else echo 0; fi`],
[Define 0/1 if your assembler and linker support COMDAT groups.])
# Restrict this test to Solaris/x86: other targets define this statically.
case "${target}" in
i?86-*-solaris2* | x86_64-*-solaris2*)
AC_MSG_CHECKING(support for hidden thunks in linkonce sections)
if test $in_tree_ld = yes || echo "$ld_ver" | grep GNU > /dev/null; then
hidden_linkonce=yes
else
case "${target}" in
# Full support for hidden thunks in linkonce sections only appeared in
# Solaris 11/OpenSolaris.
*-*-solaris2.1[[1-9]]*)
hidden_linkonce=yes
;;
*)
hidden_linkonce=no
;;
esac
fi
AC_MSG_RESULT($hidden_linkonce)
AC_DEFINE_UNQUOTED(USE_HIDDEN_LINKONCE,
[`if test $hidden_linkonce = yes; then echo 1; else echo 0; fi`],
[Define 0/1 if your linker supports hidden thunks in linkonce sections.])
;;
esac
gcc_GAS_CHECK_FEATURE([line table is_stmt support],
gcc_cv_as_is_stmt,,
[ .text
@ -7153,14 +7104,7 @@ AC_MSG_CHECKING(dl_iterate_phdr in target C library)
gcc_cv_target_dl_iterate_phdr=unknown
case "$target" in
*-*-solaris2*)
# <link.h> needs both a dl_iterate_phdr declaration and support for
# compilation with largefile support.
if grep dl_iterate_phdr $target_header_dir/link.h > /dev/null 2>&1 \
&& grep 'large file capable' $target_header_dir/link.h > /dev/null 2>&1; then
gcc_cv_target_dl_iterate_phdr=yes
else
gcc_cv_target_dl_iterate_phdr=no
fi
gcc_cv_target_dl_iterate_phdr=yes
;;
*-*-dragonfly* | *-*-freebsd*)
if grep dl_iterate_phdr $target_header_dir/sys/link_elf.h > /dev/null 2>&1; then

View File

@ -143,7 +143,7 @@ cc1plus-checksum.cc : build/genchecksum$(build_exeext) checksum-options \
cc1plus$(exeext): $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(CODYLIB) $(LIBDEPS) $(c++.prev)
@$(call LINK_PROGRESS,$(INDEX.c++),start)
+$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
$(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(CODYLIB) $(NETLIBS) \
$(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(CODYLIB) \
$(LIBS) $(BACKENDLIBS)
@$(call LINK_PROGRESS,$(INDEX.c++),end)

View File

@ -4293,7 +4293,7 @@ found on @uref{https://www.bitwizard.nl/sig11/,,www.bitwizard.nl}.
@end html
@anchor{ix86-x-solaris2}
@heading i?86-*-solaris2*
Use this for Solaris 11.3 or later on x86 and x86-64 systems. Starting
Use this for Solaris 11.4 on x86 and x86-64 systems. Starting
with GCC 4.7, there is also a 64-bit @samp{amd64-*-solaris2*} or
@samp{x86_64-*-solaris2*} configuration that corresponds to
@samp{sparcv9-sun-solaris2*}.
@ -4895,15 +4895,12 @@ supported as cross-compilation target only.
@end html
@anchor{x-x-solaris2}
@heading *-*-solaris2*
Support for Solaris 11.3 and earlier has been obsoleted in GCC 13, but
can still be enabled by configuring with @option{--enable-obsolete}.
Support for Solaris 11.3 and earlier has been removed in GCC 15.
Support for Solaris 10 has been removed in GCC 10. Support for Solaris
9 has been removed in GCC 5. Support for Solaris 8 has been removed in
GCC 4.8. Support for Solaris 7 has been removed in GCC 4.6.
Solaris 11.3 provides GCC 4.5.2, 4.7.3, and 4.8.2 as
@command{/usr/gcc/4.5/bin/gcc} or similar. Solaris 11.4
provides one or more of GCC 5, 7, 9, 10, 11, and 12.
Solaris 11.4 provides one or more of GCC 5, 7, 9, 10, 11, 12, and 13.
You need to install the @code{system/header}, @code{system/linker}, and
@code{developer/assembler} packages.
@ -4922,18 +4919,18 @@ of the build.
We recommend the use of the Solaris assembler or the GNU assembler, in
conjunction with the Solaris linker.
The GNU @command{as} versions included in Solaris 11.3, from GNU
binutils 2.23.1 or newer (in @file{/usr/bin/gas} and
The GNU @command{as} versions included in Solaris 11.4, from GNU
binutils 2.30.1 or newer (in @file{/usr/bin/gas} and
@file{/usr/gnu/bin/as}), are known to work. The version from GNU
binutils 2.40 is known to work as well. Recent versions of the Solaris
binutils 2.42 is known to work as well. Recent versions of the Solaris
assembler in @file{/usr/bin/as} work almost as well, though. To use GNU
@command{as}, configure with the options @option{--with-gnu-as
--with-as=@//usr/@/gnu/@/bin/@/as}.
For linking, the Solaris linker is preferred. If you want to use the
GNU linker instead, the version in Solaris 11.3, from GNU binutils
2.23.1 or newer (in @file{/usr/gnu/bin/ld} and @file{/usr/bin/gld}),
works, as does the version from GNU binutils 2.40. However, it
GNU linker instead, the version in Solaris 11.4, from GNU binutils
2.30.1 or newer (in @file{/usr/gnu/bin/ld} and @file{/usr/bin/gld}),
works, as does the version from GNU binutils 2.42. However, it
generally lacks platform specific features, so better stay with Solaris
@command{ld}. To use the LTO linker plugin
(@option{-fuse-linker-plugin}) with GNU @command{ld}, GNU binutils
@ -4957,7 +4954,7 @@ will be disabled if no appropriate version is found. Solaris
work.
In order to build the GNU Ada compiler, GNAT, a working GNAT is needed.
Since Solaris 11.4 SRU 39, GNAT 11 or 12 is bundled in the
Since Solaris 11.4 SRU 39, GNAT 11, 12 or 13 is bundled in the
@code{developer/gcc/gcc-gnat} package.
In order to build the GNU D compiler, GDC, a working @samp{libphobos} is
@ -4967,20 +4964,8 @@ configuring with @option{--enable-libphobos}. Also, GDC 9.4.0 is
required on x86, while GDC 9.3.0 is known to work on SPARC.
The versions of the GNU Multiple Precision Library (GMP), the MPFR
library and the MPC library bundled with Solaris 11.3 and later are
usually recent enough to match GCC's requirements. There are two
caveats:
@itemize @bullet
@item
While the version of the GMP library in Solaris 11.3 works with GCC, you
need to configure with @option{--with-gmp-include=/usr/include/gmp}.
@item
The version of the MPFR libary included in Solaris 11.3 is too old; you
need to provide a more recent one.
@end itemize
library and the MPC library bundled with Solaris 11.4 are
recent enough to match GCC's requirements.
@html
<hr />

View File

@ -80,7 +80,7 @@ cc1objplus$(exeext): $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) \
@$(call LINK_PROGRESS,$(INDEX.obj-c++),start)
+$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
$(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) \
$(CODYLIB) $(NETLIBS) $(LIBS) $(BACKENDLIBS)
$(CODYLIB) $(LIBS) $(BACKENDLIBS)
@$(call LINK_PROGRESS,$(INDEX.obj-c++),end)
# Objective C++ language specific files.

View File

@ -1415,17 +1415,11 @@ proc check_effective_target_pie { } {
|| [istarget *-*-freebsd*]
|| [istarget *-*-linux*]
|| [istarget arm*-*-uclinuxfdpiceabi]
|| [istarget *-*-solaris2*]
|| [istarget *-*-gnu*]
|| [istarget *-*-amdhsa]} {
return 1;
}
if { [istarget *-*-solaris2.1\[1-9\]*] } {
# Full PIE support was added in Solaris 11.3, but gcc errors out
# if missing, so check for that.
return [check_no_compiler_messages pie executable {
int main (void) { return 0; }
} "-pie -fpie"]
}
return 0
}

View File

@ -886,9 +886,6 @@ mergeable_string_section (tree decl ATTRIBUTE_UNUSED,
if (align < modesize)
align = modesize;
if (!HAVE_LD_ALIGNED_SHF_MERGE && align > 8)
return readonly_data_section;
str = TREE_STRING_POINTER (decl);
unit = GET_MODE_SIZE (mode);
@ -927,8 +924,7 @@ mergeable_constant_section (machine_mode mode ATTRIBUTE_UNUSED,
&& known_le (GET_MODE_BITSIZE (mode), align)
&& align >= 8
&& align <= 256
&& (align & (align - 1)) == 0
&& (HAVE_LD_ALIGNED_SHF_MERGE ? 1 : align == 8))
&& (align & (align - 1)) == 0)
{
const char *prefix = function_mergeable_rodata_prefix ();
char *name = (char *) alloca (strlen (prefix) + 30);

View File

@ -345,24 +345,11 @@ case ${host} in
# Add cpu-specific t-sol2 after t-slibgcc-* so it can augment SHLIB_MAPFILES.
tmake_file="$tmake_file $cpu_type/t-sol2"
extra_parts="gmon.o crtbegin.o crtend.o"
if test "${libgcc_cv_solaris_crts}" = yes; then
# Solaris 11.4 provides crt1.o, crti.o, and crtn.o as part of the
# base system. crtp.o and crtpg.o implement the compiler-dependent parts.
extra_parts="$extra_parts crtp.o crtpg.o"
# If the Solaris CRTs are present, both ld and gld will have PIE support.
extra_parts="$extra_parts crtbeginS.o crtendS.o"
else
case ${host} in
i?86-*-solaris2* | x86_64-*-solaris2*)
# Solaris 10+/x86 provides crt1.o, crti.o, crtn.o, and gcrt1.o as
# part of the base system.
;;
sparc*-*-solaris2*)
# Solaris 10+/SPARC lacks crt1.o and gcrt1.o.
extra_parts="$extra_parts crt1.o gcrt1.o"
;;
esac
fi
# Solaris 11.4 provides crt1.o, crti.o, and crtn.o as part of the
# base system. crtp.o and crtpg.o implement the compiler-dependent parts.
extra_parts="$extra_parts crtp.o crtpg.o"
# If the Solaris CRTs are present, both ld and gld will have PIE support.
extra_parts="$extra_parts crtbeginS.o crtendS.o"
if test x$enable_vtable_verify = xyes; then
extra_parts="$extra_parts vtv_start.o vtv_end.o vtv_start_preinit.o vtv_end_preinit.o"
fi

View File

@ -34,9 +34,6 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define if the system-provided CRTs are present on Solaris. */
#undef HAVE_SOLARIS_CRTS
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H

View File

@ -1,173 +0,0 @@
/* crt1.s for Solaris 2, x86
Copyright (C) 1993-2024 Free Software Foundation, Inc.
Written By Fred Fish, Nov 1992
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3, or (at your option) any
later version.
This file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
/* This file takes control of the process from the kernel, as specified
in section 3 of the System V Application Binary Interface, Intel386
Processor Supplement. It has been constructed from information obtained
from the ABI, information obtained from single stepping existing
Solaris executables through their startup code with gdb, and from
information obtained by single stepping executables on other i386 SVR4
implementations. This file is the first thing linked into any
executable. */
#ifndef GCRT1
.ident "GNU C crt1.s"
#define CLEANUP _cleanup
#else
/* This is a modified crt1.s by J.W.Hawtin <oolon@ankh.org> 15/8/96,
to allow program profiling, by calling monstartup on entry and _mcleanup
on exit. */
.ident "GNU C gcrt1.s"
#define CLEANUP _mcleanup
#endif
.weak _cleanup
.weak _DYNAMIC
.text
/* Start creating the initial frame by pushing a NULL value for the return
address of the initial frame, and mark the end of the stack frame chain
(the innermost stack frame) with a NULL value, per page 3-32 of the ABI.
Initialize the first stack frame pointer in %ebp (the contents of which
are unspecified at process initialization). */
.globl _start
_start:
pushl $0x0
pushl $0x0
movl %esp,%ebp
/* As specified per page 3-32 of the ABI, %edx contains a function
pointer that should be registered with atexit(), for proper
shared object termination. Just push it onto the stack for now
to preserve it. We want to register _cleanup() first. */
pushl %edx
/* Check to see if there is an _cleanup() function linked in, and if
so, register it with atexit() as the last thing to be run by
atexit(). */
movl $CLEANUP,%eax
testl %eax,%eax
je .L1
pushl $CLEANUP
call atexit
addl $0x4,%esp
.L1:
/* Now check to see if we have an _DYNAMIC table, and if so then
we need to register the function pointer previously in %edx, but
now conveniently saved on the stack as the argument to pass to
atexit(). */
movl $_DYNAMIC,%eax
testl %eax,%eax
je .L2
call atexit
.L2:
/* Register _fini() with atexit(). We will take care of calling _init()
directly. */
pushl $_fini
call atexit
#ifdef GCRT1
/* Start profiling. */
pushl %ebp
movl %esp,%ebp
pushl $_etext
pushl $_start
call monstartup
addl $8,%esp
popl %ebp
#endif
/* Compute the address of the environment vector on the stack and load
it into the global variable _environ. Currently argc is at 8 off
the frame pointer. Fetch the argument count into %eax, scale by the
size of each arg (4 bytes) and compute the address of the environment
vector which is 16 bytes (the two zero words we pushed, plus argc,
plus the null word terminating the arg vector) further up the stack,
off the frame pointer (whew!). */
movl 8(%ebp),%eax
leal 16(%ebp,%eax,4),%edx
movl %edx,_environ
/* Push the environment vector pointer, the argument vector pointer,
and the argument count on to the stack to set up the arguments
for _init(), _fpstart(), and main(). Note that the environment
vector pointer and the arg count were previously loaded into
%edx and %eax respectively. The only new value we need to compute
is the argument vector pointer, which is at a fixed address off
the initial frame pointer. */
/* Make sure the stack is properly aligned. */
andl $0xfffffff0,%esp
subl $4,%esp
pushl %edx
leal 12(%ebp),%edx
pushl %edx
pushl %eax
/* Call _init(argc, argv, environ), _fpstart(argc, argv, environ), and
main(argc, argv, environ). */
call _init
call __fpstart
call main
/* Pop the argc, argv, and environ arguments off the stack, push the
value returned from main(), and call exit(). */
addl $12,%esp
pushl %eax
call exit
/* An inline equivalent of _exit, as specified in Figure 3-26 of the ABI. */
pushl $0x0
movl $0x1,%eax
lcall $7,$0
/* If all else fails, just try a halt! */
hlt
.type _start,@function
.size _start,.-_start
#ifndef GCRT1
/* A dummy profiling support routine for non-profiling executables,
in case we link in some objects that have been compiled for profiling. */
.weak _mcount
_mcount:
ret
.type _mcount,@function
.size _mcount,.-_mcount
#endif

View File

@ -316,29 +316,6 @@ internal_mcount (char *selfpc, unsigned short *frompcindex)
/* Only necessary without the Solaris CRTs or a proper gcrt1.o, otherwise
crtpg.o or gcrt1.o take care of that.
FIXME: What about _init vs. _start on sparc? */
#ifndef HAVE_SOLARIS_CRTS
if(!already_setup) {
extern char etext[];
already_setup = 1;
#if defined __i386__
/* <sys/vmparam.h> USERSTACK. */
monstartup ((char *) 0x8048000, etext);
#elif defined __x86_64__
monstartup (NULL, etext);
#elif defined __sparc__
{
extern char _start[];
extern char _init[];
monstartup (_start < _init ? _start : _init, etext);
}
#endif
atexit (_mcleanup);
}
#endif /* !HAVE_SOLARIS_CRTS */
/* Check that we are profiling and that we aren't recursively invoked. */
if (profiling) {
goto out;

View File

@ -25,9 +25,3 @@ crtpg.o: $(srcdir)/config/sol2/crtpg.c
# gmon build rule
gmon.o: $(srcdir)/config/sol2/gmon.c
$(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $<
# Assemble startup files.
crt1.o: $(srcdir)/config/$(cpu_type)/sol2-c1.S
$(crt_compile) -c $<
gcrt1.o: $(srcdir)/config/$(cpu_type)/sol2-c1.S
$(crt_compile) -c -DGCRT1 $<

View File

@ -1,103 +0,0 @@
! crt1.s for sparc & sparcv9 (SunOS 5)
! Copyright (C) 1992-2024 Free Software Foundation, Inc.
! Written By David Vinayak Henkel-Wallace, June 1992
!
! This file is free software; you can redistribute it and/or modify it
! under the terms of the GNU General Public License as published by the
! Free Software Foundation; either version 3, or (at your option) any
! later version.
!
! This file is distributed in the hope that it will be useful, but
! WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! General Public License for more details.
!
! Under Section 7 of GPL version 3, you are granted additional
! permissions described in the GCC Runtime Library Exception, version
! 3.1, as published by the Free Software Foundation.
!
! You should have received a copy of the GNU General Public License and
! a copy of the GCC Runtime Library Exception along with this program;
! see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
! <http://www.gnu.org/licenses/>.
! This file takes control of the process from the kernel, as specified
! in section 3 of the SVr4 ABI.
! This file is the first thing linked into any executable.
#ifdef __sparcv9
#define CPTRSIZE 8
#define CPTRSHIFT 3
#define STACK_BIAS 2047
#define ldn ldx
#define stn stx
#define setn(s, scratch, dst) setx s, scratch, dst
#else
#define CPTRSIZE 4
#define CPTRSHIFT 2
#define STACK_BIAS 0
#define ldn ld
#define stn st
#define setn(s, scratch, dst) set s, dst
#endif
.section ".text"
.proc 022
.global _start
_start:
mov 0, %fp ! Mark bottom frame pointer
ldn [%sp + (16 * CPTRSIZE) + STACK_BIAS], %l0 ! argc
add %sp, (17 * CPTRSIZE) + STACK_BIAS, %l1 ! argv
! Leave some room for a call. Sun leaves 32 octets (to sit on
! a cache line?) so we do too.
#ifdef __sparcv9
sub %sp, 48, %sp
#else
sub %sp, 32, %sp
#endif
! %g1 may contain a function to be registered w/atexit
orcc %g0, %g1, %g0
#ifdef __sparcv9
be %xcc, .nope
#else
be .nope
#endif
mov %g1, %o0
call atexit
nop
.nope:
! Now make sure constructors and destructors are handled.
setn(_fini, %o1, %o0)
call atexit, 1
nop
call _init, 0
nop
! We ignore the auxiliary vector; there is no defined way to
! access those data anyway. Instead, go straight to main:
mov %l0, %o0 ! argc
mov %l1, %o1 ! argv
#ifdef GCRT1
setn(___Argv, %o4, %o3)
stn %o1, [%o3] ! *___Argv
#endif
! Skip argc words past argv, to env:
sll %l0, CPTRSHIFT, %o2
add %o2, CPTRSIZE, %o2
add %l1, %o2, %o2 ! env
setn(_environ, %o4, %o3)
stn %o2, [%o3] ! *_environ
call main, 4
nop
call exit, 0
nop
call _exit, 0
nop
! We should never get here.
.type _start,#function
.size _start,.-_start

32
libgcc/configure vendored
View File

@ -5110,38 +5110,6 @@ fi
$as_echo "$libgcc_cv_mips_hard_float" >&6; }
esac
case ${host} in
*-*-solaris2*)
# Check for system-provided CRTs on Solaris 11.4.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking system-provided CRTs on Solaris" >&5
$as_echo_n "checking system-provided CRTs on Solaris... " >&6; }
if ${libgcc_cv_solaris_crts+:} false; then :
$as_echo_n "(cached) " >&6
else
libgcc_cv_solaris_crts=no
libgcc_sysroot="`${CC} -print-sysroot`"
libgcc_libdir="$libgcc_sysroot/usr/lib"
# At the time they were added, gcrt1.o became a symlink for backwards
# compatibility on x86, while crt1.o was added on sparc, so check for that.
case ${host} in
i?86-*-solaris2* | x86_64-*-solaris2*)
if test -h "$libgcc_libdir/gcrt1.o"; then libgcc_cv_solaris_crts=yes; fi
;;
sparc*-*-solaris2*)
if test -f "$libgcc_libdir/crt1.o"; then libgcc_cv_solaris_crts=yes; fi
;;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_solaris_crts" >&5
$as_echo "$libgcc_cv_solaris_crts" >&6; }
if test $libgcc_cv_solaris_crts = yes; then
$as_echo "#define HAVE_SOLARIS_CRTS 1" >>confdefs.h
fi
;;
esac
# Determine the version of glibc, if any, used on the target.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for target glibc version" >&5
$as_echo_n "checking for target glibc version... " >&6; }

View File

@ -346,31 +346,6 @@ mips*-*-*)
[libgcc_cv_mips_hard_float=no])])
esac
case ${host} in
*-*-solaris2*)
# Check for system-provided CRTs on Solaris 11.4.
AC_CACHE_CHECK([system-provided CRTs on Solaris],
[libgcc_cv_solaris_crts],
[libgcc_cv_solaris_crts=no
libgcc_sysroot="`${CC} -print-sysroot`"
libgcc_libdir="$libgcc_sysroot/usr/lib"
# At the time they were added, gcrt1.o became a symlink for backwards
# compatibility on x86, while crt1.o was added on sparc, so check for that.
case ${host} in
i?86-*-solaris2* | x86_64-*-solaris2*)
if test -h "$libgcc_libdir/gcrt1.o"; then libgcc_cv_solaris_crts=yes; fi
;;
sparc*-*-solaris2*)
if test -f "$libgcc_libdir/crt1.o"; then libgcc_cv_solaris_crts=yes; fi
;;
esac])
if test $libgcc_cv_solaris_crts = yes; then
AC_DEFINE(HAVE_SOLARIS_CRTS, 1,
[Define if the system-provided CRTs are present on Solaris.])
fi
;;
esac
# Determine the version of glibc, if any, used on the target.
AC_MSG_CHECKING([for target glibc version])
AC_ARG_WITH([glibc-version],

View File

@ -296,11 +296,7 @@ proc add_options_for_no_pch { flags } {
# Add to FLAGS all the target-specific flags needed for networking.
proc add_options_for_net_ts { flags } {
# Before they were integrated into libc in Solaris 11.4, Solaris needs
# libsocket and libnsl for networking applications.
if { [istarget *-*-solaris2*] } {
return "$flags -lsocket -lnsl"
} elseif { [istarget *-*-rtems*] } {
if { [istarget *-*-rtems*] } {
return "$flags -lbsd -Wl,--gc-sections"
}
return $flags