crops / poky-container

A container image that is able to run bitbake/poky. It has helpers to create users and groups within the container. This is so that the output generated in the container will be readable by the user on the host.
GNU General Public License v2.0
206 stars 94 forks source link

m4 Configure fails with "C compiler cannot create executables" #22

Closed et1975 closed 6 years ago

et1975 commented 6 years ago

Just trying the default (latest) container for the first time and bitbake fails with:

DEBUG: Executing shell function autotools_preconfigure DEBUG: Shell function autotools_preconfigure finished DEBUG: Executing python function autotools_aclocals DEBUG: SITE files ['endian-little', 'common-linux', 'common-glibc', 'bit-64', 'x86_64-linux', 'common'] DEBUG: Python function autotools_aclocals finished DEBUG: Executing shell function do_configure NOTE: Running ../m4-1.4.18/configure --build=x86_64-linux --host=x86_64-linux --target=x86_64-linux --prefix=/workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr --exec_prefix=/workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr --bindir=/workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr/bin --sbindir=/workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr/sbin --libexecdir=/workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr/libexec --datadir=/workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr/share --sysconfdir=/workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/etc --sharedstatedir=/workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/com --localstatedir=/workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/var --libdir=/workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr/lib --includedir=/workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr/include --oldincludedir=/workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr/include --infodir=/workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr/share/info --mandir=/workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr/share/man --disable-silent-rules --disable-dependency-tracking --without-libsigsegv-prefix --disable-static
configure: WARNING: unrecognized options: --disable-static checking for a BSD-compatible install... /workdir/build/tmp/hosttools/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /workdir/build/tmp/hosttools/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 x86_64-linux-gcc... gcc checking whether the C compiler works... no configure: error: in /workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/build': configure: error: C compiler cannot create executables Seeconfig.log' for more details NOTE: The following config.log files may provide further information. NOTE: /workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/build/config.log ERROR: configure failed WARNING: exit code 1 from a shell command. ERROR: Function failed: do_configure (log file is located at /workdir/build/tmp/work/x86_64-linux/m4-native/1.4.18-r0/temp/log.do_configure.475)

Am I missing something?

et1975 commented 6 years ago

Further experimentation: given hello.c

#include <stdio.h>

int main() {
    printf("hello\n");
    return 0;
}

and trying to compile it with gcc hello.c, I get:

as: error while loading shared libraries: /usr/lib/x86_64-linux-gnu/libbfd-2.26.1-system.so: invalid ELF header

and looking at the lib: od /usr/lib/x86_64-linux-gnu/libbfd-2.26.1-system.so | more, the first few lines are

0000000 000000 000000 000000 000000 000000 000000 000000 000000 * 1670000 000000 040400 040526 046521 140611 104511 044310 150611 1670020 151061 024750 176247 044377 142203 102460 072300 044501

What am I seeing?

rewitt1 commented 6 years ago

I just tried compiling your sample program using

docker run -it --rm crops/poky

It compiles and runs fine. I'm not sure what's going on in your system, perhaps the image got corrupted somehow? You could try deleting the crops/poky image and downloading it again.

Without more information, and considering I can't reproduce the problem, I'm going to close this for now.