# HG changeset patch # User Rohit Joshi # Date 1274366632 14400 # Node ID d46894f3a9e453a87274dc6104aa1a71b9ed8369 # Parent 82243e9025985f2a9adbff092b74cc9eec462907 catalyst: fix compile with 2.6.33.4 and WGET_URL diff -r 82243e902598 -r d46894f3a9e4 catalyst/receipt --- a/catalyst/receipt Wed May 19 18:36:37 2010 +0200 +++ b/catalyst/receipt Thu May 20 10:43:52 2010 -0400 @@ -8,7 +8,8 @@ WEB_SITE="http://www.ati.amd.com" DEPENDS="xorg-server mesa mesa-dri libdrm linux-drm fontconfig linux-agp xorg-libSM xorg-libXi xorg-libXcursor" BUILD_DEPENDS="linux xorg-server" -TARBALL="ati-driver-installer-$VERSION-x86.x86_64.run" +TARBALL="ati-driver-installer-${VERSION/./-}-x86.x86_64.run" +WGET_URL="http://www2.ati.com/drivers/linux/$TARBALL" TAGS="drivers graphic video" # Rules to configure and make the package. @@ -16,7 +17,7 @@ compile_rules() { KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'` - WGET_URL="http://www2.ati.com/drivers/linux/$TARBALL" + [ -d $WOK/linux/taz ] || tazwok cook linux @@ -33,6 +34,8 @@ for i in autoconf.h utsrelease.h ; do grep -rl linux/$i * | xargs sed -i "s|linux/$i|generated/$i|" done + cd $src + patch -Np1 -i ../stuff/$PACKAGE-${KERNEL_VERSION}.patch cd $src/common/lib/modules/fglrx/build_mod cp $src/arch/x86/lib/modules/fglrx/build_mod/libfglrx_ip.a.GCC4 . cp 2.6.x/Makefile . diff -r 82243e902598 -r d46894f3a9e4 catalyst/stuff/catalyst-2.6.33.4.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/catalyst/stuff/catalyst-2.6.33.4.patch Thu May 20 10:43:52 2010 -0400 @@ -0,0 +1,228 @@ +Index: ati10.1/common/lib/modules/fglrx/build_mod/drmP.h +=================================================================== +--- ati10.1/common/lib/modules/fglrx/build_mod/drmP.h ++++ ati10.1/common/lib/modules/fglrx/build_mod/drmP.h 2010-01-28 19:57:07.562644291 +0200 +@@ -42,7 +42,12 @@ + * can build the DRM (part of PI DRI). 4/21/2000 S + B */ + #include + #endif /* __alpha__ */ ++#include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++#include ++#else + #include ++#endif + #include + #include + #include +@@ -51,7 +56,6 @@ + #include + #include + #include +-#include + #include + #include /* For (un)lock_kernel */ + #include +Index: ati10.1/common/lib/modules/fglrx/build_mod/firegl_public.c +=================================================================== +--- ati10.1/common/lib/modules/fglrx/build_mod/firegl_public.c ++++ ati10.1/common/lib/modules/fglrx/build_mod/firegl_public.c 2010-01-29 14:21:58.687999115 +0200 +@@ -28,7 +28,11 @@ + #error Kernel versions older than 2.6.0 are no longer supported by this module. + #endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++#include ++#else + #include ++#endif + + #if !defined(CONFIG_X86) + #if !defined(CONFIG_X86_PC) +@@ -163,8 +167,12 @@ + + // For 2.6.18 or higher, the UTS_RELEASE is defined in the generated/utsrelease.h. + #ifndef UTS_RELEASE ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++#include ++#else + #include + #endif ++#endif + + #if defined(__i386__) + #ifndef do_div +@@ -1472,7 +1472,16 @@ + #ifndef __HAVE_ARCH_CMPXCHG + return __fgl_cmpxchg(ptr,old,new,size); + #else +- return __cmpxchg(ptr,old,new,size); ++ switch (size) { ++ case 1: { volatile u8 *_ptr = ptr; return cmpxchg(_ptr, old, new); } ++ case 2: { volatile u16 *_ptr = ptr; return cmpxchg(_ptr, old, new); } ++ case 4: { volatile u32 *_ptr = ptr; return cmpxchg(_ptr, old, new); } ++#ifdef __x86_64__ ++ case 8: { volatile u64 *_ptr = ptr; return cmpxchg(_ptr, old, new); } ++#endif ++ default: ++ return old; ++ } + #endif + } + + +Index: ati10.1/common/lib/modules/fglrx/build_mod/kcl_acpi.c +=================================================================== +--- ati10.1/common/lib/modules/fglrx/build_mod/kcl_acpi.c ++++ ati10.1/common/lib/modules/fglrx/build_mod/kcl_acpi.c 2010-01-28 19:57:17.897225045 +0200 +@@ -15,7 +15,11 @@ + ****************************************************************************/ + + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++#include ++#else + #include ++#endif + #include + + #include "kcl_config.h" +Index: ati10.1/common/lib/modules/fglrx/build_mod/kcl_agp.c +=================================================================== +--- ati10.1/common/lib/modules/fglrx/build_mod/kcl_agp.c ++++ ati10.1/common/lib/modules/fglrx/build_mod/kcl_agp.c 2010-01-28 19:57:26.104892082 +0200 +@@ -31,7 +31,11 @@ + */ + + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++#include ++#else + #include ++#endif + #include + #include + #include +Index: ati10.1/common/lib/modules/fglrx/build_mod/kcl_io.c +=================================================================== +--- ati10.1/common/lib/modules/fglrx/build_mod/kcl_io.c ++++ ati10.1/common/lib/modules/fglrx/build_mod/kcl_io.c 2010-01-28 19:57:34.337558105 +0200 +@@ -37,7 +37,11 @@ + */ + + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++#include ++#else + #include ++#endif + #include + #include + #include +Index: ati10.1/common/lib/modules/fglrx/build_mod/kcl_osconfig.h +=================================================================== +--- ati10.1/common/lib/modules/fglrx/build_mod/kcl_osconfig.h ++++ ati10.1/common/lib/modules/fglrx/build_mod/kcl_osconfig.h 2010-01-28 19:57:43.599182385 +0200 +@@ -20,7 +20,11 @@ + #define KCL_OSCONFIG_H + + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++#include ++#else + #include ++#endif + + // Choose modern way to call 32-on-64 IOCTLs if configured in the kernel + #if defined(CONFIG_COMPAT) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9) +Index: ati10.1/common/lib/modules/fglrx/build_mod/kcl_pci.c +=================================================================== +--- ati10.1/common/lib/modules/fglrx/build_mod/kcl_pci.c ++++ ati10.1/common/lib/modules/fglrx/build_mod/kcl_pci.c 2010-01-28 19:57:51.295870149 +0200 +@@ -31,7 +31,11 @@ + */ + + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++#include ++#else + #include ++#endif + #include + + #include "kcl_config.h" +Index: ati10.1/common/lib/modules/fglrx/build_mod/kcl_str.c +=================================================================== +--- ati10.1/common/lib/modules/fglrx/build_mod/kcl_str.c ++++ ati10.1/common/lib/modules/fglrx/build_mod/kcl_str.c 2010-01-28 19:57:59.728528058 +0200 +@@ -30,7 +30,12 @@ + * + */ + ++#include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++#include ++#else + #include ++#endif + #include + #include + +Index: ati10.1/common/lib/modules/fglrx/build_mod/kcl_wait.c +=================================================================== +--- ati10.1/common/lib/modules/fglrx/build_mod/kcl_wait.c ++++ ati10.1/common/lib/modules/fglrx/build_mod/kcl_wait.c 2010-01-28 19:58:08.936154527 +0200 +@@ -31,7 +31,11 @@ + */ + + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++#include ++#else + #include ++#endif + #include + #include + #include +Index: ati10.1/common/lib/modules/fglrx/build_mod/make.sh +=================================================================== +--- ati10.1/common/lib/modules/fglrx/build_mod/make.sh ++++ ati10.1/common/lib/modules/fglrx/build_mod/make.sh 2010-01-28 19:55:10.849378991 +0200 +@@ -218,8 +218,15 @@ + # UTS-define is in external version-*.h files, i.e. linux-2.2.14-5.0-RedHat does this flaw + kernel_release=`cat $linuxincludes/linux/version-*.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2` + else +- # For 2.6.18 or higher, UTS-define is defined in utsrelease.h. +- kernel_release=`cat $linuxincludes/generated/utsrelease.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2` ++ UTS_REL_COUNT=`cat $linuxincludes/generated/utsrelease.h 2>/dev/null | grep UTS_RELEASE -c` ++ ++ if [ $UTS_REL_COUNT -gt 0 ]; then ++ # 2.6.33+ ++ kernel_release=`cat $linuxincludes/generated/utsrelease.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2` ++ else ++ # For 2.6.18 to 2.6.32, UTS-define is defined in utsrelease.h. ++ kernel_release=`cat $linuxincludes/generated/utsrelease.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2` ++ fi + fi + fi + fi +@@ -302,7 +309,8 @@ + # 3 + # generated/autoconf.h may contain this: #define CONFIG_SMP 1 + +-src_file=$linuxincludes/generated/autoconf.h ++src_file=$linuxincludes/generated/autoconf.h ++[ -e $src_file ] || src_file=$linuxincludes/generated/autoconf.h + + if [ ! -e $src_file ]; then + echo "Warning:" >> $logfile +@@ -355,7 +363,8 @@ + MODVERSIONS=0 + + # generated/autoconf.h may contain this: #define CONFIG_MODVERSIONS 1 +-src_file=$linuxincludes/generated/autoconf.h ++src_file=$linuxincludes/generated/autoconf.h ++[ -e $src_file ] || src_file=$linuxincludes/generated/autoconf.h + if [ ! -e $src_file ]; + then + echo "Warning:" >> $logfile