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: Wed, 16 Mar 2022 18:00:09 +0000 (GMT) [thread overview]
Message-ID: <20220316180009.1D257394743A@sourceware.org> (raw)
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=66aee60f16119c792767ad0e188aa81de740c81c
commit 66aee60f16119c792767ad0e188aa81de740c81c
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 c57b6e8785..e810148d43 100755
--- a/configure
+++ b/configure
@@ -6344,10 +6344,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 5eeabfaa6d..ecef952dee 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-03-16 18:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-16 18:00 Adhemerval Zanella [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-04-04 12:52 Adhemerval Zanella
2022-03-31 19:04 Adhemerval Zanella
2022-03-29 20:27 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=20220316180009.1D257394743A@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: link
Be 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).