Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22149

Python3 cross-compilation make failure

$
0
0

I have build sdk using crosstool-NG 1.24.0

target:

Architecture- i686 (32 bit amd)
Binutils:2.32 
kernel: 4.9.156
Glibc: 2.19
Gcc: 7.4.0

SDK build was successful. Now i am trying to cross-compile python-3.6.9

export PATH=/home/ach/x-tools/i686-pc-linux-gnu/bin:$PATH

export CC=/home/ach/x-tools/i686-pc-linux-gnu/bin/i686-pc-linux-gnu-gcc
export CPP=/home/ach/x-tools/i686-pc-linux-gnu/bin/i686-pc-linux-gnu-cpp
export CXX=/home/ach/x-tools/i686-pc-linux-gnu/bin/i686-pc-linux-gnu-g++
export INSTALL_DIR=/home/ach/Downloads/cross-python/compiled-python3
export LDFLAGS="-L/home/ach/Downloads/cross-openssl/compiled-openssl/lib/ -L/home/ach/Downloads/cross-zlib/compiled-zlib/lib"&&
export LD_LIBRARY_PATH="/home/ach/Downloads/cross-openssl/compiled-openssl/lib/:/home/ach/Downloads/cross-zlib/compiled-zlib/lib"&&
export CPPFLAGS=" -I/home/ach/x-tools/i686-pc-linux-gnu/i686-pc-linux-gnu/sysroot/usr/include -I/home/ach/Downloads/cross-openssl/compiled-openssl/include/ -I/home/ach/Downloads/cross-zlib/compiled-zlib/include"


../Python-3.6.9/configure \
    --target=x86-pc-linux-gnu \
    --prefix=$INSTALL_DIR \
    --with-libm=/home/ach/x-tools/i686-pc-linux-gnu/i686-pc-linux-gnu/sysroot/usr/lib/libm.so \
    --with-libc=/home/ach/x-tools/i686-pc-linux-gnu/i686-pc-linux-gnu/sysroot/usr/lib/libc.so \
    --with-ensurepip=install \
    --disable-ipv6 \
    --enable-shared \
    ac_cv_file__dev_ptmx=no \
    ac_cv_file__dev_ptc=no \
    ac_cv_have_long_long_format=yes

There are many errors while executing the command make

creating build/temp.linux-x86_64-3.6/home/ach/Downloads/cross-python/Python-3.6.9/Modules
/home/ach/x-tools/i686-pc-linux-gnu/bin/i686-pc-linux-gnu-gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I../Python-3.6.9/Include -IObjects -IPython -I. -I/home/ach/x-tools/i686-pc-linux-gnu/i686-pc-linux-gnu/sysroot/usr/include -I/home/ach/Downloads/cross-openssl/compiled-openssl/include/ -I/home/ach/Downloads/cross-zlib/compiled-zlib/include -I/usr/include/i386-linux-gnu -I/usr/local/include -I/home/ach/Downloads/cross-python/Python-3.6.9/Include -I/home/ach/Downloads/cross-python/build-python3 -c /home/ach/Downloads/cross-python/Python-3.6.9/Modules/_struct.c -o build/temp.linux-x86_64-3.6/home/ach/Downloads/cross-python/Python-3.6.9/Modules/_struct.o
In file included from /home/ach/x-tools/i686-pc-linux-gnu/i686-pc-linux-gnu/sysroot/usr/include/features.h:378:0,
                 from /home/ach/x-tools/i686-pc-linux-gnu/i686-pc-linux-gnu/sysroot/usr/include/limits.h:25,
                 from /home/ach/x-tools/i686-pc-linux-gnu/lib/gcc/i686-pc-linux-gnu/7.4.0/include-fixed/limits.h:194,
                 from /home/ach/x-tools/i686-pc-linux-gnu/lib/gcc/i686-pc-linux-gnu/7.4.0/include-fixed/syslimits.h:7,
                 from /home/ach/x-tools/i686-pc-linux-gnu/lib/gcc/i686-pc-linux-gnu/7.4.0/include-fixed/limits.h:34,
                 from ../Python-3.6.9/Include/Python.h:11,
                 from /home/ach/Downloads/cross-python/Python-3.6.9/Modules/_struct.c:8:
/usr/include/i386-linux-gnu/sys/cdefs.h:467:49: error: missing binary operator before token "("
 #if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
                                                 ^
In file included from ../Python-3.6.9/Include/Python.h:25:0,
                 from /home/ach/Downloads/cross-python/Python-3.6.9/Modules/_struct.c:8:
/home/ach/x-tools/i686-pc-linux-gnu/i686-pc-linux-gnu/sysroot/usr/include/stdio.h:48:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'
 typedef struct _IO_FILE FILE;
   ...

First what does this mean

/usr/include/i386-linux-gnu/sys/cdefs.h:467:49: error: missing binary operator before token "("
 #if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)

Related question here but no answer unfortunately...

secondly why it referring to below path although i have set CPPFLAGS to sysroot/include

/usr/include/i386-linux-gnu/sys/cdefs.h


$ /home/ach/x-tools/i686-pc-linux-gnu/bin/i686-pc-linux-gnu-gcc -v
gcc version 7.4.0 (crosstool-NG 1.24.0) 
COLLECT_GCC_OPTIONS='-E''-v''-mtune=generic''-march=i686'
 /home/ach/x-tools/i686-pc-linux-gnu/libexec/gcc/i686-pc-linux-gnu/7.4.0/cc1 -E -quiet -v - -mtune=generic -march=i686
ignoring nonexistent directory "/home/ach/x-tools/i686-pc-linux-gnu/i686-pc-linux-gnu/sysroot/home/ach/x-tools/i686-pc-linux-gnu/i686-pc-linux-gnu/sysroot/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/ach/x-tools/i686-pc-linux-gnu/lib/gcc/i686-pc-linux-gnu/7.4.0/include
 /home/ach/x-tools/i686-pc-linux-gnu/lib/gcc/i686-pc-linux-gnu/7.4.0/include-fixed
 /home/ach/x-tools/i686-pc-linux-gnu/lib/gcc/i686-pc-linux-gnu/7.4.0/../../../../i686-pc-linux-gnu/include
 /home/ach/x-tools/i686-pc-linux-gnu/i686-pc-linux-gnu/sysroot/usr/include

I have also have cdefs.h also at

/home/ach/x-tools/i686-pc-linux-gnu/i686-pc-linux-gnu/sysroot/usr/include/sys/cdefs.h

My sdk is at

/home/ach/x-tools/i686-pc-linux-gnu

How to solve the issue this reference issue ?

Thanks


Viewing all articles
Browse latest Browse all 22149

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>