audio/oss: Updated for version 4.2.2011.

Patched for building with gcc-5.3.0 and linux-4.1.15.
This commit is contained in:
Xylemon 2016-01-10 16:15:09 +00:00 committed by Willy Sudiarto Raharjo
parent e3f2febfed
commit eda5f68048
4 changed files with 106 additions and 5 deletions

52
audio/oss/gcc-5.patch Normal file
View file

@ -0,0 +1,52 @@
--- kernel/OS/Linux/os_linux.h 2015-01-28 08:07:23.000000000 +0000
+++ kernel/OS/Linux/os_linux.h 2015-06-01 23:12:46.044784820 +0100
@@ -119,7 +119,7 @@
/* System wall timer access */
#define GET_JIFFIES() oss_get_jiffies()
-extern inline unsigned int
+__attribute__ ((gnu_inline)) extern inline unsigned int
__inb (unsigned short port)
{
unsigned int _v;
@@ -127,7 +127,7 @@
"0" (0));
return _v;
}
-extern inline unsigned int
+__attribute__ ((gnu_inline)) extern inline unsigned int
__inw (unsigned short port)
{
unsigned int _v;
@@ -135,7 +135,7 @@
"0" (0));
return _v;
}
-extern inline unsigned int
+__attribute__ ((gnu_inline)) extern inline unsigned int
__inl (unsigned short port)
{
unsigned int _v;
@@ -143,19 +143,19 @@
return _v;
}
-extern inline void
+__attribute__ ((gnu_inline)) extern inline unsigned int
__outb (unsigned char value, unsigned short port)
{
__asm__ __volatile__ ("out" "b" " %" "b" "0,%" "w" "1"::"a" (value),
"d" (port));
}
-extern inline void
+__attribute__ ((gnu_inline)) extern inline unsigned int
__outw (unsigned short value, unsigned short port)
{
__asm__ __volatile__ ("out" "w" " %" "w" "0,%" "w" "1"::"a" (value),
"d" (port));
}
-extern inline void
+__attribute__ ((gnu_inline)) extern inline unsigned int
__outl (unsigned int value, unsigned short port)
{
__asm__ __volatile__ ("out" "l" " %" "0,%" "w" "1"::"a" (value),

View file

@ -0,0 +1,41 @@
diff -durN oss-v4.2-build2011-src-gpl/setup/Linux/oss/build/osscore.c oss-v4.2-build2011-src-gpl-patched/setup/Linux/oss/build/osscore.c
--- oss-v4.2-build2011-src-gpl/setup/Linux/oss/build/osscore.c 2014-09-04 00:15:31.000000000 +0200
+++ oss-v4.2-build2011-src-gpl-patched/setup/Linux/oss/build/osscore.c 2015-04-25 23:16:19.502116503 +0200
@@ -1950,8 +1950,13 @@
}
else
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
flags[1] = read_cr4 ();
write_cr4 (flags[1] | 0x600); /* Set OSFXSR & OSXMMEXCEPT */
+#else
+ flags[1] = __read_cr4 ();
+ __write_cr4 (flags[1] | 0x600); /* Set OSFXSR & OSXMMEXCEPT */
+#endif
FX_SAVE (envbuf);
asm ("fninit");
asm ("fwait");
@@ -1971,7 +1976,11 @@
else
{
FX_RESTORE (envbuf);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
write_cr4 (flags[1]); /* Restore cr4 */
+#else
+ __write_cr4 (flags[1]); /* Restore cr4 */
+#endif
}
write_cr0 (flags[0]); /* Restore cr0 */
}
diff -durN oss-v4.2-build2011-src-gpl/setup/setupdir.sh oss-v4.2-build2011-src-gpl-patched/setup/setupdir.sh
--- oss-v4.2-build2011-src-gpl/setup/setupdir.sh 2015-04-25 23:03:34.173985609 +0200
+++ oss-v4.2-build2011-src-gpl-patched/setup/setupdir.sh 2015-04-25 23:03:14.267351737 +0200
@@ -36,7 +36,7 @@
# Use Linux24 as the OS name for Linux 2.4.x
if test "$OS " = "Linux "
then
- if test "`uname -r|sed 's/2.//'|sed 's/\..*//'` " = "4 "
+ if test "`uname -r | cut -d '.' -f 1-2` " = "2.4 "
then
OS=Linux24
fi

View file

@ -5,7 +5,7 @@
# Written by Dugan Chen (thedoogster [at] gmail [dot] com).
PRGNAM=oss
VERSION=${VERSION:-4.2.2010}
VERSION=${VERSION:-4.2.2011}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@ -46,7 +46,7 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$SRCVERSION
rm -rf oss-${SRCVERSION}
tar xvf $CWD/oss-${SRCVERSION}.tar.bz2
cd oss-${SRCVERSION}
chown -R root:root .
@ -60,6 +60,14 @@ if [ $ARCH = "x86_64" ]; then
sed -i 's,OSSLIBDIR=\"/usr/lib/oss\",OSSLIBDIR=\"/usr/lib64/oss\",g' configure
fi
# Patches from OSS Forums
# Linux 4.0 and above fix by oss117
patch -p1 < $CWD/oss-v4.2-linux-4.0.patch
# GCC 5 fix by alexdw
patch -p0 < $CWD/gcc-5.patch
mkdir build && cd build
../configure
CFLAGS="$SLKCFLAGS" make build

View file

@ -1,8 +1,8 @@
PRGNAM="oss"
VERSION="4.2.2010"
VERSION="4.2.2011"
HOMEPAGE="http://www.opensound.com"
DOWNLOAD="http://www.4front-tech.com/developer/sources/stable/gpl/oss-v4.2-build2010-src-gpl.tar.bz2"
MD5SUM="8a3e9c2c5403ceb83bcba94a8732c403"
DOWNLOAD="http://www.4front-tech.com/developer/sources/stable/gpl/oss-v4.2-build2011-src-gpl.tar.bz2"
MD5SUM="68f80d569739a10281a8284dded12acc"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""