From b223233b15018c5e1def94d1e5d65e8684025be0 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sat, 8 May 2021 21:09:36 +0200 Subject: [PATCH] Toolchain+Ports: Skip link tests for libstdc++v3 This makes stdlib.h and stdio.h functions available in the std namespace for C++. libstdc++v3's link tests can fail if you don't have an up-to-date build directory, for example: 1. Have libc with missing _Exit symbol because you haven't done a build since that was added. 2. Run toolchain rebuild. libstdc++v3's configure script will realize that it can do link tests in general but will fail later on when it tries to link a program that tests for _Exit. Even though this is a toolchain patch this does not necessarily require rebuilding the toolchain right away. This is only required once we start using any of these new members in the std namespace, e.g. for ports. --- Ports/gcc/patches/gcc.patch | 20 ++++++++++++++++++++ Toolchain/Patches/gcc.patch | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/Ports/gcc/patches/gcc.patch b/Ports/gcc/patches/gcc.patch index 205c459056..d6eef6e996 100644 --- a/Ports/gcc/patches/gcc.patch +++ b/Ports/gcc/patches/gcc.patch @@ -6297,3 +6297,23 @@ diff -Naur gcc-11.1.0-RC-20210420/libstdc++-v3/crossconfig.m4 gcc-11.1.0-RC-2021 arm*-*-symbianelf*) # This is a freestanding configuration; there is nothing to do here. ;; +diff -Naur gcc-11.1.0/libstdc++-v3/configure gcc-11.1.0.serenity/libstdc++-v3/configure +--- gcc-11.1.0/libstdc++-v3/configure 2021-05-08 23:33:02.665399548 +0200 ++++ gcc-11.1.0.serenity/libstdc++-v3/configure 2021-05-09 08:49:22.325309643 +0200 +@@ -4219,15 +4219,7 @@ + } + _ACEOF + # FIXME: Cleanup? +-if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 +- (eval $ac_link) 2>&5 +- ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; }; then : +- gcc_no_link=no +-else +- gcc_no_link=yes +-fi ++gcc_no_link=yes + if test x$gcc_no_link = xyes; then + # Setting cross_compile will disable run tests; it will + # also disable AC_CHECK_FILE but that's generally diff --git a/Toolchain/Patches/gcc.patch b/Toolchain/Patches/gcc.patch index 205c459056..d6eef6e996 100644 --- a/Toolchain/Patches/gcc.patch +++ b/Toolchain/Patches/gcc.patch @@ -6297,3 +6297,23 @@ diff -Naur gcc-11.1.0-RC-20210420/libstdc++-v3/crossconfig.m4 gcc-11.1.0-RC-2021 arm*-*-symbianelf*) # This is a freestanding configuration; there is nothing to do here. ;; +diff -Naur gcc-11.1.0/libstdc++-v3/configure gcc-11.1.0.serenity/libstdc++-v3/configure +--- gcc-11.1.0/libstdc++-v3/configure 2021-05-08 23:33:02.665399548 +0200 ++++ gcc-11.1.0.serenity/libstdc++-v3/configure 2021-05-09 08:49:22.325309643 +0200 +@@ -4219,15 +4219,7 @@ + } + _ACEOF + # FIXME: Cleanup? +-if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 +- (eval $ac_link) 2>&5 +- ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; }; then : +- gcc_no_link=no +-else +- gcc_no_link=yes +-fi ++gcc_no_link=yes + if test x$gcc_no_link = xyes; then + # Setting cross_compile will disable run tests; it will + # also disable AC_CHECK_FILE but that's generally