linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: rdunlap@xenotime.net, akpm@linux-foundation.org,
	jmorris@namei.org, linux-fsdevel@vger.kernel.org
Subject: Re: [2.6.37-rc1] Build failure: __divdi3
Date: Fri, 05 Nov 2010 12:55:27 -0400	[thread overview]
Message-ID: <1288976127.20262.58.camel@localhost.localdomain> (raw)
In-Reply-To: <201011060148.AHA93123.FHOOMJSLtFFVOQ@I-love.SAKURA.ne.jp>

On Sat, 2010-11-06 at 01:48 +0900, Tetsuo Handa wrote:
> Hello.
> 
> Randy Dunlap wrote:
> > On Fri, 05 Nov 2010 17:59:42 +0900 Tetsuo Handa wrote:
> > 
> > > 
> > > WARNING: modpost: Found 5 section mismatch(es).
> > > To see full details build your kernel with:
> > > 'make CONFIG_DEBUG_SECTION_MISMATCH=y'
> > > fs/built-in.o(.text+0x3e357): In function `alignfile':
> > > : undefined reference to `__divdi3'
> > > fs/built-in.o(.text+0x3e39b): In function `alignfile':
> > > : undefined reference to `__divdi3'
> > > fs/built-in.o(.text+0x3f1af): In function `elf_core_dump':
> > > : undefined reference to `__divdi3'
> > > make: *** [.tmp_vmlinux1] Error 1
> > 
> > 
> > Hm, all due to usage of roundup() AFAICT.  Unfortunate.
> 
> Indeed. There is a commit for avoiding 64-bit division.
> 
>   commit ea7f1b6ee9dc96c5827b06ba21d7769d553efb7d
>   Author: Bjorn Helgaas <bjorn.helgaas@hp.com>
>   Date:   Thu Nov 5 11:17:11 2009 -0600
>   
>       x86/PCI: remove 64-bit division
>   
>       The roundup() caused a build error (undefined reference to `__udivdi3').
>       We're aligning to power-of-two boundaries, so it's simpler to just use
>       ALIGN() anyway, which avoids the division.
>   
>       Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
>       Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
>       Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> 
> It seems that the code itself has not changed between 2.6.36 and 2.6.37-rc1
> 
>   static int elf_core_dump(struct coredump_params *cprm)
>   {
>   (...snipped...)
>   	loff_t offset = 0, dataoff, foffset;
>   (...snipped...)
>   	dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE);
> 
> but the definition of roundup() has changed by
> 
>   commit b28efd54d9d5c8005a29cd8782335beb9daaa32d
>   Author: Eric Paris <eparis@redhat.com>
>   Date:   Wed Oct 13 17:50:08 2010 -0400
>   
>       kernel: roundup should only reference arguments once
>   
>       Currently the roundup macro references it's arguments more than one time.
>       This patch changes it so it will only use its arguments once.
>   
>       Suggested-by: Andrew Morton <akpm@linux-foundation.org>
>       Signed-off-by: Eric Paris <eparis@redhat.com>
>       Signed-off-by: James Morris <jmorris@namei.org>
> 
> between 2.6.36 and 2.6.37-rc1.

Interesting, is this a result of the compiler previously being able to
optimize the division since it could tell it was a power of 2 and now
that we have a private variable it can't?  The patch can easily be
reverted without breaking anyone else....

-Eric



  reply	other threads:[~2010-11-05 16:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-05  8:59 [2.6.37-rc1] Build failure: __divdi3 Tetsuo Handa
2010-11-05 16:09 ` Randy Dunlap
2010-11-05 16:48   ` Tetsuo Handa
2010-11-05 16:55     ` Eric Paris [this message]
2010-11-05 17:08       ` Tetsuo Handa
2010-11-05 17:16         ` Tetsuo Handa
2010-11-05 17:41           ` Eric Paris
2010-11-05 17:53             ` Andrew Morton
2010-11-05 18:36               ` Tetsuo Handa
2010-11-09  0:13                 ` Andrew Morton

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=1288976127.20262.58.camel@localhost.localdomain \
    --to=eparis@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=jmorris@namei.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=rdunlap@xenotime.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).