Applying patch to a package's nativesdk in Yocto - linux

Since there exists a known bug (faulty -isystem flag usage in CFLAGS, https://github.com/voidlinux/void-packages/issues/5254) in qtbase, I would like to patch qtbase package in a new Yocto layer (I'm using "morty" release for every layer).
To do this, I have created a .bbappend file to qtbase_git and qtbase-native_git (namely qtbase_git.bbappend and qtbase-native_git.bbappend) Both of these files have the following content:
FILESEXTRAPATHS_prepend := "${THISDIR}/qtbase:"
SRC_URI += " file://gccbaseISystem.patch "
Patch in the new layer (qtbase/gccbaseISystem.patch) is taken from another repo:
From 81fc64f7f3a8b0554fd8d1b96b113bc04b5f0b5c Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem#gmail.com>
Date: Wed, 14 Feb 2018 17:08:43 -0800
Subject: [PATCH] mkspecs/common/gcc-base.conf: Use -I instead of -isystem
-isystem fails to build when code uses include_next on certain files e.g.
qtbase/5.10.0+gitAUTOINC+50117d738a-r0/recipe-sysroot/usr/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:11592: .obj/qgenericpluginfactory.o] Error 1
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem#gmail.com>
---
mkspecs/common/gcc-base.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf
index 234f71d..ee3da02 100644
--- a/mkspecs/common/gcc-base.conf
+++ b/mkspecs/common/gcc-base.conf
## -46,7 +46,7 ## QMAKE_CFLAGS_DEBUG += -g
QMAKE_CFLAGS_SHLIB += -fPIC
QMAKE_CFLAGS_STATIC_LIB += -fPIC
QMAKE_CFLAGS_APP += -fPIC
-QMAKE_CFLAGS_ISYSTEM = -isystem
+QMAKE_CFLAGS_ISYSTEM = -I
QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses
QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden
QMAKE_CFLAGS_EXCEPTIONS_OFF += -fno-exceptions
What is expected from this patch is to modify QMAKE_CFLAGS_ISYSTEM = -isystem to be QMAKE_CFLAGS_ISYSTEM = -I in mkspecs/common/gcc-base.conf.
The patch applied to :
~/poky/build/tmp/work/arm1176jzfshf-vfp-embeddev-linux-gnueabi/qtbase/5.7.1+gitAUTOINC+a55f36211e-r0/sysroot-destdir/usr/lib/qt5/mkspecs/common/gcc-base.conf
~/poky/build/tmp/work/x86_64-linux/qtbase-native/5.7.1+gitAUTOINC+a55f36211e-r0/sysroot-destdir/home/mozcelikors/poky/build/tmp/sysroots/x86_64-linux/usr/lib/qt5/mkspecs/common/gcc-base.conf
The patch did not apply to where it is needed (in the SDK):
~/poky/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-qtbase/5.7.1+gitAUTOINC+a55f36211e-r0/git/mkspecs/common/gcc-base.conf
I have of course confirmed that it didn't apply by checking the SDK installation.
I would appreciate any guidance towards what this means (how some files are patched and some files aren't) and how do I make my patch appear in the nativesdk is greately appreciated.
Best regards

Related

GLIBC install failed, programs are missing or too old

I had tried to install glibc-2.15 with non-root, after googling and trying two days, I am looking help here.
After configure, it output following error:
../glibc-2.15/configure --prefix=${PWD/objDir/destDir}
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
configure: running configure fragment for add-on libidn
configure: running configure fragment for add-on nptl
checking for assembler gnu_indirect_function symbol type support... yes
checking whether .text pseudo-op must be used... yes
checking for assembler global-symbol directive... .globl
checking for assembler .type directive prefix... #
checking sysdep dirs... sysdeps/x86_64/elf nptl/sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/wordsize-64 nptl/sysdeps/unix/sysv/linux nptl/sysdeps/pthread sysdeps/pthread sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet nptl/sysdeps/unix/sysv sysdeps/unix/sysv sysdeps/unix/x86_64 nptl/sysdeps/unix sysdeps/unix sysdeps/posix sysdeps/x86_64/fpu/multiarch sysdeps/x86_64/fpu sysdeps/x86_64/multiarch nptl/sysdeps/x86_64 sysdeps/x86_64 sysdeps/wordsize-64 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64/wordsize-64 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as is GNU as... yes
checking whether /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld is GNU ld... yes
checking for /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as... /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as
checking version of /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as... 2.25.1, ok
checking for /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld... /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld
checking version of /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld... 2.25.1, ok
checking for pwd... /bin/pwd
checking for gcc... gcc
checking version of gcc... 4.9.3, ok
checking for gnumake... no
checking for gmake... gmake
checking version of gmake... 4.2.1, bad
checking for gnumsgfmt... no
checking for gmsgfmt... gmsgfmt
checking version of gmsgfmt... 0.18.3, ok
checking for makeinfo... makeinfo
checking version of makeinfo... 4.13, ok
checking for sed... sed
checking version of sed... 4.2.1, ok
checking for readelf... readelf
checking for autoconf... autoconf
checking whether autoconf works... yes
configure: error:
*** These critical programs are missing or too old: make
*** Check the INSTALL file for required versions.
and in configure.log:
cat config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by GNU C Library configure (see version.h), which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ../glibc-2.15/configure --prefix=/home/zhongxm/glibc/destDir
## --------- ##
## Platform. ##
## --------- ##
hostname = mercury
uname -m = x86_64
uname -r = 3.0.6-gentoo
uname -s = Linux
uname -v = #1 SMP Sun Dec 11 16:24:12 CST 2011
/usr/bin/uname -p = Intel(R) Xeon(R) CPU E7450 # 2.40GHz
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /home/zhongxm/bin
PATH: /home/zhongxm/local/bin
PATH: /home/zhongxm/bin/x86_64
PATH: /home/zhongxm/bin/scripts
PATH: /home/zhongxm/tool/jdk/bin
PATH: /home/zhongxm/tool/bedtools/bin
PATH: /home/zhongxm/tool/annovar
PATH: /home/zhongxm/tool/ngsShoRT
PATH: /home/zhongxm/tool/qualimap
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /opt/bin
PATH: /usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3
PATH: /opt/svn/bin
PATH: /usr/local/meme/bin
PATH: /data/tool/hisat
PATH: /rd1/user/zh2yyongxm/bin
PATH: /rd1/user/zhongxm/script/
PATH: /rd1/user/zhangsj/bin
PATH: /rd1/user/data/bin/x86_64/
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2367: checking build system type
configure:2381: result: x86_64-unknown-linux-gnu
configure:2401: checking host system type
configure:2414: result: x86_64-unknown-linux-gnu
configure:2483: checking for gcc
configure:2499: found /usr/bin/gcc
configure:2510: result: gcc
configure:2739: checking for C compiler version
configure:2748: gcc --version >&5
gcc (Gentoo 4.9.3 p1.4, pie-0.6.4) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2759: $? = 0
configure:2748: gcc -v >&5
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.3/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.9.3/work/gcc-4.9.3/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.9.3 p1.4, pie-0.6.4' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --enable-lto --without-cloog --enable-libsanitizer
Thread model: posix
gcc version 4.9.3 (Gentoo 4.9.3 p1.4, pie-0.6.4)
configure:2759: $? = 0
configure:2748: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2759: $? = 1
configure:2748: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:2759: $? = 1
configure:2764: checking for suffix of object files
configure:2786: gcc -c conftest.c >&5
configure:2790: $? = 0
configure:2811: result: o
configure:2815: checking whether we are using the GNU C compiler
configure:2834: gcc -c conftest.c >&5
configure:2834: $? = 0
configure:2843: result: yes
configure:2852: checking whether gcc accepts -g
configure:2872: gcc -c -g conftest.c >&5
configure:2872: $? = 0
configure:2913: result: yes
configure:2930: checking for gcc option to accept ISO C89
configure:2994: gcc -c -g -O2 conftest.c >&5
configure:2994: $? = 0
configure:3007: result: none needed
configure:3077: checking how to run the C preprocessor
configure:3108: gcc -E conftest.c
configure:3108: $? = 0
configure:3122: gcc -E conftest.c
conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory
#include <ac_nonexistent.h>
^
compilation terminated.
configure:3122: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "http://sourceware.org/bugzilla/"
| #define PACKAGE_URL "http://www.gnu.org/software/glibc/"
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:3147: result: gcc -E
configure:3167: gcc -E conftest.c
configure:3167: $? = 0
configure:3181: gcc -E conftest.c
conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory
#include <ac_nonexistent.h>
^
compilation terminated.
configure:3181: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "http://sourceware.org/bugzilla/"
| #define PACKAGE_URL "http://www.gnu.org/software/glibc/"
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:3268: checking for g++
configure:3284: found /usr/bin/g++
configure:3295: result: g++
configure:3322: checking for C++ compiler version
configure:3331: g++ --version >&5
g++ (Gentoo 4.9.3 p1.4, pie-0.6.4) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:3342: $? = 0
configure:3331: g++ -v >&5
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3/g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.3/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.9.3/work/gcc-4.9.3/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.9.3 p1.4, pie-0.6.4' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --enable-lto --without-cloog --enable-libsanitizer
Thread model: posix
gcc version 4.9.3 (Gentoo 4.9.3 p1.4, pie-0.6.4)
configure:3342: $? = 0
configure:3331: g++ -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:3342: $? = 1
configure:3331: g++ -qversion >&5
g++: error: unrecognized command line option '-qversion'
g++: fatal error: no input files
compilation terminated.
configure:3342: $? = 1
configure:3346: checking whether we are using the GNU C++ compiler
configure:3365: g++ -c conftest.cpp >&5
configure:3365: $? = 0
configure:3374: result: yes
configure:3383: checking whether g++ accepts -g
configure:3403: g++ -c -g conftest.cpp >&5
configure:3403: $? = 0
configure:3444: result: yes
configure:3949: running configure fragment for add-on libidn
configure:3949: running configure fragment for add-on nptl
configure:4091: checking for assembler gnu_indirect_function symbol type support
configure:4107: result: yes
configure:4110: checking whether .text pseudo-op must be used
configure:4120: gcc -c conftest.s 1>&5
configure:4123: $? = 0
configure:4134: result: yes
configure:4138: checking for assembler global-symbol directive
configure:4151: gcc -c conftest.s 1>&5
configure:4154: $? = 0
configure:4162: result: .globl
configure:4173: checking for assembler .type directive prefix
configure:4189: gcc -c conftest.s 1>&5
configure:4192: $? = 0
configure:4200: result: #
configure:4223: checking sysdep dirs
configure:4468: result: sysdeps/generic/elf sysdeps/generic
configure:4545: checking for a BSD-compatible install
configure:4613: result: /usr/bin/install -c
configure:4628: checking whether ln -s works
configure:4632: result: yes
configure:4656: checking whether /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as is GNU as
configure:4670: result: yes
configure:4675: checking whether /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld is GNU ld
configure:4689: result: yes
configure:4699: checking for /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as
configure:4726: result: /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as
configure:4741: checking version of /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as
configure:4751: result: 2.25.1, ok
configure:4762: checking for /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld
configure:4789: result: /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld
configure:4804: checking version of /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld
configure:4814: result: 2.25.1, ok
configure:4829: checking for pwd
configure:4847: found /bin/pwd
configure:4860: result: /bin/pwd
configure:4878: checking for gcc
configure:4905: result: gcc
configure:4920: checking version of gcc
configure:4930: result: 4.9.3, ok
configure:4941: checking for gnumake
configure:4971: result: no
configure:4941: checking for gmake
configure:4957: found /usr/bin/gmake
configure:4968: result: gmake
configure:4983: checking version of gmake
configure:4993: result: 4.2.1, bad
configure:5005: checking for gnumsgfmt
configure:5035: result: no
configure:5005: checking for gmsgfmt
configure:5021: found /usr/bin/gmsgfmt
configure:5032: result: gmsgfmt
configure:5047: checking version of gmsgfmt
configure:5057: result: 0.18.3, ok
configure:5068: checking for makeinfo
configure:5084: found /usr/bin/makeinfo
configure:5095: result: makeinfo
configure:5110: checking version of makeinfo
configure:5120: result: 4.13, ok
configure:5131: checking for sed
configure:5147: found /bin/sed
configure:5158: result: sed
configure:5173: checking version of sed
configure:5183: result: 4.2.1, ok
configure:5234: checking for readelf
configure:5250: found /usr/bin/readelf
configure:5261: result: readelf
configure:5288: checking for autoconf
configure:5304: found /usr/bin/autoconf
configure:5315: result: autoconf
configure:5330: checking whether autoconf works
configure:5341: result: yes
configure:5350: error:
*** These critical programs are missing or too old: make
*** Check the INSTALL file for required versions.
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-unknown-linux-gnu
ac_cv_objext=o
ac_cv_path_PWD_P=/bin/pwd
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AS=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as
ac_cv_prog_AUTOCONF=autoconf
ac_cv_prog_CC=gcc
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_LD=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld
ac_cv_prog_MAKE=gmake
ac_cv_prog_MAKEINFO=makeinfo
ac_cv_prog_MSGFMT=gmsgfmt
ac_cv_prog_SED=sed
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_ac_ct_READELF=readelf
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes
ac_cv_prog_cxx_g=yes
libc_cv_asm_global_directive=.globl
libc_cv_asm_gnu_indirect_function=yes
libc_cv_asm_type_prefix=#
libc_cv_autoconf_works=yes
libc_cv_dot_text=.text
libc_cv_nss_crypt=no
libc_cv_prog_as_gnu=yes
libc_cv_prog_ld_gnu=yes
## ----------------- ##
## Output variables. ##
## ----------------- ##
AR='/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ar'
AS='/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as'
ASFLAGS_config=''
AUTOCONF='autoconf'
AWK=''
BASH_SHELL=''
BISON=''
BUILD_CC=''
CC='gcc'
CFLAGS='-g -O2'
CPP='gcc -E'
CPPFLAGS=''
CXX='g++'
CXXFLAGS='-g -O2'
CXX_SYSINCLUDES=''
DEFINES=''
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
GREP=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_INFO=''
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
KSH=''
LD='/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld'
LDFLAGS=''
LIBGD=''
LIBOBJS=''
LIBS=''
LN_S='ln -s'
LTLIBOBJS=''
MAKE='gmake'
MAKEINFO='makeinfo'
MIG=''
MSGFMT='gmsgfmt'
OBJCOPY='/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/objcopy'
OBJDUMP='/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/objdump'
OBJEXT='o'
PACKAGE_BUGREPORT='http://sourceware.org/bugzilla/'
PACKAGE_NAME='GNU C Library'
PACKAGE_STRING='GNU C Library (see version.h)'
PACKAGE_TARNAME='glibc'
PACKAGE_URL='http://www.gnu.org/software/glibc/'
PACKAGE_VERSION='(see version.h)'
PATH_SEPARATOR=':'
PERL=''
PWD_P='/bin/pwd'
READELF='readelf'
RELEASE=''
SED='sed'
SHELL='/bin/sh'
SYSINCLUDES=''
VERSION=''
VERSIONING=''
ac_ct_CC='gcc'
ac_ct_CXX='g++'
add_on_subdirs=' libidn'
add_ons='libidn nptl'
all_warnings=''
base_machine='x86_64'
bindir='${exec_prefix}/bin'
bindnow='no'
bounded='no'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
cross_compiling='no'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
elf='yes'
enable_check_abi='no'
exceptions=''
exec_prefix='NONE'
fno_unit_at_a_time=''
force_install='yes'
gnu89_inline=''
have_libaudit=''
have_libcap=''
have_selinux=''
host='x86_64-unknown-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
ldd_rewrite_script=''
libc_cv_Bgroup=''
libc_cv_as_i686=''
libc_cv_as_needed=''
libc_cv_cc_avx=''
libc_cv_cc_fma4=''
libc_cv_cc_novzeroupper=''
libc_cv_cc_sse4=''
libc_cv_cc_submachine=''
libc_cv_cc_with_libunwind=''
libc_cv_cpp_asm_debuginfo=''
libc_cv_forced_unwind=''
libc_cv_fpie=''
libc_cv_gcc_static_libgcc=''
libc_cv_gcc_unwind_find_fde=''
libc_cv_hashstyle=''
libc_cv_have_bash2=''
libc_cv_have_initfini=''
libc_cv_have_ksh=''
libc_cv_libgcc_s_suffix=''
libc_cv_localedir=''
libc_cv_nss_crypt='no'
libc_cv_output_format=''
libc_cv_pic_default=''
libc_cv_rootsbindir=''
libc_cv_slibdir=''
libc_cv_ssp=''
libc_cv_sysconfdir=''
libc_cv_z_combreloc=''
libc_cv_z_execstack=''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mach_interface_list=''
mandir='${datarootdir}/man'
multi_arch='default'
nopic_initfini=''
old_glibc_headers=''
oldest_abi='default'
oldincludedir='/usr/include'
omitfp='no'
pdfdir='${docdir}'
prefix='/home/zhongxm/glibc/destDir'
profile='no'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
shared='default'
sharedstatedir='${prefix}/com'
sizeof_long_double=''
static='yes'
static_nss='no'
subdirs=' '
submachine=''
sysconfdir='${prefix}/etc'
sysdeps_add_ons=' nptl'
sysnames=' sysdeps/x86_64/elf nptl/sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/wordsize-64 nptl/sysdeps/unix/sysv/linux nptl/sysdeps/pthread sysdeps/pthread sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet nptl/sysdeps/unix/sysv sysdeps/unix/sysv sysdeps/unix/x86_64 nptl/sysdeps/unix sysdeps/unix sysdeps/posix sysdeps/x86_64/fpu/multiarch sysdeps/x86_64/fpu sysdeps/x86_64/multiarch nptl/sysdeps/x86_64 sysdeps/x86_64 sysdeps/wordsize-64 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64/wordsize-64 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic'
target_alias=''
use_default_link='default'
use_ldconfig=''
with_fp='yes'
xcoff='no'
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME "GNU C Library"
#define PACKAGE_TARNAME "glibc"
#define PACKAGE_VERSION "(see version.h)"
#define PACKAGE_STRING "GNU C Library (see version.h)"
#define PACKAGE_BUGREPORT "http://sourceware.org/bugzilla/"
#define PACKAGE_URL "http://www.gnu.org/software/glibc/"
#define HAVE_LIBIDN 1
#define ASM_GLOBAL_DIRECTIVE .globl
#define ASM_TYPE_DIRECTIVE_PREFIX #
#define USE_MULTIARCH 1
configure: exit 1
I had checked that programs mentioned in INSTALL is newer than it needed. Considering my software may too new, I had install make-3.79 which is mentioned in INSTALL, gcc texinfo, but they didn't solved my problem. I hardly know what to do? Is any other way can I install GLIBC without root privileges.
The related information of my machine:
uname -a
Linux mercury 3.0.6-gentoo #1 SMP Sun Dec 11 16:24:12 CST 2011 x86_64 Intel(R) Xeon(R) CPU E7450 # 2.40GHz GenuineIntel GNU/Linux
gcc --version
gcc (Gentoo 4.9.3 p1.4, pie-0.6.4) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
make --version
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
texi2pdf --version
texi2dvi (GNU Texinfo 4.13) 1.135
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Any suggestion would be grateful!
Best wishes!
Edit:
Mrak Plotnick, thanks for your reply very much!
According to your suggestion, it output new error as follow, could you give me another advice?
../glibc-2.15/configure --prefix=${PWD/objDir/destDir} --disable-multilib
........
In file included from <command-line>:0:0:
../misc/syslog.c: In function '__vsyslog_chk':
../misc/syslog.c:123:30: error: inlining failed in call to always_inline 'syslog': function not inlinable
ldbl_strong_alias (__syslog, syslog)
^
./../include/libc-symbols.h:102:26: note: in definition of macro '_strong_alias'
extern __typeof (name) aliasname __attribute__ ((alias (#name)));
^
../sysdeps/generic/math_ldbl_opt.h:12:44: note: in expansion of macro 'strong_alias'
#define ldbl_strong_alias(name, aliasname) strong_alias (name, aliasname)
^
../misc/syslog.c:123:1: note: in expansion of macro 'ldbl_strong_alias'
ldbl_strong_alias (__syslog, syslog)
^
In file included from ../sysdeps/unix/sysv/linux/syslog.c:10:0:
../misc/syslog.c:155:3: error: called from here
syslog(INTERNALLOG,
^
make[2]: *** [/home/zhongxm/glibc/v2/objDir/sysd-rules:1311: /home/zhongxm/glibc/v2/objDir/misc/syslog.os] Error 1
make[2]: Leaving directory '/home/zhongxm/glibc/v2/glibc-2.15/misc'
make[1]: *** [Makefile:220: misc/subdir_lib] Error 2
make[1]: Leaving directory '/home/zhongxm/glibc/v2/glibc-2.15'
make: *** [Makefile:7: all] Error 2
Also, I had tried to installed latest gcc (which install latest gmp, mpfr and mpc first) and glibc, but when I add the path of lib in glib to LD_LIBRARY_PATH, it output "Segmentation fault", any other suggestions?
Any suggestion would be grateful! Best wishes!

OpenSSH 7.3p1 building: configure only finds an old version of OpenSSL libraries

I'm trying to build OpenSSH 7.3p1 in a Linux box which has got installed an old OpenSSL version.
First of all I have successfully compiled OpenSSL 1.0.2h and installed in /opt/openssh-1.0.2h, not in /usr where resides the old OpenSSL version.
tar xzf openssl-1.0.2h.tar.gz
cd openssl-1.0.2h
./config --prefix=/opt/openssl-1.0.2h shared
make depend
make
make test
make install
Then I proceed with OpenSSH:
tar xzf openssh-7.3p1.tar.gz
cd openssh-7.3p1
./configure --prefix=/opt/openssh-7.3p1 --with-openssl=/opt/openssl-1.0.2h
But the configure scripts fails with the following error message:
checking OpenSSL header version... 0090802f (OpenSSL 0.9.8e-rhel5 01 Jul 2008)
checking OpenSSL library version... configure: error: OpenSSL >= 0.9.8f required (have "0090802f (OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008)")
The same message is displayed if I use --with-ssl-dir=/opt/openssl-1.0.2h/ssl
The tool findssl.sh (found in the subdirectory contrib) can find properly all OpenSSL versions. And its notes inside (comments) suggest to use CFLAGS to point out the desired library -- I quote:
# Now run findssl.sh. This should identify the headers and libraries
# present and their versions. You should be able to identify the
# libraries and headers used and adjust your CFLAGS or remove incorrect
# versions. The output will show OpenSSL's internal version identifier
# and should look something like:
Then I tried
./configure CFLAGS="-I/opt/openssl-1.0.2h/include" --prefix=/opt/openssh-7.3p1 --with-openssl=/opt/openssl-1.0.2h
This appears to work because it finds the new OpenSSL header version:
checking OpenSSL header version... 1000208f (OpenSSL 1.0.2h 3 May 2016)
checking OpenSSL library version... configure: error: OpenSSL >= 0.9.8f required (have "0090802f (OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008)")
Next step would be to supply additional options to locate the library files. But if I add LDFLAGS='-L/opt/openssl-1.0.2h/lib' or --with-ldflags='-L/opt/openssl-1.0.2h/lib', this is what I get:
checking OpenSSL header version... not found
configure: error: OpenSSL version header not found.
In summary, I do not know how to make configure use the new OpenSSL libraries.
update 1: if --with-ldflags='-L/opt/openssl-1.0.2h/ssl' is used instead of ···openssl-1.0.2h/lib then header version check works properly (see a few lines above), library version check still fails though.
update 2: I traced the problem and found it is related to shared libraries. From the config.log file I got the source code files conftest.c and confdef.h and the options used to build the runnable conftest:
#include "confdefs.h"
#include <stdio.h>
#include <string.h>
#include <openssl/opensslv.h>
#include <openssl/crypto.h>
#define DATA "conftest.ssllibver"
int
main ()
{
FILE *fd;
int rc;
fd = fopen(DATA,"w");
if (fd == NULL)
exit(1);
if ((rc = fprintf(fd, "%08lx (%s)\n", (unsigned long)SSLeay(),
SSLeay_version(SSLEAY_VERSION))) < 0)
exit(1);
exit(0);
}
This program stores the OpenSSL version as text in the file conftest.ssllibver. For debugging purposes I turned fprint(fd, into print( to print the data into the terminal.
The command line used to build the conftest program is:
# gcc -o conftest -I/opt/openssl-1.0.2h/include -Wall \
-Wpointer-arith -Wsign-compare -Wformat-security -Wno-pointer-sign \
-fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv -fno-builtin-memset \
-fstack-protector-all -std=gnu99 -fPIE -Wl,-z,relro -Wl,-z,now \
-Wl,-z,noexecstack -fstack-protector-all -pie conftest.c \
-lcrypto -lrt -ldl -lutil -lz
# ldd conftest |grep libcrypto
libcrypto.so.6 => /lib64/libcrypto.so.6 (0x00002b5fc6c3e000)
Uses the old OpenSSL library.
When -L/opt/openssl-1.0.2h/lib is added as an argument, conftest cannot run because the dynamic loader (ld.so) cannot find libcrypto.so.1.0.0:
# ./conftest
./conftest: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory
# ldd conftest | grep libcrypto
libcrypto.so.1.0.0 => not found
But when I make the LD_LIBRARY_PATH environment variable point to /opt/openssl-1.0.2h/lib, the dynamic loader finds the library file libcrypto.so.1.0.0 and thus the executable conftest works properly -- it uses the new OpenSSL library:
# export LD_LIBRARY_PATH=/opt/openssl-1.0.2h/lib
# ./conftest
1000208f (OpenSSL 1.0.2h 3 May 2016)
# ldd conftest
libcrypto.so.1.0.0 => /opt/openssl-1.0.2h/lib/libcrypto.so.1.0.0 (0x00002b450bf97000)
Export the LD_LIBRARY_PATH environment variable, which must hold the directory where new OpenSSL library files are, and run the configure script:
# export LD_LIBRARY_PATH=/opt/openssl-1.0.2h/lib
# ./configure CFLAGS="-I/opt/openssl-1.0.2h/include" \
--prefix=/opt/openssh-7.3p1 \
--with-ldflags="-L/opt/openssl-1.0.2h/lib"
Both commands can also be joined in just one:
# LD_LIBRARY_PATH=/opt/openssl-1.0.2h/lib ./configure \
CFLAGS="-I/opt/openssl-1.0.2h/include" \
--prefix=/opt/openssh-7.3p1 \
--with-ldflags="-L/opt/openssl-1.0.2h/lib"
And this is the outcome:
OpenSSH has been configured with the following options:
User binaries: /opt/openssh-7.3p1/bin
System binaries: /opt/openssh-7.3p1/sbin
Configuration files: /opt/openssh-7.3p1/etc
Askpass program: /opt/openssh-7.3p1/libexec/ssh-askpass
Manual pages: /opt/openssh-7.3p1/share/man/manX
PID file: /var/run
Privilege separation chroot path: /var/empty
sshd default user PATH: /usr/bin:/bin:/usr/sbin:/sbin:/opt/openssh-7.3p1/bin
Manpage format: doc
PAM support: no
OSF SIA support: no
KerberosV support: no
SELinux support: no
Smartcard support:
S/KEY support: no
MD5 password support: no
libedit support: no
Solaris process contract support: no
Solaris project support: no
Solaris privilege support: no
IP address in $DISPLAY hack: no
Translate v4 in v6 hack: yes
BSD Auth support: no
Random number source: OpenSSL internal ONLY
Privsep sandbox style: rlimit
Host: x86_64-unknown-linux-gnu
Compiler: gcc
Compiler flags: -I/opt/openssl-1.0.2h/include -Wall -Wpointer-arith -Wsign-compare \
-Wformat-security -Wno-pointer-sign -fno-strict-aliasing \
-D_FORTIFY_SOURCE=2 -ftrapv -fno-builtin-memset -fstack-protector-all \
-std=gnu99 -fPIE
Preprocessor flags:
Linker flags: -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -fstack-protector-all \
-L/opt/openssl-1.0.2h/lib -pie
Libraries: -lcrypto -lrt -ldl -lutil -lz -lcrypt -lresolv
It is highly recommended to use the LD_LIBRARY_PATH in the next steps make and make install; otherwise the make install will fail because the ssh-keygen command is run to generate the new host keys and it will not find the new OpenSSH library files:
mkdir /opt/openssh-7.3p1/etc
./ssh-keygen: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory
make: *** [host-key] Error 127
Maybe you should use the --with-ssl-dir option for openssh's configure script:
$ ./configure --help | grep with-ssl-dir
--with-ssl-dir=PATH Specify path to OpenSSL installation
The --with-openssl option is just a boolean flag that enables or disables the openssl dependency.
In addition to the solution provided by #Jdamain, I needed to recompile openssl setting both --prefix and --openssldir to the same directory.

Why is CMake apparently referring to host system files while cross-compiling a Net-SNMP agent despite a proper toolchain file is being used?

I am developing a Net-SNMP subagent whose final target will be an ARM board, so I'm using CMake to make it easier to manage building the native and cross-compiled versions. I started testing it on my host platform (x86_64) and it builds and works fine with this CMakeLists.txt file:
cmake_minimum_required (VERSION 2.6)
project (snmp_agent C)
set(snmp_agent_VERSION_MAJOR 1)
set(snmp_agent_VERSION_MINOR 0)
# Defines path to the net-snmp-config script
set(NETSNMPCONFIG "${CMAKE_FIND_ROOT_PATH}/usr/bin/net-snmp-config")
# Gets compiling flags and libs linked to Net-SNMP
execute_process(COMMAND "${NETSNMPCONFIG}" "--base-cflags" OUTPUT_VARIABLE NETSNMPCFLAGS)
execute_process(COMMAND "${NETSNMPCONFIG}" "--agent-libs" OUTPUT_VARIABLE NETSNMPLIBS)
# Removes leading/trailing spaces from net-snmp-config output
string(STRIP ${NETSNMPCFLAGS} NETSNMPCFLAGS)
string(STRIP ${NETSNMPLIBS} NETSNMPLIBS)
# Prints compilation and linker flags used in Net-SNMP package
message("Net-SNMP package CFLAGS: ${NETSNMPCFLAGS}")
message("Net-SNMP package LIBS: ${NETSNMPLIBS}")
# Setting libs and compilation flags variables
set(LIBS "${NETSNMPLIBS}")
set(STRICT_FLAGS "-Wall -Wstrict-prototypes")
set(CFLAGS "-I. ${STRICT_FLAGS} ${NETSNMPCFLAGS}")
# Sets prefix for files created by 'mib2c' for the wanted MIB
set(ENT_PHYSICAL_ENTRY "scalars/entPhysicalEntry")
# Source files created by 'mib2c' and then user customized
set(USER_SRCS
${ENT_PHYSICAL_ENTRY}.c
)
# Setting subagent sources
set(SRCS ${USER_SRCS}
${CMAKE_PROJECT_NAME}.c
)
# Finds the required Net-SNMP lib paths and assigns them to variables
find_library(NETSNMPAGENT "netsnmpagent")
message("Found ${NETSNMPAGENT}")
find_library(NETSNMPMIBS "netsnmpmibs")
message("Found ${NETSNMPMIBS}")
find_library(NETSNMP "netsnmp")
message("Found ${NETSNMP}")
# Sets the flags to be used for compiling and linking the executable
set_source_files_properties(${SRCS} COMPILE_FLAGS ${CFLAGS})
add_executable(${CMAKE_PROJECT_NAME} ${SRCS})
target_link_libraries(${CMAKE_PROJECT_NAME} ${NETSNMPAGENT} ${NETSNMPMIBS} ${NETSNMP})
I use a separate build dir so I don't mix build and source files, which stay along with the CMakeLists.txt file, so the the output of these commands...
cd ~/git/snmp_agent # CMakeLists.txt is in here along with source files
mkdir build
cd build
cmake ..
...is as follows:
claudio#slackdev:~/git/snmp_agent/build$ cmake ..
-- The C compiler identification is GNU 5.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
Net-SNMP package CFLAGS: -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -fPIC -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -I/usr/lib64/perl5/CORE -I/usr/include/libnl3 -I/usr/include
Net-SNMP package LIBS: -L/usr/lib64 -lnetsnmpmibs -lsensors -lpci -ldl -lnetsnmpagent -lwrap -lnsl -Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE -lnetsnmp -lcrypto -lnl-3 -lm
Found /usr/lib64/libnetsnmpagent.so
Found /usr/lib64/libnetsnmpmibs.so
Found /usr/lib64/libnetsnmp.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/claudio/git/snmp_agent/build
Running make, it builds just fine:
claudio#slackdev:~/git/snmp_agent/build$ make
Scanning dependencies of target snmp_agent
[ 25%] Building C object CMakeFiles/snmp_agent.dir/scalars/entPhysicalEntry.c.o
[ 50%] Building C object CMakeFiles/snmp_agent.dir/snmp_agent.c.o
[100%] Linking C executable snmp_agent
[100%] Built target snmp_agent
This snmp_agent runs as an agentX subagent, connecting to the main snmpd master agent and properly answering SNMP requests against entPhysicalEntry scalar objects.
Ok, so far so good. The problem is when I try to cross-compile this so it does the same thing on my final target, which is an ARMv7 Allwinner A20 board. I already have a cross-toolchain available for it - which I created using Crosstool-NG. It is in the search PATH and its tools begin with the prefix armv7-a20_allwinner-linux-gnueabihf. In order to use it, I set up the following toolchain file, which was named armv7-a20_allwinner-linux-gnueabihf.cmake:
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Linux)
# which C and C++ compiler to use
SET(CMAKE_C_COMPILER armv7-a20_allwinner-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER armv7-a20_allwinner-linux-gnueabihf-g++)
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH "$ENV{HOME}/arm_rootfs")
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
Using a different build dir for the ARM version, CMake should pick up the right paths pointing to the ARM root filesystem, which is a copy of what will be on the target board's SDcard:
cd ~/git/snmp_agent # CMakeLists.txt and armv7-a20_allwinner-linux-gnueabihf.cmake are here
mkdir build-arm
cd build-arm
cmake -DCMAKE_TOOLCHAIN_FILE=../armv7-a20_allwinner-linux-gnueabihf.cmake ..
Note that apparently CMake runs fine, as the paths found are all relative to the ARM root filesystem:
claudio#slackdev:~/git/snmp_agent/build-arm$ cmake -DCMAKE_TOOLCHAIN_FILE=../cmake_defs/armv7-a20_allwinner-linux-gnueabihf.cmake ..
-- The C compiler identification is GNU 6.3.0
-- Check for working C compiler: /home/claudio/x-tools/armv7-a20_allwinner-linux-gnueabihf/bin/armv7-a20_allwinner-linux-gnueabihf-gcc
-- Check for working C compiler: /home/claudio/x-tools/armv7-a20_allwinner-linux-gnueabihf/bin/armv7-a20_allwinner-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
Net-SNMP package CFLAGS: -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -I/usr/lib/perl5/CORE -I/usr/include/libnl3 -I/usr/include
Net-SNMP package LIBS: -L/usr/lib -lnetsnmpmibs -lsensors -lpci -ldl -lnetsnmpagent -lwrap -lnsl -Wl,-E -Wl,-rpath,/usr/lib/perl5/CORE -lnetsnmp -lcrypto -lnl-3 -lm
Found /home/claudio/arm_rootfs/usr/lib/libnetsnmpagent.so
Found /home/claudio/arm_rootfs/usr/lib/libnetsnmpmibs.so
Found /home/claudio/arm_rootfs/usr/lib/libnetsnmp.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/claudio/git/snmp_agent/build-arm
But when running make it falls apart while looking for /usr/include/gnu/stubs.h. If we try to repeat make with VERBOSE=1, we can see the gcc invocation is using paths relative to the host machine:
claudio#slackdev:~/git/snmp_agent/build-arm$ make VERBOSE=1
/usr/bin/cmake -H/home/claudio/git/snmp_agent -B/home/claudio/git/snmp_agent/build-arm --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/claudio/git/snmp_agent/build-arm/CMakeFiles /home/claudio/git/snmp_agent/build-arm/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory 'snmp_agent/build-arm'
make -f CMakeFiles/snmp_agent.dir/build.make CMakeFiles/snmp_agent.dir/depend
make[2]: Entering directory 'snmp_agent/build-arm'
cd /home/claudio/git/snmp_agent/build-arm && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/claudio/git/snmp_agent /home/claudio/git/snmp_agent /home/claudio/git/snmp_agent/build-arm /home/claudio/git/snmp_agent/build-arm /home/claudio/git/snmp_agent/build-arm/CMakeFiles/snmp_agent.dir/DependInfo.cmake --color=
make[2]: Leaving directory 'snmp_agent/build-arm'
make -f CMakeFiles/snmp_agent.dir/build.make CMakeFiles/snmp_agent.dir/build
make[2]: Entering directory 'snmp_agent/build-arm'
[ 25%] Building C object CMakeFiles/snmp_agent.dir/scalars/entPhysicalEntry.c.o
/home/claudio/x-tools/armv7-a20_allwinner-linux-gnueabihf/bin/armv7-a20_allwinner-linux-gnueabihf-gcc -I. -Wall -Wstrict-prototypes -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -I/usr/lib/perl5/CORE -I/usr/include/libnl3 -I/usr/include -o CMakeFiles/snmp_agent.dir/scalars/entPhysicalEntry.c.o -c /home/claudio/git/snmp_agent/scalars/entPhysicalEntry.c
In file included from /usr/include/features.h:392:0,
from /usr/include/stdio.h:27,
from /usr/include/net-snmp/net-snmp-includes.h:14,
from /home/claudio/git/snmp_agent/scalars/entPhysicalEntry.c:7:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
# include <gnu/stubs-32.h>
^
compilation terminated.
CMakeFiles/snmp_agent.dir/build.make:62: recipe for target 'CMakeFiles/snmp_agent.dir/scalars/entPhysicalEntry.c.o' failed
make[2]: *** [CMakeFiles/snmp_agent.dir/scalars/entPhysicalEntry.c.o] Error 1
make[2]: Leaving directory 'snmp_agent/build-arm'
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/snmp_agent.dir/all' failed
make[1]: *** [CMakeFiles/snmp_agent.dir/all] Error 2
make[1]: Leaving directory 'snmp_agent/build-arm'
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
The strange thing here is the /usr/include/gnu/stubs.h from the ARM root filesystem has nothing to do with stubs-32.h:
/* This file is automatically generated.
This file selects the right generated file of `__stub_FUNCTION' macros
based on the architecture being compiled for. */
#if !defined __ARM_PCS_VFP
# include <gnu/stubs-soft.h>
#endif
#if defined __ARM_PCS_VFP
# include <gnu/stubs-hard.h>
#endif
But if you look at the same file from the host system - which is a x86_64 machine - we can guess why it tried to find stubs-32.h (remember we are trying to compile for ARM, so it won't find the __x86_64__ symbol definition):
/* This file is automatically generated.
This file selects the right generated file of `__stub_FUNCTION' macros
based on the architecture being compiled for. */
#if !defined __x86_64__
# include <gnu/stubs-32.h>
#endif
#if defined __x86_64__ && defined __LP64__
# include <gnu/stubs-64.h>
#endif
#if defined __x86_64__ && defined __ILP32__
# include <gnu/stubs-x32.h>
#endif
Why is that happening, since the toolchain file clearly specifies that libraries and includes are to be searched ONLY in the path set by CMAKE_FIND_ROOT_PATH?
UPDATE (problem not totally solved yet!):
After I had accepted the answer from #Tsyvarev I was double checking my CMakeLists.txt file and I found while trying to make it work I had made a hack by manually setting CMAKE_FIND_ROOT_PATH as prefix of each compiler include switches (-I) returned by net-snmp-config, which obviously is not the ideal thing to do. That, along with CMAKE_SYSROOT, makes it work, but CMAKE_SYSROOT alone doesn't prefix the include paths by itself:
# This is the manually hacked line:
set(NETSNMPCFLAGS "-DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I${CMAKE_FIND_ROOT_PATH}/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -I${CMAKE_FIND_ROOT_PATH}/usr/lib/perl5/CORE -I${CMAKE_FIND_ROOT_PATH}/usr/include/libnl3 -I${CMAKE_FIND_ROOT_PATH}/usr/include")
set(LIBS "${NETSNMPLIBS}")
set(STRICT_FLAGS "-Wall -Wstrict-prototypes")
set(CFLAGS "-I. ${STRICT_FLAGS} ${NETSNMPCFLAGS}")
You need to set CMAKE_SYSROOT variable for refer to "here is the target environment located".
Unlike to CMAKE_FIND_ROOT_PATH variable, which is used only in find_* commands, CMAKE_SYSROOT is used also as a hint to the compiler (--sysroot option), so compiler will pick correct includes.
In case of cross-compiling, variable CMAKE_FIND_ROOT_PATH is used for provide additional search prefixes for find_* commands. CMAKE_SYSROOT is used as a prefix automatically.
FINAL SOLUTION:
Like explained on the question UPDATE, #Tsyvarev's answer fixed the linking part by providing the --sysroot switch to the compiler pointing to the root filesystem for ARM, but the problem of finding a stubs-32.h from the host system isn't fixed by that. Although it was part of the solution, it is important to note the primary observation had another cause: the include -I switches were being used directly as CFLAGS to the compiler, making it effectively look at the host system, since they where not prefixed with the root filesystem path for the ARM board (remember the flags were output directly by the net-snmp-config script, which was reporting flags for the native ARM build, so with "normal" paths instead). To fix that I used a CMake string command to remove all the -I switches from the NETSNMPCFLAGS variable:
# Gets compiling flags and libs linked to Net-SNMP
execute_process(COMMAND "${NETSNMPCONFIG}" "--base-cflags" OUTPUT_VARIABLE NETSNMPCFLAGS)
execute_process(COMMAND "${NETSNMPCONFIG}" "--agent-libs" OUTPUT_VARIABLE NETSNMPLIBS)
# removes the include dir switches "-I" from the NETSNMPCFLAGS, since we don't want
# the compiler to include paths relative to the host system in the compilation
string(REGEX REPLACE "-I[a-zA-Z0-9/]*" "" NETSNMPCFLAGS ${NETSNMPCFLAGS})
set(STRICT_FLAGS "-Wall -Wstrict-prototypes")
set(CFLAGS "-I. ${STRICT_FLAGS} ${NETSNMPCFLAGS}")
and put the root filesystem in an include_directories directive:
# Sets the flags to be used for compiling and linking the executable
set_source_files_properties(${SRCS} COMPILE_FLAGS ${CFLAGS})
include_directories(${CMAKE_FIND_ROOT_PATH}/usr/include)
add_executable(${CMAKE_PROJECT_NAME} ${SRCS})
target_link_libraries(${CMAKE_PROJECT_NAME} ${NETSNMPAGENT} ${NETSNMPMIBS} ${NETSNMP})

cpanm perl module installation failed on 'make' and 'make test'

I asked a question regarding configure does not generate makefile while building perl from source. While awaiting for a solution, here is another (possibly relevant) question. When I install perl modules for the system perl via something like sudo cpanm Try::Tiny it fails with following log:
cpanm (App::cpanminus) 1.7040 on perl 5.018002 built for x86_64-linux-gnu-thread-multi
Work directory is /home/zxu/.cpanm/work/1462290395.17141
You have make /usr/bin/make
You have LWP 6.05
You have /bin/tar: tar (GNU tar) 1.27.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching Try::Tiny () on cpanmetadb ...
--> Working on Try::Tiny
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Try-Tiny-0.24.tar.gz
-> OK
Unpacking Try-Tiny-0.24.tar.gz
Entering Try-Tiny-0.24
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (6.66)
Configuring Try-Tiny-0.24
Running Makefile.PL
Checking if your kit is complete...
Warning: the following files are missing in your kit:
lib/Try/Tiny.pm
maint/bench.pl
t/00-report-prereqs.dd
t/00-report-prereqs.t
t/basic.t
t/context.t
t/erroneous_usage.t
t/finally.t
t/given_when.t
t/global_destruction_forked.t
t/global_destruction_load.t
t/lib/TryUser.pm
t/named.t
t/when.t
xt/author/00-compile.t
xt/author/eol.t
xt/author/kwalitee.t
xt/author/mojibake.t
xt/author/no-tabs.t
xt/author/pod-coverage.t
xt/author/pod-spell.t
xt/author/pod-syntax.t
xt/release/changes_has_content.t
xt/release/cpan-changes.t
xt/release/distmeta.t
xt/release/pod-no404s.t
xt/release/portability.t
Please inform the author.
Wide character in print at /usr/share/perl/5.18/ExtUtils/MakeMaker.pm line 1034.
Wide character in print at /usr/share/perl/5.18/ExtUtils/MakeMaker.pm line 1034.
Wide character in print at /usr/share/perl/5.18/ExtUtils/MakeMaker.pm line 1034.
Writing Makefile for Try::Tiny
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have warnings 0 ... Yes (1.18)
Checking if you have constant 0 ... Yes (1.27)
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.66)
Checking if you have if 0 ... Yes (0.0602)
Checking if you have strict 0 ... Yes (1.07)
Checking if you have Exporter 5.57 ... Yes (5.68)
Checking if you have File::Spec 0 ... Yes (3.40)
Checking if you have Carp 0 ... Yes (1.29)
Checking if you have Test::More 0 ... Yes (1.001014)
Building and testing Try-Tiny-0.24
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
#
# Versions for all modules listed in MYMETA.json (including optional ones):
#
# === Configure Requires ===
#
# Module Want Have
# ------------------- ---- ----
# ExtUtils::MakeMaker any 6.66
#
# === Build Requires ===
#
# Module Want Have
# ------------------- ---- ----
# ExtUtils::MakeMaker any 6.66
#
# === Test Requires ===
#
# Module Want Have
# ------------------- ---- --------
# ExtUtils::MakeMaker any 6.66
# File::Spec any 3.40
# Test::More any 1.001014
# if any 0.0602
#
# === Test Recommends ===
#
# Module Want Have
# ------------- -------- --------
# CPAN::Meta 2.120900 2.133380
# Capture::Tiny 0.12 missing
#
# === Test Suggests ===
#
# Module Want Have
# --------- ---- -------
# Sub::Util any missing
#
# === Runtime Requires ===
#
# Module Want Have
# -------- ---- ----
# Carp any 1.29
# Exporter 5.57 5.68
# constant any 1.27
# strict any 1.07
# warnings any 1.18
#
# === Other Modules ===
#
# Module Have
# ------------- -------
# Pod::Coverage missing
#
t/00-report-prereqs.t .......... ok
Can't locate Try/Tiny.pm in #INC (you may need to install the Try::Tiny module) (#INC contains: /home/zxu/.cpanm/work/1462290395.17141/Try-Tiny-0.24/blib/lib /home/zxu/.cpanm/work/1462290395.17141/Try-Tin
y-0.24/blib/arch /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at t/basic.t line 8.
BEGIN failed--compilation aborted at t/basic.t line 8.
# Looks like your test exited with 2 before it could output anything.
t/basic.t ......................
Dubious, test returned 2 (wstat 512, 0x200)
Failed 25/25 subtests
Can't locate Try/Tiny.pm in #INC (you may need to install the Try::Tiny module) (#INC contains: /home/zxu/.cpanm/work/1462290395.17141/Try-Tiny-0.24/blib/lib /home/zxu/.cpanm/work/1462290395.17141/Try-Tiny-0.24/blib/arch /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at t/context.t line 6.
BEGIN failed--compilation aborted at t/context.t line 6.
... ... ##more tests failure
Test Summary Report
-------------------
t/basic.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: Bad plan. You planned 25 tests but ran 0.
t/context.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/erroneous_usage.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: Bad plan. You planned 8 tests but ran 0.
t/finally.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: Bad plan. You planned 27 tests but ran 0.
t/given_when.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: Bad plan. You planned 2 tests but ran 0.
t/global_destruction_forked.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: Bad plan. You planned 3 tests but ran 0.
t/when.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: Bad plan. You planned 5 tests but ran 0.
Files=10, Tests=1, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.23 cusr 0.02 csys = 0.28 CPU)
Result: FAIL
Failed 7/10 test programs. 0/1 subtests failed.
make: *** [test_dynamic] Error 2
-> FAIL Installing Try::Tiny failed. See /home/zxu/.cpanm/work/1462290395.17141/build.log for details. Retry with --force to force install it.
, and if I run sudo -s, cd to the downloaded module directory and run perl Makefile.PL && make && make test, the tests fail again (compared with the cpanm log, no missing file warnings anymore):
Writing Makefile for Try::Tiny
Wide character in print at /usr/share/perl/5.18/ExtUtils/MakeMaker.pm line 1034.
Wide character in print at /usr/share/perl/5.18/ExtUtils/MakeMaker.pm line 1034.
Wide character in print at /usr/share/perl/5.18/ExtUtils/MakeMaker.pm line 1034.
Writing MYMETA.yml and MYMETA.json
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-report-prereqs.t .......... #
# Versions for all modules listed in MYMETA.json (including optional ones):
#
# === Configure Requires ===
#
# Module Want Have
# ------------------- ---- ----
# ExtUtils::MakeMaker any 6.66
#
# === Build Requires ===
#
# Module Want Have
# ------------------- ---- ----
# ExtUtils::MakeMaker any 6.66
#
# === Test Requires ===
#
# Module Want Have
# ------------------- ---- --------
# ExtUtils::MakeMaker any 6.66
# File::Spec any 3.40
# Test::More any 1.001014
# if any 0.0602
#
# === Test Recommends ===
#
# Module Want Have
# ------------- -------- --------
# CPAN::Meta 2.120900 2.133380
# Capture::Tiny 0.12 missing
#
# === Test Suggests ===
#
# Module Want Have
# --------- ---- -------
# Sub::Util any missing
#
# === Runtime Requires ===
#
# Module Want Have
# -------- ---- ----
# Carp any 1.29
# Exporter 5.57 5.68
# constant any 1.27
# strict any 1.07
# warnings any 1.18
#
# === Other Modules ===
#
# Module Have
# ------------- -------
# Pod::Coverage missing
#
t/00-report-prereqs.t .......... ok
t/basic.t ...................... Can't locate Try/Tiny.pm in #INC (you may need to install the Try::Tiny module) (#INC contains: /home/zxu/.cpanm/work/1462290395.17141/Try-Tiny-0.24/blib/lib /home/zxu/.cp
anm/work/1462290395.17141/Try-Tiny-0.24/blib/arch /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/s
ite_perl .) at t/basic.t line 8.
BEGIN failed--compilation aborted at t/basic.t line 8.
# Looks like your test exited with 2 before it could output anything.
t/basic.t ...................... Dubious, test returned 2 (wstat 512, 0x200)
Failed 25/25 subtests
t/context.t .................... Can't locate Try/Tiny.pm in #INC (you may need to install the Try::Tiny module) (#INC contains: /home/zxu/.cpanm/work/1462290395.17141/Try-Tiny-0.24/blib/lib /home/zxu/.cp
anm/work/1462290395.17141/Try-Tiny-0.24/blib/arch /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/s
ite_perl .) at t/context.t line 6.
BEGIN failed--compilation aborted at t/context.t line 6.
... ... ##more tests failure
It seems the module Try::Tiny is not installed successfully since make didn't spit out any log message and the test couldn't locate the module in #INC. I am on Ubuntu 14.04 (kernel 3.13.0-24-generic), and using apt-get install for module installation is ok. The output from perl -V is:
Summary of my perl5 (revision 5 version 18 subversion 2) configuration:
Platform:
osname=linux, osvers=3.13.0-79-generic, archname=x86_64-linux-gnu-thread-multi
uname='linux lgw01-37 3.13.0-79-generic #123-ubuntu smp fri feb 19 14:27:58 utc 2016 x86_64 x86_64 x86_64 gnulinux '
config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Dldflags= -Wl,-Bsymbolic-functions
-Wl,-z,relro -Dlddlflags=-shared -Wl,-Bsymbolic-functions -Wl,-z,relro -Dcccdlflags=-fPIC -Darchname=x86_64-linux-gnu -Dprefix=/usr -Dprivlib=/usr/share/perl/5.18 -Darchlib=/usr/lib/perl/5.18 -Dvendorpre
fix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.18.2 -Dsitearch=/usr/local/lib/perl/5.18.2 -Dman1dir=/usr/share/man/man1 -Dman3d
ir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Duse64bitint -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uus
enm -Ui_libutil -Uversiononly -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -Dlibperl=libperl.so.5.18.2 -des'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2 -g',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include'
ccversion='', gccversion='4.8.2', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib
libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
perllibs=-ldl -lm -lpthread -lc -lcrypt
libc=, so=so, useshrplib=true, libperl=libperl.so.5.18.2
gnulibc_version='2.19'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib -fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_64_BIT_ALL
USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
USE_REENTRANT_API
Locally applied patches:
DEBPKG:debian/cpan_definstalldirs - Provide a sensible INSTALLDIRS default for modules installed from CPAN.
DEBPKG:debian/db_file_ver - http://bugs.debian.org/340047 Remove overly restrictive DB_File version check.
DEBPKG:debian/doc_info - Replace generic man(1) instructions with Debian-specific information.
DEBPKG:debian/enc2xs_inc - http://bugs.debian.org/290336 Tweak enc2xs to follow symlinks and ignore missing #INC directories.
DEBPKG:debian/errno_ver - http://bugs.debian.org/343351 Remove Errno version check due to upgrade problems with long-running processes.
DEBPKG:debian/libperl_embed_doc - http://bugs.debian.org/186778 Note that libperl-dev package is required for embedded linking
DEBPKG:fixes/respect_umask - Respect umask during installation
DEBPKG:debian/writable_site_dirs - Set umask approproately for site install directories
DEBPKG:debian/extutils_set_libperl_path - EU:MM: Set location of libperl.a to /usr/lib
DEBPKG:debian/no_packlist_perllocal - Don't install .packlist or perllocal.pod for perl or vendor
DEBPKG:debian/prefix_changes - Fiddle with *PREFIX and variables written to the makefile
DEBPKG:debian/fakeroot - Postpone LD_LIBRARY_PATH evaluation to the binary targets.
DEBPKG:debian/instmodsh_doc - Debian policy doesn't install .packlist files for core or vendor.
DEBPKG:debian/ld_run_path - Remove standard libs from LD_RUN_PATH as per Debian policy.
DEBPKG:debian/libnet_config_path - Set location of libnet.cfg to /etc/perl/Net as /usr may not be writable.
DEBPKG:debian/mod_paths - Tweak #INC ordering for Debian
DEBPKG:debian/module_build_man_extensions - http://bugs.debian.org/479460 Adjust Module::Build manual page extensions for the Debian Perl policy
DEBPKG:debian/prune_libs - http://bugs.debian.org/128355 Prune the list of libraries wanted to what we actually need.
DEBPKG:fixes/net_smtp_docs - [rt.cpan.org #36038] http://bugs.debian.org/100195 Document the Net::SMTP 'Port' option
DEBPKG:debian/perlivp - http://bugs.debian.org/510895 Make perlivp skip include directories in /usr/local
DEBPKG:debian/cpanplus_definstalldirs - http://bugs.debian.org/533707 Configure CPANPLUS to use the site directories by default.
DEBPKG:debian/cpanplus_config_path - Save local versions of CPANPLUS::Config::System into /etc/perl.
DEBPKG:debian/deprecate-with-apt - http://bugs.debian.org/702096 Point users to Debian packages of deprecated core modules
DEBPKG:debian/squelch-locale-warnings - http://bugs.debian.org/508764 Squelch locale warnings in Debian package maintainer scripts
DEBPKG:debian/skip-upstream-git-tests - Skip tests specific to the upstream Git repository
DEBPKG:debian/patchlevel - http://bugs.debian.org/567489 List packaged patches for 5.18.2-2ubuntu1.1 in patchlevel.h
DEBPKG:debian/skip-kfreebsd-crash - http://bugs.debian.org/628493 [perl #96272] Skip a crashing test case in t/op/threads.t on GNU/kFreeBSD
DEBPKG:fixes/document_makemaker_ccflags - http://bugs.debian.org/628522 [rt.cpan.org #68613] Document that CCFLAGS should include $Config{ccflags}
DEBPKG:debian/find_html2text - http://bugs.debian.org/640479 Configure CPAN::Distribution with correct name of html2text
DEBPKG:debian/hurd_test_skip_stack - http://bugs.debian.org/650175 Disable failing GNU/Hurd tests dist/threads/t/stack.t
DEBPKG:fixes/manpage_name_Test-Harness - http://bugs.debian.org/650451 [rt.cpan.org #73399] cpan/Test-Harness: add NAME headings in modules with POD
DEBPKG:debian/makemaker-pasthru - http://bugs.debian.org/660195 [rt.cpan.org #28632] Make EU::MM pass LD through to recursive Makefile.PL invocations
DEBPKG:debian/perl5db-x-terminal-emulator.patch - http://bugs.debian.org/668490 Invoke x-terminal-emulator rather than xterm in perl5db.pl
DEBPKG:debian/cpan-missing-site-dirs - http://bugs.debian.org/688842 Fix CPAN::FirstTime defaults with nonexisting site dirs if a parent is writable
DEBPKG:fixes/memoize_storable_nstore - [rt.cpan.org #77790] http://bugs.debian.org/587650 Memoize::Storable: respect 'nstore' option not respected
DEBPKG:fixes/net_ftp_failed_command - [rt.cpan.org #37700] http://bugs.debian.org/491062 Net::FTP: cope gracefully with a failed command
DEBPKG:fixes/perlbug-patchlist - [3541c11] http://bugs.debian.org/710842 [perl #118433] Make perlbug look up the list of local patches at run time
DEBPKG:fixes/module_metadata_security_doc - [68cdd4b] CVE-2013-1437 documentation fix
DEBPKG:fixes/module_metadata_taint_fix - [bff978f] http://bugs.debian.org/722210 [rt.cpan.org #88576] untaint version, if needed, in Module::Metadata
DEBPKG:fixes/IPC-SysV-spelling - http://bugs.debian.org/730558 [rt.cpan.org #86736] Fix spelling of IPC_CREAT in IPC-SysV documentation
DEBPKG:fixes/fix-undef-source -
DEBPKG:fixes/CVE-2013-7422.patch - [PATCH] [perl #119505] Segfault from bad backreference
DEBPKG:fixes/CVE-2014-4330.patch - [PATCH] don't recurse infinitely in Data::Dumper
DEBPKG:fixes/CVE-2016-2381.patch - [PATCH 1/2] remove duplicate environment variables from environ
Built under linux
Compiled at Mar 1 2016 17:15:04
#INC:
/etc/perl
/usr/local/lib/perl/5.18.2
/usr/local/share/perl/5.18.2
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.18
/usr/share/perl/5.18
/usr/local/lib/site_perl
.
It seems the system perl was built against a different kernel version 3.13.0-79-generic. Could this be the problem? Plz help! Let me know if you need any more info. Thanks.
Based on this mailing list thread, the third post in particular, I would suggest editing '/usr/lib/perl//Config.pm' so that dont_use_nlink is set to 'define' instead of undef. This solution worked for me.

Failed Plone 4.1.4 install: lxml build failed: libxml2:

Expected Outcome:
Successful installtion of Plone 4.1.4
Actual Outcome:
Installation fails with: libxml2: cmmi failed:
Stack:
Ubuntu Ubuntu 10.04.4 LT (Lucid)
Apache 2.2.14
Plone-4.1.4-UnifiedInstaller
Install System Libraries, Header Files, etc
root#li54-28:~#apt-get update
root#li54-28:~#apt-get install g++ python-dev python-setuptools python-lxml python-libxml2 libxml2-dev libxslt1-dev openssl subversion
Install Plone
joeblow#li54-28:~/Plone-4.1.4-UnifiedInstaller$ ./install.sh standalone --target=${HOME} --instance=joeblow.org
Stand-Alone Zope Instance selected
Detailed installation log being written to /home/joeblow/Plone-4.1.4-UnifiedInstaller/install.log
Rootless install method chosen. Will install for use by system user joeblow
Installing Plone 4.1.4 at /home/joeblow
Skipping libjpeg build
Skipping zlib build
Skipping readline build
Installing Python 2.6.7. This takes a while...
Patching for thread size
Installing distribute...
Python build looks OK.
Unpacking buildout cache to /home/joeblow/buildout-cache
Compiling .py files in egg cache
Copying Plone-docs
Generating random password ...
****Your platform's xml2/xslt are missing or out-of-date. We'll need to build them.****
Copying buildout skeleton
Fixing up bin/buildout
Building lxml with static libxml2/libxslt; this takes a while...
lxml build failed. You may wish to clean up and try again
without the lxml build by adding --without-lxml to the
command line.
Buildout returned an error code: 1; Aborting.
Buildout failed. Unable to continue
Installation has failed.
See the detailed installation log at /home/joeblow/Plone-4.1.4-UnifiedInstaller/install.log
to determine the cause.
*Notice the installer says: **Your platform's xml2/xslt are missing or out-of-date and then trys to build them. But I already installed them via apt-get install...
Troubleshooting
joeblow#li54-28:~/Plone-4.1.4-UnifiedInstaller$ tail -75 install.log
/
bin/bash ./libtool --tag=CC --mode=link gcc -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -o testReader testReader.o ./libxml2.la -lz -lm
libtool: link: gcc -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -o .libs/testReader testReader.o ./.libs/libxml2.so -ldl -lz -lm -Wl,-rpath -Wl,/home/joeblow/joeblow.org/parts/lxml/libxml2/lib
gcc -DHAVE_CONFIG_H -I. -I./include -I./include -D_REENTRANT -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -MT testapi.o -MD -MP -MF .deps/testapi.Tpo -c -o testapi.o testapi.c
testapi.c: In function âtest_xmlBufferSetAllocationSchemeâ:
testapi.c:18773: warning: comparison of distinct pointer types lacks a cast
testapi.c: At top level:
testapi.c:17989: warning: âgen_xmlSchematronPtrâ defined but not used
testapi.c:17992: warning: âdes_xmlSchematronPtrâ defined but not used
testapi.c:18009: warning: âgen_xmlSchematronParserCtxtPtrâ defined but not used
testapi.c:18012: warning: âdes_xmlSchematronParserCtxtPtrâ defined but not used
testapi.c:34157: warning: âgen_xmlSAXHandlerPtr_ptrâ defined but not used
testapi.c:34160: warning: âdes_xmlSAXHandlerPtr_ptrâ defined but not used
gcc: Internal error: Killed (program cc1)
Please submit a full bug report.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.
make[2]: *** [testapi.o] Error 1
make[2]: Leaving directory `/tmp/tmp8quJWJbuildout-libxml2/libxml2-2.7.8'
**make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/tmp8quJWJbuildout-libxml2/libxml2-2.7.8'
make: *** [all] Error 2
**libxml2: cmmi failed:** /tmp/tmp8quJWJbuildout-libxml2**
While:
Installing lxml.
An internal error occured due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/home/joeblow/buildout-cache/eggs/zc.buildout-1.4.4-py2.6.egg/zc/buildout/buildout.py", line 1683, in main
getattr(buildout, command)(args)
File "/home/joeblow/buildout-cache/eggs/zc.buildout-1.4.4-py2.6.egg/zc/buildout/buildout.py", line 555, in install
installed_files = self[part]._call(recipe.install)
File "/home/joeblow/buildout-cache/eggs/zc.buildout-1.4.4-py2.6.egg/zc/buildout/buildout.py", line 1227, in _call
return f()
File "/home/joeblow/buildout-cache/eggs/z3c.recipe.staticlxml-0.7.2-py2.6.egg/z3c/recipe/staticlxml/__init__.py", line 169, in install
self.build_libxml2()
File "/home/joeblow/buildout-cache/eggs/z3c.recipe.staticlxml-0.7.2-py2.6.egg/z3c/recipe/staticlxml/__init__.py", line 129, in build_libxml2
loc = self.xml2_cmmi.install()
File "/home/joeblow/buildout-cache/eggs/zc.recipe.cmmi-1.3.4-py2.6.egg/zc/recipe/cmmi/__init__.py", line 99, in install
self.build()
File "/home/joeblow/buildout-cache/eggs/zc.recipe.cmmi-1.3.4-py2.6.egg/zc/recipe/cmmi/__init__.py", line 182, in build
self.cmmi(dest)
File "/home/joeblow/buildout-cache/eggs/zc.recipe.cmmi-1.3.4-py2.6.egg/zc/recipe/cmmi/__init__.py", line 208, in cmmi
system("make")
File "/home/joeblow/buildout-cache/eggs/zc.recipe.cmmi-1.3.4-py2.6.egg/zc/recipe/cmmi/__init__.py", line 31, in system
raise SystemError("Failed", c)
SystemError: ('Failed', 'make')
****** PICKED VERSIONS *******
[versions]
****** /PICKED VERSIONS ******
libxml2-dev Package Info
root#li54-28:~# apt-cache show libxml2-dev
Package: libxml2-dev
Priority: optional
Section: libdevel
Installed-Size: 2116
Maintainer: Ubuntu Developers <ubuntu-devel-discuss#lists.ubuntu.com>
Original-Maintainer: Debian XML/SGML Group <debian-xml-sgml-pkgs#lists.alioth.debian.org>
Architecture: i386
Source: libxml2
Version: 2.7.6.dfsg-1ubuntu1.4
Replaces: libxml2 (<= 2.6.6-1), libxml2-headers (= 2.6.7-1)
Depends: libxml2 (= 2.7.6.dfsg-1ubuntu1.4), zlib1g-dev | libz-dev
Conflicts: libxml2 (<= 2.6.6-1), libxml2-headers (= 2.6.7-1)
Filename: pool/main/libx/libxml2/libxml2-dev_2.7.6.dfsg-1ubuntu1.4_i386.deb
Size: 753312
MD5sum: 5c7bc3d0979cf1078ebee42b199d454a
SHA1: 9bc9c14507b08c0a9e192fa4d136c84af1e4079b
SHA256: 426c56e2ef30f3c1341126f736f084b73b506c17bb339f92e1b2c18745e6eed9
Description: Development files for the GNOME XML library
XML is a metalanguage to let you design your own markup language.
A regular markup language defines a way to describe information in
a certain class of documents (eg HTML). XML lets you define your
own customized markup languages for many classes of document. It
can do this because it's written in SGML, the international standard
metalanguage for markup languages.
.
Install this package if you wish to develop your own programs using
the GNOME XML library.
Homepage: http://xmlsoft.org/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 18m
Package: libxml2-dev
Priority: optional
Section: libdevel
Installed-Size: 2116
Maintainer: Ubuntu Developers <ubuntu-devel-discuss#lists.ubuntu.com>
Original-Maintainer: Debian XML/SGML Group <debian-xml-sgml-pkgs#lists.alioth.debian.org>
Architecture: i386
Source: libxml2
Version: 2.7.6.dfsg-1ubuntu1
Replaces: libxml2 (<= 2.6.6-1), libxml2-headers (= 2.6.7-1)
Depends: libxml2 (= 2.7.6.dfsg-1ubuntu1), zlib1g-dev | libz-dev
Conflicts: libxml2 (<= 2.6.6-1), libxml2-headers (= 2.6.7-1)
Filename: pool/main/libx/libxml2/libxml2-dev_2.7.6.dfsg-1ubuntu1_i386.deb
Size: 750710
MD5sum: 7272dcc6226fa95ab767f382aa562862
SHA1: b049bffa4a86c1ade69d0f2e6cf1ee88a675149e
SHA256: b9df88fafe1ed33bd029127d216cffce98ada1201b22802657ef5be1f77e016c
Description: Development files for the GNOME XML library
XML is a metalanguage to let you design your own markup language.
A regular markup language defines a way to describe information in
a certain class of documents (eg HTML). XML lets you define your
own customized markup languages for many classes of document. It
can do this because it's written in SGML, the international standard
metalanguage for markup languages.
.
Install this package if you wish to develop your own programs using
the GNOME XML library.
Homepage: http://xmlsoft.org/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 18m
NOTES
Even though the Plone install failed, it still created the website directory, a buildout.cfg, and a curious looking file named lxml_static.cfg
I couldn´t find much about lxml_static.cfg but i did encounter this link. Since the install failed completely and this looks like an entirely different buldout I am unsure if it is directly related.
Any hints?
This class of problem is probably better handled by filing a ticket at dev.plone.org.
Your system has libxml2, but the libxslt is probably not adequate; this is true of all but the most current releases.
The install.log report unfortunately isn't very helpful. The pertinent line is:
gcc: Internal error: Killed (program cc1)
but that gives no indication of why it was killed. However, this does tell us that gcc was killed by an outside process rather than by something like a compilation error. Your system logs may tell you something more (e.g., killed process XXX for reason YYY).
Is it possible that your user limits are set so conservatively that they won't allow a memory/cpu intensive build? If so, check with your sysadmin.
As an FYI we use the following for Ubuntu before we deploy Plone from unified installer:
apt-get install libxml2 libxml2-dev libxslt1-dev libbz2-dev libssl-dev p7zip-full rar lha unrar unzip unace unp bzip2 gzip patch
Looks like I hit a potential bug (Thanks #SteveM) trying to install Plone 4.1.4 on Ubuntu 10.04.4 LT (Lucid). If you are having a similar issue you can track the potential bug here: dev.plone.org/ticket/12795
Work Around Solution: Install without lxml!!
./install.sh standalone --target="${HOME}/plone" --instance=${WEBSITE_NAME} --without-lxml
Thanks for Playing

Resources