From patchwork Wed Dec 28 20:04:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christopher Covington X-Patchwork-Id: 9490631 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 270C0602A7 for ; Wed, 28 Dec 2016 20:06:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18D6420855 for ; Wed, 28 Dec 2016 20:06:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09E2326530; Wed, 28 Dec 2016 20:06:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 598C020855 for ; Wed, 28 Dec 2016 20:06:02 +0000 (UTC) Received: from localhost ([::1]:60768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMKU5-0003hI-5D for patchwork-qemu-devel@patchwork.kernel.org; Wed, 28 Dec 2016 15:06:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMKSt-00036D-Hg for qemu-devel@nongnu.org; Wed, 28 Dec 2016 15:04:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMKSq-0007VN-CJ for qemu-devel@nongnu.org; Wed, 28 Dec 2016 15:04:47 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:35120) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cMKSq-0007VF-3I for qemu-devel@nongnu.org; Wed, 28 Dec 2016 15:04:44 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id EAC0C60318; Wed, 28 Dec 2016 20:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1482955483; bh=ZTrF65jcAoBQZtIfw9zYfRZ5Wi2wV8PmBaY4CB6xqFo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JOSitp3xHdVOUIwjI1nRcyWqdBEeyNo24hoGTGB11+WZ3fKj3N/m5dNnFg7Xl1S9h oGzhCwAwZrzhN1Nzom/bJRJI2XROCWhjq9yYMbhBM3g6k0kgtgHS7LBG7cH9IRWfkb DUw1qnquhLWW3zocuiqtIlBnXtOJuY4/205fl3Uw= Received: from rtp-lab-has1.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: cov@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id D4E5D6023E; Wed, 28 Dec 2016 20:04:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1482955482; bh=ZTrF65jcAoBQZtIfw9zYfRZ5Wi2wV8PmBaY4CB6xqFo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N2aolaF9NVT3v/lBaj/ieaJ8IdBl/mkgUElrCPkD4lSYd9Lh0rrF83brH349Ommaw gYXjkV8Yle190qRbhqK0GYIBLj41rkdRM3FANgdBXzXNi9OO98ko1IrI/bqfbQ0rW9 09+0IeWjGBDinVuDFVo4ccbX86GuOj131LWG7SZU= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org D4E5D6023E Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=cov@codeaurora.org From: Christopher Covington To: qemu-devel@nongnu.org Date: Wed, 28 Dec 2016 15:04:33 -0500 Message-Id: <20161228200433.24244-1-cov@codeaurora.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161228145344.30819-1-cov@codeaurora.org> References: <20161228145344.30819-1-cov@codeaurora.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 198.145.29.96 Subject: [Qemu-devel] [PATCH v3] build: include sys/sysmacros.h for major() and minor() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= , Christopher Covington , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The definition of the major() and minor() macros are moving within glibc to . Include this header when it is available to avoid the following sorts of build-stopping messages: qga/commands-posix.c: In function ‘dev_major_minor’: qga/commands-posix.c:656:13: error: In the GNU C Library, "major" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "major", include directly. If you did not intend to use a system-defined macro "major", you should undefine it after including . [-Werror] *devmajor = major(st.st_rdev); ^~~~~~~~~~~~~~~~~~~~~~~~~~ qga/commands-posix.c:657:13: error: In the GNU C Library, "minor" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "minor", include directly. If you did not intend to use a system-defined macro "minor", you should undefine it after including . [-Werror] *devminor = minor(st.st_rdev); ^~~~~~~~~~~~~~~~~~~~~~~~~~ The additional include allows the build to complete on Fedora 26 (Rawhide) with glibc version 2.24.90. Signed-off-by: Christopher Covington Reviewed-by: Eric Blake --- configure | 18 ++++++++++++++++++ include/sysemu/os-posix.h | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/configure b/configure index 218df87d21..58a33c71ad 100755 --- a/configure +++ b/configure @@ -4746,6 +4746,20 @@ if test "$modules" = "yes" && test "$LD_REL_FLAGS" = ""; then fi ########################################## +# check for sysmacros.h + +have_sysmacros=no +cat > $TMPC << EOF +#include +int main(void) { + return makedev(0, 0); +} +EOF +if compile_prog "" "" ; then + have_sysmacros=yes +fi + +########################################## # End of CC checks # After here, no more $cc or $ld runs @@ -5721,6 +5735,10 @@ if test "$have_af_vsock" = "yes" ; then echo "CONFIG_AF_VSOCK=y" >> $config_host_mak fi +if test "$have_sysmacros" = "yes" ; then + echo "CONFIG_SYSMACROS=y" >> $config_host_mak +fi + # Hold two types of flag: # CONFIG_THREAD_SETNAME_BYTHREAD - we've got a way of setting the name on # a thread we have a handle to diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h index b0a6c0695b..900bdcb45a 100644 --- a/include/sysemu/os-posix.h +++ b/include/sysemu/os-posix.h @@ -34,6 +34,10 @@ #include #include +#ifdef CONFIG_SYSMACROS +#include +#endif + void os_set_line_buffering(void); void os_set_proc_name(const char *s); void os_setup_signal_handling(void);