Error: target architecture does not support `extern "C"` ABI

Hi, I am currently investigating porting rust to a new target (opus3). The target exists in an out of tree LLVM fork. So far so good until this error occurs:
failed: target architecture "opus3" does not support extern "C" ABI

I am on Windows, anybody has an idea what is missing?

Here is the full command and logs: c:\git\sdt_rust>python x.py build --host x86_64-pc-windows-msvc --target opus3-octasic-opuskernel Updating only changed submodules Submodules updated in 0.06 seconds Building rustbuild Finished dev [unoptimized] target(s) in 0.39s Building stage0 std artifacts (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc) Finished release [optimized] target(s) in 0.67s Copying stage0 std from stage0 (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc / x86_64-pc-windows-msvc) Building stage0 compiler artifacts (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc) Finished release [optimized] target(s) in 1.47s Copying stage0 rustc from stage0 (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc / x86_64-pc-windows-msvc) Assembling stage1 compiler (x86_64-pc-windows-msvc) Building stage1 std artifacts (x86_64-pc-windows-msvc -> opus3-octasic-opuskernel) Compiling core v0.0.0 (C:\git\sdt_rust\library\core) Compiling rustc-std-workspace-core v1.99.0 (C:\git\sdt_rust\library\rustc-std-workspace-core) Compiling compiler_builtins v0.1.73 Compiling libc v0.2.126 Compiling alloc v0.0.0 (C:\git\sdt_rust\library\alloc) Compiling cfg-if v0.1.10 Compiling adler v0.2.3 Compiling memchr v2.4.1 Compiling rustc-demangle v0.1.21 Compiling unwind v0.0.0 (C:\git\sdt_rust\library\unwind) error: internal compiler error: compiler\rustc_codegen_llvm\src\context.rs:1004:21: fn_abi_of_instance(memcpy, []) failed: target architecture "opus3" does not support extern "C" ABI --> C:\Users\frpic.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.73\src\macros.rs:296:9 | 61 | / macro_rules! intrinsics { 62 | | () => (); 63 | | 64 | | // Support cfg_attr: ... | 296 | | pub unsafe extern $abi fn $name( $($argname: $ty),* ) $(-> $ret)? { | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... | 424 | | ); 425 | | } | |__- in this expansion of intrinsics! | ::: C:\Users\frpic.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.73\src\mem\mod.rs:22:1 | 22 | / intrinsics! { 23 | | #[mem_builtin] 24 | | #[cfg_attr(not(all(target_os = "windows", target_env = "gnu")), linkage = "weak")] 25 | | pub unsafe extern "C" fn memcpy(dest: *mut u8, src: *const u8, n: usize) -> *mut u8 { ... | 82 | | } 83 | | } | |_- in this macro invocation

I haven't worked on custom targets, but I suspect you're missing an entry in some table that specifies what targets support what ABIs. (I.e. a actual definition of extern "C" for the target.)

Ok probably I need to add a file for my target in rust\compiler\rustc_target\src\abi\call

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.