From: Maya Rashish Date: Mon, 18 Jun 2018 17:28:53 +0000 (+0000) Subject: crossconfig.m4: Handle OpenBSD just like NetBSD. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4f9eae9fd88ea2de19b7660b03fa6d49217ab211;p=gcc.git crossconfig.m4: Handle OpenBSD just like NetBSD. 2018-06-18 Maya Rashish * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6a386d93691..b3449654b1e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -14,6 +14,16 @@ (strlen_check_and_optimize_stmt): Same. * doc/extend.texi (Other Builtins): Document strnlen. +2018-06-18 Maya Rashish + + * 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 * tree.c (escaped_string::escape): Replace cast to char * by diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h index db766616156..2a767f193f2 100644 --- a/gcc/config/alpha/elf.h +++ b/gcc/config/alpha/elf.h @@ -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 diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h index 9ef320668c7..2bf52fe78ae 100644 --- a/gcc/config/alpha/linux.h +++ b/gcc/config/alpha/linux.h @@ -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}}" diff --git a/gcc/config/alpha/openbsd.h b/gcc/config/alpha/openbsd.h index aa369d7630a..9f035150d8b 100644 --- a/gcc/config/alpha/openbsd.h +++ b/gcc/config/alpha/openbsd.h @@ -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 */ +/* This must agree with */ #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 "." diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d5985588b4c..0af7c93227e 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2018-06-18 Maya Rashish + + * crossconfig.m4: Handle OpenBSD just like NetBSD. + * configure: Rebuilt. + 2018-06-18 Jonathan Wakely P0754R2 header diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 7bad76486a0..5a017beaabe 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -66148,7 +66148,7 @@ fi done ;; - *-netbsd*) + *-netbsd* | *-openbsd*) SECTION_FLAGS='-ffunction-sections -fdata-sections' diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4 index 669d87f7602..0dbfe4057bd 100644 --- a/libstdc++-v3/crossconfig.m4 +++ b/libstdc++-v3/crossconfig.m4 @@ -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