调试 ntp-4.2.8p7 源码,编译报错
cd /ntpd/sntp && env PATH="/prj/ntpd/__build/obj/sntp:/opt/gcc-4.4.7-gnu/bin/:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin" AUTOGEN_DNE_DATE=-D autogen -L include -L ag-tpl --writable -DMAN_SECTION=1sntpmdoc -Tagmdoc-cmd.tpl sntp-opts.def
Error in template /usr/local/share/autogen/cmd-doc.tlib, line 219
DEFINITIONS ERROR in /usr/local/share/autogen/cmd-doc.tlib line 219 for sntp-opts.mdoc:
Cannot locate converter for mdoc
Failing Guile command: = = = = =
(define sec-type (string-upcase (get “ds-type”)))
(define sec-name (name-to-fname sec-type))
(define cvt-fn (find-file (string-append
(get “ds-format” “man”) “2mdoc”)))
(if (not (defined? 'cvt-fn))
(error (sprintf “Cannot locate converter for %s”
(get “ds-format” “man”))))
(define sec-file (string-append tmp-dir “/SEC/” sec-name))
(access? sec-file R_OK)
=================================
I'm cross-compiling ntp-4.2.8p10 for aarch64 using Debian as the build machine. I can build it fine with the native compiler, but using the ARM cross-compiler I get this:
8<-----------8<------------8<
make[4]: Leaving directory '/home/asmith/xds/rootfs85-arm/sandbox/ntp/xbuild/sntp/libopts'
make[4]: Entering directory '/home/asmith/xds/rootfs85-arm/sandbox/ntp/xbuild/sntp'
cd /home/asmith/xds/rootfs85-arm/sandbox/ntp/sntp && env PATH="/home/asmith/xds/rootfs85-arm/sandbox/ntp/xbuild/sntp:/home/asmith/bin:/home/asmith/xds/toolchain-16.3.0.0/bin:/home/asmith/xds/rootfs85-arm/sandbox/xds-scripts/:/home/asmith/bin:/home/asmith/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/lib/jvm/java-6-sun-1.6.0.03/bin:/usr/NX/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/lib/jvm/java-6-sun-1.6.0.03/bin:/usr/NX/bin" AUTOGEN_DNE_DATE=-D autogen -L include -L ag-tpl --writable -DMAN_SECTION=1sntpmdoc -Tagmdoc-cmd.tpl sntp-opts.def
Error in template /usr/share/autogen/cmd-doc.tlib, line 219
DEFINITIONS ERROR in /usr/share/autogen/cmd-doc.tlib line 219 for sntp-opts.mdoc:
Cannot locate converter for mdoc
Failing Guile command: = = = = =
(define sec-type (string-upcase (get "ds-type")))
(define sec-name (name-to-fname sec-type))
(define cvt-fn (find-file (string-append
(get "ds-format" "man") "2mdoc")))
(if (not (defined? 'cvt-fn))
(error (sprintf "Cannot locate converter for %s"
(get "ds-format" "man"))))
(define sec-file (string-append tmp-dir "/SEC/" sec-name))
(access? sec-file R_OK)
=================================
Makefile:1580: recipe for target '/home/asmith/xds/rootfs85-arm/sandbox/ntp/sntp/sntp.1sntpmdoc' failed
make[4]: *** [/home/asmith/xds/rootfs85-arm/sandbox/ntp/sntp/sntp.1sntpmdoc] Error 2
make[4]: Leaving directory '/home/asmith/xds/rootfs85-arm/sandbox/ntp/xbuild/sntp'
Makefile:1051: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/home/asmith/xds/rootfs85-arm/sandbox/ntp/xbuild/sntp'
Makefile:679: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/asmith/xds/rootfs85-arm/sandbox/ntp/xbuild/sntp'
Makefile:666: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/asmith/xds/rootfs85-arm/sandbox/ntp/xbuild'
Makefile:598: recipe for target 'all' failed
make: *** [all] Error 2
Failed
8<-----------8<------------8<
Since it works for the native build, I'm wondering what I could be missing in building for ARM64. I can get past this error by commenting the mdoc portions of sntp-opts.def and the other def files that fail after doing so, but I'm not happy with that kind of hack.
I've used this ARM64 toolchain to build many other projects successfully. Any help appreciated,
--
@@ron
$ autogen --version
autogen (GNU AutoGen) 5.18.12
$ aarch64-bcm-linux-gnueabi-gcc --version
aarch64-bcm-linux-gnueabi-gcc (crosstool-NG crosstool-ng-1.23.0) 6.3.0
Copyright (C) 2016 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.
主要参考下面这句话解决的,但是不清除./bootstrap 这个命令有什么作用。。😟
Resolved by running ./bootstrap in top-level directory of pristine source.
在调试ntp-4.2.8p7源码时,使用ARM64交叉编译器遇到模板错误,无法定位mdoc转换器,通过运行./bootstrap命令解决了问题。

被折叠的 条评论
为什么被折叠?



