From patchwork Fri Dec 19 16:33:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 4364 Received: (qmail 8447 invoked by alias); 19 Dec 2014 16:33:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 8434 invoked by uid 89); 19 Dec 2014 16:33:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f178.google.com MIME-Version: 1.0 X-Received: by 10.60.57.10 with SMTP id e10mr5303181oeq.45.1419006790018; Fri, 19 Dec 2014 08:33:10 -0800 (PST) In-Reply-To: References: <20141219134216.GA5739@gmail.com> Date: Fri, 19 Dec 2014 08:33:09 -0800 Message-ID: Subject: Re: [PATCH] Compile s_llround.c with -Wno-error for x32 build From: "H.J. Lu" To: Joseph Myers Cc: GNU C Library On Fri, Dec 19, 2014 at 8:25 AM, Joseph Myers wrote: > On Fri, 19 Dec 2014, H.J. Lu wrote: > >> On x32, I got >> >> ../sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c:75:24: error: >> conflicting types for built-in function ‘lround’ [-Werror] >> weak_alias (__llround, lround) >> ^ >> ./../include/libc-symbols.h:128:26: note: in definition of macro >> ‘_weak_alias’ >> extern __typeof (name) aliasname __attribute__ ((weak, alias >> (#name))); >> ^ >> ../sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c:75:1: note: in >> expansion of macro ‘weak_alias’ >> weak_alias (__llround, lround) >> ^ >> cc1: all warnings being treated as errors >> >> Since x32 returns 32-bit long int and 64-bit long long int in the >> same 64-bit register, we make the 32b-bit lround an alias of the >> 64-bit llround. This patch adds -Wno-error for x32 build to silence >> the compiler. Verified on x32, i686 and x86-64 with GCC 4.8.3. I >> checked it in as an obvious fix. > > I think -fno-builtin-lround would be better than -Wno-error if it works to > fix the warning. (Cf. the CFLAGS-nldbl-*.c settings in > sysdeps/ieee754/ldbl-opt/Makefile.) > It works. I checked in this. Thanks. diff --git a/ChangeLog b/ChangeLog index 7d6d2de..e7392a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-12-19 H.J. Lu + + * sysdeps/x86_64/x32/Makefile (CFLAGS-s_llround.c): Replace + -Wno-error with -fno-builtin-lround. + 2014-12-19 Torvald Riegel * sysdeps/unix/sysv/linux/i386/lowlevellock-futex.h: New file. diff --git a/sysdeps/x86_64/x32/Makefile b/sysdeps/x86_64/x32/Makefile index 47e567c..f2ebc24 100644 --- a/sysdeps/x86_64/x32/Makefile +++ b/sysdeps/x86_64/x32/Makefile @@ -1,6 +1,6 @@ ifeq ($(subdir),math) # Since x32 returns 32-bit long int and 64-bit long long int in the # same 64-bit register, we make the 32b-bit lround an alias of the -# 64-bit llround. Add -Wno-error to silence the compiler. -CFLAGS-s_llround.c += -Wno-error +# 64-bit llround. Add -fno-builtin-lround to silence the compiler. +CFLAGS-s_llround.c += -fno-builtin-lround endif