出于某种原因,我无法让NTP libs交叉编译。在我未经训练的眼睛看来,这是交叉编译手臂。但是,当我做$file的时候,它们并没有显示为ARM。
./configure -prefix=$(pwd) CC=~/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc LD=~/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-ld AS=~/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-as --host=arm-linux CFLAGS=-static
结果:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/home/eecklund/development/trunk/build_tools/ntp-4.2.8p8/sntp/libevent/build-aux/missing: Unknown `--is-lightweight' option
Try `/home/eecklund/development/trunk/build_tools/ntp-4.2.8p8/sntp/libevent/build-aux/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for arm-linux-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking for style of include used by make... GNU
checking for arm-linux-gcc... /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-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... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc accepts -g... yes
checking for /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc option to accept ISO C89... none needed
checking whether /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc understands -c and -o together... yes
checking dependency style of /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc... gcc3
checking how to run the C preprocessor... /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/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 for /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc option to accept ISO C89... (cached) none needed
checking for /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc option to accept ISO C99... -std=gnu99
checking for arm-linux-gcc... (cached) /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc accepts -g... (cached) yes
checking for /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc option to accept ISO C89... (cached) none needed
checking whether /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc understands -c and -o together... (cached) yes
checking dependency style of /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc... (cached) gcc3
checking whether /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc needs -traditional... no
checking if /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc can handle #warning... yes
checking if /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc supports __attribute__((...))... yes
checking if /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc can handle -Wstrict-overflow... yes
checking if /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc can handle -Winit-self... yes
checking if linker supports omitting unused code and data... no
checking additional compiler flags... none needed
checking additional linker flags... none needed
checking whether byte ordering is bigendian... no
checking for working volatile... yes
checking how to run the C preprocessor... /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc -E
checking how to run the C preprocessor... /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc -E
checking for arm-linux-g++... no
checking for arm-linux-c++... no
checking for arm-linux-gpp... no
checking for arm-linux-aCC... no
checking for arm-linux-CC... no
checking for arm-linux-cxx... no
checking for arm-linux-cc++... no
checking for arm-linux-cl.exe... no
checking for arm-linux-FCC... no
checking for arm-linux-KCC... no
checking for arm-linux-RCC... no
checking for arm-linux-xlC_r... no
checking for arm-linux-xlC... no
checking for g++... g++
configure: WARNING: using cross tools not prefixed with host triplet
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for bison... bison -y
checking whether /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc and cc understand -c and -o together... yes
checking whether the compiler supports C99 structure initialization... yes
checking to see if we need ylwrap VPATH hack... no
checking for install dir and man conventions... in file loc/redhat
checking for arm-linux-ar... no
checking for arm-linux-lib... no
checking for arm-linux-link... no
checking for ar... ar
checking the archiver (ar) interface... ar
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc... /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-ld
checking if the linker (/home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... no
checking for arm-linux-dumpbin... no
checking for arm-linux-link... no
checking for dumpbin... no
checking for link... link -dump
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to arm-unknown-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-ld option to reload object files... -r
checking for arm-linux-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for arm-linux-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for arm-linux-ar... ar
checking for archiver @FILE support... @
checking for arm-linux-strip... strip
checking for arm-linux-ranlib... no
checking for ranlib... ranlib
checking command to parse nm output from /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc object... ok
checking for sysroot... no
checking for arm-linux-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... no
checking for /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc option to produce PIC... -fPIC -DPIC
checking if /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc PIC flag -fPIC -DPIC works... yes
checking if /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc static flag -static works... yes
checking if /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc supports -c -o file.o... yes
checking if /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc supports -c -o file.o... (cached) yes
checking whether the /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc linker (/home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-ld
checking if the linker (/home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-ld) is GNU ld... yes
checking whether the g++ linker (/home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-ld) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for pid_t... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/poll.h usability... yes
checking sys/poll.h presence... yes
checking for sys/poll.h... yes
checking sys/procset.h usability... no
checking sys/procset.h presence... no
checking for sys/procset.h... no
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/stropts.h usability... yes
checking sys/stropts.h presence... yes
checking for sys/stropts.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking for dlfcn.h... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.h... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for memory.h... (cached) yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking setjmp.h usability... yes
checking setjmp.h presence... yes
checking for setjmp.h... yes
checking stdbool.h usability... yes
checking stdbool.h presence... yes
checking for stdbool.h... yes
checking sysexits.h usability... yes
checking sysexits.h presence... yes
checking for sysexits.h... yes
checking for unistd.h... (cached) yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking for string.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for inttypes.h... (cached) yes
checking for working stdnoreturn.h... no
checking for runetype.h... no
checking for wchar.h... yes
checking for wchar_t... yes
checking for wint_t... yes
checking for int8_t... yes
checking for uint8_t... yes
checking for int16_t... yes
checking for uint16_t... yes
checking for int32_t... yes
checking for uint32_t... yes
checking for intptr_t... yes
checking for uintptr_t... yes
checking for uint_t... no
checking for pid_t... (cached) yes
checking for size_t... yes
checking for ptrdiff_t... yes
checking size of char *... 4
checking size of int... 4
checking size of long... 4
checking size of short... 2
checking for pathfind in -lgen... no
checking for gettext in -lintl... no
checking for vprintf... yes
checking for _doprnt... no
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... cross
configure: WARNING: result yes guessed because of cross compilation
checking for working vfork... (cached) yes
checking for mmap... yes
checking for canonicalize_file_name... yes
checking for snprintf... yes
checking for strdup... yes
checking for strchr... yes
checking for strrchr... yes
checking for strsignal... yes
checking for fchmod... yes
checking for fstat... yes
checking for chmod... yes
checking for a sed that does not truncate output... (cached) /usr/bin/sed
configure: Using supplied libopts tearoff
checking for arm-linux-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking if pkg-config is at least version 0.15.0... yes
checking if libevent 2 or later is installed... Package libevent_pthreads was not found in the pkg-config search path.
Perhaps you should add the directory containing `libevent_pthreads.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libevent_pthreads' found
no
configure: Using libevent tearoff
checking for size_t... (cached) yes
checking for stdarg.h... (cached) yes
checking for unsigned long long int... yes
checking for vsnprintf... yes
checking whether vsnprintf is C99 compliant... no
checking if C99-snprintf replacement vsnprintf will be used... yes
checking for inttypes.h... (cached) yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdint.h... (cached) yes
checking for struct lconv.decimal_point... yes
checking for struct lconv.thousands_sep... yes
checking for long double... yes
checking for long long int... yes
checking for unsigned long long int... (cached) yes
checking for size_t... (cached) yes
checking for intmax_t... yes
checking for uintmax_t... yes
checking for uintptr_t... (cached) yes
checking for ptrdiff_t... (cached) yes
checking for localeconv... yes
checking for an ANSI C-conforming const... yes
checking for snprintf... (cached) yes
checking whether snprintf is C99 compliant... no
checking if C99-snprintf replacement snprintf will be used... yes
checking for ld used by /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc... (cached) /home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-ld
checking if the linker (/home/eecklund/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-ld) is GNU ld... (cached) yes
checking for directory path separator... '/'
checking line editing libraries... edit,editline
checking for readline() with -ledit... no
checking for readline() with -ledit -ltermcap... no
checking for el_gets() with -ledit -ltermcap... no
checking for readline() with -ledit -lcurses... no
checking for el_gets() with -ledit -lcurses... no
checking for readline() with -ledit -lncurses... no
checking for el_gets() with -ledit -lncurses... no
checking for readline() with -leditline... no
checking for readline() with -leditline -ltermcap... no
checking for el_gets() with -leditline -ltermcap... no
checking for readline() with -leditline -lcurses... no
checking for el_gets() with -leditline -lcurses... no
checking for readline() with -leditline -lncurses... no
checking for el_gets() with -leditline -lncurses... no
checking for library containing cos... -lm
checking for vfork.h... (cached) no
checking for fork... (cached) yes
checking for vfork... (cached) yes
checking for working fork... (cached) yes
checking for working vfork... (cached) yes
checking for working alloca.h... yes
checking for alloca... yes
checking whether strerror_r is declared... yes
checking for strerror_r... yes
checking whether strerror_r returns char *... yes
checking for library containing clock_gettime... -lrt
checking for clock_getres... yes
checking for clock_gettime... yes
checking for clock_settime... yes
checking for getclock... no
checking for stime... yes
checking for timegm... yes
checking for strlcpy... no
checking for strlcat... no
checking for library containing snprintb... no
checking for errno.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for sys/types.h... (cached) yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for net/if.h... yes
checking for linux/if_addr.h... yes
checking arpa/nameser.h usability... yes
checking arpa/nameser.h presence... yes
checking for arpa/nameser.h... yes
checking for sys/param.h... (cached) yes
checking for sys/time.h... (cached) yes
checking sys/timers.h usability... no
checking sys/timers.h presence... no
checking for sys/timers.h... no
checking for sys/sysctl.h... yes
checking netinet/in_system.h usability... no
checking netinet/in_system.h presence... no
checking for netinet/in_system.h... no
checking netinet/in_systm.h usability... yes
checking netinet/in_systm.h presence... yes
checking for netinet/in_systm.h... yes
checking for netinet/in.h... (cached) yes
checking for resolv.h... yes
checking for net/if_var.h... no
checking for netinet/ip.h... yes
checking for netinet/in_var.h... no
checking for library containing inet_pton... none required
checking for library containing inet_ntop... none required
checking for library containing setsockopt... none required
checking for recvmsg... yes
checking for inline... inline
checking whether time.h and sys/time.h may both be included... yes
checking size of time_t... 4
checking whether char is unsigned... yes
checking size of signed char... 1
checking for s_char... no
checking for long long... yes
checking size of short... (cached) 2
checking size of int... (cached) 4
checking size of long... (cached) 4
checking size of long long... 8
checking for uid_t in sys/types.h... yes
checking if we're including debugging code... yes
checking semaphore.h usability... yes
checking semaphore.h presence... yes
checking for semaphore.h... yes
checking for socketpair... yes
checking for _beginthread... no
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking POSIX thread version... 10
checking for LinuxThreads pthread.h... no
checking for GNU Pth pthread.h... no
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking for pthread_create in default libraries... no
checking for pthread link with -kthread... no
checking for pthread link with -pthread... yes
configure: ol_link_threads: <posix> ol_link_pthreads <-pthread>
checking for sched_yield... yes
checking for pthread_yield... yes
checking for thr_yield... no
checking for pthread_kill... yes
checking for pthread_rwlock_destroy with <pthread.h>... yes
checking for pthread_detach with <pthread.h>... yes
checking for pthread_setconcurrency... yes
checking for pthread_getconcurrency... yes
checking for thr_setconcurrency... no
checking for thr_getconcurrency... no
checking for pthread_kill_other_threads_np... no
checking for LinuxThreads implementation... no
checking for LinuxThreads consistency... no
checking if pthread_create() works... yes
checking if select yields when using pthreads... cross
configure: error: crossing compiling: use --with-yielding-
运行make之后,我检查文件。
文件ntpdate/ntpdate结果:
ntpdate/ntpdate: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0x4874a368a9eff3595cfca7948c4588627c80be80, not stripped
最佳答案
你试着照上面说的做了吗?
/configure --with-yielding-select=yes -prefix=$(pwd) CC=~/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-gcc LD=~/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-ld AS=~/development/trunk/build_tools/arm-2010q1/bin/arm-none-linux-gnueabi-as --host=arm-linux CFLAGS=-static
尽管我已经安装了openssl,但在make过程中我做了那件事,然后得到了一个
"missing openssl/bn.h"
错误。通过添加
--with-openssl-incdir="/usr/include"
作为配置选项来解决此问题。现在尝试解决配置过程中出现的“错误:系统上必须有stdarg.h或varargs.h”错误。如果我解决的话会回来的。关于linux - 无法使NTP交叉编译到ARM,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40470198/