public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] Fix -fno-unit-at-a-time for clang Date: Mon, 4 Apr 2022 12:52:26 +0000 (GMT) [thread overview] Message-ID: <20220404125226.B3C993857C41@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=81c44937d19b3b95f801745b8859d4e63055256f commit 81c44937d19b3b95f801745b8859d4e63055256f Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> 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 <<EOF +int foo; +EOF +if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -S -Werror -fno-unit-at-a-time conftest.c + 1>&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 <<EOF +int foo; +EOF +if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -Werror -fno-unit-at-a-time conftest.c + 1>&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)
next reply other threads:[~2022-04-04 12:52 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-04 12:52 Adhemerval Zanella [this message] -- strict thread matches above, loose matches on Subject: below -- 2022-03-31 19:04 Adhemerval Zanella 2022-03-29 20:27 Adhemerval Zanella 2022-03-16 18:00 Adhemerval Zanella 2022-03-15 18:37 Adhemerval Zanella 2022-03-11 17:22 Adhemerval Zanella 2022-03-10 19:20 Adhemerval Zanella
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220404125226.B3C993857C41@sourceware.org \ --to=azanella@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).