From patchwork Tue Dec 16 19:05:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 422019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7A94F140081 for ; Wed, 17 Dec 2014 06:05:14 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; q=dns; s=default; b=i3npz9al/pW5m9pj4ZwSI8KUFeJa+Gr1cOtTkAW9uWq 9qX7W8BfBjwGp3ffLt407tzB1lAkeWlnwZx0cH9gSiAZQvr1/pLNvze40zJzLnUF j/UUwHQhUK9dZfw9KIOP3cKVwKsL/o+ud7byn9fu/O1y7S4/3w9eUMc94gtXR95o = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; s=default; bh=DSbQWHPfBfWLlElkPer3CmzDE9Y=; b=VyvX3rYe7mxgjGubZ U2oFfTT1HVA1+AdRrswRYQdxfTYN7k4dx2k1drMFwyBMxik4N2kj7oZgSgUJl50A aDlPjhs3mY8TK0P+Z8uLhL1DJJFdLT+RNCnBfCHiGx5WIuFMsFbVWBvw1K+f6H1G I6UCE/0Dzgckmi9R9YlZi1MS+c= Received: (qmail 584 invoked by alias); 16 Dec 2014 19:05:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 571 invoked by uid 89); 16 Dec 2014 19:05:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS, URIBL_BLACK autolearn=no version=3.3.2 X-HELO: mail-ob0-f173.google.com Received: from mail-ob0-f173.google.com (HELO mail-ob0-f173.google.com) (209.85.214.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 16 Dec 2014 19:05:05 +0000 Received: by mail-ob0-f173.google.com with SMTP id uy5so47875obc.4 for ; Tue, 16 Dec 2014 11:05:03 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.202.84.147 with SMTP id i141mr22205305oib.56.1418756703156; Tue, 16 Dec 2014 11:05:03 -0800 (PST) Received: by 10.60.69.73 with HTTP; Tue, 16 Dec 2014 11:05:03 -0800 (PST) Date: Tue, 16 Dec 2014 20:05:03 +0100 Message-ID: Subject: [PATCH, libgo]: Fix build warning From: Uros Bizjak To: "gcc-patches@gcc.gnu.org" Cc: "gofrontend-dev@googlegroups.com" , Ian Taylor Hello! When building libgo on CentOS 5.11, following warnings appear: In file included from /usr/include/fcntl.h:38:0, from sysinfo.c:6: /home/uros/gcc-build/gcc/include-fixed/sys/stat.h:317:16: warning: inline function ‘lstat64’ declared but never defined __inline__ int lstat64 (__const char *__restrict __file, ^ /home/uros/gcc-build/gcc/include-fixed/sys/stat.h:286:16: warning: inline function ‘fstatat64’ declared but never defined __inline__ int fstatat64 (int __fd, __const char *__restrict __file, ^ /home/uros/gcc-build/gcc/include-fixed/sys/stat.h:255:16: warning: inline function ‘fstat64’ declared but never defined __inline__ int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2)); ^ /home/uros/gcc-build/gcc/include-fixed/sys/stat.h:250:16: warning: inline function ‘stat64’ declared but never defined __inline__ int stat64 (__const char *__restrict __file, ^ These are emitted from: CC="/home/uros/gcc-build/./gcc/xgcc -B/home/uros/gcc-build/./gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/ local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include -DHAVE_CONFIG_H -I. -I../../../gcc-svn/trunk/libgo -I ../../../gcc-svn/trunk/libgo/run time -I../../../gcc-svn/trunk/libgo/../libffi/include -I../libffi/include -pthread -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" /bin/sh ../../../gcc-svn/trunk/libgo/mksysin fo.sh due to the sys/stat.h, which protects above functions with: # if defined __USE_LARGEFILE64 \ && (! defined __USE_FILE_OFFSET64 \ || (defined __REDIRECT_NTH && defined __OPTIMIZE__)) Adding -O to OSCFLAGS fixes this issue, as __OPTIMIZE__ is defined with -O. Patch was bootstrapped and regression tested on x86_64-linux-gnu (CentOS 5.11), where it removes the above warnings. OK for mainline? Uros. Index: configure =================================================================== --- configure (revision 218778) +++ configure (working copy) @@ -13968,7 +13968,7 @@ -OSCFLAGS="-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +OSCFLAGS="-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O" case "$target" in mips-sgi-irix6.5*) # IRIX 6 needs _XOPEN_SOURCE=500 for the XPG5 version of struct Index: configure.ac =================================================================== --- configure.ac (revision 218778) +++ configure.ac (working copy) @@ -349,7 +349,7 @@ AC_SUBST(GO_SYSCALL_OS_ARCH_FILE) dnl Special flags used to generate sysinfo.go. -OSCFLAGS="-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +OSCFLAGS="-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O" case "$target" in mips-sgi-irix6.5*) # IRIX 6 needs _XOPEN_SOURCE=500 for the XPG5 version of struct