Message ID | 1476850306-2141-8-git-send-email-rasesh.mody@qlogic.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Bruce Richardson |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 9F6D77F50; Wed, 19 Oct 2016 06:13:04 +0200 (CEST) Received: from mx0b-0016ce01.pphosted.com (mx0a-0016ce01.pphosted.com [67.231.148.157]) by dpdk.org (Postfix) with ESMTP id 61D4A7F3C for <dev@dpdk.org>; Wed, 19 Oct 2016 06:13:02 +0200 (CEST) Received: from pps.filterd (m0095336.ppops.net [127.0.0.1]) by mx0a-0016ce01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9J4BAfu001898; Tue, 18 Oct 2016 21:13:01 -0700 Received: from avcashub1.qlogic.com ([198.186.0.117]) by mx0a-0016ce01.pphosted.com with ESMTP id 263jj4nbp4-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 18 Oct 2016 21:13:01 -0700 Received: from avluser05.qlc.com (10.1.113.115) by qlc.com (10.1.4.192) with Microsoft SMTP Server id 14.3.235.1; Tue, 18 Oct 2016 21:13:00 -0700 Received: (from rmody@localhost) by avluser05.qlc.com (8.14.4/8.14.4/Submit) id u9J4D0fq002286; Tue, 18 Oct 2016 21:13:00 -0700 X-Authentication-Warning: avluser05.qlc.com: rmody set sender to rasesh.mody@qlogic.com using -f From: Rasesh Mody <rasesh.mody@qlogic.com> To: <ferruh.yigit@intel.com>, <thomas.monjalon@6wind.com>, <bruce.richardson@intel.com> CC: <dev@dpdk.org>, <Dept-EngDPDKDev@qlogic.com>, Rasesh Mody <rasesh.mody@qlogic.com> Date: Tue, 18 Oct 2016 21:11:21 -0700 Message-ID: <1476850306-2141-8-git-send-email-rasesh.mody@qlogic.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1476850306-2141-1-git-send-email-rasesh.mody@qlogic.com> References: <1476850306-2141-1-git-send-email-rasesh.mody@qlogic.com> MIME-Version: 1.0 Content-Type: text/plain disclaimer: bypass X-Proofpoint-Virus-Version: vendor=nai engine=5800 definitions=8322 signatures=670725 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610190074 Subject: [dpdk-dev] [PATCH v4 07/32] net/qede: fix 32 bit compilation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Rasesh Mody
Oct. 19, 2016, 4:11 a.m. UTC
Fix 32 bit compilation for gcc version 4.3.4.
Fixes: ec94dbc57362 ("qede: add base driver")
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
---
drivers/net/qede/Makefile | 4 ++++
1 file changed, 4 insertions(+)
Comments
2016-10-18 21:11, Rasesh Mody: > Fix 32 bit compilation for gcc version 4.3.4. > > Fixes: ec94dbc57362 ("qede: add base driver") > > Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com> [...] > ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) > +ifeq ($(shell gcc -Wno-unused-but-set-variable -Werror -E - < /dev/null > /dev/null 2>&1; echo $$?),0) > CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable > +endif > CFLAGS_BASE_DRIVER += -Wno-missing-declarations > +ifeq ($(shell gcc -Wno-maybe-uninitialized -Werror -E - < /dev/null > /dev/null 2>&1; echo $$?),0) > CFLAGS_BASE_DRIVER += -Wno-maybe-uninitialized > +endif > CFLAGS_BASE_DRIVER += -Wno-strict-prototypes > ifeq ($(shell test $(GCC_VERSION) -ge 60 && echo 1), 1) > CFLAGS_BASE_DRIVER += -Wno-shift-negative-value What the hell are you doing here? 1/ You should better fix "unused-but-set-variable" errors 2/ It won't work when cross-compiling because you do not use $(CC) in $(shell gcc I really do not want to look at the qede patches. But each time my eyes stop on one of them, I'm struggling.
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Wednesday, October 26, 2016 9:54 AM > > 2016-10-18 21:11, Rasesh Mody: > > Fix 32 bit compilation for gcc version 4.3.4. > > > > Fixes: ec94dbc57362 ("qede: add base driver") > > > > Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com> > [...] > > ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) > > +ifeq ($(shell gcc -Wno-unused-but-set-variable -Werror -E - < > > +/dev/null > /dev/null 2>&1; echo $$?),0) > > CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable > > +endif > > CFLAGS_BASE_DRIVER += -Wno-missing-declarations > > +ifeq ($(shell gcc -Wno-maybe-uninitialized -Werror -E - < /dev/null > > > +/dev/null 2>&1; echo $$?),0) > > CFLAGS_BASE_DRIVER += -Wno-maybe-uninitialized > > +endif > > CFLAGS_BASE_DRIVER += -Wno-strict-prototypes ifeq ($(shell test > > $(GCC_VERSION) -ge 60 && echo 1), 1) CFLAGS_BASE_DRIVER += > > -Wno-shift-negative-value > > What the hell are you doing here? In one of our compilation testing on i586, we have gcc version 4.3.4. This version of gcc gives us following errors: cc1: error: unrecognized command line option "-Wno-unused-but-set-variable" cc1: error: unrecognized command line option "-Wno-maybe-uninitialized" -Wno-unused-but-set-variable option was added only in gcc version 5.1.0 -Wno-maybe-uninitialized option was added only in gcc version 4.7.0 All that above change does is that it checks if -Wno-unused-but-set-variable and -Wno-maybe-uninitialized options are available with gcc only then include them for compilation. > 1/ You should better fix "unused-but-set-variable" errors 2/ It won't work > when cross-compiling because you do not use $(CC) > in $(shell gcc We tested on gcc version 6.2.0 on x86_64 without applying this patch. Errors related to "unused-but-set-variable" option were not seen. The only errors we saw are as noted above due to an older version of gcc. We do use $(shell gcc, however, it is used under ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y), so, I believe it should work when cross-compiling. For example, in one of our compilation testing on clang version 3.8.0, with this patch applied, we did not see any errors. Please let us know if you see otherwise. However, I do agree it is better to use $(CC). We could change that with a follow on patch. Thanks! -Rasesh > > I really do not want to look at the qede patches. > But each time my eyes stop on one of them, I'm struggling.
2016-10-26 21:01, Mody, Rasesh: > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > Sent: Wednesday, October 26, 2016 9:54 AM > > > > 2016-10-18 21:11, Rasesh Mody: > > > Fix 32 bit compilation for gcc version 4.3.4. > > > > > > Fixes: ec94dbc57362 ("qede: add base driver") > > > > > > Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com> > > [...] > > > ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) > > > +ifeq ($(shell gcc -Wno-unused-but-set-variable -Werror -E - < > > > +/dev/null > /dev/null 2>&1; echo $$?),0) > > > CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable > > > +endif > > > CFLAGS_BASE_DRIVER += -Wno-missing-declarations > > > +ifeq ($(shell gcc -Wno-maybe-uninitialized -Werror -E - < /dev/null > > > > +/dev/null 2>&1; echo $$?),0) > > > CFLAGS_BASE_DRIVER += -Wno-maybe-uninitialized > > > +endif > > > CFLAGS_BASE_DRIVER += -Wno-strict-prototypes ifeq ($(shell test > > > $(GCC_VERSION) -ge 60 && echo 1), 1) CFLAGS_BASE_DRIVER += > > > -Wno-shift-negative-value > > > > What the hell are you doing here? > > In one of our compilation testing on i586, we have gcc version 4.3.4. This version of gcc gives us following errors: > > cc1: error: unrecognized command line option "-Wno-unused-but-set-variable" > cc1: error: unrecognized command line option "-Wno-maybe-uninitialized" > > -Wno-unused-but-set-variable option was added only in gcc version 5.1.0 > -Wno-maybe-uninitialized option was added only in gcc version 4.7.0 > > All that above change does is that it checks if -Wno-unused-but-set-variable and -Wno-maybe-uninitialized options are available with gcc only then include them for compilation. Have you tried to look what is done for other drivers? It is using GCC_VERSION to check the compatibility. > > 1/ You should better fix "unused-but-set-variable" errors 2/ It won't work > > when cross-compiling because you do not use $(CC) > > in $(shell gcc > > We tested on gcc version 6.2.0 on x86_64 without applying this patch. Errors related to "unused-but-set-variable" option were not seen. The only errors we saw are as noted above due to an older version of gcc. > We do use $(shell gcc, however, it is used under ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y), so, I believe it should work when cross-compiling. For example, in one of our compilation testing on clang version 3.8.0, with this patch applied, we did not see any errors. Please let us know if you see otherwise. Cross-compilation is using $(CROSS) prefix, e.g. when compiling for ARM on x86. > However, I do agree it is better to use $(CC). We could change that with a follow on patch. Please fix this patch by using GCC_VERSION.
diff --git a/drivers/net/qede/Makefile b/drivers/net/qede/Makefile index fe449aa..7965a83 100644 --- a/drivers/net/qede/Makefile +++ b/drivers/net/qede/Makefile @@ -48,9 +48,13 @@ endif endif ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) +ifeq ($(shell gcc -Wno-unused-but-set-variable -Werror -E - < /dev/null > /dev/null 2>&1; echo $$?),0) CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable +endif CFLAGS_BASE_DRIVER += -Wno-missing-declarations +ifeq ($(shell gcc -Wno-maybe-uninitialized -Werror -E - < /dev/null > /dev/null 2>&1; echo $$?),0) CFLAGS_BASE_DRIVER += -Wno-maybe-uninitialized +endif CFLAGS_BASE_DRIVER += -Wno-strict-prototypes ifeq ($(shell test $(GCC_VERSION) -ge 60 && echo 1), 1) CFLAGS_BASE_DRIVER += -Wno-shift-negative-value