[Hero, G2 Touch General] userdima:
Hi! This is my first question here, and this site doesn't allow it to be posted in development questions.

I'm trying to patch and modify the kernel (las-venturax 0.6.0) to support usb host mode on htc hero. I implemented the sub host driver, compiled it as a module, and everything woked fine. Btw, i'm using ndk r6b. And when i tried to insmod host driver, kernel told me "usbcore: Unknown symbol _GLOBAL_OFFSET_TABLE_". Google told me to use "-fno-pic" flag to compile modules, and it worked fine for usb drivers (even after insmod'ing it). But when i compiled wlan module (tiwlan1251), it listed lots of errors:

make EXTRA_CFLAGS=-fno-pic modules
...
CC [M] drivers/net/tun.o
CC [M] drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.o
In file included from drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:43:
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.h:46:23: error: memMngrEx.h: No such file or directory
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.h:47:21: error: report.h: No such file or directory
In file included from drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:43:
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.h:55: error: expected specifier-qualifier-list before 'TI_HANDLE'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.h:92: error: expected ')' before 'hOs'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.h:94: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_ConfigMsduList'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.h:97: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_SetMsduListNumOfElements'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.h:99: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_SetMsduListOverFlowPolicy'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.h:101: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_FreeMsduList'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.h:103: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_EmptyMsduList'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.h:105: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_Insert'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.h:107: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_WatchFirst'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.h:109: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_GetFirst'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.h:111: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_getCurrNumOfMsdu'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:44:22: error: osTIType.h: No such file or directory
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:45:21: error: paramIn.h: No such file or directory
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:46:19: error: osApi.h: No such file or directory
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:60: error: expected ')' before 'hOs'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:103: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_ConfigMsduList'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:142: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_SetMsduListNumOfElements'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:165: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_SetMsduListOverFlowPolicy'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:189: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_FreeMsduList'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:223: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_EmptyMsduList'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:291: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_Insert'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:391: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_GetFirst'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:428: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_WatchFirst'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:445: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'msduList_getCurrNumOfMsdu'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c: In function 'printMsduList':
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:455: error: implicit declaration of function 'WLAN_OS_REPORT'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:457: error: 'MsduList_t' has no member named 'first'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:457: warning: left-hand operand of comma expression has no effect
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:458: error: 'MsduList_t' has no member named 'last'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:458: warning: left-hand operand of comma expression has no effect
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:459: error: 'MsduList_t' has no member named 'maxNumOfMsdu'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:459: warning: left-hand operand of comma expression has no effect
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:460: error: 'MsduList_t' has no member named 'CurrNumOfMsdu'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:460: warning: left-hand operand of comma expression has no effect
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:461: error: 'MsduList_t' has no member named 'numOfOverFlow'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:461: warning: left-hand operand of comma expression has no effect
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:462: error: 'MsduList_t' has no member named 'maxCurrOfMsdu'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:462: warning: left-hand operand of comma expression has no effect
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:464: error: 'MsduList_t' has no member named 'useAdmissionAlgo'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:464: warning: left-hand operand of comma expression has no effect
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:465: error: 'MsduList_t' has no member named 'credit'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:465: warning: left-hand operand of comma expression has no effect
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:466: error: 'MsduList_t' has no member named 'enableTransmissionTime'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:466: warning: left-hand operand of comma expression has no effect
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:467: error: 'MsduList_t' has no member named 'lastTimeStamp'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:467: warning: left-hand operand of comma expression has no effect
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:468: error: 'MsduList_t' has no member named 'mediumTime'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:468: warning: left-hand operand of comma expression has no effect
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:469: error: 'MsduList_t' has no member named 'totalUsedTime'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:469: warning: left-hand operand of comma expression has no effect
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c: In function 'printFullMsduList':
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:475: error: 'mem_MSDU_T' undeclared (first use in this function)
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:475: error: (Each undeclared identifier is reported only once
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:475: error: for each function it appears in.)
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:475: error: 'tmpMSDU' undeclared (first use in this function)
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:476: error: 'UINT32' undeclared (first use in this function)
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:476: error: expected ';' before 'i'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:480: error: 'MsduList_t' has no member named 'first'
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:481: error: 'i' undeclared (first use in this function)
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:481: error: 'NULL' undeclared (first use in this function)
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:481: warning: left-hand operand of comma expression has no effect
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:483: warning: left-hand operand of comma expression has no effect
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:483: warning: left-hand operand of comma expression has no effect
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:483: warning: left-hand operand of comma expression has no effect
drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.c:483: warning: left-hand operand of comma expression has no effect
make[4]: *** [drivers/net/wireless/tiwlan1251/./common/src/core/data_ctrl/Tx/MsduList.o] Error 1
make[3]: *** [drivers/net/wireless/tiwlan1251] Error 2
make[2]: *** [drivers/net/wireless] Error 2
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2

It compiles fine without this flag.

Where is the problem? I thought of messed Makefiles, because it just doesn't find the include dir, but I dont understand the connection between this flag and include directories...