rust-lang/rustc_codegen_gcc

Remove the builtin import code

antoyo opened this issue · 2 comments

The builtin import code is a hack and it's starting to be an issue.
With the more recent compiler_builtins which implements the math builtin functions in Rust, we can get conflicts between the GCC imported builtins and the Rust builtins:

libgccjit.so: error: : gcc_jit_function_new_block: cannot add block to an imported function
thread 'rustc' panicked at /home/user/.cargo/git/checkouts/gccjit.rs-13c2e290f2fb9e4d/f1545d7/src/function.rs:183:17:
gcc_jit_function_new_block: cannot add block to an imported function (cos)

if it's not being used anywhere else in the code, it shouldn't be a problem

Well, it's used in the sense that it's how we are able to return the Function object for builtin functions when requested elsewhere.
But having to list them all is not a good solution: I'd prefer something that would fetch the builtin only when requested.
Feel free to ask for more info in that's not clear.