Building OSS4.2 for 3.11.0 Linux Kernel

OSS specific Linux discussion (x86/amd64)

Moderators: cesium, dev, kodachi, hannu

Building OSS4.2 for 3.11.0 Linux Kernel

Postby squeeze » Sat Jul 20, 2013 10:49 pm

in kernel 3.11 the struct file_operations (include/linux/fs.h) was slightly changed.
osscore relies on that struct and won't build without a minor patch.

linux_kernel_3.11.0.txt
(451 Bytes) Downloaded 868 times


Sincerely,

squeeze
squeeze
New Member
 
Posts: 6
Joined: Sat May 18, 2013 7:39 pm

Re: Building OSS4.2 for 3.11.0 Linux Kernel

Postby alexdw » Sat Aug 17, 2013 12:03 am

Thanks again squeeze. :) This patch fixes the OSS build for me in 3.10.7 (the kernel version currently in the Arch Testing repo).
alexdw
New Member
 
Posts: 7
Joined: Sat Jul 06, 2013 12:29 pm

Re: Building OSS4.2 for 3.11.0 Linux Kernel

Postby alexdw » Sat Aug 24, 2013 3:47 pm

Attached slightly modified version for 3.10.7 (the only change is the kernel version number), as this patch seems to be required for 3.10.7.
Attachments
linux_kernel_3.10.7.txt
(451 Bytes) Downloaded 3868 times
alexdw
New Member
 
Posts: 7
Joined: Sat Jul 06, 2013 12:29 pm

Thanks!

Postby cvnmjs » Sun Sep 22, 2013 11:50 am

much appreciated.
cheers.
cvnmjs
New Member
 
Posts: 5
Joined: Sun Aug 04, 2013 6:07 pm

Re: Building OSS4.2 for 3.11.0 Linux Kernel

Postby kinik » Wed Oct 09, 2013 11:25 am

Hi! Can you make patch for 3.11.4?
kinik
New Member
 
Posts: 2
Joined: Wed Oct 09, 2013 9:13 am

Re: Building OSS4.2 for 3.11.0 Linux Kernel

Postby alexdw » Wed Oct 09, 2013 10:39 pm

kinik wrote:Hi! Can you make patch for 3.11.4?

The current patches continue to work for me on 3.11.4.
alexdw
New Member
 
Posts: 7
Joined: Sat Jul 06, 2013 12:29 pm

Re: Building OSS4.2 for 3.11.0 Linux Kernel

Postby kinik » Thu Oct 10, 2013 2:34 pm

When I'm patching source of oss it says:
Code: Select all
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- setup/Linux/oss/build/osscore.c   2012-05-22 00:23:41.000000000 +0200
|+++ setup/Linux/oss/build/osscore.c   2013-07-20 21:47:18.294007175 +0200
kinik
New Member
 
Posts: 2
Joined: Wed Oct 09, 2013 9:13 am

Re: Building OSS4.2 for 3.11.0 Linux Kernel

Postby seawright » Mon Oct 21, 2013 10:26 pm

Just upgraded Ubuntu 13.04 to 13.10 and can't get oss to install on new kernel.
uname -r gives 3.11.0-12-generic
To date I have:
  • Cloned Mercurial version with command: hg clone http://opensound.hg.sourceforge.net:800 ... /opensound oss
  • cd oss and applied above patch with command: patch -p0 <~/oss311.pat
  • mkdir ../build && cd ../build && /usr/src/oss/configure && make
  • Then as root: rm -rf /usr/lib/oss && make install
Install failed with message "Failed to compile OSS". Contents of build.list are as follows:
Code: Select all
make[1]: Entering directory `/usr/lib/oss/build'
make -C /lib/modules/3.11.0-12-generic/build M=/usr/lib/oss/build modules
make[2]: Entering directory `/usr/src/linux-headers-3.11.0-12-generic'
  CC [M]  /usr/lib/oss/build/osscore.o
/usr/lib/oss/build/osscore.c: In function ‘init_proc_fs’:
/usr/lib/oss/build/osscore.c:287:8: error: implicit declaration of function ‘create_proc_entry’ [-Werror=implicit-function-declaration]
        create_proc_entry ("opensound", 0700 | S_IFDIR, NULL)) == NULL)
        ^
/usr/lib/oss/build/osscore.c:286:22: warning: assignment makes pointer from integer without a cast [enabled by default]
   if ((oss_proc_root =
                      ^
/usr/lib/oss/build/osscore.c:293:26: warning: assignment makes pointer from integer without a cast [enabled by default]
   if ((oss_proc_devfiles =
                          ^
/usr/lib/oss/build/osscore.c:300:20: error: dereferencing pointer to incomplete type
   oss_proc_devfiles->proc_fops = &oss_proc_operations;
                    ^
/usr/lib/oss/build/osscore.c: In function ‘alloc_fop’:
/usr/lib/oss/build/osscore.c:966:14: warning: assignment from incompatible pointer type [enabled by default]
   fop->fsync = oss_no_fsync;
              ^
/usr/lib/oss/build/osscore.c: In function ‘oss_pci_read_devpath’:
/usr/lib/oss/build/osscore.c:1640:3: warning: return discards ‘const’ qualifier from pointer target type [enabled by default]
   return dev_name(&dip->pcidev->dev);
   ^
cc1: some warnings being treated as errors
make[3]: *** [/usr/lib/oss/build/osscore.o] Error 1
make[2]: *** [_module_/usr/lib/oss/build] Error 2
make[2]: Leaving directory `/usr/src/linux-headers-3.11.0-12-generic'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/usr/lib/oss/build'
Does anyone know what I am doing wrong or how I can get osscore to compile?

Thanks in advance.
regards
Clive
seawright
Member
 
Posts: 92
Joined: Sat Jan 06, 2007 9:10 pm
Location: Hampshire UK

Re: Building OSS4.2 for 3.11.0 Linux Kernel

Postby cesium » Fri Oct 25, 2013 9:49 pm

The attached diff works for me with 3.10.17.
Attachments
osscore-diff.gz
(535 Bytes) Downloaded 344 times
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: Building OSS4.2 for 3.11.0 Linux Kernel

Postby seawright » Sun Oct 27, 2013 2:19 pm

Thanks for patch. Still get an error,
Code: Select all
/usr/lib/oss/build/osscore.c: In function ‘alloc_fop’:
/usr/lib/oss/build/osscore.c:978:6: error: ‘struct file_operations’ has no member named ‘readdir’
   fop->readdir = NULL;  /* tmp_readdir; */
      ^
after applying patch to oss-v4.2-build2008-src-gpl/setup/Linux/oss/build/osscore.c

Used oss-v4.2-build2008-src-gpl as this appears to be newer than version in Mercurial which identifies as build 2006.
regards
Clive
seawright
Member
 
Posts: 92
Joined: Sat Jan 06, 2007 9:10 pm
Location: Hampshire UK

Re: Building OSS4.2 for 3.11.0 Linux Kernel

Postby cesium » Sun Oct 27, 2013 6:10 pm

Not many things would like to readdir() over /dev/dsp... We can just comment out the line. Or use the attached patch which does the same thing (includes 3.10 changes).
Attachments
osscore.diff.gz
diff for 3.11
(650 Bytes) Downloaded 323 times
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: Building OSS4.2 for 3.11.0 Linux Kernel

Postby seawright » Mon Oct 28, 2013 9:23 pm

Latest patch does allow osscore.ko kernel module to be built but make errors out over problem with pci_wrapper.inc before other modules are built and copied to kernel modules directory:
Code: Select all
make[1]: Entering directory `/usr/lib/oss/build'
make -C /lib/modules/3.11.0-12-generic/build M=/usr/lib/oss/build modules
make[2]: Entering directory `/usr/src/linux-headers-3.11.0-12-generic'
  CC [M]  /usr/lib/oss/build/oss_ali5455.o
In file included from /usr/lib/oss/build/module.inc:45:0,
                 from /usr/lib/oss/build/oss_ali5455.c:21:
/usr/lib/oss/build/pci_wrapper.inc:21:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘osspci_probe’
osspci_probe (struct pci_dev *pcidev, const struct pci_device_id *pciid)
^
/usr/lib/oss/build/pci_wrapper.inc:69:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘osspci_remove’
osspci_remove (struct pci_dev *pcidev)
^
In file included from /usr/lib/oss/build/oss_ali5455.c:21:0:
/usr/lib/oss/build/module.inc:51:12: error: ‘osspci_probe’ undeclared here (not in a function)
   .probe = osspci_probe,
            ^
/usr/lib/oss/build/module.inc:52:13: error: ‘osspci_remove’ undeclared here (not in a function)
   .remove = osspci_remove
             ^
In file included from /usr/lib/oss/build/oss_ali5455.c:21:0:
/usr/lib/oss/build/module.inc:33:12: warning: ‘instance’ defined but not used [-Wunused-variable]
static int instance = 0;
            ^
In file included from /usr/lib/oss/build/module.inc:45:0,
                 from /usr/lib/oss/build/oss_ali5455.c:21:
/usr/lib/oss/build/pci_wrapper.inc:17:18: warning: ‘dev_map’ defined but not used [-Wunused-variable]
static dev_map_t dev_map[MAX_INSTANCE];
                  ^
/usr/lib/oss/build/pci_wrapper.inc:18:12: warning: ‘n_devmap’ defined but not used [-Wunused-variable]
static int n_devmap = 0;
            ^
make[3]: *** [/usr/lib/oss/build/oss_ali5455.o] Error 1
make[2]: *** [_module_/usr/lib/oss/build] Error 2
make[2]: Leaving directory `/usr/src/linux-headers-3.11.0-12-generic'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/usr/lib/oss/build'

Tried inserting osscore.ko manually with following results:
Code: Select all
$ sudo insmod /usr/lib/oss/build/osscore.ko
Error: could not insert module /usr/lib/oss/build/osscore.ko: Unknown symbol in module

Don't know how to identify offending symbol.

Edit:
I was wrong to assume osscore.ko in build directory was a copy of osscore.ko in kernel modules directory. just noticed different file size.
Tried inserting osscore.ko manually with following results:
Code: Select all
$ sudo insmod /lib/modules/3.11.0-12-generic/kernel/oss/osscore.ko
Error: could not insert module /lib/modules/3.11.0-12-generic/kernel/oss/osscore.ko: Invalid parameters
regards
Clive
seawright
Member
 
Posts: 92
Joined: Sat Jan 06, 2007 9:10 pm
Location: Hampshire UK

Re: Building OSS4.2 for 3.11.0 Linux Kernel

Postby kosproger » Mon Nov 11, 2013 6:59 pm

seawright,
If you are using GCC version 4.8, try to use 4.7 instead. That's helped to me
kosproger
Member
 
Posts: 11
Joined: Thu Aug 09, 2012 8:40 pm
Location: Vitebsk, Belarus

Re: Building OSS4.2 for 3.11.0 Linux Kernel

Postby alexdw » Mon Nov 11, 2013 9:00 pm

Have a look at the comments for the AUR package:
https://aur.archlinux.org/packages/oss/
alexdw
New Member
 
Posts: 7
Joined: Sat Jul 06, 2013 12:29 pm

Re: Building OSS4.2 for 3.11.0 Linux Kernel

Postby igorzwx » Tue Nov 12, 2013 4:26 pm

alexdw wrote:Have a look at the comments for the AUR package:
https://aur.archlinux.org/packages/oss/


According to those comments, the problem is that the new version of gcc "generates calls to memmove":

https://bugs.archlinux.org/task/35672#comment114487
> OSS doesn't use memmove at all so this problem must be caused by some
> new version of gcc that geterates calls to memmove. I have never heard
> about this kind of problem.


Notice that gcc generates those calls from "nothing".
This might be a kind of backdoor:

It is also possible to create a backdoor without modifying the source code of a program, or even modifying it after compilation. This can be done by rewriting the compiler so that it recognizes code during compilation that triggers inclusion of a backdoor in the compiled output. When the compromised compiler finds such code, it compiles it as normal, but also inserts a backdoor (perhaps a password recognition routine). So, when the user provides that input, he gains access to some (likely undocumented) aspect of program operation. This attack was first outlined by Ken Thompson in his famous paper Reflections on Trusting Trust.
https://en.wikipedia.org/wiki/Backdoor_(computing)#Overview
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Next

Return to Linux

Who is online

Users browsing this forum: No registered users and 1 guest