From patchwork Mon May 13 22:37:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikulas Patocka X-Patchwork-Id: 2562861 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id CCB7F3FD85 for ; Tue, 14 May 2013 05:35:04 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uc1Rr-0008RY-W5; Mon, 13 May 2013 22:42:35 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uc1Nj-00009G-5V; Mon, 13 May 2013 22:38:11 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uc1Ne-00008w-Rf for linux-arm-kernel@lists.infradead.org; Mon, 13 May 2013 22:38:08 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4DMbgWK014633 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 13 May 2013 18:37:42 -0400 Received: from file.rdu.redhat.com (file.rdu.redhat.com [10.11.255.147]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4DMbgt9021553 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 May 2013 18:37:42 -0400 Received: from file.rdu.redhat.com (localhost [127.0.0.1]) by file.rdu.redhat.com (8.14.4/8.14.4) with ESMTP id r4DMbfBM032488; Mon, 13 May 2013 18:37:41 -0400 Received: from localhost (mpatocka@localhost) by file.rdu.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id r4DMbeXr032485; Mon, 13 May 2013 18:37:40 -0400 X-Authentication-Warning: file.rdu.redhat.com: mpatocka owned process doing -bs Date: Mon, 13 May 2013 18:37:40 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file.rdu.redhat.com To: Rob Herring , "Alasdair G. Kergon" , Edward Thornber Subject: [PATCH] bcache: Fix link errors on ARM In-Reply-To: <5175C06B.4020805@gmail.com> Message-ID: References: <5170B4C6.1030300@gmail.com> <5175C06B.4020805@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130513_183807_044590_B263E303 X-CRM114-Status: GOOD ( 19.80 ) X-Spam-Score: -7.5 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [209.132.183.28 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: dm-devel@redhat.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Mon, 22 Apr 2013, Rob Herring wrote: > On 04/22/2013 12:32 PM, Mikulas Patocka wrote: > > > > > > On Thu, 18 Apr 2013, Rob Herring wrote: > > > >> Current errors in linux-next for ARM multi-platform randconfig builds. > >> > >> Rob > >> > >> drivers/built-in.o:drivers/md/dm-cache-target.c:429: more undefined references to `__udivdi3' follow > >> /var/lib/jenkins/jobs/linux-randconfig/workspace/drivers/md/dm-cache-target.c:429: undefined reference to `__udivdi3' > >> /var/lib/jenkins/jobs/linux-randconfig/workspace/drivers/md/dm-cache-target.c:429: undefined reference to `__umoddi3' > >> driversdrivers/md/dm-cache-target.c:429: more undefined references to `__udivdi3' follow > >> drivers/md/dm-cache-target.c:429: undefined reference to `__udivdi3' > >> drivers/md/dm-cache-target.c:429: undefined reference to `__umoddi3' > > > > Hi > > > > I tried to cross-compile dm-cache on linux-next for arm and there were no > > failures and no references to __udivdi3 and __umoddi3. > > > > Please send the .config file that resulted in these faulures. > > The config is attached. My guess is it might be related to CONFIG_AEABI > not set. The compiler is "gcc version 4.6.3 (Ubuntu/Linaro > 4.6.3-1ubuntu5)" which is ubuntu 12.04 arm cross compiler. > > Rob This is a problem in gcc-4.6. (gcc-4.7 is OK). --- bcache: Fix link errors on ARM gcc-4.6 on ARM has some problem, it creates a function block_div.part.8, it references __udivdi3 and __umoddi3 and it is never called. The references to __udivdi3 and __umoddi3 cause a link failure. __always_inline works around the bug. Signed-off-by: Mikulas Patocka Index: linux-2.6/drivers/md/dm-cache-target.c =================================================================== --- linux-2.6.orig/drivers/md/dm-cache-target.c 2013-05-14 00:03:53.276986022 +0200 +++ linux-2.6/drivers/md/dm-cache-target.c 2013-05-14 00:34:09.128986023 +0200 @@ -425,6 +425,10 @@ return cache->sectors_per_block_shift >= 0; } +/* gcc on ARM generates spurious references to __udivdi3 and __umoddi3 */ +#if defined(CONFIG_ARM) && __GNUC__ == 4 && __GNUC_MINOR__ <= 6 +__always_inline +#endif static dm_block_t block_div(dm_block_t b, uint32_t n) { do_div(b, n);