All of lore.kernel.org
 help / color / mirror / Atom feed
From: mpatocka@redhat.com (Mikulas Patocka)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] bcache: Fix link errors on ARM
Date: Mon, 13 May 2013 18:37:40 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.1305131831110.32345@file.rdu.redhat.com> (raw)
In-Reply-To: <5175C06B.4020805@gmail.com>



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 <mpatocka@redhat.com>

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);

WARNING: multiple messages have this Message-ID (diff)
From: Mikulas Patocka <mpatocka@redhat.com>
To: Rob Herring <robherring2@gmail.com>,
	"Alasdair G. Kergon" <agk@redhat.com>,
	Edward Thornber <thornber@redhat.com>
Cc: dm-devel@redhat.com, linux-arm-kernel@lists.infradead.org
Subject: [PATCH] bcache: Fix link errors on ARM
Date: Mon, 13 May 2013 18:37:40 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.1305131831110.32345@file.rdu.redhat.com> (raw)
In-Reply-To: <5175C06B.4020805@gmail.com>



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 <mpatocka@redhat.com>

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);

  reply	other threads:[~2013-05-13 22:37 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19  3:06 linux-next ARM multi-platform randconfig errors Rob Herring
2013-04-19 16:12 ` Tony Lindgren
2013-04-19 16:41   ` Tomi Valkeinen
2013-04-19 19:43     ` Tony Lindgren
2013-04-19 19:51       ` Tony Lindgren
2013-04-19 20:11       ` Arnd Bergmann
2013-04-19 20:40         ` Tony Lindgren
2013-04-19 20:58           ` Arnd Bergmann
     [not found]             ` <20130419215134.GY10155@atomide.com>
2013-04-19 22:08               ` Arnd Bergmann
2013-04-19 22:53                 ` Paul Walmsley
2013-04-19 21:02           ` Tony Lindgren
2013-04-19 21:09           ` Tony Lindgren
2013-04-19 19:52     ` Jon Hunter
2013-04-19 20:42       ` Tony Lindgren
2013-04-19 17:23   ` Tony Lindgren
2013-04-22  7:23   ` Roger Quadros
2013-04-22  8:21     ` Felipe Balbi
2013-04-22 11:52       ` Felipe Balbi
2013-04-22 12:45         ` Kishon Vijay Abraham I
2013-04-22 13:04           ` Felipe Balbi
2013-04-22 17:32 ` Mikulas Patocka
2013-04-22 22:57   ` Rob Herring
2013-05-13 22:37     ` Mikulas Patocka [this message]
2013-05-13 22:37       ` [PATCH] bcache: Fix link errors on ARM Mikulas Patocka
2013-04-22 18:59 ` linux-next ARM multi-platform randconfig errors Mike Turquette

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.1305131831110.32345@file.rdu.redhat.com \
    --to=mpatocka@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.