lkml.org 
[lkml]   [2007]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: linux-2.6.21 and __udivid3
Date
On Thu, 26 Apr 2007 19:55:26 +0200
Adrian Bunk <bunk@stusta.de> wrote:

> On Fri, Apr 27, 2007 at 12:24:32AM +0900, l l wrote:
> > Hi,
> >
> > How to link libgcc.a with linux-2.6.21?
> >
> > LD .tmp_vmlinux1
> > kernel/built-in.o: In function `timespec_add_ns':
> > /usr/src/linux-2.6.21/kernel/timer.c:828: undefined reference to
> > `__udivdi3'
> > /usr/src/linux-2.6.21/kernel/timer.c:841: undefined reference to
> > `__udivdi3'
> > /usr/src/linux-2.6.21/kernel/timer.c:1311: undefined reference to
> > `__udivdi3'
> > make[1]: *** [.tmp_vmlinux1] Error 1
> > make[1]: Leaving directory `/usr/src/linux-2.6.21'
> > make: *** [debian/stamp-build-kernel] Error 2
>
> I assume this is a plain 2.6.21 from ftp.kernel.org?
>
> > cc -v
> > Using built-in specs.
> > Target: i686-pc-linux-gnu
> > Configured with: ../gcc/configure --prefix=/usr --libexecdir=/usr/lib
> > --enable-shared --enable-threads=posix --enable-__cxa_atexit
> > --enable-clocale=gnu --enable-languages=c,c++,treelang
> > --with-system-zlib --with-gmp --enable-mpfr
> > --enable-libstdcxx-allocator=mt
> > Thread model: posix
> > gcc version 4.3.0 20070420 (experimental)
>
> Can you reproduce this with gcc 4.1?
> If yes, please send your .config .
>
> > TIA
>
> cu
> Adrian
>

I wonder if GCC 4.3 is trying to optimize this loop into a divide/remainder?
If so, then it is time to give the gcc developers a little talking to.


static inline void timespec_add_ns(struct timespec *a, u64 ns)
{
ns += a->tv_nsec;
while(unlikely(ns >= NSEC_PER_SEC)) {
ns -= NSEC_PER_SEC;
a->tv_sec++;
}
a->tv_nsec = ns;
}


--
Stephen Hemminger <shemminger@linux-foundation.org>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-04-26 22:03    [W:0.805 / U:1.064 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site