Skip to content
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

linking issues on arm32 Linux #3529

Closed
jasonKercher opened this issue May 3, 2024 · 0 comments · Fixed by #3570
Closed

linking issues on arm32 Linux #3529

jasonKercher opened this issue May 3, 2024 · 0 comments · Fixed by #3570

Comments

@jasonKercher
Copy link
Contributor

Context

Trying to build odin in arm32 Debian container...

  • Operating System & Odin Version:
Odin:    dev-2024-05:9b55cb58
OS:      Debian GNU/Linux trixie/sid, Linux 6.5.3-1-MANJARO
CPU:     ARM
RAM:     1 MiB
Backend: LLVM 14.0.6

Expected Behavior

Demo builds and runs.

Current Behavior

compiler builds, demo compiles, but fails to link.

I lie. The compiler fails to build because gb_rdtsc is undefined. So...

diff --git a/src/gb/gb.h b/src/gb/gb.h
index 93d250f2..fe82d5ac 100644
--- a/src/gb/gb.h
+++ b/src/gb/gb.h
@@ -6172,7 +6172,8 @@ gb_no_inline isize gb_snprintf_va(char *text, isize max_len, char const *fmt, va
                return virtual_timer_value;
        }
 #else
-#error "gb_rdtsc not supported"
+#warning "gb_rdtsc not supported"
+       gb_inline u64 gb_rdtsc(void) { return 0; }
 #endif

 #if defined(GB_SYSTEM_WINDOWS)

Blam... compiler builds. (gb_rdtsc isn't used anywhere).

Failure Information (for bugs)

+ set +x
/usr/bin/arm-linux-gnueabihf-ld: /home/odinist/vol/Odin/demo.o: relocations in generic ELF (EM: 3)
/usr/bin/arm-linux-gnueabihf-ld: /home/odinist/vol/Odin/demo.o: relocations in generic ELF (EM: 3)
/usr/bin/arm-linux-gnueabihf-ld: /home/odinist/vol/Odin/demo.o: relocations in generic ELF (EM: 3)
/usr/bin/arm-linux-gnueabihf-ld: /home/odinist/vol/Odin/demo.o: relocations in generic ELF (EM: 3)
/usr/bin/arm-linux-gnueabihf-ld: /home/odinist/vol/Odin/demo.o: error adding symbols: file in wrong format
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:10: debug] Error 1
failed to build odin
failed to container exec ./run.sh --arch=arm _compile 14

This is where I'm stuck.

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

Successfully merging a pull request may close this issue.

1 participant