Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为ARM处理器构建systemd失败_Arm_Cross Compiling_Systemd - Fatal编程技术网

为ARM处理器构建systemd失败

为ARM处理器构建systemd失败,arm,cross-compiling,systemd,Arm,Cross Compiling,Systemd,我已经从debian.org下载了debian systemd 232,我正在尝试交叉编译ARM处理器在ARM linux gnueabihf gcc上的代码。我已经为ARM编译了libcap、libkmod和libattr,所有这些库现在都安装在/usr/ARM-linux-gnueabihf/lib目录中。我还使用sudo./autogen.sh和sudo./configure--host=arm-linux-gnueabihf--prefix=/usr/arm-linux-gnueabih

我已经从debian.org下载了debian systemd 232,我正在尝试交叉编译ARM处理器在ARM linux gnueabihf gcc上的代码。我已经为ARM编译了libcap、libkmod和libattr,所有这些库现在都安装在/usr/ARM-linux-gnueabihf/lib目录中。我还使用
sudo./autogen.sh
sudo./configure--host=arm-linux-gnueabihf--prefix=/usr/arm-linux-gnueabihf-PKG\u-CONFIG\u-PATH=/usr/arm-linux-gnueabihf/lib/pkgconfig-ac\u-cv\u-func\u-malloc\u 0\u-nonnull=yes-ac\u-cv\u-func\u-realoc\u-0\u-nonnull=yes>配置了Makefile文件
/autogen.sh
/configure
成功完成,无错误。现在,我正在尝试使用
sudo make
为我的ARM处理器构建未触及的项目(我还没有为自己的目的编辑源文件,所有源代码-除了“missing_syscall.h”文件-都是从中下载的原始代码),但构建终止时出现以下错误:

CC       src/analyze/systemd_analyze-analyze-verify.o
In file included from ./src/basic/util.h:46,
                 from ./src/basic/hashmap.h:29,
                 from ./src/shared/install.h:34,
                 from ./src/shared/path-lookup.h:26,
                 from src/analyze/analyze-verify.h:24,
                 from src/analyze/analyze-verify.c:23:
./src/basic/missing.h:473:17: error: expected identifier before numeric constant
  473 | #define MS_MOVE 8192
正如我追溯到的,
MS_MOVE
“missing.h”
(它是systemd头文件的一部分)和
(它是/usr/arm-linux-gnueabihf/include中gnu头文件的一部分)中都有定义,但是
不包括在任何
分析验证.c
分析验证.h
path lookup.h
install.h
hashmap.h
util.h
missinh.h
文件

我应该提到,我已经修改了
“missing_syscall.h”
头文件,如下所示:

static inline int missing_renameat2(int oldfd, const char *oldname, int newfd, const char *newname, unsigned flags) {
#  ifdef __NR_renameat2
        return syscall(__NR_renameat2, oldfd, oldname, newfd, newname, flags);
#  else
        errno = ENOSYS;
        return -1;
#  endif
}
#define renameat2 missing_renameat2

memfd_create
重命名为
missing_memfd_create
,并使用
\define
将它们链接在一起。对于
缺少_renameat2
重命名eat2
,这种情况也有效

之所以进行这些修改,是因为在执行这些修改之前发出了
sudo make
时,我遇到了以下错误:

error: static declaration of renameat2 follows non-static declaration

我用gcc版本2.27在Ubuntu18.04上构建systemd,但当我在网上搜索
静态声明
问题时,问题的解决方案是将gcc从2.27升级到最高版本。现在我试图在ubuntu 20.04上构建这个项目,但是我的ARM GCC编译器版本是
(ubuntu 9.3.0-17ubuntu1~20.04)9.3.0

我花了好几个小时为ARM处理器构建systemd,还用谷歌搜索了很多关键词来寻找解决方案,但我还没有找到上述问题的任何线索或解决方案。如果有人能帮我解决这个问题,我将不胜感激

提前感谢,


Mohamadreza

您能提供您执行的确切命令吗?linux内核systemd运行的确切版本是什么?是否可以从中获取其源代码?您能否通过指向您下载systemd源代码的位置的链接来补充您的问题?不是很有用,但总是很有趣,你将在你的目标上使用什么样的CPU?
error: static declaration of renameat2 follows non-static declaration
error: static declaration of memfd_create follows non-static declaration