kobolabs / Kobo-Reader

http://www.koboereader.com/
585 stars 126 forks source link

Unable to build glibc #82

Open rickjansen-dev opened 5 years ago

rickjansen-dev commented 5 years ago

I'm trying to setup a build environment using the scripts in build/ directory.

Compiling glibc fails with the following errors:

...
/bin/bash ../libtool  --tag=CC   --mode=compile arm-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I..  -I..  -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION -DPCRE_STATIC -DG_DISABLE_SINGLE_INCLUDES -pthread  -I/home/rick/kobo/libroot/include -I/home/rick/kobo/libroot/usr/include -march=armv7 -march=armv7 -Wall -MT gatomic.lo -MD -MP -MF .deps/gatomic.Tpo -c -o gatomic.lo gatomic.c
/bin/bash ../libtool  --tag=CC   --mode=compile arm-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I..  -I..  -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION -DPCRE_STATIC -DG_DISABLE_SINGLE_INCLUDES -pthread  -I/home/rick/kobo/libroot/include -I/home/rick/kobo/libroot/usr/include -march=armv7 -march=armv7 -Wall -MT gbacktrace.lo -MD -MP -MF .deps/gbacktrace.Tpo -c -o gbacktrace.lo gbacktrace.c
libtool: compile:  arm-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION -DPCRE_STATIC -DG_DISABLE_SINGLE_INCLUDES -pthread -I/home/rick/kobo/libroot/include -I/home/rick/kobo/libroot/usr/include -march=armv7 -march=armv7 -Wall -MT gatomic.lo -MD -MP -MF .deps/gatomic.Tpo -c gatomic.c  -fPIC -DPIC -o .libs/gatomic.o
libtool: compile:  arm-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION -DPCRE_STATIC -DG_DISABLE_SINGLE_INCLUDES -pthread -I/home/rick/kobo/libroot/include -I/home/rick/kobo/libroot/usr/include -march=armv7 -march=armv7 -Wall -MT gbacktrace.lo -MD -MP -MF .deps/gbacktrace.Tpo -c gbacktrace.c  -fPIC -DPIC -o .libs/gbacktrace.o
/tmp/ccMaC2Le.s: Assembler messages:
/tmp/ccMaC2Le.s:37: Error: selected processor does not support Thumb mode `swp r3,r3,[r2]'
Makefile:993: recipe for target 'gatomic.lo' failed
make[4]: *** [gatomic.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
mv -f .deps/gbacktrace.Tpo .deps/gbacktrace.Plo
make[4]: Leaving directory '/home/rick/kobo/Kobo-Reader/build/glib-2.22.0/glib'

I'm using the gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf toolchain that was added yesterday. Also tested with the gcc-linaro-arm-linux-gnueabihf-4.8-2013.04-20130417_linux, same thing happens.

gtalusan commented 5 years ago

Howdy, check out https://github.com/kobolabs/glib. There are some build instructions thrown on top of the README.md. The scripts in the build directory are semi-outdated.

pgaskin commented 5 years ago

Try setting the target cpu with -mcpu=something in the CFLAGS. Also, if you are trying to build a custom application, it is usually easier to link with musl statically instead of glibc.