kubilus1 / gendev

Genesis development environment for Linux.
BSD 3-Clause "New" or "Revised" License
209 stars 23 forks source link

Fails to build on aarch64 #51

Closed dleslie closed 3 years ago

dleslie commented 3 years ago

This will effect Raspberry Pi, Pinebook, and Apple M1 users.

I attempted both make and docker build -t gendev . and receive the same result.

Results in:

checking build system type... ../newlib-1.19.0/config.guess: unable to guess system type

This script, last modified 2010-04-03, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

If the version you run (../newlib-1.19.0/config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.

config.guess timestamp = 2010-04-03

uname -m = aarch64
uname -r = 5.7.19-1-MANJARO-ARM
uname -s = Linux
uname -v = #1 SMP Wed Sep 2 20:43:09 +03 2020

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

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

UNAME_MACHINE = aarch64
UNAME_RELEASE = 5.7.19-1-MANJARO-ARM
UNAME_SYSTEM  = Linux
UNAME_VERSION = #1 SMP Wed Sep 2 20:43:09 +03 2020
configure: error: cannot guess build type; you must specify one
Makefile:51: recipe for target '/work/toolchain/../toolchain/work/build-newlib' failed

I attempted to replace all of the config.guess and config.sub files with the newest versions from GNU and it gets a bit farther, but results in:

libraries/unix/os_utilities.cpp:61:10: fatal error: sys/sysctl.h: No such file or directory
   61 | #include <sys/sysctl.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:18: libraries/unix/os_utilities.o] Error 1
make[2]: Leaving directory '/data/Workspace/other/gendev/tools/work/zasm/zasm-3.0.21-i386-ubuntu-linux-2011-06-19/source'
make[1]: *** [Makefile:105: /data/Workspace/other/gendev/tools/../build/bin/zasm] Error 2
make[1]: Leaving directory '/data/Workspace/other/gendev/tools'
gustavolinux commented 3 years ago

I'm having the same issue here as @dleslie

kubilus1 commented 3 years ago

It might be worth trying a newer gcc and matching binutils version, see if that works. Unfortunately, I have no easy way to directly build an arm and I don't see any arm runners on circleci.

I've been looking a bit into using an aarch64 cross compiled gcc to see if I could just create a package for arm, this should be possible, but isn't super quick and easy.

But yeah, you ought to be able to build this toolchain on ARM, but very likely need to update things to get that setup.

dleslie commented 3 years ago

@gustavolinux @kubilus1 I went through the effort of fixing up Marsdev and getting its Dockerfile into an operational state; with binfmt and qemu-static it's been completely usable on aarch64.

https://github.com/andwn/marsdev

dleslie commented 3 years ago

Probably worth doing the same with gendev - package it all up in a dockerfile and run it over qemu.

kubilus1 commented 3 years ago

Yeah, a qemu build may be what I end up going with. This is a problem for a lot of projects, that CICD tools like Circle haven't quite caught up to.

kubilus1 commented 3 years ago

I've updated GCC and deps, this should build on arm64 now.