RobertElderSoftware / recc

A collection of compiler, emulator and microkernel tools.
Apache License 2.0
244 stars 14 forks source link

Failed to open file test/struct_unsigned_char_ptr_to_struct_constant_description_ptr_key_value_pair_ptr_binary_search.l2 for read #1

Closed ghost closed 9 years ago

ghost commented 9 years ago
[HOSTCC=gcc]
$ make kernel
...
Failed to open file test/struct_unsigned_char_ptr_to_struct_constant_description_ptr_key_value_pair_ptr_binary_search.l2 for read.
On line 1 in file test/struct_unsigned_char_ptr_to_struct_constant_description_ptr_key_value_pair_ptr_binary_search.l2
recc: linker.c:590: process_assembly: Assertion `0 && "OFFSET not declared.."' failed.
kernel/Makefile:5: recipe for target 'kernel/kernel.l1' failed
make: *** [kernel/kernel.l1] Aborted (core dumped)
RobertElder commented 9 years ago

Ah yes, I was a bit sloppy when I released last. The build process is complicated which I need to work on, but if you do

'make' it should build that dependency that is missing, then it will try to run the unit tests, but unless you've set up the testing API on your machine, it will error out when it starts chrome (but you can ignore that because you got the dependency built that you need).

Then, to build the kernel image without trying to run it in the browser (which requires the API), you can just do

make kernel/kernel.l1

Then you can do

make run-c-emulator

or

make run-java-emulator

or

make run-python-emulator

and it should just work. You can exit the kernel with the 'q' key.

If you get build errors, it might be because you have a different version of gcc or clang, so it is safe to delete all the compiler flags from the root makefile.

I'll fix this dependency error and change around the make file soon.

Leme know if you need help.

ghost commented 9 years ago

Still it isn't working.

I think if you clone the project from github into a new directory, you will be able to replicate the build error.

RobertElder commented 9 years ago

I just tried out doing

git clone https://github.com/RobertElderSoftware/recc.git && make test/filesystem.l1 && make kernel/kernel.l1

and that should work to build the kernel. Then I did

make run-python-emulator

and I can get it to run (it is quite slow at the moment).

make run-c-emulator

will run it a bit faster (but I just noticed that clang complains with some of the strict warning flags). If you delete the clang flags from the makefile it runs without a hitch.

I'll update the makefile to make it more user friendly.

ghost commented 9 years ago

It seems to be a gcc-related problem. With clang, make kernel/kernel.l1 and run-c-emulator works, albeit with slightly reduced CLANG_FLAGS.

RobertElder commented 9 years ago

What kind of problem/error messages to you get?

RobertElder commented 9 years ago

I just pushed an update to make the makefile a bit more clear, fixed a few warnings, and fixed the build for the kernel image. Here were my steps:

Tested on Ubuntu 4 with gcc 3.3.4

Grab and unzip

wget http://recc.robertelder.org/recc.tar.gz && gunzip recc.tar.gz && tar -xvf recc.tar

Old versions of gcc don't understand newer warnings flags

cat Makefile | sed 's/GCC_FLAGS=.*/GCC_FLAGS=/g' > newmake && mv newmake Makefile

Build kernel

make bootstrap-datatypes && make kernel/kernel.l1

Run Kernel

make run-c-emulator

Tested on Ubuntu 14:

gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4

git clone https://github.com/RobertElderSoftware/recc.git && cd recc && make bootstrap-datatypes && make kernel/kernel.l1

make run-c-emulator

I'll consider it resolved for now, but if something is still broken, feel free to re-open an issue.