Bug 321

Summary: alsa-lib uses host include files for python which breaks builds on 64 bit Linux
Product: buildroot Reporter: Ulf Samuelsson <ulf.samuelsson>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: blocker CC: buildroot
Priority: P5    
Version: unspecified   
Target Milestone: 2010.05   
Hardware: PC   
OS: Linux   
Host: OpenSuse 11.1 64 bit on Core i7 processor Target: at91sam9261ek_defconfig
Build:

Description Ulf Samuelsson 2009-05-07 08:36:14 UTC
at91sam9261ek_defconfig was updated to use the latest 
binutils, gcc, kernel headers etc, and this is yet
to be committed.

When you build alsa-lib, with python enabled, it tries to include some python headers.
These are included from the host machine and not the target machine.

/home/ulf/projects/Buildroot/20090506/buildroot/build_arm/staging_dir/usr/bin/arm-linux-uclibc-gcc -Os -pipe -Os  -I/home/ulf/projects/Buildroot/20090506/buildroot/build_arm/staging_dir/usr/include -I/home/ulf/projects/Buildroot/20090506/buildroot/build_arm/staging_dir/include --sysroot=/home/ulf/projects/Buildroot/20090506/buildroot/build_arm/staging_dir/ -isysroot /home/ulf/projects/Buildroot/20090506/buildroot/build_arm/staging_dir -mabi=apcs-gnu -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -shared  .libs/sbase.o  -Wl,--rpath -Wl,/home/ulf/projects/Buildroot/20090506/buildroot/build_arm/alsa-lib-1.0.18/src/.libs -L/home/ulf/projects/Buildroot/20090506/buildroot/build_arm/staging_dir/lib -L/home/ulf/projects/Buildroot/20090506/buildroot/build_arm/staging_dir/usr/lib -lm ../../../src/.libs/libasound.so  -mabi=apcs-gnu -mabi=apcs-gnu -Wl,-soname -Wl,smixer-sbase.so -o .libs/smixer-sbase.so
In file included from /usr/include/python2.6/Python.h:58,
                 from python.c:22:
/usr/include/python2.6/pyport.h:685:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."


Since the host is 64 bit and the target is 32 bit, the check fails.
It would not fail the test if the host is running 32 bit Linux.
The real problem (using host includes) still exist and can cause subtle bugs


This was also reported to the mailing list by Matt Wood 
Dec 19, 2008; 07:48pm.
Comment 1 Ulf Samuelsson 2009-07-26 07:15:21 UTC
Adding

 ALSA_LIB_CONF_OPT += --with-pythonlibs=-lpython$(PYTHON_VERSION_MAJOR)
+ALSA_LIB_CONF_OPT += --with-pythonincludes=-I$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)
 ALSA_LIB_CFLAGS+=-I$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)

to the alsa-lib build recipe seems to fix the problem.