I'm having trouble cross-compiling systemtap under ubuntu 18.04 Here are the compile-time errors
➜ systemtap-master ./configure --prefix=$PWD/_install --host=aarch64-linux-gnu --with-elfutils=/home/zhongyi/tools/elfutils-0.188 CXXFLAGS=-static CFLAGS=-static LIBS=-lz CPPFLAGS=-I/home/zhongyi/tools/elfutils-0.188/_install/include LDFLAGS="-L/home/zhongyi/tools/zlib-1.2.13/_install/lib -L/home/zhongyi/tools/elfutils-0.188/_install/lib"
checking build system type... x86_64-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking target system type... aarch64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for aarch64-linux-gnu-strip... aarch64-linux-gnu-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... (cached) yes
checking whether make supports the include directive... yes (GNU style)
checking for aarch64-linux-gnu-gcc... aarch64-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether aarch64-linux-gnu-gcc accepts -g... yes
checking for aarch64-linux-gnu-gcc option to accept ISO C89... none needed
checking whether aarch64-linux-gnu-gcc understands -c and -o together... yes
checking dependency style of aarch64-linux-gnu-gcc... gcc3
checking how to run the C preprocessor... aarch64-linux-gnu-gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether ln -s works... yes
checking for aarch64-linux-gnu-gcc... (cached) aarch64-linux-gnu-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether aarch64-linux-gnu-gcc accepts -g... (cached) yes
checking for aarch64-linux-gnu-gcc option to accept ISO C89... (cached) none needed
checking whether aarch64-linux-gnu-gcc understands -c and -o together... (cached) yes
checking dependency style of aarch64-linux-gnu-gcc... (cached) gcc3
checking for aarch64-linux-gnu-g++... no
checking for aarch64-linux-gnu-c++... no
checking for aarch64-linux-gnu-gpp... no
checking for aarch64-linux-gnu-aCC... no
checking for aarch64-linux-gnu-CC... no
checking for aarch64-linux-gnu-cxx... no
checking for aarch64-linux-gnu-cc++... no
checking for aarch64-linux-gnu-cl.exe... no
checking for aarch64-linux-gnu-FCC... no
checking for aarch64-linux-gnu-KCC... no
checking for aarch64-linux-gnu-RCC... no
checking for aarch64-linux-gnu-xlC_r... no
checking for aarch64-linux-gnu-xlC... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C preprocessor... aarch64-linux-gnu-gcc -E
checking for aarch64-linux-gnu-ar... aarch64-linux-gnu-ar
checking the archiver (aarch64-linux-gnu-ar) interface... ar
checking for aarch64-linux-gnu-ranlib... aarch64-linux-gnu-ranlib
checking whether make sets $(MAKE)... (cached) yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for ppoll... yes
checking for openat... yes
checking for a sed that does not truncate output... /bin/sed
checking whether NLS is requested... yes
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for ld used by aarch64-linux-gnu-gcc... /usr/aarch64-linux-gnu/bin/ld
checking if the linker (/usr/aarch64-linux-gnu/bin/ld) is GNU ld... yes
checking for shared library run path origin... done
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking for GNU gettext in libc... yes
checking whether to use NLS... yes
checking where the gettext function comes from... libc
checking for python... /usr/bin/python
checking whether /usr/bin/python is version 2 or 3... 2
checking for a Python interpreter with version >= 2.6... python2
checking for python2... /usr/bin/python2
checking for python2 version... 2.7
checking for python2 platform... linux2
checking for python2 script directory... ${prefix}/lib/python2.7/site-packages
checking for python2 extension module directory... ${exec_prefix}/lib/python2.7/site-packages
checking for python3... /usr/bin/python3
checking for python3 version... 3.6
checking for python3 platform... linux
checking for python3 script directory... ${prefix}/lib/python3.6/site-packages
checking for python3 extension module directory... ${exec_prefix}/lib/python3.6/site-packages
checking to see if prologue searching should be the default... no
checking to see if sdt probes should be the default... yes
checking whether g++ supports C++11 features by default... yes
configure: Compiling with gcc -fstack-protector-all et al.
configure: Compiling with gcc pie et al.
checking whether to use debuginfod... auto
checking for aarch64-linux-gnu-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for debuginfod... no
configure: WARNING: libdebuginfod is missing or unusable; some features may be unavailable.
checking for sqlite3... no
checking for latex... no
checking for dvips... no
checking for ps2pdf... yes
configure: will only install prebuilt documentation
checking for xmlto... no
checking for fop... no
checking for nss... no
checking for openssl... yes
configure: using dracut module directory /usr/lib/dracut/modules.d/99stap
configure: using dracut binary /sbin
configure: WARNING: will not build systemtap compile server, cannot find nss headers
configure: WARNING: compile-server client functionality will be disabled, cannot find nss development files
checking for avahi... no
configure: WARNING: some compile-server functionality will be restricted, cannot find avahi development files
checking for rpmtsInitIterator in -lrpm... no
checking for rpmdbNextIterator in -lrpmdb... no
checking for rpmFreeCrypto in -lrpmio... no
checking how to link readline libs... none
checking for ebl_strtabinit in -lebl... no
checking for dwfl_module_getsym in -ldw... no
configure: error: missing elfutils development headers/libraries (install elfutils-devel, libebl-dev, libdw-dev and/or libebl-devel)
➜ systemtap-master make && make install
/bin/bash ./git_version.sh -k -s . -o git_version.h
git_version.sh: Output is new file, creating git_version.h
make all-recursive
make[1]: Entering directory '/home/zhongyi/tools/systemtap-master'
Making all in .
make[2]: Entering directory '/home/zhongyi/tools/systemtap-master'
make[2]: Leaving directory '/home/zhongyi/tools/systemtap-master'
Making all in java
make[2]: Entering directory '/home/zhongyi/tools/systemtap-master/java'
make all-am
make[3]: Entering directory '/home/zhongyi/tools/systemtap-master/java'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/zhongyi/tools/systemtap-master/java'
make[2]: Leaving directory '/home/zhongyi/tools/systemtap-master/java'
Making all in python
make[2]: Entering directory '/home/zhongyi/tools/systemtap-master/python'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/zhongyi/tools/systemtap-master/python'
Making all in stapdyn
make[2]: Entering directory '/home/zhongyi/tools/systemtap-master/stapdyn'
make -C .. git_version.stamp
make[3]: Entering directory '/home/zhongyi/tools/systemtap-master'
/bin/bash ./git_version.sh -k -s . -o git_version.h
git_version.sh: Not a git repo, keeping existing git_version.h
make[3]: Leaving directory '/home/zhongyi/tools/systemtap-master'
make all-am
make[3]: Entering directory '/home/zhongyi/tools/systemtap-master/stapdyn'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/zhongyi/tools/systemtap-master/stapdyn'
make[2]: Leaving directory '/home/zhongyi/tools/systemtap-master/stapdyn'
Making all in staprun
make[2]: Entering directory '/home/zhongyi/tools/systemtap-master/staprun'
make -C .. git_version.stamp
make[3]: Entering directory '/home/zhongyi/tools/systemtap-master'
/bin/bash ./git_version.sh -k -s . -o git_version.h
git_version.sh: Not a git repo, keeping existing git_version.h
make[3]: Leaving directory '/home/zhongyi/tools/systemtap-master'
make all-am
make[3]: Entering directory '/home/zhongyi/tools/systemtap-master/staprun'
CC staprun-staprun.o
CC staprun-staprun_funcs.o
CC staprun-ctl.o
CC staprun-common.o
CXX ../staprun-privilege.o
CXX ../staprun-util.o
CC libstrfloctime_a-strfloctime.o
AR libstrfloctime.a
aarch64-linux-gnu-ar: `u' modifier ignored since `D' is the default (see `U')
CXXLD staprun
/usr/bin/ld: libstrfloctime.a(libstrfloctime_a-strfloctime.o): Relocations in generic ELF (EM: 183)
libstrfloctime.a(libstrfloctime_a-strfloctime.o): error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
Makefile:677: recipe for target 'staprun' failed
make[3]: *** [staprun] Error 1
make[3]: Leaving directory '/home/zhongyi/tools/systemtap-master/staprun'
Makefile:528: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/zhongyi/tools/systemtap-master/staprun'
Makefile:2105: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/zhongyi/tools/systemtap-master'
Makefile:789: recipe for target 'all' failed
make: *** [all] Error 2
I specified the option --host=aarch64-linux-gnu at compiling. Why is there still an error?
Cross-compilation toolchain has been installed on ubuntu. Zlib and elfutils can be cross-compiled normally.
I can't find the detailed tutorial of cross-compilation on the official website of systemtap.