Thursday, February 11, 2010

How to solve undefined reference to `__umoddi3'

Problem faced:

kernel/built-in.o: In function `getnstimeofday':
(.text+0xee36): undefined reference to `__umoddi3'
kernel/built-in.o: In function `do_gettimeofday':
(.text+0xeee1): undefined reference to `__udivdi3'
kernel/built-in.o: In function `do_gettimeofday':
(.text+0xeefe): undefined reference to `__umoddi3'
kernel/built-in.o: In function `do_timer':
(.text+0xfd88): undefined reference to `__udivdi3'
kernel/built-in.o: In function `do_timer':
(.text+0xfda5): undefined reference to `__umoddi3'
make: *** [.tmp_vmlinux1] Error 1

Solution:


---
 include/linux/time.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/include/linux/time.h b/include/linux/time.h
index 2091a19..d32ef0a 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -174,6 +174,10 @@ static inline void timespec_add_ns(struct timespec *a, u64 ns)
 {
  ns += a->tv_nsec;
  while(unlikely(ns >= NSEC_PER_SEC)) {
+  /* The following asm() prevents the compiler from
+   * optimising this loop into a modulo operation.  */
+  asm("" : "+r"(ns));       // Include this line in the file /include/linux/time.h
+
   ns -= NSEC_PER_SEC;
   a->tv_sec++;
  }
-- 
This patch prevents gcc form "optimizing" the while loop into a costly modulo.
operation

Thursday, February 4, 2010

Setting and Removing http_proxy in linux

1. For setting http_proxy
                export http_proxy="http://proxy:port/"

2. For unsetting
                  unset http_proxy=""

Removing http_proxy [ 407 proxy authentication required ] when using synaptic package manager:

Do the following:
1. Remove proxy from Preferences -> Network proxy [ use direct connection ]
2. Remove proxy from synaptic package manager -> preferences -> Network
3. use unset http_proxy
4. export http_proxy=""
           check if proxy is set or not by using: echo $http_proxy
Repeat steps (3) and (4) for ftp proxy also.


5. immediately do apt-get update once or twice
6. If still you get error [407 proxy authentication required]

    goto ~/.bashrc check if http_proxy is set if so remove it.

Please also check if you have changed the file sources.list in /etc/apt folder. If so reverse it back to the old version.
Powered By Blogger