crossconfig.m4: Handle OpenBSD just like NetBSD.

2018-06-18  Maya Rashish  <coypu@sdf.org>

	* crossconfig.m4: Handle OpenBSD just like NetBSD.
	* configure: Rebuilt.

	* config/alpha/openbsd.h (TARGET_DEFAULT): Define.
	(LINK_SPEC, STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
	(INTMAX_TYPE, UINTMAX_TYPE, WINT_TYPE): Likewise.

	* config/alpha/elf.h (STARTFILE_SPEC, ENDFILE_SPEC): Move from
	here to ...
	* config/alpha/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Here.

From-SVN: r261707
This commit is contained in:
Maya Rashish 2018-06-18 17:28:53 +00:00 committed by Jeff Law
parent 410fb7d7b0
commit 4f9eae9fd8
7 changed files with 75 additions and 29 deletions

View File

@ -14,6 +14,16 @@
(strlen_check_and_optimize_stmt): Same.
* doc/extend.texi (Other Builtins): Document strnlen.
2018-06-18 Maya Rashish <coypu@sdf.org>
* config/alpha/openbsd.h (TARGET_DEFAULT): Define.
(LINK_SPEC, STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
(INTMAX_TYPE, UINTMAX_TYPE, WINT_TYPE): Likewise.
* config/alpha/elf.h (STARTFILE_SPEC, ENDFILE_SPEC): Move from
here to ...
* config/alpha/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Here.
2018-06-18 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* tree.c (escaped_string::escape): Replace cast to char * by

View File

@ -100,32 +100,6 @@ do { \
ASM_OUTPUT_DEF (FILE, alias, name); \
} while (0)
/* Provide a STARTFILE_SPEC appropriate for ELF. Here we add the
(even more) magical crtbegin.o file which provides part of the
support for getting C++ file-scope static object constructed
before entering `main'. */
#undef STARTFILE_SPEC
#ifdef HAVE_LD_PIE
#define STARTFILE_SPEC \
"%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}\
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
#else
#define STARTFILE_SPEC \
"%{!shared: %{pg|p:gcrt1.o%s;:crt1.o%s}}\
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
#endif
/* Provide a ENDFILE_SPEC appropriate for ELF. Here we tack on the
magical crtend.o file which provides part of the support for
getting C++ file-scope static object constructed before entering
`main', followed by a normal ELF "finalizer" file, `crtn.o'. */
#undef ENDFILE_SPEC
#define ENDFILE_SPEC \
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
/* This variable should be set to 'true' if the target ABI requires
unwinding tables even when exceptions are not used. */
#define TARGET_UNWIND_TABLES_DEFAULT true

View File

@ -78,6 +78,32 @@ along with GCC; see the file COPYING3. If not see
#define TARGET_POSIX_IO
/* Provide a STARTFILE_SPEC appropriate for ELF. Here we add the
(even more) magical crtbegin.o file which provides part of the
support for getting C++ file-scope static object constructed
before entering `main'. */
#undef STARTFILE_SPEC
#ifdef HAVE_LD_PIE
#define STARTFILE_SPEC \
"%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}\
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
#else
#define STARTFILE_SPEC \
"%{!shared: %{pg|p:gcrt1.o%s;:crt1.o%s}}\
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
#endif
/* Provide a ENDFILE_SPEC appropriate for ELF. Here we tack on the
magical crtend.o file which provides part of the support for
getting C++ file-scope static object constructed before entering
`main', followed by a normal ELF "finalizer" file, `crtn.o'. */
#undef ENDFILE_SPEC
#define ENDFILE_SPEC \
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
#define LINK_GCC_C_SEQUENCE_SPEC \
"%{static|static-pie:--start-group} %G %L \
%{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}"

View File

@ -19,6 +19,28 @@ along with GCC; see the file COPYING3. If not see
/* Controlling the compilation driver. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT \
(MASK_FPREGS | MASK_IEEE | MASK_IEEE_CONFORMANT)
#define LINK_SPEC \
"%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
%{shared:-shared} %{R*} \
%{static:-Bstatic} \
%{!static:-Bdynamic} \
%{rdynamic:-export-dynamic} \
%{assert*} \
%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}"
/* As an elf system, we need crtbegin/crtend stuff. */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "\
%{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} \
%{!p:%{!static:crt0%O%s} %{static:%{nopie:crt0%O%s} \
%{!nopie:rcrt0%O%s}}}} crtbegin%O%s} %{shared:crtbeginS%O%s}"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
/* run-time target specifications */
#define TARGET_OS_CPP_BUILTINS() \
do { \
@ -28,18 +50,27 @@ along with GCC; see the file COPYING3. If not see
/* Layout of source language data types. */
/* This must agree with <machine/ansi.h> */
/* This must agree with <machine/_types.h> */
#undef SIZE_TYPE
#define SIZE_TYPE "long unsigned int"
#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE "long int"
#undef INTMAX_TYPE
#define INTMAX_TYPE "long long int"
#undef UINTMAX_TYPE
#define UINTMAX_TYPE "long long unsigned int"
#undef WCHAR_TYPE
#define WCHAR_TYPE "int"
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
#undef WINT_TYPE
#define WINT_TYPE "int"
#define LOCAL_LABEL_PREFIX "."

View File

@ -1,3 +1,8 @@
2018-06-18 Maya Rashish <coypu@sdf.org>
* crossconfig.m4: Handle OpenBSD just like NetBSD.
* configure: Rebuilt.
2018-06-18 Jonathan Wakely <jwakely@redhat.com>
P0754R2 <version> header

View File

@ -66148,7 +66148,7 @@ fi
done
;;
*-netbsd*)
*-netbsd* | *-openbsd*)
SECTION_FLAGS='-ffunction-sections -fdata-sections'

View File

@ -201,7 +201,7 @@ case "${host}" in
AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
AC_CHECK_FUNCS(_wfopen)
;;
*-netbsd*)
*-netbsd* | *-openbsd*)
SECTION_FLAGS='-ffunction-sections -fdata-sections'
AC_SUBST(SECTION_FLAGS)
GLIBCXX_CHECK_LINKER_FEATURES