[New-bugs-announce] [issue26443] cross building extensions picks up host headers

Martin Hundebøll report at bugs.python.org
Fri Feb 26 10:19:33 EST 2016


New submission from Martin Hundebøll:

When cross building python, the building of extensions is called with -I/usr/include and -L/usr/lib

This makes some extensions fail to compile due to picking up inline assembly from host headers (e.g. _socket[1]).

I have fixed this locally by applying the attached patch, but I cannot tell if that would make other builds fail.

[1] log output:
building '_socket' extension
arm-cortexa9neon-linux-gnueabi-gcc -fPIC -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/home/mnhu/projects/pil/oe/tmp/work/machine/arm-cortexa9neon-linux-gnueabi/python-3.5.1/stage/machine/usr/lib/libffi-3.2.1/include -O2 -fexpensive-optimizations -fomit-frame-pointer -frename-registers -Werror=declaration-after-statement -I./Include -I/usr/include -I. -IInclude -I/home/mnhu/projects/pil/oe/tmp/work/machine/arm-cortexa9neon-linux-gnueabi/python-3.5.1/stage/cross/bin/../arm-cortexa9neon-linux-gnueabi/sysroot/usr/include -I/home/mnhu/projects/pil/oe/tmp/work/machine/arm-cortexa9neon-linux-gnueabi/python-3.5.1/src/Python-3.5.1/Include -I/home/mnhu/projects/pil/oe/tmp/work/machine/arm-cortexa9neon-linux-gnueabi/python-3.5.1/src/Python-3.5.1 -c /home/mnhu/projects/pil/oe/tmp/work/machine/arm-cortexa9neon-linux-gnueabi/python-3.5.1/src/Python-3.5.1/Modules/socketmodule.c -o build/temp.linux-arm-3.5/home/mnhu/projects/pil/oe/tmp/work/machine/arm-cortexa9neon-linux-gnueabi/python-3.5.1/src/Python-3.5.1/Modules/socketmodule.o
In file included from /usr/include/bits/byteswap.h:35:0,
                 from /usr/include/endian.h:60,
                 from /usr/include/bits/string2.h:51,
                 from /usr/include/string.h:635,
                 from ./Include/Python.h:30,
                 from /home/mnhu/projects/pil/oe/tmp/work/machine/arm-cortexa9neon-linux-gnueabi/python-3.5.1/src/Python-3.5.1/Modules/socketmodule.c:95:
/home/mnhu/projects/pil/oe/tmp/work/machine/arm-cortexa9neon-linux-gnueabi/python-3.5.1/src/Python-3.5.1/Modules/socketmodule.c: In function 'socket_getservbyport':
/usr/include/bits/byteswap-16.h:31:5: error: invalid 'asm': invalid operand for code 'w'
     __asm__ ("rorw $8, %w0"           \
     ^
/usr/include/netinet/in.h:403:21: note: in expansion of macro '__bswap_16'
 #   define htons(x) __bswap_16 (x)
                     ^
/home/mnhu/projects/pil/oe/tmp/work/machine/arm-cortexa9neon-linux-gnueabi/python-3.5.1/src/Python-3.5.1/Modules/socketmodule.c:4861:24: note: in expansion of macro 'htons'
     sp = getservbyport(htons((short)port), proto);
                        ^

----------
components: Cross-Build
files: include-dirs.patch
keywords: patch
messages: 260894
nosy: hundeboll
priority: normal
severity: normal
status: open
title: cross building extensions picks up host headers
type: compile error
versions: Python 2.7, Python 3.5
Added file: http://bugs.python.org/file42032/include-dirs.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26443>
_______________________________________


More information about the New-bugs-announce mailing list