Compiling gentoo-bionic on a x86_64 Linux machine

As you know, Bionic is the C library used by Google to run Android applications. There are attempts to compile it on Linux machines, so it can be easily used outside of Android. This is code from a recent effort, originally called Gentoo-bionic. The original project was based on Gentoo, but the current source is not specific to Gentoo. I am using Ubuntu. Here is the code:

https://github.com/gentoobionic/bionic

And this will be a presentation about it at ELC2013:

I tried to compile it on X86_64 Ubuntu, but could not. I tried:

./autogen.sh ./configure 

I got:

 configure: error: unsupported host cpu x86_64 

So I tried:

 ./configure --build=arm-linux --target=arm-linux --host=arm-linux 

It is configured fine, but I got:

 $ make make: *** No rule to make target `libc/arch-x86/include/machine/cpu-features.h', needed by `all-am'. Stop. 

Is there any chance that someone could suggest a workaround?

+5
source share
2 answers

Since November 2015, my set of ebuid scripts compiles bionic for x86_64 and i386 on my Gentoo x86_64 desktop. Tools needed: GCC glibc targeting version 4.9.3 or 5.3.0; binutils 2.4.25 or later, glabc-targeting clang 3.5.0, make.

If you can install these tools on your desktop, you can compile bionic.

Note, however, that my ebuilds apply zillion patches.

To find out what they are doing, you can:

  • Download the Live Gentoo DVD to your x86_64 desktop or laptop.
  • Install my scripts.
  • Run their output output, for example

    USE = verbose ebuild bionic / bionic-5.1.1-r29.ebuild clean install qmerge 2> & 1 | tee / tmp / bionic.cout

As soon as such a command completes, you get a corrected source tree, the result of intermediate and final compilation, and a complete build log with the gcc / clang / ld / ar commands.

+2
source

I don't know anything about bionics. I just want to help you. when I looked at the configuration file, I saw this code.

Makefile.h.am:Line 135

 if TARGET_ARCH_IS_X86 includemachine_HEADERS += \ $(addprefix $(top_srcdir)/libc/arch-x86/include/, \ machine/fpu_control.h \ machine/sigcontext.h \ machine/wordsize.h \ ) endif if TARGET_ARCH_IS_ARM includemachine_HEADERS += \ $(addprefix $(top_srcdir)/libc/arch-x86/include/, \ machine/cpu-features.h \ ) endif 

configure.ac: line 94

 case $host_cpu in *i?86*) TARGET_ARCH=x86 COMMON_LDFLAGS="${COMMON_LDFLAGS} ${COMMON_LDFLAGS_X86}" COMMON_CFLAGS="${COMMON_CFLAGS} ${COMMON_CFLAGS_X86}" COMMON_INCLUDES="${COMMON_INCLUDES} ${COMMON_INCLUDES_X86}" COMMON_LDLIBS="${COMMON_LDLIBS} ${COMMON_LDLIBS_X86}" ;; *arm*) TARGET_ARCH=arm COMMON_LDFLAGS="${COMMON_LDFLAGS} ${COMMON_LDFLAGS_ARM}" COMMON_CFLAGS="${COMMON_CFLAGS} ${COMMON_CFLAGS_ARM}" COMMON_INCLUDES="${COMMON_INCLUDES} ${COMMON_INCLUDES_ARM}" COMMON_LDLIBS="${COMMON_LDLIBS} ${COMMON_LDLIBS_ARM}" ;; *) AC_MSG_ERROR([unsupported host cpu $host_cpu]) ;; esac 

The cpu-features.h file is missing from the include / machine file. Therefore, you must use a different purpose.

+3
source

Source: https://habr.com/ru/post/1246144/


All Articles