From patchwork Tue Sep 26 07:15:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 9971249 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 AA759602D8 for ; Tue, 26 Sep 2017 07:15:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C6D028D8F for ; Tue, 26 Sep 2017 07:15:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 914DA28EA8; Tue, 26 Sep 2017 07:15:37 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD04428D8F for ; Tue, 26 Sep 2017 07:15:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966350AbdIZHPg (ORCPT ); Tue, 26 Sep 2017 03:15:36 -0400 Received: from arcturus.kleine-koenig.org ([78.47.169.190]:47042 "EHLO arcturus.kleine-koenig.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965122AbdIZHPf (ORCPT ); Tue, 26 Sep 2017 03:15:35 -0400 Received: by arcturus.kleine-koenig.org (Postfix, from userid 1000) id 034841BAF50; Tue, 26 Sep 2017 09:15:34 +0200 (CEST) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: linux-sparse@vger.kernel.org Subject: [PATCH] cgcc: provide __ARM_PCS_VFP for armhf Date: Tue, 26 Sep 2017 09:15:20 +0200 Message-Id: <20170926071520.26507-1-uwe@kleine-koenig.org> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This fixes: $ uname -m armv8l $ env CHECK=./sparse ./cgcc -no-compile memops.c /usr/include/arm-linux-gnueabihf/gnu/stubs.h:7:12: error: unable to open 'gnu/stubs-soft.h' Signed-off-by: Uwe Kleine-König --- Hello, I added env CHECK=./sparse ./cgcc -no-compile memops.c to the package building process and that failed on armhf (i.e. Armv7 CPU with Thumb-2 and VFP3D16 or better) with the above error. With that applied all Debian primary architectures work fine; see https://buildd.debian.org/status/package.php?p=sparse&suite=unstable Best regards Uwe cgcc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cgcc b/cgcc index a8d7b4f..ee59201 100755 --- a/cgcc +++ b/cgcc @@ -296,7 +296,14 @@ sub add_specs { &define_size_t ("long unsigned int") . ' -D__SIZEOF_POINTER__=' . ($m64 ? '8' : '4')); } elsif ($spec eq 'arm') { - return (' -D__arm__=1 -m32' . + chomp (my $gccmachine = `$cc -dumpmachine`); + my $cppsymbols = ' -D__arm__=1 -m32'; + + if ($gccmachine eq 'arm-linux-gnueabihf') { + $cppsymbols .= ' -D__ARM_PCS_VFP=1'; + } + + return ($cppsymbols . &float_types (1, 1, 36, [24,8], [53,11], [53, 11])); } elsif ($spec eq 'aarch64') { return (' -D__aarch64__=1 -m64' . @@ -324,7 +331,7 @@ sub add_specs { return &add_specs ('s390x'); } elsif ($arch =~ /^(sparc64)$/i) { return &add_specs ('sparc64'); - } elsif ($arch =~ /^(arm)$/i) { + } elsif ($arch =~ /^arm(?:v[78]l)?$/i) { return &add_specs ('arm'); } elsif ($arch =~ /^(aarch64)$/i) { return &add_specs ('aarch64');