Bug 5666

Summary: Fails to build python 2.7.2 for 2440 arm
Product: buildroot Reporter: hardcorefs <hardcore>
Component: OtherAssignee: unassigned
Status: RESOLVED WORKSFORME    
Severity: blocker CC: buildroot
Priority: P5    
Version: 2012.08   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:
Attachments: example of broken python build

Description hardcorefs 2012-11-12 12:28:48 UTC
The build process for  Python under the samsung cpu 2440 fails to build with the following error


bob@bob-virtual-machine:~/buildroot-2012.08$ make
>>> python 2.7.2 Building
PATH="/home/bob/buildroot-2012.08/output/host/bin:/home/bob/buildroot-2012.08/output/host/usr/bin:/home/bob/buildroot-2012.08/output/host/usr/sbin/:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" PERLLIB="/home/bob/buildroot-2012.08/output/host/usr/lib/perl" PYTHON_MODULES_INCLUDE=/home/bob/buildroot-2012.08/output/host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include PYTHON_MODULES_LIB="/home/bob/buildroot-2012.08/output/host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/lib /home/bob/buildroot-2012.08/output/host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/lib" /usr/bin/make -j2  -C /home/bob/buildroot-2012.08/output/build/python-2.7.2/
make[1]: Entering directory `/home/bob/buildroot-2012.08/output/build/python-2.7.2'
/home/bob/buildroot-2012.08/output/host/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc -c -fno-strict-aliasing  -pipe -Os  -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include  -fPIC -DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c
/home/bob/buildroot-2012.08/output/host/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc -c -fno-strict-aliasing  -pipe -Os  -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include  -fPIC -DPy_BUILD_CORE -o Parser/acceler.o Parser/acceler.c
In file included from Include/Python.h:85:0,
                 from ./Modules/python.c:3:
Include/unicodeobject.h:575:20: warning: type defaults to 'int' in declaration of 'wchar_t'
Include/unicodeobject.h:575:28: error: expected ';', ',' or ')' before '*' token
Include/unicodeobject.h:593:14: warning: type defaults to 'int' in declaration of 'wchar_t'
Include/unicodeobject.h:593:22: error: expected ';', ',' or ')' before '*' token
In file included from Include/Python.h:85:0,
                 from Include/pgenheaders.h:10,
                 from Parser/acceler.c:13:
Include/unicodeobject.h:575:20: warning: type defaults to 'int' in declaration of 'wchar_t'
Include/unicodeobject.h:575:28: error: expected ';', ',' or ')' before '*' token
Include/unicodeobject.h:593:14: warning: type defaults to 'int' in declaration of 'wchar_t'
Include/unicodeobject.h:593:22: error: expected ';', ',' or ')' before '*' token
make[1]: *** [Modules/python.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Parser/acceler.o] Error 1
make[1]: Leaving directory `/home/bob/buildroot-2012.08/output/build/python-2.7.2'
make: *** [/home/bob/buildroot-2012.08/output/build/python-2.7.2/.stamp_built] Error 2
bob@bob-virtual-machine:~/buildroot-2012.08$
Comment 1 Thomas Petazzoni 2012-11-12 12:38:00 UTC
Could you please share your Buildroot .config ?
Comment 2 hardcorefs 2012-11-12 13:04:07 UTC
Created attachment 4622 [details]
example of broken python build
Comment 3 Thomas Petazzoni 2012-11-12 14:34:59 UTC
Ok. My guess is that:

*) You built once without WCHAR support in the toolchain (BR2_USE_WCHAR not enabled)

*) You went back in menuconfig, enabled Python. But to do this, you enabled WCHAR support in the toolchain. And then, instead of doing a complete "make clean all" cycle that ensures the toolchain gets rebuilt, you just did "make". So it tried to build Python without rebuilding the toolchain, leading to your error.

I'm pretty sure that the problem will go away if you do a "make clean all" cycle. I tested your configuration here and it built just fine.
Comment 4 hardcorefs 2012-11-12 22:32:37 UTC
HI,
Yep you are indeed a fortune teller........
Did "make clean all" and it did solve the problem, just it extends the build time every time.