Fixes for cross compilation #194

Manually merged
abonerib merged 3 commits from fix/crossRV64 into master 2025-10-09 15:55:53 +02:00
Collaborator
No description provided.
abonerib added 3 commits 2025-10-08 15:00:24 +02:00
Even if we do an override to papi get the proper configure flags for
cross-compiling, the memory fences are not defined for risc-v:

mb.h:67:2: error: #error Need to define rmb for this architecture!
Fix nanos6 cross-compilation for riscv
All checks were successful
CI / build:all (pull_request) Successful in 16s
c5563ab111
abonerib requested review from rarias 2025-10-08 15:00:25 +02:00
rarias force-pushed fix/crossRV64 from c5563ab111 to cc7f674f38 2025-10-09 11:52:26 +02:00 Compare
rarias reviewed 2025-10-09 12:15:57 +02:00
@ -36,2 +40,4 @@
CPPFLAGS=-I${libtirpc.dev}/include/tirpc
LDFLAGS=-ltirpc
CC=${stdenv.cc.targetPrefix}cc
AR=${stdenv.cc.targetPrefix}ar
Owner

Maybe just CC=$CC and AR=$AR ?

Maybe just `CC=$CC` and `AR=$AR` ?
abonerib marked this conversation as resolved
@ -0,0 +7,4 @@
CC=`../scripts/compiler`
MAKE=`../scripts/make`
-AR=ar
+AR?=ar
Owner

Do we need this patch? When passing variables via make arguments, they should take precedence over =.

https://www.gnu.org/software/make/manual/html_node/Overriding.html

Do we need this patch? When passing variables via make arguments, they should take precedence over `=`. https://www.gnu.org/software/make/manual/html_node/Overriding.html
abonerib marked this conversation as resolved
@ -75,2 +79,3 @@
(optional enableJemalloc "--with-jemalloc=${jemallocNanos6}") ++
(optional enableGlibcxxDebug "CXXFLAGS=-D_GLIBCXX_DEBUG");
(optional enableGlibcxxDebug "CXXFLAGS=-D_GLIBCXX_DEBUG") ++
(optional isCross "--with-symbol-resolution=ifunc");
Owner

We may want to add a comment on why we explicitly chose ifunc over indirect. I forgot why we usually want ifunc.

We may want to add a comment on why we explicitly chose ifunc over indirect. I forgot why we usually want ifunc.
Author
Collaborator

I am not sure either, nanos6 uses ifunc as the default and indirect the fallback: 57f0d9e5b0

I am not sure either, nanos6 uses `ifunc` as the default and indirect the fallback: https://gitlab.pm.bsc.es/nanos6/nanos6/-/commit/57f0d9e5b06c8969d8f4a1148704571903cf8b4c
abonerib marked this conversation as resolved
abonerib force-pushed fix/crossRV64 from cc7f674f38 to 58a9a09c31 2025-10-09 12:44:41 +02:00 Compare
abonerib force-pushed fix/crossRV64 from 58a9a09c31 to 6c7bb0c3cd 2025-10-09 12:59:20 +02:00 Compare
rarias approved these changes 2025-10-09 15:46:20 +02:00
rarias force-pushed fix/crossRV64 from 6c7bb0c3cd to 67726c1d44 2025-10-09 15:49:27 +02:00 Compare
abonerib manually merged commit 67726c1d44 into master 2025-10-09 15:55:53 +02:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rarias/jungle#194
No description provided.