@ezilg: 
I've had the same problems ("Unknown symbol __divdi3" etc.) with my DVB-Dongle 
"Trekstor Terres". This dongle uses the RTL2832U along with the Tuner FC0012. I 
use Ubuntu 10.10 with Kernel "3.0.0-12-generic". I am using the RTL2832-driver 
from "https://bitbucket.org/themagicpudding/rtl2832_2836_2840";, Revision 
"f9ab69bf2eee". At last I found the cause of the Problem:
Some of the Source-Files for the RTL2832U-Driver (e.g. "rtl2832u_fe.c" ) are 
using 64Bit-divisions with the normal operators "/" and "%" (remainder). These 
operators are converted by gcc to libgcc-functions (e.g. "__divdi3" for signed 
64Bit-operators). But Kernel-Modules can not use / don't have access to the 
libgcc-functions (see "http://www.spinics.net/lists/newbies/msg43464.html";)! 
After some time I found a way to solve the problem without changing all "/" and 
"%" operators in the source-files: It is possible to write wrapper functions 
which are called instead of the (undefined) original ones, see 
"http://objectmix.com/compilers/782173-how-link-file-wrapper-function.html";. 
The necessary changes in detail:

- Copy the attached files "div64_wrap.h" and "div64_wrap.c" into the folder 
"...linux/drivers/media/dvb/dvb-usb" (were the other RTL2832U driver 
source-files are).
- Add "div64_wrap.o" to "Makefile" in the same directory 
("dvb-usb-rtl2832u-objs = ... div64_wrap.o")
- Add "EXTRA_LDFLAGS += --wrap __udivdi3 --wrap __divdi3 --wrap __moddi3 --wrap 
__umoddi3" to "Makefile" in the "v4l"-directory:
...
# CFLAGS configuration

ifeq ($(CONFIG_DVB_FIRESAT),m)
  EXTRA_CFLAGS += -I$(srctree)/drivers/ieee1394/
endif

EXTRA_CFLAGS += -g
EXTRA_LDFLAGS += --wrap __udivdi3 --wrap __divdi3 --wrap __moddi3 --wrap 
__umoddi3
...

After this my USB-dongle worked (I still have performance problems but
that's another isue).

"div64_wrap.h":
/******************************************************

File: div64_wrap.h

Description:
Wrapper-functions for some 64Bit-division functions of 
libgcc (e.g. "__divdi3"). That means that the functions
declared here are used instead of the originally ones.
LD-options "--wrap=__divdi3 --wrap __udivdi3 --wrap __moddi3 
--wrap __umoddi3" have to be used!

Reason:
Building modules for e.g. the Ubuntu-Kernel "3.0.0-12-generic"
using integer 64Bit divisions with the "/" or "%" operator
fails at linker-stage with e.g. 'WARNING: "__divdi3" [dvb-usb-
rtl2832u.ko] undefined!' Problem: gcc is using the "divdi"-functions
defined in libgcc. But Kernel-Modules can not use the libgcc-
functions! 


Author: Stefan Bosch
Date:   2011-11-11

********************************************************/

#include <linux/math64.h>

unsigned long long __wrap___udivdi3(unsigned long long a, unsigned long long b);
long long __wrap___divdi3(long long a, long long b);
unsigned long long __wrap___umoddi3(unsigned long long a, unsigned long long b);
long long __wrap___moddi3(long long a, long long b);

// ******* EOF

"div64_wrap.c": see attachment


** Attachment added: "div64_wrap.c"
   
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/838130/+attachment/2594824/+files/div64_wrap.c

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/838130

Title:
  Kernel 3.0 breaks DVB-T (ISDB-Tb) in DiBcom 8000

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/838130/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to