diff --git gcc-clean/config.sub gcc-workdir/config.sub index 38f3d03..ee981b0 100755 --- gcc-clean/config.sub +++ gcc-workdir/config.sub @@ -1749,7 +1749,7 @@ case $os in | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ - | fiwix* ) + | fiwix* | astral* ) ;; # This one is extra strict with allowed versions sco3.2v2 | sco3.2v[4-9]* | sco5v6*) diff --git gcc-clean/fixincludes/mkfixinc.sh gcc-workdir/fixincludes/mkfixinc.sh index df90720..aebfb82 100755 --- gcc-clean/fixincludes/mkfixinc.sh +++ gcc-workdir/fixincludes/mkfixinc.sh @@ -11,6 +11,8 @@ target=fixinc.sh # Check for special fix rules for particular targets case $machine in + *-astral* | \ + *-*-astral* | \ i?86-*-cygwin* | \ i?86-*-mingw32* | \ x86_64-*-mingw32* | \ diff --git gcc-workdir/gcc/config/astral.h gcc-workdir/gcc/config/astral.h new file mode 100644 index 0000000..1768e2c --- /dev/null +++ gcc-workdir/gcc/config/astral.h @@ -0,0 +1,24 @@ +#undef TARGET_ASTRAL +#define TARGET_ASTRAL 1 + +#undef LIB_SPEC +#define LIB_SPEC "-lc" + +#undef LINK_SPEC +#define LINK_SPEC "%{shared:-shared} %{static:-static} %{!shared: %{!static: %{rdynamic:-export-dynamic}}} %{!dynamic-linker:-dynamic-linker /usr/lib/ld.so}" + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "%{!shared:crt1.o%s} crti.o%s %{shared:crtbeginS.o%s;:crtbegin.o%s}" + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "%{shared:crtendS.o%s;:crtend.o%s} crtn.o%s" + +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do { \ + builtin_define ("__astral__"); \ + builtin_define ("__unix__"); \ + builtin_assert ("system=astral"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=posix"); \ + } while(0); diff --git gcc-clean/gcc/config.gcc gcc-workdir/gcc/config.gcc index a3566f5..93b4acc 100644 --- gcc-clean/gcc/config.gcc +++ gcc-workdir/gcc/config.gcc @@ -825,6 +825,14 @@ case ${target} in rust_target_objs="${rust_target_objs} dragonfly-rust.o" target_has_targetrustm=yes ;; +*-*-astral*) + extra_options="$extra_options gnu-user.opt" + gas=yes + gnu_ld=yes + default_use_cxa_atexit=yes + use_gcc_stdint=provide + thread_file='posix' + ;; *-*-freebsd*) # This is the generic ELF configuration of FreeBSD. Later # machine-specific sections may refine and add to this @@ -1189,6 +1197,9 @@ case ${target} in esac case ${target} in +x86_64-*-astral*) + tm_file="${tm_file} i386/unix.h i386/att.h elfos.h glibc-stdint.h i386/i386elf.h i386/x86-64.h gnu-user.h astral.h" + ;; aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*) tm_file="${tm_file} elfos.h newlib-stdint.h" tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-elf-raw.h" diff --git gcc-clean/libatomic/configure.tgt gcc-workdir/libatomic/configure.tgt index 4237f28..6adebf9 100644 --- gcc-clean/libatomic/configure.tgt +++ gcc-workdir/libatomic/configure.tgt @@ -150,6 +150,7 @@ case "${target}" in *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \ | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly* \ + | *-*-astral* \ | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \ | *-*-darwin* | *-*-aix* | *-*-cygwin*) # POSIX system. The OS is supported. diff --git gcc-clean/libgcc/config.host gcc-workdir/libgcc/config.host index ee10e99..411a213 100644 --- gcc-clean/libgcc/config.host +++ gcc-workdir/libgcc/config.host @@ -784,6 +784,10 @@ i[34567]86-*-openbsd*) ;; x86_64-*-openbsd*) ;; +x86_64-*-astral*) + extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtprec32.o crtprec64.o crtprec80.o crtfastmath.o" + tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic i386/t-crtpc t-crtfm i386/t-crtstuff t-dfprules" + ;; i[34567]86-*-linux*) extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o" tmake_file="${tmake_file} i386/t-crtpc t-crtfm i386/t-crtstuff t-dfprules" diff --git gcc-clean/libgcc/libgcov.h gcc-workdir/libgcc/libgcov.h index 9d83a27..5315570 100644 --- gcc-clean/libgcc/libgcov.h +++ gcc-workdir/libgcc/libgcov.h @@ -25,6 +25,8 @@ #ifndef GCC_LIBGCOV_H #define GCC_LIBGCOV_H +#include + /* work around the poisoned malloc/calloc in system.h. */ #ifndef xmalloc #define xmalloc malloc diff --git gcc-clean/libstdc++-v3/configure.ac gcc-workdir/libstdc++-v3/configure.ac index a6525a9..6c8c322 100644 --- gcc-clean/libstdc++-v3/configure.ac +++ gcc-workdir/libstdc++-v3/configure.ac @@ -134,7 +134,7 @@ fi # Use glibcxx_compiler_pic_flag to designate a compile-time flags for # creating position-independent objects. This varies with the target # hardware and operating system, but is often: -DPIC -fPIC. -if test "$enable_shared" = yes; then +if test "$enable_shared" = yes || test "${with_pic+set}" = set; then glibcxx_lt_pic_flag="-prefer-pic" glibcxx_compiler_pic_flag="$lt_prog_compiler_pic_CXX" glibcxx_compiler_shared_flag="-D_GLIBCXX_SHARED" diff --git gcc-clean/libstdc++-v3/crossconfig.m4 gcc-workdir/libstdc++-v3/crossconfig.m4 index b3269cb..a5d4014 100644 --- gcc-clean/libstdc++-v3/crossconfig.m4 +++ gcc-workdir/libstdc++-v3/crossconfig.m4 @@ -8,7 +8,12 @@ case "${host}" in arm*-*-symbianelf*) # This is a freestanding configuration; there is nothing to do here. ;; - + *-astral*) + GLIBCXX_CHECK_COMPILER_FEATURES + GLIBCXX_CHECK_LINKER_FEATURES + GLIBCXX_CHECK_MATH_SUPPORT + GLIBCXX_CHECK_STDLIB_SUPPORT + ;; avr*-*-*) AC_DEFINE(HAVE_ACOSF) AC_DEFINE(HAVE_ASINF)