jarrocha / XinuBBB

Source and guide to run Xinu on the BeagleBone Black
Other
44 stars 10 forks source link

Unable to build XinuBB #4

Closed codernavi18 closed 2 years ago

codernavi18 commented 2 years ago

The make throws the following error :

user@workstation:/tmp/XinuBBB/compile$ make
Rebuilding the .defs file
../cross_compiler/bin/arm-none-eabi-gcc -mcpu=cortex-a8 -mno-unaligned-access -marm -fno-builtin -fno-stack-protector -nostdlib -c -Wall -O -DBSDURG -DVERSION=\""`cat version`"\" -I../include -o binaries/start.o ../system/start.S
/bin/sh: 1: ../cross_compiler/bin/arm-none-eabi-gcc: not found
make: *** [.defs:258: binaries/start.o] Error 127
user@workstation:/tmp/XinuBBB/compile$ ls -la ../cross_compiler/bin/arm-none-eabi-gcc
-rwxrwxr-x 1 user user 676048 Dec 30 12:35 ../cross_compiler/bin/arm-none-eabi-gcc

I could finish the build by editing the makefile easily, but we may want to address these minor errors.

jarrocha commented 2 years ago

Strange, I tried to reproduce the error but couldn't. I moved the directory to the same location and it still worked. What modification did you do to fix this? Just curious to know what could have caused this.

rfrankla commented 2 years ago

Hi, I just got the same error. And I did a little digging.... $ file ../cross_compiler/bin/arm-none-eabi-gcc ../cross_compiler/bin/arm-none-eabi-gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.16, stripped $ uname -mo x86_64 GNU/Linux Err... my OS is a 64-bit Linux Mint

jarrocha commented 2 years ago

@rfrankla @codernavi18 What steps did you do? Here are the commands I did from my ~/Downloads directory at: /home/jaime/Downloads

  1. git clone git@github.com:jarrocha/XinuBBB.git
  2. cd XinuBBB/compile
  3. make
codernavi18 commented 2 years ago

@jarrocha Yeah the problem is that we are including a cross_compiler that expects a 32-bit host and hence it fails on 64-bit host. Either we should explicitly mention it or add support for 64-bit host as development environment. Majority of users use 64-bit machines these days, so maybe we can make 64-bit host as default, and add corresponding cross_compiler? Or maybe we can remove it all together from the source code and add steps for developers to get their own toolchain downloaded from ARM/Linaro.

naveen@workstation:/tmp/XinuBBB/cross_compiler/arm-none-eabi/bin$ file gcc
gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.16, stripped
naveen@workstation:/tmp/XinuBBB/cross_compiler/arm-none-eabi/bin$ uname -a
Linux workstation 5.11.0-40-generic #44~20.04.2-Ubuntu SMP Tue Oct 26 18:07:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
jarrocha commented 2 years ago

So, yes after a bit of research this is the issue that can arise if your 64-bit system does not have the necessary libraries to run 32-bit applications. For apt based Linux systems (Debian, Ubuntu, Mint) you can do:

sudo dpkg --add-architecture i386
sudo apt-get update

This will install the required libraries. But if you are running in a system without privileges then you will have problems. I'll see about adding updated compilers to the repo.

@rfrankla , were your able to fix this issue on your side? Let me know. Here's an article with more details: https://www.unixmen.com/enable-32-bit-support-64-bit-ubuntu-13-10-greater/

I'll add this issue as a milestone.

santalvarez commented 1 year ago

In my Ubuntu 22.04 I also had to do sudo apt-get install libc6-i386 to get it to work.