randyrossi / bmc64

A bare metal Commodore 64 emulator for the Raspberry Pi with true 50hz/60hz smooth scrolling, low input latency and better audio/video sync.
GNU General Public License v3.0
488 stars 59 forks source link

Problem compiling for rpi2 on bionic #111

Closed podulator closed 4 years ago

podulator commented 4 years ago

Hi there, was looking to build this for thec64 maxi, and have encountered a problem. Attached is my Dockerfile build environment, with details how to build it and run it.

Dockerfile.txt

On container start, these are the main env vars :: PREFIX=arm-none-eabi- CC=arm-none-eabi- JAVA_VERSION=1.11.0 ARM_VERSION=9.2.1 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/gcc-arm-none-eabi-9-2019-q4-major/bin ARM_HOME=/opt/gcc-arm-none-eabi-9-2019-q4-major

./make_all.sh pi2 fails with

In file included from kernel.h:19, from main.cpp:16: viceapp.h:40:10: fatal error: circle_glue.h: No such file or directory 40 | #include <circle_glue.h> | ^~~~~~~~~~~~~~~

the file lives at : docker@eba5bbb9be92:/workspace$ locate circle_glue.h /workspace/third_party/circle-stdlib/include/circle_glue.h

so I tried : export CPATH=/workspace/third_party/circle-stdlib/include/

But this gives me : ` rm -f .o .a .elf .lst .img .hex .cir .map *~ CPP main.o

In file included from /opt/gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi/include/stdio.h:61, from viceapp.h:41, from kernel.h:19, from main.cpp:16:

/opt/gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi/include/sys/types.h:129:18: error: conflicting declaration 'typedef __int_least64_t time_t'

129 | typedef _TIMET time_t; | ^~

In file included from third_party/circle-stdlib/libs/circle/include/circle/logger.h:27, from third_party/circle-stdlib/libs/circle/addon/SDCard/emmc.h:38, from viceapp.h:20, from kernel.h:19, from main.cpp:16:

third_party/circle-stdlib/libs/circle/include/circle/time.h:26:21: note: previous declaration as 'typedef long int time_t' 26 | typedef signed long time_t; | ^~ third_party/circle-stdlib/libs/circle/Rules.mk:132: recipe for target 'main.o' failed`

Also, I noticed this error during ./make_all.sh pi2 ` BUILD CIRCLE-STDLIB /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/gcc-arm-none-eabi-9-2019-q4-major/bin

patching file configure Hunk #1 succeeded at 161 (offset 1 line). patching file include/circle_glue.h File libs/circle is not a regular file -- refusing to patch 1 out of 1 hunk ignored -- saving rejects to file libs/circle.rej File libs/circle-newlib is not a regular file -- refusing to patch 1 out of 1 hunk ignored -- saving rejects to file libs/circle-newlib.rej File libs/mbedtls is not a regular file -- refusing to patch 1 out of 1 hunk ignored -- saving rejects to file libs/mbedtls.rej RASPBERRYPI=2 TOOLPREFIX=arm-none-eabi- CIRCLE_BUILD=1 FLOAT_ABI=hard NEWLIB_BUILD=1 RASPBERRYPI=2 STDLIB_SUPPORT=3 NEWLIB_INSTALL_DIR=/workspace/third_party/circle-stdlib/install NEWLIB_BUILD_DIR=/workspace/third_party/circle-stdlib/build/circle-newlib DEBUG=0

Remaining arguments:

Error: Invalid toolchain prefix, exiting TOOLPREFIX is "arm-none-eabi-"

Makefile:3: Config.mk: No such file or directory make: *** No rule to make target 'Config.mk'. Stop. `

but it looks to be correct : $ arm-none-eabi- arm-none-eabi-addr2line arm-none-eabi-cpp arm-none-eabi-gcc-ar arm-none-eabi-gcov-tool arm-none-eabi-gprof arm-none-eabi-objdump arm-none-eabi-strip arm-none-eabi-ar arm-none-eabi-elfedit arm-none-eabi-gcc-nm arm-none-eabi-gdb arm-none-eabi-ld arm-none-eabi-ranlib arm-none-eabi-as arm-none-eabi-g++ arm-none-eabi-gcc-ranlib arm-none-eabi-gdb-add-index arm-none-eabi-ld.bfd arm-none-eabi-readelf arm-none-eabi-c++ arm-none-eabi-gcc arm-none-eabi-gcov arm-none-eabi-gdb-add-index-py arm-none-eabi-nm arm-none-eabi-size arm-none-eabi-c++filt arm-none-eabi-gcc-9.2.1 arm-none-eabi-gcov-dump arm-none-eabi-gdb-py arm-none-eabi-objcopy arm-none-eabi-strings

Any thoughts? And thanks for making this!!! M

randyrossi commented 4 years ago

First, I would either try gcc-arm-none-eabi-7-2018-q2-update or gcc-arm-8.3-2019.03-x86_64-arm-eabi compilers. I've never tried gcc-arm-none-eabi-9-2019-q4-major and it's not the compiler circle recommends. It sounds like circle actually didn't configure properly. The make rules in circle are supposed to define STDDEF_INCPATH but it looks like that's not happening.

On Thu, Feb 20, 2020 at 5:03 AM mat rowlands notifications@github.com wrote:

Hi there, was looking to build this for thec64 maxi, and have encountered a problem. Attached is my Dockerfile build environment, with details how to build it and run it.

Dockerfile.txt https://github.com/randyrossi/bmc64/files/4229956/Dockerfile.txt

On container start, these are the main env vars :: PREFIX=arm-none-eabi- CC=arm-none-eabi- JAVA_VERSION=1.11.0 ARM_VERSION=9.2.1 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/gcc-arm-none-eabi-9-2019-q4-major/bin ARM_HOME=/opt/gcc-arm-none-eabi-9-2019-q4-major

./make_all.sh pi2 fails with

In file included from kernel.h:19, from main.cpp:16: viceapp.h:40:10: fatal error: circle_glue.h: No such file or directory 40 | #include

| ^~~~~~~~~~~~~~~ the file lives at : docker@eba5bbb9be92:/workspace$ locate circle_glue.h /workspace/third_party/circle-stdlib/include/circle_glue.h so I tried : export CPATH=/workspace/third_party/circle-stdlib/include/ But this gives me : ` rm -f *.o *.a *.elf *.lst *.img *.hex *.cir *.map *~ CPP main.o In file included from /opt/gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi/include/stdio.h:61, from viceapp.h:41, from kernel.h:19, from main.cpp:16: /opt/gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi/include/sys/types.h:129:18: error: conflicting declaration 'typedef __int_least64_t time_t' 129 | typedef *TIME_T* time_t; | ^~~~~~ In file included from third_party/circle-stdlib/libs/circle/include/circle/logger.h:27, from third_party/circle-stdlib/libs/circle/addon/SDCard/emmc.h:38, from viceapp.h:20, from kernel.h:19, from main.cpp:16: third_party/circle-stdlib/libs/circle/include/circle/time.h:26:21: note: previous declaration as 'typedef long int time_t' 26 | typedef signed long time_t; | ^~~~~~ third_party/circle-stdlib/libs/circle/Rules.mk:132: recipe for target 'main.o' failed` Also, I noticed this error during ./make_all.sh pi2 ` BUILD CIRCLE-STDLIB /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/gcc-arm-none-eabi-9-2019-q4-major/bin patching file configure Hunk #1 succeeded at 161 (offset 1 line). patching file include/circle_glue.h File libs/circle is not a regular file -- refusing to patch 1 out of 1 hunk ignored -- saving rejects to file libs/circle.rej File libs/circle-newlib is not a regular file -- refusing to patch 1 out of 1 hunk ignored -- saving rejects to file libs/circle-newlib.rej File libs/mbedtls is not a regular file -- refusing to patch 1 out of 1 hunk ignored -- saving rejects to file libs/mbedtls.rej RASPBERRYPI=2 TOOLPREFIX=arm-none-eabi- CIRCLE_BUILD=1 FLOAT_ABI=hard NEWLIB_BUILD=1 RASPBERRYPI=2 STDLIB_SUPPORT=3 NEWLIB_INSTALL_DIR=/workspace/third_party/circle-stdlib/install NEWLIB_BUILD_DIR=/workspace/third_party/circle-stdlib/build/circle-newlib DEBUG=0 Remaining arguments: Error: Invalid toolchain prefix, exiting TOOLPREFIX is "arm-none-eabi-" Makefile:3: Config.mk: No such file or directory make: *** No rule to make target 'Config.mk'. Stop. ` but it looks to be correct : $ arm-none-eabi- arm-none-eabi-addr2line arm-none-eabi-cpp arm-none-eabi-gcc-ar arm-none-eabi-gcov-tool arm-none-eabi-gprof arm-none-eabi-objdump arm-none-eabi-strip arm-none-eabi-ar arm-none-eabi-elfedit arm-none-eabi-gcc-nm arm-none-eabi-gdb arm-none-eabi-ld arm-none-eabi-ranlib arm-none-eabi-as arm-none-eabi-g++ arm-none-eabi-gcc-ranlib arm-none-eabi-gdb-add-index arm-none-eabi-ld.bfd arm-none-eabi-readelf arm-none-eabi-c++ arm-none-eabi-gcc arm-none-eabi-gcov arm-none-eabi-gdb-add-index-py arm-none-eabi-nm arm-none-eabi-size arm-none-eabi-c++filt arm-none-eabi-gcc-9.2.1 arm-none-eabi-gcov-dump arm-none-eabi-gdb-py arm-none-eabi-objcopy arm-none-eabi-strings Any thoughts? And thanks for making this!!! M — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or unsubscribe .

-- Randy Rossi

C:(+1)416-605-5112 (Canada)

Jammmmm commented 4 years ago

I've run this through Docker and have found that, for some reason, circle-stdlib dies on the ./configure step.

Specifically it's at:

: ${CC:="$TOOLPREFIX"gcc}

Before and after that line in your install, CC is "arm-none-eabi-". It's meant to be "arm-none-eabi-gcc" after that line. It all looks fine so I have no idea why it's not working.

What you could do after grabbing the bmc64 repository is run sed to comment out that line and set the CC variable yourself with "export CC=arm-none-eabi-gcc". That should work, but I haven't tested to make sure.


EDIT:

I've just noticed in your Dockerfile you're setting "ENV CC=arm-none-eabi-". That's probably the issue. Try removing that line and running again. Or run "unset CC" before starting the build process.

podulator commented 4 years ago

Hi Jammmmm, thanks for pointing that out, it's moved me further along, i now have kernel7.img.[machine] :) Will test them tomorrow! Latest dockerfile attached in case anyone wants it. Dockerfile.txt

Jammmmm commented 4 years ago

Glad you got it working, podulator!