星期五, 5月 04, 2007

Busybox錯誤訊息[applets]

$ make 會遇到

applets/applets.c:20:2: error: #warning Static linking against glibc produces buggy executables
applets/applets.c:21:2: error: #warning (glibc does not cope well with ld --gc-sections).
applets/applets.c:22:2: error: #warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
applets/applets.c:23:2: error: #warning Note that glibc is unsuitable for static linking anyway.
applets/applets.c:24:2: error: #warning If you still want to do it, remove -Wl,--gc-sections
applets/applets.c:25:2: error: #warning from top-level Makefile and remove this warning.
make[1]: *** [applets/applets.o] Error 1
這個警告的定義在applets/applets.c中,將這段警告註釋掉就可以了。這段的意思就是告訴你最好用uclibc編譯,而不用glibc因為glibc比較大,busybox在寸土寸金的內嵌系統中運用比較多,所以會有這樣的要求。編輯 ~/applets/applets.c , 將警告註解掉即可 (第 20-25 行)
...
/*
#if ENABLE_STATIC && defined(__GLIBC__) && !defined(__UCLIBC__)
#warning Static linking against glibc produces buggy executables
#warning (glibc does not cope well with ld --gc-sections).
#warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
#warning Note that glibc is unsuitable for static linking anyway.
#warning If you still want to do it, remove -Wl,--gc-sections
#warning from top-level Makefile and remove this warning.
#endif
*/
...