diff --git a/host-recipes/xgcc b/host-recipes/xgcc index 0b4a097a..98de5d8b 100644 --- a/host-recipes/xgcc +++ b/host-recipes/xgcc @@ -6,7 +6,7 @@ hostdeps="automake autoconf xbinutils pkgconfig" deps="mlibc-headers" build() { - ${source_dir}/configure --target=x86_64-astral --prefix=${prefix} --with-sysroot=${sysroot_dir} --enable-languages=c,c++ -enable-threads=posix --disable-multilib + ${source_dir}/configure --target=x86_64-astral --prefix=${prefix} --with-sysroot=${sysroot_dir} --enable-languages=c,c++ -enable-threads=posix --disable-multilib --enable-shared --enable-host-shared --with-pic make all-gcc all-target-libgcc -j ${parallelism} } diff --git a/patches/gcc/jinx-working-patch.patch b/patches/gcc/jinx-working-patch.patch index c480ee6b..115fa146 100644 --- a/patches/gcc/jinx-working-patch.patch +++ b/patches/gcc/jinx-working-patch.patch @@ -1,7 +1,8 @@ -diff -ruN gcc-12.1.0/config.sub gcc-12.1.0-patched/config.sub ---- gcc-12.1.0/config.sub 2022-05-06 04:30:56.000000000 -0300 -+++ gcc-12.1.0-patched/config.sub 2022-09-14 19:57:47.513031678 -0300 -@@ -1749,7 +1749,7 @@ +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* \ @@ -10,10 +11,11 @@ diff -ruN gcc-12.1.0/config.sub gcc-12.1.0-patched/config.sub ;; # This one is extra strict with allowed versions sco3.2v2 | sco3.2v[4-9]* | sco5v6*) -diff -ruN gcc-12.1.0/fixincludes/mkfixinc.sh gcc-12.1.0-patched/fixincludes/mkfixinc.sh ---- gcc-12.1.0/fixincludes/mkfixinc.sh 2022-05-06 04:30:56.000000000 -0300 -+++ gcc-12.1.0-patched/fixincludes/mkfixinc.sh 2022-09-14 19:59:55.153030645 -0300 -@@ -11,6 +11,8 @@ +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 @@ -22,9 +24,11 @@ diff -ruN gcc-12.1.0/fixincludes/mkfixinc.sh gcc-12.1.0-patched/fixincludes/mkfi i?86-*-cygwin* | \ i?86-*-mingw32* | \ x86_64-*-mingw32* | \ -diff -ruN gcc-12.1.0/gcc/config/astral.h gcc-12.1.0-patched/gcc/config/astral.h ---- gcc-12.1.0/gcc/config/astral.h 1969-12-31 21:00:00.000000000 -0300 -+++ gcc-12.1.0-patched/gcc/config/astral.h 2022-09-14 19:58:16.803031441 -0300 +diff --git gcc-workdir/gcc/config/astral.h gcc-workdir/gcc/config/astral.h +new file mode 100644 +index 0000000..fe6e2e1 +--- /dev/null ++++ gcc-workdir/gcc/config/astral.h @@ -0,0 +1,24 @@ +#undef TARGET_ASTRAL +#define TARGET_ASTRAL 1 @@ -50,10 +54,11 @@ diff -ruN gcc-12.1.0/gcc/config/astral.h gcc-12.1.0-patched/gcc/config/astral.h + builtin_assert ("system=unix"); \ + builtin_assert ("system=posix"); \ + } while(0); -diff -ruN gcc-12.1.0/gcc/config.gcc gcc-12.1.0-patched/gcc/config.gcc ---- gcc-12.1.0/gcc/config.gcc 2022-05-06 04:30:56.000000000 -0300 -+++ gcc-12.1.0-patched/gcc/config.gcc 2022-09-14 19:57:58.466364923 -0300 -@@ -773,6 +773,14 @@ +diff --git gcc-clean/gcc/config.gcc gcc-workdir/gcc/config.gcc +index c5064dd..e151646 100644 +--- gcc-clean/gcc/config.gcc ++++ gcc-workdir/gcc/config.gcc +@@ -773,6 +773,14 @@ case ${target} in tmake_file="${tmake_file} t-dragonfly" target_has_targetdm=yes ;; @@ -68,7 +73,7 @@ diff -ruN gcc-12.1.0/gcc/config.gcc gcc-12.1.0-patched/gcc/config.gcc *-*-freebsd*) # This is the generic ELF configuration of FreeBSD. Later # machine-specific sections may refine and add to this -@@ -1087,6 +1093,9 @@ +@@ -1087,6 +1095,9 @@ case ${target} in esac case ${target} in @@ -78,10 +83,11 @@ diff -ruN gcc-12.1.0/gcc/config.gcc gcc-12.1.0-patched/gcc/config.gcc aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*) tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h" tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-elf-raw.h" -diff -ruN gcc-12.1.0/libgcc/config.host gcc-12.1.0-patched/libgcc/config.host ---- gcc-12.1.0/libgcc/config.host 2022-05-06 04:30:59.000000000 -0300 -+++ gcc-12.1.0-patched/libgcc/config.host 2022-09-14 19:59:26.003030881 -0300 -@@ -751,6 +751,10 @@ +diff --git gcc-clean/libgcc/config.host gcc-workdir/libgcc/config.host +index 8c56fca..aecb1da 100644 +--- gcc-clean/libgcc/config.host ++++ gcc-workdir/libgcc/config.host +@@ -751,6 +751,10 @@ i[34567]86-*-openbsd*) ;; x86_64-*-openbsd*) ;; @@ -92,10 +98,37 @@ diff -ruN gcc-12.1.0/libgcc/config.host gcc-12.1.0-patched/libgcc/config.host 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 -ruN gcc-12.1.0/libstdc++-v3/crossconfig.m4 gcc-12.1.0-patched/libstdc++-v3/crossconfig.m4 ---- gcc-12.1.0/libstdc++-v3/crossconfig.m4 2022-05-06 04:31:00.000000000 -0300 -+++ gcc-12.1.0-patched/libstdc++-v3/crossconfig.m4 2022-09-14 19:58:39.359697928 -0300 -@@ -8,7 +8,12 @@ +diff --git gcc-clean/libgcc/libgcov.h gcc-workdir/libgcc/libgcov.h +index 40e845c..cbe95b8 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 e59bcdb..c2ac19b 100644 +--- gcc-clean/libstdc++-v3/configure.ac ++++ gcc-workdir/libstdc++-v3/configure.ac +@@ -118,7 +118,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 ae5283b..15d769e 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. ;; @@ -109,14 +142,3 @@ diff -ruN gcc-12.1.0/libstdc++-v3/crossconfig.m4 gcc-12.1.0-patched/libstdc++-v3 avr*-*-*) AC_DEFINE(HAVE_ACOSF) AC_DEFINE(HAVE_ASINF) ---- gcc-12.1.0/libgcc/libgcov.h 2022-05-06 04:30:59.000000000 -0300 -+++ gcc-12.1.0-patched/libgcc/libgcov.h 2022-09-15 17:13:09.406451175 -0300 -@@ -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