OSS fails to build against Linux 4.0 [SOLVED]

OSS specific Linux discussion (x86/amd64)

Moderators: hannu, dev, cesium

oss117
Member
Posts: 27
Joined: Tue Jan 15, 2008 4:39 pm

OSS fails to build against Linux 4.0 [SOLVED]

Postby oss117 » Tue Apr 14, 2015 10:11 pm

Linux 4.0 is released, but the current OSS release fails to build against it (problems with include files, apparently). Any chance to get a working version or a patch against the current one ?
Last edited by oss117 on Sat Apr 25, 2015 9:27 pm, edited 1 time in total.

oss117
Member
Posts: 27
Joined: Tue Jan 15, 2008 4:39 pm

Patch to build OSS against Linux 4.0

Postby oss117 » Sat Apr 25, 2015 9:27 pm

Well, let's reply my own question with my own patch...

There were two issues:
  • a test in the configuration scripts, supposed to detect Linux kernel v2.4 was mistaking v4.0 for v2.4...
  • read_cr4() and write_cr4() have been renamed into __read_cr4() and __write_cr4() in Linux 4.0.

Here is the corresponding patch (to be applied with: 'patch -p1 -s' from inside the OSS sources tree):
oss-v4.2-linux-4.0-patch.txt
Patch to make OSS v4.2 (build 2011) compatible with Linux 4.0 kernels
(1.49 KiB) Downloaded 3161 times

nuc
Moderator
Posts: 109
Joined: Fri Aug 03, 2012 10:20 am
Sound Card: PowerColor DEVIL HDX
OS: ArchLinux
Contact:

Re: OSS fails to build against Linux 4.0 [SOLVED]

Postby nuc » Sun Apr 26, 2015 1:56 pm

At least somebody is still motivated to fix those issues... thanks oss117!
Check out my effort on revamping the opensound website => github.com/Nuc1eoN/4Front-Tech-Website
Any feedback greatly appreciated =)

alexdw
Member
Posts: 23
Joined: Sat Jul 06, 2013 12:29 pm

Re: Patch to build OSS against Linux 4.0

Postby alexdw » Thu May 07, 2015 7:36 pm

oss117 wrote:Well, let's reply my own question with my own patch...

There were two issues:
  • a test in the configuration scripts, supposed to detect Linux kernel v2.4 was mistaking v4.0 for v2.4...
  • read_cr4() and write_cr4() have been renamed into __read_cr4() and __write_cr4() in Linux 4.0.

Here is the corresponding patch (to be applied with: 'patch -p1 -s' from inside the OSS sources tree):
oss-v4.2-linux-4.0-patch.txt


Thank you! I'm adding your patch to the Arch (AUR) packages. :)

alexdw
Member
Posts: 23
Joined: Sat Jul 06, 2013 12:29 pm

Re: OSS fails to build against Linux 4.0 [SOLVED]

Postby alexdw » Wed May 27, 2015 9:46 pm

Seems to be broken again in Linux 4.0.4. :(

oss117
Member
Posts: 27
Joined: Tue Jan 15, 2008 4:39 pm

Re: OSS fails to build against Linux 4.0 [SOLVED]

Postby oss117 » Fri May 29, 2015 9:52 am

alexdw wrote:Seems to be broken again in Linux 4.0.4. :(

Not at all... Working just fine, here with Linux v4.0.4: it both auto-compiled the new modules on kernel update and I still can build the package under v4.0.4.

alexdw
Member
Posts: 23
Joined: Sat Jul 06, 2013 12:29 pm

Re: OSS fails to build against Linux 4.0 [SOLVED]

Postby alexdw » Sun May 31, 2015 9:55 am

oss117 wrote:
alexdw wrote:Seems to be broken again in Linux 4.0.4. :(

Not at all... Working just fine, here with Linux v4.0.4: it both auto-compiled the new modules on kernel update and I still can build the package under v4.0.4.


Thanks for the information. You are right - it appears that it wasn't Linux 4.0.4 which prevents me from building oss but a new version of gcc (5.1.0).

igorzwx
Known Member
Posts: 1246
Joined: Sun Jun 28, 2009 9:31 pm

Re: OSS fails to build against Linux 4.0 [SOLVED]

Postby igorzwx » Sun May 31, 2015 12:35 pm

alexdw wrote:it appears that it wasn't Linux 4.0.4 which prevents me from building oss but a new version of gcc (5.1.0).


It may happen. Similar problems were reported for gcc-4.8 (they were somehow fixed).

Please keep us informed about such problems.

For Ubuntu users:
It is not difficult to switch to an older version of gcc.
You have to install it from the official repository, and change the so-called "symbolic link"
_http://askubuntu.com/questions/26498/choose-gcc-and-g-version/26502#26502

Code: Select all

$ apt-cache search --names-only gcc-

Code: Select all

$ sudo apt-get install gcc-[old.version]


Download the source code of OSS4 from "git":

Code: Select all

$ sudo apt-get install git
$ mkdir mumu
$ cd mumu
$ git clone git://opensound.git.sourceforge.net/gitroot/opensound/opensound opensound-git

oss117
Member
Posts: 27
Joined: Tue Jan 15, 2008 4:39 pm

Re: OSS fails to build against Linux 4.0 [SOLVED]

Postby oss117 » Mon Jun 01, 2015 2:40 pm

igorzwx wrote:
alexdw wrote:it appears that it wasn't Linux 4.0.4 which prevents me from building oss but a new version of gcc (5.1.0).


It may happen. Similar problems were reported for gcc-4.8 (they were somehow fixed).

Please keep us informed about such problems.

For Ubuntu users:
It is not difficult to switch to an older version of gcc.

BEWARE: when using a different version of gcc than the one shipped with your distro as the "system compiler", you will have to ensure both the kernel and any third party modules (such as OSS) are indeed compiled with the same gcc version. Else you'll most likely get crashes and kernel panics...

igorzwx
Known Member
Posts: 1246
Joined: Sun Jun 28, 2009 9:31 pm

Re: OSS fails to build against Linux 4.0 [SOLVED]

Postby igorzwx » Mon Jun 01, 2015 4:02 pm

oss117 wrote:BEWARE: when using a different version of gcc than the one shipped with your distro as the "system compiler", you will have to ensure both the kernel and any third party modules (such as OSS) are indeed compiled with the same gcc version. Else you'll most likely get crashes and kernel panics...


Such problems have not been reported (at least, on this forum) for experiments with gcc-4.8 and its older versions.
It seems that there is not a big difference between gcc versions, except, perhaps, for some new bugs and/or "backdoors".

Compiler backdoors
_https://en.wikipedia.org/wiki/Backdoor_(computing)#Compiler_backdoors

Everything may happen, of course. Notice, however, that "kernel panics can also be caused by errors originating outside of kernel space. For example, many Unix OSes panic if the init process, which runs in userspace, terminates" _https://en.wikipedia.org/wiki/Kernel_panic

oss117
Member
Posts: 27
Joined: Tue Jan 15, 2008 4:39 pm

Re: OSS fails to build against Linux 4.0 [SOLVED]

Postby oss117 » Mon Jun 01, 2015 8:20 pm

igorzwx wrote:Such problems have not been reported (at least, on this forum) for experiments with gcc-4.8 and its older versions.

Updating from a major version to another (e.g. 4.8 to 5.1) or even a minor version to another (e.g v4.3 to 4.8 ) *will* cause breakage between kernel and modules when they are not compiled with the same version. This is due to the API changes (and function calling convention, such as parameters passed to functions in registers instead of the stack, or issues with stack protectors, etc).

Final word: you *must* compile both the kernel and modules with the *same* gcc version (major.minor at least. The micro number is not an issue).

igorzwx
Known Member
Posts: 1246
Joined: Sun Jun 28, 2009 9:31 pm

Re: OSS fails to build against Linux 4.0 [SOLVED]

Postby igorzwx » Mon Jun 01, 2015 9:34 pm

oss117 wrote:
igorzwx wrote:Such problems have not been reported (at least, on this forum) for experiments with gcc-4.8 and its older versions.

Updating from a major version to another (e.g. 4.8 to 5.1) or even a minor version to another (e.g v4.3 to 4.8 ) *will* cause breakage between kernel and modules when they are not compiled with the same version. This is due to the API changes (and function calling convention, such as parameters passed to functions in registers instead of the stack, or issues with stack protectors, etc).

Final word: you *must* compile both the kernel and modules with the *same* gcc version (major.minor at least. The micro number is not an issue).


What was reported on this forum is that OSS4 was successfully compiled with gcc-4.7 (instead of gcc-4.8 ) and gcc-4.6 (instead of gcc-4.8 ). No problems were reported.

Of course, it is better to have everything compiled with the same compiler.
On the other hand, if you install the newest Ubuntu with the newest kernel and compiler, you need not to expect a stable performance. In 2009-2010, for example, the so-called "Brown Screen of Death" was not something unusual for Ubuntu users.

alexdw
Member
Posts: 23
Joined: Sat Jul 06, 2013 12:29 pm

Re: OSS fails to build against Linux 4.0 [SOLVED]

Postby alexdw » Mon Jun 01, 2015 10:53 pm

igorzwx wrote:
alexdw wrote:it appears that it wasn't Linux 4.0.4 which prevents me from building oss but a new version of gcc (5.1.0).


It may happen. Similar problems were reported for gcc-4.8 (they were somehow fixed).


I have made a quick and dirty patch for this (see attached) based on the information in the GCC 5 porting guide:
https://gcc.gnu.org/gcc-5/porting_to.html
Attachments
gcc-5.patch.txt
Linux patch for gcc-5.
(1.39 KiB) Downloaded 664 times


Return to “Linux”

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests