From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 16 May 2022 15:08:53 +0200 Subject: [PATCH] libstdc++: Support SerenityOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During the toolchain build, SerenityOS libraries are not available, so we have to manually tell libstdc++ about what our LibC supports. In most places, we take the Newlib code paths. Co-Authored-By: Gunnar Beutner Co-Authored-By: Daniel Bertalan Co-Authored-By: Itamar Co-Authored-By: James Mintram Co-Authored-By: Martin Bříza Co-Authored-By: Nico Weber Co-Authored-By: Philip Herron Co-Authored-By: Shannon Booth --- libstdc++-v3/acinclude.m4 | 4 ++-- libstdc++-v3/configure | 11 ++++++++--- libstdc++-v3/configure.host | 3 +++ libstdc++-v3/crossconfig.m4 | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 49cb0623e4f04665645b7ef2f0132bced452a892..52b0b2ef38457d5a02e1f21a3e65927402296d90 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1397,7 +1397,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [ ac_has_nanosleep=yes ac_has_sched_yield=yes ;; - freebsd*|netbsd*|dragonfly*|rtems*) + freebsd*|netbsd*|dragonfly*|rtems*|serenity*) ac_has_clock_monotonic=yes ac_has_clock_realtime=yes ac_has_nanosleep=yes @@ -2434,7 +2434,7 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ dragonfly* | freebsd*) enable_clocale_flag=dragonfly ;; - openbsd*) + openbsd* | serenity*) enable_clocale_flag=newlib ;; *) diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 9b6027775456469940da9c515dad5c0160d3cd3d..bd6c4ed05cb9621f855ed15d8e0825e5fc4d2d8c 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -11910,6 +11910,11 @@ else lt_cv_dlopen_libs= ;; + serenity*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs="" + ;; + darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 @@ -16514,7 +16519,7 @@ fi dragonfly* | freebsd*) enable_clocale_flag=dragonfly ;; - openbsd*) + openbsd* | serenity*) enable_clocale_flag=newlib ;; *) @@ -20675,7 +20680,7 @@ fi ac_has_nanosleep=yes ac_has_sched_yield=yes ;; - freebsd*|netbsd*|dragonfly*|rtems*) + freebsd*|netbsd*|dragonfly*|rtems*|serenity*) ac_has_clock_monotonic=yes ac_has_clock_realtime=yes ac_has_nanosleep=yes @@ -29361,7 +29366,7 @@ case "${host}" in # This is a freestanding configuration; there is nothing to do here. ;; - avr*-*-*) + avr*-*-* | *serenity*) $as_echo "#define HAVE_ACOSF 1" >>confdefs.h $as_echo "#define HAVE_ASINF 1" >>confdefs.h diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host index 9e7c7f02dfd1cce8ec663b3bd337a2ed4d736aad..609c641ff5e9b4f44db9a6909adb876b5e65349e 100644 --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host @@ -297,6 +297,9 @@ case "${host_os}" in # Use libatomic if necessary and avoid libstdc++ specific atomicity support atomicity_dir="cpu/generic/atomicity_builtins" ;; + serenity*) + os_include_dir="os/newlib" + ;; solaris2*) os_include_dir="os/solaris" ;; diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4 index b3269cb88e077425be95bfe6c424b08106cab93f..3bba9653675c98ae76caf6cb77bbc483886dc80b 100644 --- a/libstdc++-v3/crossconfig.m4 +++ b/libstdc++-v3/crossconfig.m4 @@ -9,7 +9,7 @@ case "${host}" in # This is a freestanding configuration; there is nothing to do here. ;; - avr*-*-*) + avr*-*-* | *serenity*) AC_DEFINE(HAVE_ACOSF) AC_DEFINE(HAVE_ASINF) AC_DEFINE(HAVE_ATAN2F)