我是交叉编译的新手,我遵循了MAKSYM SHYTE 使用交叉工具ng和cygwin的步骤
为i686 nptl linux gnu目标生成交叉编译器时,交叉工具无法构建gettext
build = x86_64-unknown-cygwin
host = x86_64-unknown-cygwin
target = i686-nptl-linux-gnu or x86_64-unknown-linux-gnu
注意:Ken Brown的这个gnulib补丁是编译gettext模块所必需的。或者,如果我们只是根据bountysource 中的thorrr注释掉/usr/include/sys/types.h中的#include,它也会编译
[UPDATE1]为主机构建gettext模块也为x86_64-unknown-linux-gnu目标提供了完全相同的错误。
在为主机生成gettext模块时,ct-ng生成在链接阶段失败。
[ALL ] libtool: link: x86_64-build_unknown-cygwin-g++ -shared -nostdlib
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/crtbeginS.o
.libs/libgettextsrc_la-message.o .libs/libgettextsrc_la-po-error.o
.libs/libgettextsrc_la-po-xerror.o .libs/libgettextsrc_la-read-catalog-abstract.o
.libs/libgettextsrc_la-po-lex.o .libs/libgettextsrc_la-po-gram-gen.o
.libs/libgettextsrc_la-po-charset.o .libs/libgettextsrc_la-read-po.o
.libs/libgettextsrc_la-read-properties.o .libs/libgettextsrc_la-read-stringtable.o
.libs/libgettextsrc_la-open-catalog.o .libs/libgettextsrc_la-dir-list.o
.libs/libgettextsrc_la-str-list.o .libs/libgettextsrc_la-read-catalog.o
../woe32dll/.libs/libgettextsrc_la-c++color.o ../woe32dll/.libs/libgettextsrc_la-c++write-catalog.o
../woe32dll/.libs/libgettextsrc_la-c++write-properties.o
../woe32dll/.libs/libgettextsrc_la-c++write-stringtable.o
../woe32dll/.libs/libgettextsrc_la-c++write-po.o
.libs/libgettextsrc_la-msgl-ascii.o .libs/libgettextsrc_la-msgl-iconv.o
.libs/libgettextsrc_la-msgl-equal.o .libs/libgettextsrc_la-msgl-cat.o
.libs/libgettextsrc_la-msgl-header.o .libs/libgettextsrc_la-msgl-english.o
.libs/libgettextsrc_la-msgl-check.o .libs/libgettextsrc_la-file-list.o
.libs/libgettextsrc_la-msgl-charset.o .libs/libgettextsrc_la-po-time.o
.libs/libgettextsrc_la-plural-exp.o .libs/libgettextsrc_la-plural-eval.o
.libs/libgettextsrc_la-plural-table.o .libs/libgettextsrc_la-sentence.o
.libs/libgettextsrc_la-libexpat-compat.o ../woe32dll/.libs/libgettextsrc_la-c++format.o
.libs/libgettextsrc_la-format-c.o .libs/libgettextsrc_la-format-sh.o
.libs/libgettextsrc_la-format-python.o .libs/libgettextsrc_la-format-python-brace.o
.libs/libgettextsrc_la-format-lisp.o .libs/libgettextsrc_la-format-elisp.o
.libs/libgettextsrc_la-format-librep.o .libs/libgettextsrc_la-format-scheme.o
.libs/libgettextsrc_la-format-java.o .libs/libgettextsrc_la-format-csharp.o
.libs/libgettextsrc_la-format-awk.o .libs/libgettextsrc_la-format-pascal.o
.libs/libgettextsrc_la-format-ycp.o .libs/libgettextsrc_la-format-tcl.o
.libs/libgettextsrc_la-format-perl.o .libs/libgettextsrc_la-format-perl-brace.o
.libs/libgettextsrc_la-format-php.o .libs/libgettextsrc_la-format-gcc-internal.o
.libs/libgettextsrc_la-format-gfc-internal.o .libs/libgettextsrc_la-format-qt.o
.libs/libgettextsrc_la-format-qt-plural.o .libs/libgettextsrc_la-format-kde.o
.libs/libgettextsrc_la-format-kde-kuit.o .libs/libgettextsrc_la-format-boost.o
.libs/libgettextsrc_la-format-lua.o .libs/libgettextsrc_la-format-javascript.o
.libs/libgettextsrc_la-read-desktop.o ../woe32dll/.libs/libgettextsrc_la-gettextsrc-exports.o
-L/home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/intl/.libs
../gnulib-lib/.libs/libgettextlib.dll.a
-L/home/admin/l64/.build/i686-nptl-linux-gnu/buildtools/lib /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/intl/.libs/libintl.dll.a
-lncurses ../intl/.libs/libintl.dll.a /home/admin/l64/.build/i686-nptl-linux-gnu/buildtools/lib/libiconv.dll.a
-L/usr/lib/gcc/x86_64-pc-cygwin/5.4.0
-L/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../x86_64-pc-cygwin/lib/../lib
-L/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../lib -L/lib/../lib
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../x86_64-pc-cygwin/lib
-L/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../.. -lstdc++ -lgcc_s -lgcc
-lcygwin -ladvapi32 -lshell32 -luser32 -lkernel32 -lgcc_s -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/crtend.o -g -O2
-Wl,--export-all-symbols -Wl,--disable-auto-import -o .libs/cyggettextsrc-0-19-6.dll
-Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libgettextsrc.dll.a
[ALL ] .libs/libgettextsrc_la-libexpat-compat.o: In function `is_XML_LARGE_SIZE_ABI':
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/libexpat-compat.c:74: undefined reference to `XML_GetFeatureList'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/libexpat-compat.c:74:(.text+0x28): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XML_GetFeatureList'
[ALL ] .libs/libgettextsrc_la-libexpat-compat.o: In function `rpl_XML_GetCurrentLineNumber':
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/libexpat-compat.c:90: undefined reference to `XML_GetCurrentLineNumber'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/libexpat-compat.c:90:(.text+0x96): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XML_GetCurrentLineNumber'
[ALL ] .libs/libgettextsrc_la-libexpat-compat.o: In function `rpl_XML_GetCurrentColumnNumber':
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/libexpat-compat.c:99: undefined reference to `XML_GetCurrentColumnNumber'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/libexpat-compat.c:99:(.text+0xb6): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XML_GetCurrentColumnNumber'
[ALL ] .libs/libgettextsrc_la-format-kde-kuit.o: In function `format_parse':
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/format-kde-kuit.c:236: undefined reference to `XML_ParserCreate'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/format-kde-kuit.c:236:(.text+0x27d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XML_ParserCreate'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/format-kde-kuit.c:244: undefined reference to `XML_SetElementHandler'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/format-kde-kuit.c:244:(.text+0x29f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XML_SetElementHandler'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/format-kde-kuit.c:248: undefined reference to `XML_Parse'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/format-kde-kuit.c:248:(.text+0x2b8): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XML_Parse'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/format-kde-kuit.c:258: undefined reference to `XML_Parse'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/format-kde-kuit.c:258:(.text+0x2d3): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XML_Parse'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/format-kde-kuit.c:269: undefined reference to `XML_ParserFree'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/format-kde-kuit.c:269:(.text+0x2eb): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XML_ParserFree'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/format-kde-kuit.c:261: undefined reference to `XML_GetErrorCode'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/format-kde-kuit.c:261:(.text+0x4ec): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XML_GetErrorCode'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/format-kde-kuit.c:261: undefined reference to `XML_ErrorString'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/format-kde-kuit.c:261:(.text+0x4f3): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XML_ErrorString'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/format-kde-kuit.c:264: undefined reference to `XML_ParserFree'
[ALL ] /home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src/format-kde-kuit.c:264:(.text+0x52a): additional relocation overflows omitted from the output
[ERROR] collect2: error: ld returned 1 exit status
[ERROR] make[6]: *** [Makefile:2388: libgettextsrc.la] Error 1
[ALL ] make[6]: Leaving directory '/home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src'
[ERROR] make[5]: *** [Makefile:2300: all] Error 2
[ALL ] make[5]: Leaving directory '/home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools/src'
[ERROR] make[4]: *** [Makefile:1742: all-recursive] Error 1
[ALL ] make[4]: Leaving directory '/home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools'
[ERROR] make[3]: *** [Makefile:1608: all] Error 2
[ALL ] make[3]: Leaving directory '/home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin/gettext-tools'
[ERROR] make[2]: *** [Makefile:380: all-recursive] Error 1
[ALL ] make[2]: Leaving directory '/home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin'
[ERROR] make[1]: *** [Makefile:336: all] Error 2
[ALL ] make[1]: Leaving directory '/home/admin/l64/.build/i686-nptl-linux-gnu/build/build-gettext-host-x86_64-build_unknown-cygwin'
[ERROR]
[ERROR] >>
[ERROR] >> Build failed in step 'Installing gettext for host'
[ERROR] >> called in step '(top-level)'
[ERROR] >>
[ERROR] >> Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR] >> called from: do_gettext_backend[scripts/build/companion_libs/330-gettext.sh@131]
[ERROR] >> called from: do_gettext_for_host[scripts/build/companion_libs/330-gettext.sh@63]
[ERROR] >> called from: do_companion_libs_for_host[scripts/build/companion_libs.sh@36]
[ERROR] >> called from: main[scripts/crosstool-NG.sh@646]
[ERROR] >>
[ERROR] >> For more info on this error, look at the file: 'build.log'
[UPDATE2]填写了"collect2:error:ld return 1 exit status"之前的所有日志
1) 构建日志显示,"为构建构建和安装gettext模块"成功了,但当"为主机构建和安装getext模块"时失败了-由于构建和主机架构相同-x86/cygwin,会有什么区别??我是否缺少任何配置设置?
2) 如果有人在最近的cygwin版本中使用了针对linux 64/32位目标的交叉工具ng,请分享详细的步骤或链接。
[更新3]
由于我没有尝试为linux(ubuntu)进行交叉编译,我尝试了arm未知的linux gnueabi和armv7-rpi2-linux-gnueabihf目标,cygwin可以生成对这两个目标都很好的交叉编译器。奇怪的是,32位和64位普通linux目标的交叉编译器生成在Cygwin中失败了。我可能错过了一些琐碎的事情。
[/UPDATE3]
任何最近在(x86/i686)_linux目标上取得成功的人,请分享您的步骤或链接。
未定义的符号(XML_GetFeatureList XML_GetCurrentLineNumber XML_GetCurrent ColumnNumber XML_ParserCreate XML_SetElementHandler XML_Parse XML_ParserFree XML_GetErrorCode XML_ErrorString)是在expat-2.1.0.tar(一个单独的包)中定义的。我无法将其链接到交叉工具构建中,但通过从.config文件中删除以下内容,我克服了gettext链接器错误
CT_EXPAT=y
CT_EXPAT_NEEDED=y
CT_EXPAT_VERSION="2.1.0"
CT_EXPAT_V_2_1_0=y
我有同样的问题,但使用了不同的配置:
build = x86_64-unknown-cygwin
host = x86_64-w64-mingw32
target = x86_64-pc-linux-gnu
我无法将其链接到交叉工具构建中,但通过从.config文件中删除以下内容,我克服了gettext链接器错误
通过从.config中删除expat行,我也获得了gettext链接只会在稍后出现"本机gdb"的配置错误。
[EXTRA] Building native gdb
[ERROR] configure: error: expat is missing or unusable