本文介绍了yapto中的apache2构建失败-"/usr/local/include"对于交叉编译是不安全的[-Wpoison-system-directorys]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在yocto上构建 apache2 .但是我遇到了错误.

I was trying to build apache2 on yocto.But I was getting below errors.

有些谷歌搜索使我转向 https://lists.yoctoproject.org/pipermail/yocto/2012-March/005125.html

Some googling led me tohttps://lists.yoctoproject.org/pipermail/yocto/2012-March/005125.html

所以我查看了 conf.log 并找出了这些行:

So I looked into conf.log and find out those lines:

cc1: warning: include location "/usr/local/include" is unsafe for
cross-compilation [-Wpoison-system-directories]

arm-poky-linux-gnueabi/4.9.2/ld: warning: library search path "/usr/local/lib"
is unsafe for cross-compilation

我再次谷歌搜索,但我还不明白3件事:

I googled again but, I couldn't understand 3 things yet:

  1. 为什么将PATH设置为本地路径?
  2. 为什么只有在构建 apache2 [我可以构建 ngnix cryptsetup 等时,才会出现此错误."
  3. 我该如何解决?
  1. Why has the PATH been set to local path ?
  2. Why does this error only come when building apache2 [ I can build ngnix, cryptsetup, etc..]
  3. How can I fix it?

推荐答案

通常,这些类型的错误来自具有路径的配置脚本(例如/usr/local/include /usr/include 和各种其他变体形式).因此,解决此问题的方法是修补 configure.ac (如果软件包中有一个补丁,当然,如果 configure ,则)删除此路径.

Usually these types of errors come from configure scripts that have paths (like /usr/local/include, /usr/include and all sorts of other variations) hardcoded into them. So the way to fix it is to patch configure.ac (if there is one in the package, of course, configure otherwise) removing this paths.

例如,看看修补程序,它解决了类似的问题:

For example, take a look at patch for pure-ftpd from current meta-oe, it solves similar problem:

--- a/configure.ac
+++ b/configure.ac
@@ -100,18 +100,6 @@ AC_ARG_VAR(PYTHON,local path to the python interpreter)
 python_possible_path="/usr/bin:/usr/local/bin:/bin:/opt/python/bin:/opt/python/usr/bin:/opt/python/usr/local/bin"
 AC_PATH_PROG(PYTHON,python,/usr/bin/env python,$python_possible_path)

-if test -d /usr/local/include; then
-  CPPFLAGS="$CPPFLAGS -I/usr/local/include"
-fi
-
-if test -d /usr/kerberos/include; then
-  CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
-fi
-
-if test -d /usr/local/lib; then
-  LDFLAGS="$LDFLAGS -L/usr/local/lib"
-fi
-
 CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"

 dnl Checks for header files

这篇关于yapto中的apache2构建失败-"/usr/local/include"对于交叉编译是不安全的[-Wpoison-system-directorys]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 14:51