Rockbox Technical Forums

Rockbox General => Rockbox General Discussion => Topic started by: psxpetey on December 29, 2021, 10:44:10 AM

Title: how to compile ibugger on linux?
Post by: psxpetey on December 29, 2021, 10:44:10 AM
So i'm getting an issue, when I try to make anything in https://github.com/jeanthom/ibugger/blob/master/flasher/Makefile I get: no can do sir no such thing as arm-elf-as. So I setup the environment from rockbox using rockboxdev.sh arm-none-eabi binutils up to wazoo. So I try changing the path at the top of the make and changing arm-elf to arm-none like so:
LIBGCC = /cygdrive/c/programme/gnuarm/lib/gcc/arm-elf/4.1.1/libgcc.a

CROSS  ?= arm-elf-
AS      = $(CROSS)as
CC      = $(CROSS)gcc
LD      = $(CROSS)ld
NM      = $(CROSS)nm
OBJCOPY = $(CROSS)objcopy
CFLAGS += -Os -W -Wall -ffreestanding -fomit-frame-pointer
LDFLAGS+= -T$(LS) $(LIBGCC)
>>>
LIBGCC = /usr/lib/gcc-cross/arm-linux-gnueabi

CROSS  ?= arm-non-
EABI      = $(CROSS)eabi
CC      = $(CROSS)gcc
LD      = $(CROSS)ld
NM      = $(CROSS)nm
OBJCOPY = $(CROSS)objcopy
CFLAGS += -Os -W -Wall -ffreestanding -fomit-frame-pointer
LDFLAGS+= -T$(LS) $(LIBGCC)

but no luck. AS if definitely in my path. Anyway using ubuntu what am I doing wrong here.
Title: Re: how to compile ibugger on linux?
Post by: psxpetey on December 29, 2021, 04:45:07 PM
welp so far ive gotten arm-elf-as but now ive got a linker error lsx appears multiple times error one lol progress haha:P
Title: Re: how to compile ibugger on linux?
Post by: bluebrother on December 31, 2021, 05:12:55 AM
What compiler are you using? Works fine for me with the Rockbox compiler. Using the arm toolchain (not arm-linux), with (in my case) compiler installed in ~/local, so its executable files are in ~/local/bin, and I don't modify PATH system-wide but only for the make call:

Code: [Select]
PATH=~/local/bin/:$PATH CROSS=arm-elf-eabi- make
(no idea if the resulting binary does anything useful, can't test -- I only did compile things.)
Title: Re: how to compile ibugger on linux?
Post by: psxpetey on January 01, 2022, 11:07:45 PM
arm -none -eabi I got a recipe for arm-elf and was able to get most of it, I cant do rockboxdev.sh for some reason the certs always fail when downloading on ubuntu or lubuntu on mint it passed but something else broke so I guess i'm stuck with source compiling if I want it what is the deal there?

checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for perl... perl
checking for pdflatex... no
checking for pod2html... pod2html
checking for stdint types... stdint.h (shortcircuit)
make use of stdint.h in include/isl/stdint.h (assuming C99 compatible system)
checking which gmp to use... system
checking gmp.h usability... no
checking gmp.h presence... no
checking for gmp.h... no
configure: error: gmp.h header not found
make[1]: *** [Makefile:5771: configure-isl] Error 1
make[1]: Leaving directory '/tmp/rbdev-build/build-binutils'
make: *** [Makefile:847: all] Error 2
root@m-VirtualBox:/home/m/Desktop/rockbox source/rockbox/tools# gmp
bash: gmp: command not found
root@m-VirtualBox:/home/m/Desktop/rockbox source/rockbox/tools# gmp.h
bash: gmp.h: command not found
root@m-VirtualBox:/home/m/Desktop/rockbox source/rockbox/tools#
Title: Re: how to compile ibugger on linux?
Post by: 7o9 on January 02, 2022, 08:09:44 AM
libgmp-dev - Multiprecision arithmetic library developers tools
Title: Re: how to compile ibugger on linux?
Post by: psxpetey on January 02, 2022, 10:48:03 AM
it compiled for so long I thought it was broken haha but ya I got libgmp3 and it worked
Title: Re: how to compile ibugger on linux?
Post by: psxpetey on January 02, 2022, 11:09:11 AM
What compiler are you using? Works fine for me with the Rockbox compiler. Using the arm toolchain (not arm-linux), with (in my case) compiler installed in ~/local, so its executable files are in ~/local/bin, and I don't modify PATH system-wide but only for the make call:

Code: [Select]
PATH=~/local/bin/:$PATH CROSS=arm-elf-eabi- make
(no idea if the resulting binary does anything useful, can't test -- I only did compile things.)

my libgcc.a: LIBGCC=/usr/local/lib/gcc/arm-elf-eabi/4.9.4/libgcc.a

make[1]: Entering directory '/home/m/Desktop/ibug/ibugger/flasher'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/m/Desktop/ibug/ibugger/flasher'
make -C ibugger
make[1]: Entering directory '/home/m/Desktop/ibug/ibugger/ibugger'
make -C nano2g/core
make[2]: Entering directory '/home/m/Desktop/ibug/ibugger/ibugger/nano2g/core'
arm-elf-eabi-gcc -Os -W -Wall -pedantic -ffreestanding -fomit-frame-pointer -Wa,-alhn=strlen.lst -c strlen.c -o strlen.o
strlen.c:1:20: fatal error: string.h: No such file or directory


 #include <string.h>
                    ^
compilation terminated.
make[2]: *** [Makefile:31: strlen.o] Error 1
make[2]: Leaving directory '/home/m/Desktop/ibug/ibugger/ibugger/nano2g/core'
make[1]: *** [Makefile:2: all] Error 2
make[1]: Leaving directory '/home/m/Desktop/ibug/ibugger/ibugger'
make: *** [Makefile:3: all] Error 2
root@m-VirtualBox:/home/m/Desktop/ibug/ibugger#


Title: Re: how to compile ibugger on linux?
Post by: amachronic on January 02, 2022, 03:32:22 PM
string.h isn't available in freestanding C. Maybe some versions of GCC provide it as an extension but generally you'd need your own implementation of it.

EDIT: I just noticed that repo was updated a couple days ago. Maybe he saw this thread - the fixes seem to be for the problems you're hitting.