Open Enet4 opened 1 month ago
OK, so with this teeny change:
diff --git a/src/coff_go32.rs b/src/coff_go32.rs
index d0bd2d4..1aeb7a4 100644
--- a/src/coff_go32.rs
+++ b/src/coff_go32.rs
@@ -32,13 +32,14 @@ pub const R_386_GOTPC: u32 = 10;
///
/// Link them to the real DJGPP functions instead by renaming the symbols, what could possibly go
/// wrong
-const FIX_EXTERN_SYMBOLS_PREFIXES: [(&str, &[u8]); 6] = [
+const FIX_EXTERN_SYMBOLS_PREFIXES: [(&str, &[u8]); 7] = [
("compiler_builtins::mem::memset", b"memset"),
("compiler_builtins::mem::memcmp", b"memcmp"),
("compiler_builtins::mem::bcmp", b"bcmp"),
("compiler_builtins::mem::strlen", b"strlen"),
("compiler_builtins::mem::memcpy", b"memcpy"),
("compiler_builtins::mem::memmove", b"memmove"),
+ ("compiler_builtins::math::", b""),
];
pub fn fix_extern_symbol(name: Cow<[u8]>) -> Cow<[u8]> {
I could build my projects successfully using nightly-2024-04-15
as well as the latest nightly, nightly-2024-07-26
. Please let me know if you want me to send a PR your way. :)
Starting from
nightly-2024-04-15
, there was an update tocompiler_builtins
which changed the way that math functions are linked (https://github.com/rust-lang/compiler-builtins/pull/577). As a consequence, programs combining converted objects fail to build and link with the DJGPP toolchain because it cannot find the various functions incompiler_builtins::math
.I've been looking into this problem here and I'm thinking whether it would be best resolved at
elf2djgpp
directly. Would it make sense to also translate symbols incompiler_builtins::math
using this tool?As it turns out, I could reproduce the same problem with the example project after a few changes: