Hi,
I use base-linux on an arm_v7a target. This works well except for lx_hubrid components (for example linux_nic_drv).
On several places the toolchain, includes and libraries of the host are used (see repos/base-linux/lib/import/import-lx_hybrid.mk).
Do you see a way how I can cross-compile on a Linux x86_64 host for a Linux arm_v7a target?
Thanks, Roman
Hello Roman,
On Wed, Oct 23, 2019 at 14:52:01 CEST, Roman Iten wrote:
I use base-linux on an arm_v7a target. This works well except for lx_hubrid components (for example linux_nic_drv).
On several places the toolchain, includes and libraries of the host are used (see repos/base-linux/lib/import/import-lx_hybrid.mk).
Do you see a way how I can cross-compile on a Linux x86_64 host for a Linux arm_v7a target?
My impulsive reaction to this question is plain: No, I can't imagine this to work!
But, this is just the result of a long rocky path of adaptions that ended in a collection of heuristics in import-lx_hybrid.mk and other places of the build system (and base-linux sources). So theoretically, it may work like [1] hints and from the top of my head needs work at the following places.
- For compilation, our code base depends on genode-arm-gcc being used, but the heuristics in import-lx_hybrid.mk must be adapted to fit the cross-compilation environment (e.g., include paths for headers in HOST_INC_DIR). - Currently we link with 'c++'. This definitely should be your-arm-c++. - The cross-compilation environment must include all needed headers, linker scripts, libraries, and tools for the cross target. - repos/base-linux/src/lib/lx_hybrid (resp. repos/base-linux/lib/mk/lx_hybrid.mk) may need ARM-specific adaptions. - general Linux wizardry including the implications of the following (for Ubuntu)
apt depends gcc-7-arm-linux-gnueabihf
... Suggests: libgcc1-dbg-armhf-cross
apt show libc6-dev-armhf-cross
... Contains the symlinks, headers, and object files needed to compile and link programs which use the standard C library.
[1] https://www.96boards.org/documentation/guides/crosscompile/commandline.html
Unfortunately, I can't help further in this regard.
Greets
Hi Christian
On 23.10.19 16:04, Christian Helmuth wrote:
Do you see a way how I can cross-compile on a Linux x86_64 host for a Linux arm_v7a target?
My impulsive reaction to this question is plain: No, I can't imagine this to work!
Thanks to your hints, compiling and linking turned out to be surprisingly easy! Using the branch [1] I can now build and link using my cross-compilation toolchain (built using crosstool-ng [2]), by pointing CUSTOM_HOST_CC and CUSTOM_HOST_CXX to my toolchain. That the patches break pretty much every other platform I don't care for now...
The problem I care about is that scenarios using hybrid components don't work at runtime. For example run/lx_fs or run/netperf_lwip (uses linux_nic_drv):
``` [10:49:20.418] Warning: blocking canceled in entrypoint constructor ```
Any idea whats wrong?
Thanks, Roman
[1] https://github.com/rite/genode/tree/cross-arm-linux [2] https://crosstool-ng.github.io/
Hi Roman,
great to hear you managed to fit this square peg into a round hole (and broke all other platforms ;-).
On Tue, Oct 29, 2019 at 11:23:36 CET, Roman Iten wrote:
The problem I care about is that scenarios using hybrid components don't work at runtime. For example run/lx_fs or run/netperf_lwip (uses linux_nic_drv):
[10:49:20.418] Warning: blocking canceled in entrypoint constructor
Any idea whats wrong?
Actually, no. The information you provided about what happens could be called scarce at best. The core output about "blocking canceled" you cite happens if the core Linux process happens to receive a POSIX signal, which is in many cases SIGCHLD because any child exited.
I suggest you try to investigate this suspicion using the following hints.
- Analyze the syslog looking for messages about segmentation or protection faults. - Pause execution of linux_nic_drv early on startup by calling magic extern "C" void wait_for_continue(); which waits for input on stdin. - Try to attach a debugger to linux_nic_drv on the target. - Maybe replace linux_nic_drv with a very simple hybrid Hello-World program.
Good luck
Hi
I pushed the commit 26eeb4e to [1]. The square peg now fits the round hole nicely, nothing else broke (we actually use it since a few weeks now). Thanks for your support Christian and Pirmin!
Roman
[1] https://github.com/genodelabs/genode/issues/3466
On 29.10.19 11:41, Christian Helmuth wrote:
Hi Roman,
great to hear you managed to fit this square peg into a round hole (and broke all other platforms ;-).
On Tue, Oct 29, 2019 at 11:23:36 CET, Roman Iten wrote:
The problem I care about is that scenarios using hybrid components don't work at runtime. For example run/lx_fs or run/netperf_lwip (uses linux_nic_drv):
[10:49:20.418] Warning: blocking canceled in entrypoint constructor
Any idea whats wrong?
Actually, no. The information you provided about what happens could be called scarce at best. The core output about "blocking canceled" you cite happens if the core Linux process happens to receive a POSIX signal, which is in many cases SIGCHLD because any child exited.
I suggest you try to investigate this suspicion using the following hints.
- Analyze the syslog looking for messages about segmentation or protection faults.
- Pause execution of linux_nic_drv early on startup by calling magic extern "C" void wait_for_continue(); which waits for input on stdin.
- Try to attach a debugger to linux_nic_drv on the target.
- Maybe replace linux_nic_drv with a very simple hybrid Hello-World program.
Good luck