10

I'm cross-compiling the Dart runtime using the instruction here.

I've installed all the dependencies as specified. I've also cloned the git repository with the necessary tool chain.

I'm running the runtime compilation with this command:

./tools/build.py -m release -a arm --toolchain=../tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf runtime

The compilation starts with no problem then it stops with this error:

  LINK(target) out/ReleaseXARM/libdart_dependency_helper.target
  CXX(host) out/ReleaseXARM/obj.host/libdart_lib_withcore/runtime/vm/bootstrap.o
In file included from /usr/include/sys/socket.h:38:0,
                 from /usr/include/netinet/in.h:23,
                 from /usr/include/arpa/inet.h:22,
                 from runtime/platform/globals.h:56,
                 from runtime/platform/assert.h:16,
                 from runtime/vm/allocation.h:8,
                 from runtime/vm/bootstrap.h:9,
                 from runtime/vm/bootstrap.cc:5:
/usr/include/bits/socket.h:345:24: fatal error: asm/socket.h: No such file or directory
 #include <asm/socket.h>
                        ^
compilation terminated.
  CXX(host) out/ReleaseXARM/obj.host/libdart_lib_withcore/gen/async_gen.o
In file included from /usr/include/sys/socket.h:38:0,
                 from /usr/include/netinet/in.h:23,
                 from /usr/include/arpa/inet.h:22,
                 from runtime/platform/globals.h:56,
                 from runtime/platform/assert.h:16,
                 from runtime/vm/allocation.h:8,
                 from runtime/vm/bootstrap.h:9,
                 from out/ReleaseXARM/obj/gen/async_gen.cc:5:
/usr/include/bits/socket.h:345:24: fatal error: asm/socket.h: No such file or directory
 #include <asm/socket.h>
                        ^
compilation terminated.
runtime/libdart_lib_withcore.host.mk:978: recipe for target 'out/ReleaseXARM/obj.host/libdart_lib_withcore/runtime/vm/bootstrap.o' failed
make: *** [out/ReleaseXARM/obj.host/libdart_lib_withcore/runtime/vm/bootstrap.o] Error 1
make: *** Waiting for unfinished jobs....
runtime/libdart_lib_withcore.host.mk:986: recipe for target 'out/ReleaseXARM/obj.host/libdart_lib_withcore/gen/async_gen.o' failed
make: *** [out/ReleaseXARM/obj.host/libdart_lib_withcore/gen/async_gen.o] Error 1
BUILD FAILED

Am I missing any dependency or package?

Fedy2
  • 3,147
  • 4
  • 26
  • 44
  • Did you tried this? https://lists.debian.org/debian-user/2014/01/msg00111.html – Fox32 Nov 15 '14 at 13:30
  • Yes, but the apt will try to remove other packages: The following packages will be REMOVED: g++-4.9-arm-linux-gnueabihf g++-4.9-multilib-arm-linux-gnueabihf g++-arm-linux-gnueabihf gcc-4.9-arm-linux-gnueabihf gcc-4.9-multilib-arm-linux-gnueabihf gcc-arm-linux-gnueabihf gobjc++-4.9-arm-linux-gnueabihf gobjc++-4.9-multilib-arm-linux-gnueabihf gobjc-4.9-arm-linux-gnueabihf gobjc-4.9-multilib-arm-linux-gnueabihf – Fedy2 Nov 15 '14 at 13:58
  • I wonder if it is a problem that you use gcc 4.9 and not 4.6 as mentioned. Maybe things have changed in between? You can also try to ask on the dart:misc mailing list. – Fox32 Nov 15 '14 at 15:18
  • The dependecies have been installed through the suggested script. I will try to downgrade to 4.6 and also to ask in the mailing list. Thank you. – Fedy2 Nov 15 '14 at 16:22

3 Answers3

8

I hit the same problem. On my ubuntu 14.04 system /usr/include/asm didn't exist. It was called asm-generic instead. I sym-linked it and the build was able to continue.

cd /usr/include
sudo ln -s asm-generic/ asm

The build was able to continue after that.

Sam Corder
  • 5,374
  • 3
  • 25
  • 30
6

This is probably because you're trying to build an application without some of the include paths correctly set, for example using a 32-bit gcc on a 64-bit platform. To resolve:

sudo apt-get install gcc-multilib

2

I'm not sure why this happens, but sometimes /usr/include/asm gets deleted. My teammates who looked at their Ubuntu x86-64 workstations found that the asm symlink was:

0 lrwxrwxrwx 1 root root 20 May 22  2013 /usr/include/asm -> x86_64-linux-gnu/asm

And the command to recreate it is:

$ cd /usr/include
$ sudo ln -s x86_64-linux-gnu/asm asm

The files in /usr/include/asm-generic are sometimes, but not always, equivalent to the files in the x86-64 specific directory; so it's difficult to recommend symlinking it as a workaround.

Will Angley
  • 1,392
  • 7
  • 11