All of lore.kernel.org
 help / color / mirror / Atom feed
* 2.6.18-rc3-mm2 Compile Error
@ 2006-08-07  3:30 Matt Reuther
  2006-08-07  5:21 ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Matt Reuther @ 2006-08-07  3:30 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

I got an Error while compiling 2.6.18-rc3-mm2:

  AR      arch/i386/lib/lib.a
  GEN     .version
  CHK     include/linux/compile.h
  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
kernel/built-in.o(.text+0x45667): In function `bacct_add_tsk':
include/linux/time.h:130: undefined reference to `__divdi3'
make: *** [.tmp_vmlinux1] Error 1

I attached the .config file.

Have a good day.
Matt

[-- Attachment #2: config-2.6.18-rc3-mm2-1.bz2 --]
[-- Type: application/x-bzip2, Size: 14399 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 2.6.18-rc3-mm2 Compile Error
  2006-08-07  3:30 2.6.18-rc3-mm2 Compile Error Matt Reuther
@ 2006-08-07  5:21 ` Andrew Morton
  2006-08-07 11:31   ` Matt Reuther
  2006-08-07 13:32   ` [-mm patch] add timespec_to_us() and use it in kernel/tsacct.c Adrian Bunk
  0 siblings, 2 replies; 8+ messages in thread
From: Andrew Morton @ 2006-08-07  5:21 UTC (permalink / raw)
  To: Matt Reuther; +Cc: LKML

On Sun, 6 Aug 2006 23:30:19 -0400
Matt Reuther <mreuther@umich.edu> wrote:

> I got an Error while compiling 2.6.18-rc3-mm2:
> 
>   AR      arch/i386/lib/lib.a
>   GEN     .version
>   CHK     include/linux/compile.h
>   UPD     include/linux/compile.h
>   CC      init/version.o
>   LD      init/built-in.o
>   LD      .tmp_vmlinux1
> kernel/built-in.o(.text+0x45667): In function `bacct_add_tsk':
> include/linux/time.h:130: undefined reference to `__divdi3'
> make: *** [.tmp_vmlinux1] Error 1
> 
> I attached the .config file.
> 

ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.18-rc3/2.6.18-rc3-mm2/hot-fixes/csa-basic-accounting-over-taskstats-fix.patch
should fix this, thanks.  

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 2.6.18-rc3-mm2 Compile Error
  2006-08-07  5:21 ` Andrew Morton
@ 2006-08-07 11:31   ` Matt Reuther
  2006-08-07 13:32   ` [-mm patch] add timespec_to_us() and use it in kernel/tsacct.c Adrian Bunk
  1 sibling, 0 replies; 8+ messages in thread
From: Matt Reuther @ 2006-08-07 11:31 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML

On Monday 07 August 2006 01:21 am, Andrew Morton wrote:
> On Sun, 6 Aug 2006 23:30:19 -0400
>
> Matt Reuther <mreuther@umich.edu> wrote:
> > I got an Error while compiling 2.6.18-rc3-mm2:
> >
> >   AR      arch/i386/lib/lib.a
> >   GEN     .version
> >   CHK     include/linux/compile.h
> >   UPD     include/linux/compile.h
> >   CC      init/version.o
> >   LD      init/built-in.o
> >   LD      .tmp_vmlinux1
> > kernel/built-in.o(.text+0x45667): In function `bacct_add_tsk':
> > include/linux/time.h:130: undefined reference to `__divdi3'
> > make: *** [.tmp_vmlinux1] Error 1
> >
> > I attached the .config file.
>
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.18-rc3/2.
>6.18-rc3-mm2/hot-fixes/csa-basic-accounting-over-taskstats-fix.patch should
> fix this, thanks.

It does indeed fix the error. Thank you!

Matt

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [-mm patch] add timespec_to_us() and use it in kernel/tsacct.c
  2006-08-07  5:21 ` Andrew Morton
  2006-08-07 11:31   ` Matt Reuther
@ 2006-08-07 13:32   ` Adrian Bunk
  2006-08-07 20:24     ` Andrew Morton
  2006-08-09 11:57     ` Matt Reuther
  1 sibling, 2 replies; 8+ messages in thread
From: Adrian Bunk @ 2006-08-07 13:32 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Matt Reuther, LKML, Jay Lan

On Sun, Aug 06, 2006 at 10:21:29PM -0700, Andrew Morton wrote:
> On Sun, 6 Aug 2006 23:30:19 -0400
> Matt Reuther <mreuther@umich.edu> wrote:
> 
> > I got an Error while compiling 2.6.18-rc3-mm2:
> > 
> >   AR      arch/i386/lib/lib.a
> >   GEN     .version
> >   CHK     include/linux/compile.h
> >   UPD     include/linux/compile.h
> >   CC      init/version.o
> >   LD      init/built-in.o
> >   LD      .tmp_vmlinux1
> > kernel/built-in.o(.text+0x45667): In function `bacct_add_tsk':
> > include/linux/time.h:130: undefined reference to `__divdi3'
> > make: *** [.tmp_vmlinux1] Error 1
> > 
> > I attached the .config file.
> > 
> 
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.18-rc3/2.6.18-rc3-mm2/hot-fixes/csa-basic-accounting-over-taskstats-fix.patch
> should fix this, thanks.  

This doesn't look correct since do_div() does not guarantee to return 
more than 32bit.

What about the patch below that adds a timespec_to_us() to time.h and 
uses this function in kernel/tsacct.c?


<--  snip  -->


This patch adds a timespec_to_us() to include/linux/time.h and uses it 
to fix a compile error in kernel/tsacct.c .

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 include/linux/time.h |   12 ++++++++++++
 kernel/tsacct.c      |    2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

--- linux-2.6.18-rc3-mm2-full/include/linux/time.h.old	2006-08-06 19:56:50.000000000 +0200
+++ linux-2.6.18-rc3-mm2-full/include/linux/time.h	2006-08-06 20:00:51.000000000 +0200
@@ -132,6 +132,18 @@
 }
 
 /**
+ * timespec_to_us - Convert timespec to microseconds
+ * @ts:		pointer to the timespec variable to be converted
+ *
+ * Returns the scalar microsecond representation of the timespec
+ * parameter.
+ */
+static inline s64 timespec_to_us(const struct timespec *ts)
+{
+	return ((s64) ts->tv_sec * USEC_PER_SEC) + ts->tv_nsec / NSEC_PER_USEC;
+}
+
+/**
  * timeval_to_ns - Convert timeval to nanoseconds
  * @ts:		pointer to the timeval variable to be converted
  *
--- linux-2.6.18-rc3-mm2-full/kernel/tsacct.c.old	2006-08-06 19:54:45.000000000 +0200
+++ linux-2.6.18-rc3-mm2-full/kernel/tsacct.c	2006-08-06 19:56:44.000000000 +0200
@@ -36,7 +36,7 @@
 	do_posix_clock_monotonic_gettime(&uptime);
 	ts = timespec_sub(uptime, current->group_leader->start_time);
 	/* rebase elapsed time to usec */
-	stats->ac_etime = (timespec_to_ns(&ts))/NSEC_PER_USEC;
+	stats->ac_etime = timespec_to_us(&ts);
 	stats->ac_btime = xtime.tv_sec - ts.tv_sec;
 	if (thread_group_leader(tsk)) {
 		stats->ac_exitcode = tsk->exit_code;



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [-mm patch] add timespec_to_us() and use it in kernel/tsacct.c
  2006-08-07 13:32   ` [-mm patch] add timespec_to_us() and use it in kernel/tsacct.c Adrian Bunk
@ 2006-08-07 20:24     ` Andrew Morton
  2006-08-07 20:46       ` Adrian Bunk
  2006-08-08  0:02       ` Paul Mackerras
  2006-08-09 11:57     ` Matt Reuther
  1 sibling, 2 replies; 8+ messages in thread
From: Andrew Morton @ 2006-08-07 20:24 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Matt Reuther, LKML, Jay Lan

On Mon, 7 Aug 2006 15:32:41 +0200
Adrian Bunk <bunk@stusta.de> wrote:

> On Sun, Aug 06, 2006 at 10:21:29PM -0700, Andrew Morton wrote:
> > On Sun, 6 Aug 2006 23:30:19 -0400
> > Matt Reuther <mreuther@umich.edu> wrote:
> > 
> > > I got an Error while compiling 2.6.18-rc3-mm2:
> > > 
> > >   AR      arch/i386/lib/lib.a
> > >   GEN     .version
> > >   CHK     include/linux/compile.h
> > >   UPD     include/linux/compile.h
> > >   CC      init/version.o
> > >   LD      init/built-in.o
> > >   LD      .tmp_vmlinux1
> > > kernel/built-in.o(.text+0x45667): In function `bacct_add_tsk':
> > > include/linux/time.h:130: undefined reference to `__divdi3'
> > > make: *** [.tmp_vmlinux1] Error 1
> > > 
> > > I attached the .config file.
> > > 
> > 
> > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.18-rc3/2.6.18-rc3-mm2/hot-fixes/csa-basic-accounting-over-taskstats-fix.patch
> > should fix this, thanks.  
> 
> This doesn't look correct since do_div() does not guarantee to return 
> more than 32bit.

eh?  We use do_div() to do 64bit/something all the time??

> What about the patch below that adds a timespec_to_us() to time.h and 
> uses this function in kernel/tsacct.c?

Seems reasonable, but it'd be better as two patches..

Do we do timespec->microseconds anywhere else?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [-mm patch] add timespec_to_us() and use it in kernel/tsacct.c
  2006-08-07 20:24     ` Andrew Morton
@ 2006-08-07 20:46       ` Adrian Bunk
  2006-08-08  0:02       ` Paul Mackerras
  1 sibling, 0 replies; 8+ messages in thread
From: Adrian Bunk @ 2006-08-07 20:46 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Matt Reuther, LKML, Jay Lan

On Mon, Aug 07, 2006 at 01:24:18PM -0700, Andrew Morton wrote:
> On Mon, 7 Aug 2006 15:32:41 +0200
> Adrian Bunk <bunk@stusta.de> wrote:
> 
> > On Sun, Aug 06, 2006 at 10:21:29PM -0700, Andrew Morton wrote:
> > > On Sun, 6 Aug 2006 23:30:19 -0400
> > > Matt Reuther <mreuther@umich.edu> wrote:
> > > 
> > > > I got an Error while compiling 2.6.18-rc3-mm2:
> > > > 
> > > >   AR      arch/i386/lib/lib.a
> > > >   GEN     .version
> > > >   CHK     include/linux/compile.h
> > > >   UPD     include/linux/compile.h
> > > >   CC      init/version.o
> > > >   LD      init/built-in.o
> > > >   LD      .tmp_vmlinux1
> > > > kernel/built-in.o(.text+0x45667): In function `bacct_add_tsk':
> > > > include/linux/time.h:130: undefined reference to `__divdi3'
> > > > make: *** [.tmp_vmlinux1] Error 1
> > > > 
> > > > I attached the .config file.
> > > > 
> > > 
> > > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.18-rc3/2.6.18-rc3-mm2/hot-fixes/csa-basic-accounting-over-taskstats-fix.patch
> > > should fix this, thanks.  
> > 
> > This doesn't look correct since do_div() does not guarantee to return 
> > more than 32bit.
> 
> eh?  We use do_div() to do 64bit/something all the time??

Sorry, this was my thinko.

> > What about the patch below that adds a timespec_to_us() to time.h and 
> > uses this function in kernel/tsacct.c?
> 
> Seems reasonable, but it'd be better as two patches..

Feel free to split this patch however you want, I thought it was not 
worth splitting it.

> Do we do timespec->microseconds anywhere else?

I haven't found another place.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [-mm patch] add timespec_to_us() and use it in kernel/tsacct.c
  2006-08-07 20:24     ` Andrew Morton
  2006-08-07 20:46       ` Adrian Bunk
@ 2006-08-08  0:02       ` Paul Mackerras
  1 sibling, 0 replies; 8+ messages in thread
From: Paul Mackerras @ 2006-08-08  0:02 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Adrian Bunk, Matt Reuther, LKML, Jay Lan

Andrew Morton writes:
> On Mon, 7 Aug 2006 15:32:41 +0200
> Adrian Bunk <bunk@stusta.de> wrote:
> > This doesn't look correct since do_div() does not guarantee to return 
> > more than 32bit.
> 
> eh?  We use do_div() to do 64bit/something all the time??

Indeed.  If do_div didn't return a 64-bit quotient then
printk("%lld", ...) wouldn't work.  (The remainder is 32-bit of course,
because the divisor is 32-bit.)

Paul.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [-mm patch] add timespec_to_us() and use it in kernel/tsacct.c
  2006-08-07 13:32   ` [-mm patch] add timespec_to_us() and use it in kernel/tsacct.c Adrian Bunk
  2006-08-07 20:24     ` Andrew Morton
@ 2006-08-09 11:57     ` Matt Reuther
  1 sibling, 0 replies; 8+ messages in thread
From: Matt Reuther @ 2006-08-09 11:57 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Andrew Morton, LKML, Jay Lan

On Monday 07 August 2006 09:32 am, Adrian Bunk wrote:
> On Sun, Aug 06, 2006 at 10:21:29PM -0700, Andrew Morton wrote:
> > On Sun, 6 Aug 2006 23:30:19 -0400

> What about the patch below that adds a timespec_to_us() to time.h and
> uses this function in kernel/tsacct.c?
>
>
> <--  snip  -->
>
>
> This patch adds a timespec_to_us() to include/linux/time.h and uses it
> to fix a compile error in kernel/tsacct.c .
>
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
>
> ---
>
>  include/linux/time.h |   12 ++++++++++++
>  kernel/tsacct.c      |    2 +-
>  2 files changed, 13 insertions(+), 1 deletion(-)
>
> --- linux-2.6.18-rc3-mm2-full/include/linux/time.h.old	2006-08-06
> 19:56:50.000000000 +0200 +++
> linux-2.6.18-rc3-mm2-full/include/linux/time.h	2006-08-06
> 20:00:51.000000000 +0200 @@ -132,6 +132,18 @@
>  }
>
>  /**
> + * timespec_to_us - Convert timespec to microseconds
> + * @ts:		pointer to the timespec variable to be converted
> + *
> + * Returns the scalar microsecond representation of the timespec
> + * parameter.
> + */
> +static inline s64 timespec_to_us(const struct timespec *ts)
> +{
> +	return ((s64) ts->tv_sec * USEC_PER_SEC) + ts->tv_nsec / NSEC_PER_USEC;
> +}
> +
> +/**
>   * timeval_to_ns - Convert timeval to nanoseconds
>   * @ts:		pointer to the timeval variable to be converted
>   *
> --- linux-2.6.18-rc3-mm2-full/kernel/tsacct.c.old	2006-08-06
> 19:54:45.000000000 +0200 +++
> linux-2.6.18-rc3-mm2-full/kernel/tsacct.c	2006-08-06 19:56:44.000000000
> +0200 @@ -36,7 +36,7 @@
>  	do_posix_clock_monotonic_gettime(&uptime);
>  	ts = timespec_sub(uptime, current->group_leader->start_time);
>  	/* rebase elapsed time to usec */
> -	stats->ac_etime = (timespec_to_ns(&ts))/NSEC_PER_USEC;
> +	stats->ac_etime = timespec_to_us(&ts);
>  	stats->ac_btime = xtime.tv_sec - ts.tv_sec;
>  	if (thread_group_leader(tsk)) {
>  		stats->ac_exitcode = tsk->exit_code;

This patch also compiles for me without errors.

Matt


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-08-10  2:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-07  3:30 2.6.18-rc3-mm2 Compile Error Matt Reuther
2006-08-07  5:21 ` Andrew Morton
2006-08-07 11:31   ` Matt Reuther
2006-08-07 13:32   ` [-mm patch] add timespec_to_us() and use it in kernel/tsacct.c Adrian Bunk
2006-08-07 20:24     ` Andrew Morton
2006-08-07 20:46       ` Adrian Bunk
2006-08-08  0:02       ` Paul Mackerras
2006-08-09 11:57     ` Matt Reuther

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.