Hi all,
I'm trying to build Genode for the Linux base platform for ARM without success so far. Despite having the ARM toolchain installed, my builds always are x86_64. Here is what I did after checking out the source tree:
$ cd <genode_dir>/tool $ ./toolchain arm
After prompting for my super user password the toolchain gets installed to /usr/local/genode-gcc. The resulting tools (genode-arm-*) appear to work OK.
$ ./create_builddir linux_arm $ cd ../build/linux_arm $ make run/demo
However, when done an SDL window running the *x86_64* version of the demo pops up.
$ file init/init init/init: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
I'm building a current Genode master branch on Debian 8 / x86_64.
What am I missing?
Cheers, Alex
Hi Alex,
the Linux platforms don't support cross-compiling at this stage, which means that 'linux_arm' only works on an ARM Linux host system.
Regards, Christian
On 18.05.2015 22:10, Alexander Senier wrote:
Hi all,
I'm trying to build Genode for the Linux base platform for ARM without success so far. Despite having the ARM toolchain installed, my builds always are x86_64. Here is what I did after checking out the source tree:
$ cd <genode_dir>/tool $ ./toolchain arm
After prompting for my super user password the toolchain gets installed to /usr/local/genode-gcc. The resulting tools (genode-arm-*) appear to work OK.
$ ./create_builddir linux_arm $ cd ../build/linux_arm $ make run/demo
However, when done an SDL window running the *x86_64* version of the demo pops up.
$ file init/init init/init: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
I'm building a current Genode master branch on Debian 8 / x86_64.
What am I missing?
Cheers, Alex
One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ genode-main mailing list genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
Hi Christian,
that explains the issue. Would be nice if the build system could stop if I ask it to cross-build for linux_arm. (Or even better, to have a cross toolchain ;-)
I don't have a suitable host to build natively right now, but managed to create a "cross" toolchain using qemu-user like this (most of it is taken from [1]):
# apt-get install binfmt-support qemu qemu-user-static debootstrap # mkdir debian_armel_jessie # debootstrap --foreign --arch armel jessie debian_armel_jessie http://ftp.de.debian.org/debian/ # cp /usr/bin/qemu-arm-static debian_armel_jessie/usr/bin # DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C chroot debian_armel_jessie /debootstrap/debootstrap --second-stage # DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C chroot debian_armel_jessie dpkg --configure -a # sudo git clone git://github.com/genodelabs/genode.git debian_armel_jessie/build/genode # LC_ALL=C LANGUAGE=C LANG=C chroot debian_armel_jessie
Inside the chroot:
# apt-get update # apt-get install build-essential autoconf2.64 libncurses-dev texinfo autogen sudo expect # cd /build/genode/tool/ # ./tool_chain arm # ./create_builddir linux_arm
Note, that building the toolchain will take VERY long.
Building from inside the chroot does not yet succeed. Not sure whether this is due to my special setup or whether there's another issue:
# cd ../build/linux_arm # VERBOSE= make core checking library dependencies... Library platform Library cxx COMPILE guard.o /usr/local/genode-gcc/bin/genode-arm-g++ -Wno-psabi -Wno-psabi -ffunction-sections -fno-strict-aliasing -nostdinc -g -O2 -MMD -MP -MT 'guard.o guard.d' -Wall -ffunction-sections -fno-strict-aliasing -nostdinc -g -O2 -MMD -MP -MT 'guard.o guard.d' -Wall -fPIC -std=gnu++11 -Wno-psabi -Wno-psabi -ffunction-sections -fno-strict-aliasing -nostdinc -g -O2 -MMD -MP -MT 'guard.o guard.d' -Wall -ffunction-sections -fno-strict-aliasing -nostdinc -g -O2 -MMD -MP -MT 'guard.o guard.d' -Wall -fPIC -std=gnu++11 -I. -I/build/genode/repos/base-linux/src/platform/arm -I/build/genode/repos/base/src/platform/arm -I/build/genode/repos/base/include/arm -I/build/genode/repos/base/include/32bit -I/build/genode/repos/base/include/arm_v7 -I/build/genode/repos/os/include/arm_v7 -I/build/genode/repos/base/include/arm -I/build/genode/repos/base/include/32bit -I/build/genode/repos/base-linux/include -I/build/genode/repos/base/include -I/build/genode/repos/os/include -I/build/genode/repos/demo/include -I/usr/local/genode-gcc/bin/../lib/gcc/arm-elf-eabi/4.7.4/include -c /build/genode/repos/base/src/base/cxx/guard.cc -o guard.o /tmp/cc4ojSu0.s: Assembler messages: /tmp/cc4ojSu0.s:45: Error: selected processor does not support ARM mode `ldrex ip,[r0]' /tmp/cc4ojSu0.s:48: Error: selected processor does not support ARM mode `strexeq ip,r2,[r0]' /tmp/cc4ojSu0.s:62: Error: selected processor does not support ARM mode `dmb' /build/genode/repos/base/mk/generic.mk:56: recipe for target 'guard.o' failed
Adding -march=armv7-a manually to the above g++ invocation succeed, but I don't see where to set the architecture in the build config.
Cheers, Alex
[1] https://wiki.debian.org/EmDebian/CrossDebootstrap
On 18.05.2015 22:56, Christian Prochaska wrote:
the Linux platforms don't support cross-compiling at this stage, which means that 'linux_arm' only works on an ARM Linux host system.
Hi Alex,
On 05/19/2015 10:26 AM, Alexander Senier wrote:
Adding -march=armv7-a manually to the above g++ invocation succeed, but I don't see where to set the architecture in the build config.
creating a file '/build/linux_arm/etc/tools.conf' with the line
CC_MARCH+=-march=armv7-a
should do it.
Regards, Christian
Hi Christian,
yes, that did the trick. Thanks a lot!
Building Genode programs for linux_arm works now in the qemu-user chroot environment. Even the SDL-based nitpicker demo runs from within that environment. The only disadvantage is that the run scripts fail, as expect has some issues with creating PTYs.
Cheers, Alex
On 19.05.2015 11:33, Christian Prochaska wrote:
creating a file '/build/linux_arm/etc/tools.conf' with the line
CC_MARCH+=-march=armv7-a
should do it.
Hi Alex,
good to hear that you got it to work.
On 05/19/2015 01:41 PM, Alexander Senier wrote:
The only disadvantage is that the run scripts fail, as expect has some issues with creating PTYs.
I remember having some problems with chroot environments and terminals in general when /dev/pts was not bind-mounted in the chroot environment. Could this be the problem here, too?
Regards, Christian
Hi Christian,
On 19.05.2015 14:08, Christian Prochaska wrote:
I remember having some problems with chroot environments and terminals in general when /dev/pts was not bind-mounted in the chroot environment. Could this be the problem here, too?
Yes, this most likely is the Problem. However, bind-mounting (or re-mounting) /dev/pts from the host crashes the qemu-user processes. Nevermind, I can survive without expect for now.
Cheers, Alex