Summary: | ASTERISK-12944: dahdi fails compile on powerpc | ||
Reporter: | Brendan Martens (shrift) | Labels: | |
Date Opened: | 2008-10-21 12:37:14 | Date Closed: | 2008-10-22 12:08:56 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Channels/chan_dahdi |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) wctdm-powerpc.patch | |
Description: | I hope this is the right place to report this. : ( When trying to compile dahdi linux-complete from svn I get these errors: root@asterisk:/usr/local/dahdi# make all make -C linux all make[1]: Entering directory `/usr/local/dahdi/linux' make -C /lib/modules/2.6.24-etchnhalf.1-powerpc-smp/build ARCH=ppc SUBDIRS=/usr/local/dahdi/linux/drivers/dahdi DAHDI_INCLUDE=/usr/local/dahdi/linux/include DAHDI_MODULES_EXTRA=" " HOTPLUG_FIRMWARE=yes modules DAHDI_BUILD_ALL=m make[2]: Entering directory `/usr/src/linux-headers-2.6.24-etchnhalf.1-powerpc-smp' CC [M] /usr/local/dahdi/linux/drivers/dahdi/wctdm.o /usr/local/dahdi/linux/drivers/dahdi/wctdm.c: In function ‘wctdm_receiveprep’: /usr/local/dahdi/linux/drivers/dahdi/wctdm.c:398: error: request for member ‘readchunk’ in something not a structure or union /usr/local/dahdi/linux/drivers/dahdi/wctdm.c:400: error: request for member ‘readchunk’ in something not a structure or union /usr/local/dahdi/linux/drivers/dahdi/wctdm.c:402: error: request for member ‘readchunk’ in something not a structure or union /usr/local/dahdi/linux/drivers/dahdi/wctdm.c:404: error: request for member ‘readchunk’ in something not a structure or union make[3]: *** [/usr/local/dahdi/linux/drivers/dahdi/wctdm.o] Error 1 make[2]: *** [_module_/usr/local/dahdi/linux/drivers/dahdi] Error 2 make[2]: Leaving directory `/usr/src/linux-headers-2.6.24-etchnhalf.1-powerpc-smp' make[1]: *** [modules] Error 2 make[1]: Leaving directory `/usr/local/dahdi/linux' make: *** [all] Error 2 After reviewing the errors I opened /usr/local/dahdi/linux/drivers/dahdi/wctdm.c and commented out the following lines: 396 /*#ifdef __BIG_ENDIAN 397 if (wc->cardflag & (1 << 3)) 398 wc->chans[3].readchunk[x] = (readchunk[x]) & 0xff; 399 if (wc->cardflag & (1 << 2)) 400 wc->chans[2].readchunk[x] = (readchunk[x] >> 8) & 0xff; 401 if (wc->cardflag & (1 << 1)) 402 wc->chans[1].readchunk[x] = (readchunk[x] >> 16) & 0xff; 403 if (wc->cardflag & (1 << 0)) 404 wc->chans[0].readchunk[x] = (readchunk[x] >> 24) & 0xff; 405 #else 406 if (wc->cardflag & (1 << 3)) 407 wc->chans[3]->readchunk[x] = (readchunk[x] >> 24) & 0xff; 408 if (wc->cardflag & (1 << 2)) 409 wc->chans[2]->readchunk[x] = (readchunk[x] >> 16) & 0xff; 410 if (wc->cardflag & (1 << 1)) 411 wc->chans[1]->readchunk[x] = (readchunk[x] >> 8) & 0xff; 412 if (wc->cardflag & (1 << 0)) 413 wc->chans[0]->readchunk[x] = (readchunk[x]) & 0xff; 414 #endif*/ After that the compile finished cleanly. ****** ADDITIONAL INFORMATION ****** I fetched dahdi like this: svn co http://svn.digium.com/svn/dahdi/linux-complete/tags/2.0.0%2B2.0.0/ dahdi and it got versions: Checked out revision 398. Checked out revision 5107. Checked out revision 5107. | ||
Comments: | By: Gregory Hinton Nietsky (irroot) 2008-10-21 12:58:15 the problem seems obvious from where i sit you are __BIG_ENDIAN the code should read ... the -> instead of . c->chans[3]->readchunk[x] = (readchunk[x]) & 0xff; not c->chans[3].readchunk[x] = (readchunk[x]) & 0xff; in lines 398 to 404 try this and see what happens ... By: Brendan Martens (shrift) 2008-10-21 13:04:28 That did indeed make it behave. : ) Thanks. Will having commented out what I did cause any issues? Should I recompile and reinstall with this change? By: Gregory Hinton Nietsky (irroot) 2008-10-21 13:06:48 i not sure of that part of code.it must be there for a reason right ;) usual rule applies it breaks you get to keep the pieces ... id compile it with it in to be safe By: Gregory Hinton Nietsky (irroot) 2008-10-21 13:08:29 me work on patch quick ... By: Brendan Martens (shrift) 2008-10-21 13:13:19 Yeah I just went ahead and recompiled... <3 checkinstall. : ) By: Digium Subversion (svnbot) 2008-10-22 12:08:53 Repository: dahdi Revision: 5121 U linux/trunk/drivers/dahdi/wctdm.c ------------------------------------------------------------------------ r5121 | qwell | 2008-10-22 12:08:53 -0500 (Wed, 22 Oct 2008) | 8 lines Fix building on big endian machines. (closes issue ASTERISK-12944) Reported by: shrift Patches: wctdm-powerpc.patch uploaded by irroot (license 52) Tested by: shrift ------------------------------------------------------------------------ http://svn.digium.com/view/dahdi?view=rev&revision=5121 |