简体   繁体   English

asm / socket.h:没有这样的文件或目录交叉编译Dart for Raspberry pi

[英]asm/socket.h: No such file or directory cross compiling Dart for Raspberry pi

I'm cross-compiling the Dart runtime using the instruction here . 我正在使用这里的指令交叉编译Dart运行时。

I've installed all the dependencies as specified. 我已按指定安装了所有依赖项。 I've also cloned the git repository with the necessary tool chain. 我还用必要的工具链克隆了git存储库。

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? 我错过了任何依赖或包裹吗?

I hit the same problem. 我遇到了同样的问题。 On my ubuntu 14.04 system /usr/include/asm didn't exist. 在我的ubuntu 14.04系统/ usr / include / asm上不存在。 It was called asm-generic instead. 它被称为asm-generic。 I sym-linked it and the build was able to continue. 我sym链接它,构建能够继续。

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

The build was able to continue after that. 之后构建能够继续。

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. 这可能是因为您尝试在没有正确设置某些包含路径的情况下构建应用程序,例如在64位平台上使用32位gcc。 To resolve: 解决:

sudo apt-get install gcc-multilib sudo apt-get install gcc-multilib

I'm not sure why this happens, but sometimes /usr/include/asm gets deleted. 我不确定为什么会这样,但有时/usr/include/asm会被删除。 My teammates who looked at their Ubuntu x86-64 workstations found that the asm symlink was: 我的队友看了他们的Ubuntu x86-64工作站,发现asm符号链接是:

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; /usr/include/asm-generic中的文件有时(但不总是)等同于x86-64特定目录中的文件; so it's difficult to recommend symlinking it as a workaround. 所以很难推荐将其作为一种解决方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM