Skip to content

cannot find default-jit.o: No such file or directory when building cross-compiler #407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
darcagn opened this issue Dec 26, 2023 · 2 comments

Comments

@darcagn
Copy link
Contributor

darcagn commented Dec 26, 2023

Hi all,
I'm a Sega Dreamcast developer attempting to deliver Rust support to the platform (Dreamcast uses the SuperH SH4). I've already had some success creating a Rust demo on the Dreamcast using gccrs, but I would really like to get rustc_codegen_gcc working since it's much further along, as I understand it. I'm also a maintainer of the toolchain for our platform so if I can get this working, I'll create a configuration that I can help test over time.

I've tried to build @antoyo's GCC fork both with our own toolchain building scripts and also with crosstool-ng, but I receive the error
ld: cannot find default-jit.o: No such file or directory

I don't receive this error building libgccjit with standard GCC versions.

I can open gcc/jit/default-jit.cc and see that the only code it contains is:
struct gcc_targetjitm targetjitm = TARGETJITM_INITIALIZER;

So as a workaround, I can open gcc/config.gcc and remove default-jit.o from the following section:

if [ "$target_has_targetjitm" = "no" ]; then
  jit_target_objs="$jit_target_objs default-jit.o"
fi

so it no longer complains about the missing default-jit.o, and then find gcc/jit/jit-target.cc and add the following code:

#include "jit-target-def.h"
struct gcc_targetjitm targetjitm = TARGETJITM_INITIALIZER;

and then it successfully compiles and functions (though I haven't managed to get Rust itself compiled with the resulting compiler yet, but I'll attempt to troubleshoot that next).

@darcagn
Copy link
Contributor Author

darcagn commented Dec 26, 2023

I figured out by checking @YakoYakoYokuYoku's AVR issue #406 that the proper fix here is to add the following:

default-jit.o: config/default-jit.cc
	$(COMPILE) $<
	$(POSTCOMPILE)

to gcc/Makefile.in. As he plans on upstreaming that change, I'll close this issue as a duplicate and continue on in my quest. Thanks.

@darcagn darcagn closed this as not planned Won't fix, can't repro, duplicate, stale Dec 26, 2023
@YakoYakoYokuYoku
Copy link

I've sent this to fix your issue, thanks for reporting anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants