Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
chroot env complain about cross compiling (stage3 mips)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
zivimo2
n00b
n00b


Joined: 15 Oct 2015
Posts: 5

PostPosted: Thu Oct 15, 2015 8:38 pm    Post subject: chroot env complain about cross compiling (stage3 mips) Reply with quote

I got problems with gentoo: I took the stage3 (experimental mips32 - http://distfiles.gentoo.org/experimental/mips/stages/mips32/2014/stage3-mips32-20140904.tar.bz2) tarball and put it on my Ubuntu14x64. Set binfmt in cooperation with qemu to support mips binaries, mounted /dev, /proc and so on and chrooted to the unpacked tarball. I emerge --sync-ed and it suggested me to do a emerge --oneshot portage at the end. And so I did. The problem is if it gets down to compiling it says:

Code:
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2_build':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details


Is there any variable read from the host (maybe via /proc) making the ditro think it is cross compiling? How can I redeem that? Thanks in advance.

PS:
- build-log
Code:
 * Package:    dev-lang/python-exec-2.0.2
 * Repository: gentoo
 * Maintainer: python@gentoo.org
 * Upstream:   mgorny@gentoo.org https://bitbucket.org/mgorny/python-exec/issues/
 * USE:        elibc_glibc kernel_linux mips python_targets_python2_7 python_targets_python3_3 python_targets_python3_4 python_targets_python3_5 userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
/var/tmp/portage/dev-lang/python-exec-2.0.2/temp/environment: line 68: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
/var/tmp/portage/dev-lang/python-exec-2.0.2/temp/environment: line 71: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory
>>> Unpacking source...
>>> Unpacking python-exec-2.0.2.tar.bz2 to /var/tmp/portage/dev-lang/python-exec-2.0.2/work
>>> Source unpacked in /var/tmp/portage/dev-lang/python-exec-2.0.2/work
/var/tmp/portage/dev-lang/python-exec-2.0.2/temp/environment: line 68: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
/var/tmp/portage/dev-lang/python-exec-2.0.2/temp/environment: line 71: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory
>>> Preparing source in /var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2 ...
 * Running elibtoolize in: python-exec-2.0.2/
>>> Source prepared.
/var/tmp/portage/dev-lang/python-exec-2.0.2/temp/environment: line 69: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
/var/tmp/portage/dev-lang/python-exec-2.0.2/temp/environment: line 72: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory
>>> Configuring source in /var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2 ...
>>> Working in BUILD_DIR: "/var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2_build"
/var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2/configure --prefix=/usr --build=mips-unknown-linux-gnu --host=mips-unknown-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-silent-rules --disable-dependency-tracking --docdir=/usr/share/doc/python-exec-2.0.2 --with-eprefix= --with-python-impls= jython2.5 jython2.7 pypy pypy3 python3.3 python3.4 python3.5 python2.7
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for mips-unknown-linux-gnu-gcc... mips-unknown-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2_build':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2_build/config.log
 * ERROR: dev-lang/python-exec-2.0.2::gentoo failed (configure phase):
 *   econf failed
 *
 * Call stack:
 *          ebuild.sh, line   93:  Called src_configure
 *        environment, line 3783:  Called autotools-utils_src_configure
 *        environment, line  673:  Called econf '--docdir=/usr/share/doc/python-exec-2.0.2' '--with-eprefix=' '--with-python-impls= jython2.5 jython2.7 pypy pypy3 python3.3 python3.4 python3.5 python2.7'
 *   phase-helpers.sh, line  584:  Called die
 * The specific snippet of code:
 *            die "econf failed"
 *
 * If you need support, post the output of `emerge --info '=dev-lang/python-exec-2.0.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/python-exec-2.0.2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-lang/python-exec-2.0.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-lang/python-exec-2.0.2/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2_build'
 * S: '/var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2'
/var/tmp/portage/dev-lang/python-exec-2.0.2/temp/environment: line 69: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
/var/tmp/portage/dev-lang/python-exec-2.0.2/temp/environment: line 72: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory


- config-log
Code:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by python-exec configure 2.0.2, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ /var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2/configure --prefix=/usr --build=mips-unknown-linux-gnu --host=mips-unknown-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-silent-rules --disable-dependency-tracking --docdir=/usr/share/doc/python-exec-2.0.2 --with-eprefix= --with-python-impls= jython2.5 jython2.7 pypy pypy3 python3.3 python3.4 python3.5 python2.7

## --------- ##
## Platform. ##
## --------- ##

hostname = ubuntu14
uname -m = mips
uname -r = 3.19.0-25-generic
uname -s = Linux
uname -v = #26~14.04.1-Ubuntu SMP Fri Jul 24 21:16:20 UTC 2015

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /var/tmp/portage/._portage_reinstall_.7jy3lc/bin/ebuild-helpers
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /opt/bin
PATH: /usr/mips-unknown-linux-gnu/gcc-bin/4.8.3


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2301: checking for a BSD-compatible install
configure:2369: result: /usr/bin/install -c
configure:2380: checking whether build environment is sane
configure:2435: result: yes
configure:2586: checking for a thread-safe mkdir -p
configure:2625: result: /bin/mkdir -p
configure:2632: checking for gawk
configure:2648: found /usr/bin/gawk
configure:2659: result: gawk
configure:2670: checking whether make sets $(MAKE)
configure:2692: result: yes
configure:2721: checking whether make supports nested variables
configure:2738: result: yes
configure:2876: checking whether make supports nested variables
configure:2893: result: yes
configure:2913: checking for mips-unknown-linux-gnu-gcc
configure:2929: found /usr/bin/mips-unknown-linux-gnu-gcc
configure:2940: result: mips-unknown-linux-gnu-gcc
configure:3209: checking for C compiler version
configure:3218: mips-unknown-linux-gnu-gcc --version >&5
mips-unknown-linux-gnu-gcc (Gentoo 4.8.3 p1.1, pie-0.5.9) 4.8.3
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3229: $? = 0
configure:3218: mips-unknown-linux-gnu-gcc -v >&5
Using built-in specs.
COLLECT_GCC=/usr/mips-unknown-linux-gnu/gcc-bin/4.8.3/mips-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/mips-unknown-linux-gnu/4.8.3/lto-wrapper
Target: mips-unknown-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.8.3/work/gcc-4.8.3/configure --host=mips-unknown-linux-gnu --build=mips-unknown-linux-gnu --prefix=/usr --bindir=/usr/mips-unknown-linux-gnu/gcc-bin/4.8.3 --includedir=/usr/lib/gcc/mips-unknown-linux-gnu/4.8.3/include --datadir=/usr/share/gcc-data/mips-unknown-linux-gnu/4.8.3 --mandir=/usr/share/gcc-data/mips-unknown-linux-gnu/4.8.3/man --infodir=/usr/share/gcc-data/mips-unknown-linux-gnu/4.8.3/info --with-gxx-include-dir=/usr/lib/gcc/mips-unknown-linux-gnu/4.8.3/include/g++-v4 --with-python-dir=/share/gcc-data/mips-unknown-linux-gnu/4.8.3/python --enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.8.3 p1.1, pie-0.5.9' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --disable-altivec --disable-fixed-point --with-abi=32 --disable-libgcj --disable-libgomp --disable-libmudflap --disable-libssp --disable-libquadmath --enable-lto --without-cloog
Thread model: posix
gcc version 4.8.3 (Gentoo 4.8.3 p1.1, pie-0.5.9)
configure:3229: $? = 0
configure:3218: mips-unknown-linux-gnu-gcc -V >&5
mips-unknown-linux-gnu-gcc: error: unrecognized command line option '-V'
mips-unknown-linux-gnu-gcc: fatal error: no input files
compilation terminated.
configure:3229: $? = 1
configure:3218: mips-unknown-linux-gnu-gcc -qversion >&5
mips-unknown-linux-gnu-gcc: error: unrecognized command line option '-qversion'
mips-unknown-linux-gnu-gcc: fatal error: no input files
compilation terminated.
configure:3229: $? = 1
configure:3249: checking whether the C compiler works
configure:3271: mips-unknown-linux-gnu-gcc -O2 -march=mips32 -mabi=32 -mplt -pipe  -Wl,-O1 -Wl,--as-needed conftest.c  >&5
configure:3275: $? = 0
configure:3323: result: yes
configure:3326: checking for C compiler default output file name
configure:3328: result: a.out
configure:3334: checking for suffix of executables
configure:3341: mips-unknown-linux-gnu-gcc -o conftest -O2 -march=mips32 -mabi=32 -mplt -pipe  -Wl,-O1 -Wl,--as-needed conftest.c  >&5
configure:3345: $? = 0
configure:3367: result:
configure:3389: checking whether we are cross compiling
configure:3397: mips-unknown-linux-gnu-gcc -o conftest -O2 -march=mips32 -mabi=32 -mplt -pipe  -Wl,-O1 -Wl,--as-needed conftest.c  >&5
configure:3401: $? = 0
configure:3408: ./conftest
/var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2/configure: line 3410: ./conftest: cannot execute binary file
configure:3412: $? = 126
configure:3419: error: in `/var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2_build':
configure:3421: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-O2 -march=mips32 -mabi=32 -mplt -pipe'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value='-Wl,-O1 -Wl,--as-needed'
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=set
ac_cv_env_build_alias_value=mips-unknown-linux-gnu
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=mips-unknown-linux-gnu
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_mkdir=/bin/mkdir
ac_cv_prog_AWK=gawk
ac_cv_prog_CC=mips-unknown-linux-gnu-gcc
ac_cv_prog_make_make_set=yes
am_cv_make_support_nested_variables=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2/build-aux/missing aclocal-1.15'
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AM_BACKSLASH='\'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
AM_DEFAULT_VERBOSITY='1'
AM_V='$(V)'
AUTOCONF='${SHELL} /var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2/build-aux/missing autoconf'
AUTOHEADER='${SHELL} /var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2/build-aux/missing autoheader'
AUTOMAKE='${SHELL} /var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2/build-aux/missing automake-1.15'
AWK='gawk'
CC='mips-unknown-linux-gnu-gcc'
CCDEPMODE=''
CFLAGS='-O2 -march=mips32 -mabi=32 -mplt -pipe'
CPP=''
CPPFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
GREP=''
HAVE_READLINK_FALSE=''
HAVE_READLINK_TRUE=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LDFLAGS='-Wl,-O1 -Wl,--as-needed'
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
MAKEINFO='${SHELL} /var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2/build-aux/missing makeinfo'
MKDIR_P='/bin/mkdir -p'
OBJEXT=''
PACKAGE='python-exec'
PACKAGE_BUGREPORT=''
PACKAGE_NAME='python-exec'
PACKAGE_STRING='python-exec 2.0.2'
PACKAGE_TARNAME='python-exec'
PACKAGE_URL=''
PACKAGE_VERSION='2.0.2'
PATH_SEPARATOR=':'
PYTHON_IMPLS=' jython2.5 jython2.7 pypy pypy3 python3.3 python3.4 python3.5 python2.7'
SED=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
VERSION='2.0.2'
ac_ct_CC=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include=''
am__isrc=' -I$(srcdir)'
am__leading_dot='.'
am__nodep=''
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
bindir='${exec_prefix}/bin'
build_alias='mips-unknown-linux-gnu'
datadir='/usr/share'
datarootdir='${prefix}/share'
docdir='/usr/share/doc/python-exec-2.0.2'
dvidir='${docdir}'
exec_prefix='NONE'
host_alias='mips-unknown-linux-gnu'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='/usr/share/info'
install_sh='${SHELL} /var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2/build-aux/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='/var/lib'
mandir='/usr/share/man'
mkdir_p='$(MKDIR_P)'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
scriptrootdir='${exec_prefix}/lib/python-exec'
sharedstatedir='${prefix}/com'
sysconfdir='/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "python-exec"
#define PACKAGE_TARNAME "python-exec"
#define PACKAGE_VERSION "2.0.2"
#define PACKAGE_STRING "python-exec 2.0.2"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define PYTHON_IMPLS "python2.7", "python3.5", "python3.4", "python3.3", "pypy3", "pypy", "jython2.7", "jython2.5", 0
#define MAX_EPYTHON_LEN 9
#define EPREFIX ""
#define PACKAGE "python-exec"
#define VERSION "2.0.2"

configure: exit 1


- emerge-info
Code:
Portage 2.2.12 (python 3.3.5-final-0, default/linux/mips/13.0, gcc-4.8.3, glibc-2.19-r1, 3.19.0-25-generic mips)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.19.0-25-generic-mips-with-gentoo-2.2
KiB Mem:     3034016 total,   1882308 free
KiB Swap:    2096124 total,   2096124 free
Timestamp of tree: Wed, 07 Oct 2015 01:00:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.2_p47
dev-lang/perl:            5.18.2-r1
dev-lang/python:          2.7.8, 3.3.5-r1, 3.4.1
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.1
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.16 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo
ACCEPT_KEYWORDS="mips ~mips"
ACCEPT_LICENSE="* -@EULA"
CBUILD="mips-unknown-linux-gnu"
CFLAGS="-O2 -march=mips32 -mabi=32 -mplt -pipe"
CHOST="mips-unknown-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=mips32 -mabi=32 -mplt -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS=""
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
USE="acl berkdb bzip2 cli cracklib crypt cxx gdbm iconv ipv6 mips modules ncurses nls nptl pam pcre readline seccomp session ssl tcpd unicode zlib" ALSA_CARDS="au1x00" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="fbdev impact newport dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON


- emerge-pqv
Code:
[ebuild  N    ] dev-lang/python-exec-2.0.2  PYTHON_TARGETS="(python2_7) (python3_3) (python3_4) (python3_5) (-jython2_5) (-jython2_7) (-pypy) (-pypy3)"

 * IMPORTANT: 13 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.
Back to top
View user's profile Send private message
kikko
Apprentice
Apprentice


Joined: 29 Apr 2014
Posts: 256
Location: Milan, IT

PostPosted: Thu Oct 15, 2015 10:33 pm    Post subject: Reply with quote

Hi zivimo2
zivimo2 wrote:
Code:
configure:3408: ./conftest
/var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2/configure: line 3410: ./conftest: cannot execute binary file
configure:3412: $? = 126

it looks like "/var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2/./conftest" cannot be executed, you can start with that

Regards
Back to top
View user's profile Send private message
zivimo2
n00b
n00b


Joined: 15 Oct 2015
Posts: 5

PostPosted: Fri Oct 16, 2015 4:13 pm    Post subject: Reply with quote

hey kikko,

thanks for your reply. i tinkered on and got really strange results:

Code:
ubuntu14 root # cat hello.c
#include <stdio.h>

int main(void)
{
    puts("Hallo Welt!");
}
ubuntu14 root # gcc hello.c -o hello
ubuntu14 root # ./hello
bash: ./hello: cannot execute binary file
ubuntu14 root # strip hello
ubuntu14 root # ./hello
Hallo Welt!
ubuntu14 root # gcc --version
gcc (Gentoo 4.8.3 p1.1, pie-0.5.9) 4.8.3
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ubuntu14 root # strip --version
GNU strip (Gentoo 2.24 p1.4) 2.24
Copyright 2013 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.


why does it work stripped but not unstripped :?: :!:

the file /var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2/./conftest does not exist! i remembered searching it once by myself. maybe its related to my above observations. that all seems really strange to me...
Back to top
View user's profile Send private message
kikko
Apprentice
Apprentice


Joined: 29 Apr 2014
Posts: 256
Location: Milan, IT

PostPosted: Fri Oct 16, 2015 7:24 pm    Post subject: Reply with quote

Hi zivimo2
what kind of system are you using?
Code:
# uname -a
# gcc hello.c -o hello && file hello

The file /var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2/./conftest could also be not there... error stated that ./conftest could not be executed, but this depends on which was working dir at the time that file was launched: /var/tmp/portage/dev-lang/python-exec-2.0.2/work/python-exec-2.0.2/configure - line 3410 :?
Indeed compilation problems are happening directly on your "starting point" host-Ubuntu?

Regards
Back to top
View user's profile Send private message
zivimo2
n00b
n00b


Joined: 15 Oct 2015
Posts: 5

PostPosted: Sat Oct 17, 2015 12:51 pm    Post subject: Reply with quote

host:
Code:
Linux ubuntu14 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:16:20 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


chroot:
Code:
Linux ubuntu14 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:16:20 UTC 2015 mips GNU/Linux

(binfmt incooperated)

Code:
ubuntu14 ~ # gcc hello.c -o hello && file hello
hello: ELF 32-bit MSB executable, MIPS, MIPS32 version 1, dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
ubuntu14 ~ # strip hello
ubuntu14 ~ # file hello
hello: ELF 32-bit MSB executable, MIPS, MIPS32 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, stripped


does the "(SYSV)" make a difference?

cant find the conftest.c on the whole filesystem... python package might be broken?
Back to top
View user's profile Send private message
kikko
Apprentice
Apprentice


Joined: 29 Apr 2014
Posts: 256
Location: Milan, IT

PostPosted: Sat Oct 17, 2015 1:12 pm    Post subject: Reply with quote

So your host is not a MIPS! 8O
I'm not an expert about MIPS, but afaik you have to download and compile the correct stage3 for your arch: x86_64
Otherwise, you produce binaries that will never run on your system
Even if you are on chroot env, this cannot change your CPU architecture :wink:

Regards
Back to top
View user's profile Send private message
zivimo2
n00b
n00b


Joined: 15 Oct 2015
Posts: 5

PostPosted: Sat Oct 17, 2015 2:32 pm    Post subject: Reply with quote

well the thing is i have a powerful x64 maschine and want to prepare a gentoo filesystem for a router which is mips (and not as powerful). so thats why i run the mips-binary-chroot via qemu on my x64 host (look again at first post). so the chroot uses its own compiler (which compiles for mips) and everything else in mips version. even the uname displays mips... and if the gcc would(!) compile x64 code why doesnt it work unstripped but stripped it does in the mips-chroot?!
Back to top
View user's profile Send private message
heiwa
n00b
n00b


Joined: 24 Oct 2012
Posts: 70

PostPosted: Sat Oct 17, 2015 5:28 pm    Post subject: Reply with quote

binfmt_misc identifies for which binaries to run qemu using a magic
number. Maybe it changes for mips after the stripping. How have you
setup binfmt_misc?
Back to top
View user's profile Send private message
roarinelk
Guru
Guru


Joined: 04 Mar 2004
Posts: 499

PostPosted: Sat Oct 17, 2015 6:51 pm    Post subject: Reply with quote

How are you setting up the binfmt_misc handler?
Compare the magic and mask you're putting in there with the one of a stripped and unstripped (working) MIPS binary,
there are probably differences in 1 or 2 bits.

readelf -h /bin/true
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00

I use the following for my mipsel environment:

echo ':mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-mipsel:' > /proc/sys/fs/binfmt_misc/register
Back to top
View user's profile Send private message
zivimo2
n00b
n00b


Joined: 15 Oct 2015
Posts: 5

PostPosted: Sat Oct 17, 2015 7:11 pm    Post subject: Reply with quote

hey,

yes they differ!!! great hint !

just showing the differences:
Code:
ubuntu14 ~ # readelf -h hello.stripped
ELF Header:
  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
  ABI Version:                       0
  Start of section headers:          4588 (bytes into file)
  Number of section headers:         29
ubuntu14 ~ # readelf -h hello.unstripped
ELF Header:
  Magic:   7f 45 4c 46 01 02 01 00 01 00 00 00 00 00 00 00
  ABI Version:                       1
  Start of section headers:          4604 (bytes into file)
  Number of section headers:         31


byte 8 differs! have a look at following:

Code:
lenny@ubuntu14:[~]$  update-binfmts --display
qemu-mips (enabled):
     package = qemu
        type = magic
      offset = 0
       magic = \x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08
        mask = \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff
 interpreter = /usr/lib/qemu-binfmt/mips
    detector =


can i just copy that entry with a changed magic? and how do i copy that? i'm using binfmt_misc with the default settings.

PS:
unstripped = not working
stripped = working

EDIT:
i went on messing with the update-binfmts:
Code:
lenny@ubuntu14:[~]$ ls /proc/sys/fs/binfmt_misc
total 0
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 jar
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 qemu-arm
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 qemu-armeb
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 qemu-mips
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 qemu-mipsel
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 qemu-powerpc
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 qemu-sparc
200 --w------- 1 root root 0 Oct 18 10:36 register
644 -rw-r--r-- 1 root root 0 Oct 18 10:36 status
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 python3.4
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 python2.7
lenny@ubuntu14:[~]$ cat /proc/sys/fs/binfmt_misc/qemu-mips
enabled
interpreter /usr/lib/qemu-binfmt/mips
flags:
offset 0
magic 7f454c4601020100000000000000000000020008
mask ffffffffffffff00fffffffffffffffffffeffff
lenny@ubuntu14:[~]$ sudo umount /proc/sys/fs/binfmt_misc/
lenny@ubuntu14:[~]$ sudo update-binfmts --install qemu-mips-unstripped /usr/lib/qemu-binfmt/mips --magic '\x7fELF\x01\x02\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08' --mask '\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' --offset 0 --package qemu
lenny@ubuntu14:[~]$ ls /proc/sys/fs/binfmt_misc
total 0
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 jar
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 qemu-arm
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 qemu-armeb
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 qemu-mips
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 qemu-mipsel
644 -rw-r--r-- 1 root root 0 Oct 18 10:40 qemu-mips-unstripped
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 qemu-powerpc
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 qemu-sparc
200 --w------- 1 root root 0 Oct 18 10:40 register
644 -rw-r--r-- 1 root root 0 Oct 18 10:40 status
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 python3.4
644 -rw-r--r-- 1 root root 0 Oct  8 23:50 python2.7
lenny@ubuntu14:[~]$ cat /proc/sys/fs/binfmt_misc/qemu-mips-unstripped
enabled
interpreter /usr/lib/qemu-binfmt/mips
flags:
offset 0
magic 7f454c4601020100010000000000000000020008
mask ffffffffffffff00fffffffffffffffffffeffff
lenny@ubuntu14:[~]$ sudo schroot -c gentoo-s3
ubuntu14 ~ # cat hello.c
#include <stdio.h>

int main(void)
{
    puts("Hallo Welt!");
}
ubuntu14 ~ # gcc hello.c -o hello
ubuntu14 ~ # ./hello
Hallo Welt!
ubuntu14 ~ # strip hello
ubuntu14 ~ # ./hello
Hallo Welt!


at least the compile problem seems to be solved. will now try to 'emerge --oneshot portage' again...

EDIT2:
works a treat!!! thanks to you all.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum