[asterisk-dev] Problem building Zaptel 1.4 from SVN

Tzafrir Cohen tzafrir.cohen at xorcom.com
Fri Feb 9 01:19:45 MST 2007


On Fri, Feb 09, 2007 at 03:44:58PM +1300, Matt Riddell (NZ) wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi,
> 
> I'm getting the following error building Zaptel 1.4 from SVN:
> 
> make[2]: Entering directory `/lib/modules/2.6.9-1.667/build'
> 
>   CC [M]  /usr/src/zaptel/xpp/card_fxo.o
> In file included from /usr/src/zaptel/xpp/card_fxo.c:27:
> /usr/src/zaptel/xpp/xpd.h:111: error: syntax error before "gfp_t"
> /usr/src/zaptel/xpp/xpd.h:111: warning: function declaration isn't a
> prototype
> In file included from /usr/src/zaptel/xpp/card_fxo.c:32:
> /usr/src/zaptel/xpp/xbus-core.h:46: error: syntax error before "gfp_t"
> /usr/src/zaptel/xpp/xbus-core.h:46: warning: function declaration isn't
> a prototype
> make[4]: *** [/usr/src/zaptel/xpp/card_fxo.o] Error 1
> make[3]: *** [/usr/src/zaptel/xpp] Error 2
> make[2]: *** [_module_/usr/src/zaptel] Error 2
> make[2]: Leaving directory `/lib/modules/2.6.9-1.667/build'
> make[1]: *** [linux26] Error 2
> make[1]: Leaving directory `/usr/src/zaptel'
> make: *** [all] Error 2

Digging further:

that typedef was added to the RHEL4 kernel tarball in a patch called
linux-2.6.9-gfp_t-typedef.patch that only adds it. It seems to have been
generated at around 2005-11-16 .

I see this typedef used by at least two other patches from around the
same time (linux-2.6.9-OpenIB-3965-partial.patch ,
linux-2.6.9-net-sky2.patch ), but none of those changes any global
define.

On the srpm spec file it is listed as:
# OpenIB Infiniband patches
Patch2700: linux-2.6.9-OpenIB-3965-partial.patch
Patch2701: linux-2.6.9-spinlock-define.patch
Patch2702: linux-2.6.9-OpenIB-build.patch
Patch2703: linux-2.6.9-OpenIB-core.patch
Patch2704: linux-2.6.9-OpenIB-idr.patch
Patch2705: linux-2.6.9-if_infiniband.patch
Patch2706: linux-2.6.9-OpenIB-mthca-dev.patch
Patch2707: linux-2.6.9-gfp_t-typedef.patch
Patch2708: linux-2.6.9-OpenIB-mthca-main.patch
Patch2709: linux-2.6.9-OpenIB-mthca-provider.patch
Patch2710: linux-2.6.9-OpenIB-sdp-1.patch
Patch2711: linux-2.6.9-OpenIB-sdp-3.patch
Patch2712: linux-2.6.9-OpenIB-srp-export.patch
Patch2713: linux-2.6.9-OpenIB-srp-completion.patch
Patch2714: linux-2.6.9-OpenIB-umad.patch
Patch2715: linux-2.6.9-OpenIB-uverbs.patch

"spinlock-define" sounds more promising. I believe it will be familiar
to some of you:

--- linux-2.6.9/include/linux/spinlock.h.define 2005-11-14 20:40:05.000000000 -0500
+++ linux-2.6.9/include/linux/spinlock.h        2005-11-14 20:40:12.000000000 -0500
@@ -403,6 +403,8 @@
 #define spin_trylock(lock)     _spin_trylock(lock)
 #define write_trylock(lock)    _write_trylock(lock)

+#define DEFINE_SPINLOCK(x)     spinlock_t x = SPIN_LOCK_UNLOCKED
+#define DEFINE_RWLOCK(x)       rw_lock_t x = RW_LOCK_UNLOCKED
 /* Where's read_trylock? */

 #define spin_lock(lock)                _spin_lock(lock)

So the following Would probably work for now:

Index: xpp/xpd.h
===================================================================
--- xpp/xpd.h   (revision 2128)
+++ xpp/xpd.h   (working copy)
@@ -47,7 +47,7 @@
 #ifdef __KERNEL__
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
 /* pretend every 2.6.9 is later RHEL */
-#if LINUX_VERSION_CODE != KERNEL_VERSION(2,6,9) 
+#if LINUX_VERSION_CODE != KERNEL_VERSION(2,6,9) && defined(DEFINE_SPINLOCK)
 typedef        unsigned gfp_t;         /* Added in 2.6.14 */
 #endif
 #endif

It seems to still build on a CentOS4 system.

-- 
               Tzafrir Cohen       
icq#16849755                    jabber:tzafrir at jabber.org
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com       
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir


More information about the asterisk-dev mailing list