From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id B3C993857C41; Mon, 4 Apr 2022 12:52:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B3C993857C41 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] Fix -fno-unit-at-a-time for clang X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 470bac73eace7dee7b3c1b24abb69e64527ce933 X-Git-Newrev: 81c44937d19b3b95f801745b8859d4e63055256f Message-Id: <20220404125226.B3C993857C41@sourceware.org> Date: Mon, 4 Apr 2022 12:52:26 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2022 12:52:26 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=81c44937d19b3b95f801745b8859d4e63055256f commit 81c44937d19b3b95f801745b8859d4e63055256f Author: Adhemerval Zanella Date: Wed Mar 9 16:06:34 2022 -0300 Fix -fno-unit-at-a-time for clang It does not support the option. Diff: --- configure | 32 +++++++++++++++++++++++++++++++- configure.ac | 20 +++++++++++++++++++- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 701f8d9b95..465e9d0fc1 100755 --- a/configure +++ b/configure @@ -6343,10 +6343,40 @@ rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_fno_toplevel_reorder" >&5 $as_echo "$libc_cv_fno_toplevel_reorder" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fno-unit-at-a-time" >&5 +$as_echo_n "checking for -fno-unit-at-a-time... " >&6; } +if ${libc_cv_fno_unit_at_a_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.c <&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then + libc_cv_fno_unit_at_a_time=yes +else + libc_cv_fno_unit_at_a_time=no +fi +rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_fno_unit_at_a_time" >&5 +$as_echo "$libc_cv_fno_unit_at_a_time" >&6; } + if test $libc_cv_fno_toplevel_reorder = yes; then fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors" else - fno_unit_at_a_time=-fno-unit-at-a-time + if test $libc_cv_fno_unit_at_a_time == yes; then + fno_unit_at_a_time="-fno-unit-at-a-time" + else + fno_unit_at_a_time= + fi fi diff --git a/configure.ac b/configure.ac index 29fecae212..79b9400450 100644 --- a/configure.ac +++ b/configure.ac @@ -1490,10 +1490,28 @@ else libc_cv_fno_toplevel_reorder=no fi rm -f conftest*]) + +AC_CACHE_CHECK(for -fno-unit-at-a-time, libc_cv_fno_unit_at_a_time, [dnl +cat > conftest.c <&AS_MESSAGE_LOG_FD]) +then + libc_cv_fno_unit_at_a_time=yes +else + libc_cv_fno_unit_at_a_time=no +fi +rm -f conftest*]) + if test $libc_cv_fno_toplevel_reorder = yes; then fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors" else - fno_unit_at_a_time=-fno-unit-at-a-time + if test $libc_cv_fno_unit_at_a_time == yes; then + fno_unit_at_a_time="-fno-unit-at-a-time" + else + fno_unit_at_a_time= + fi fi AC_SUBST(fno_unit_at_a_time)