我是新手来进行交叉编译,我按照using-crosstool-ng-and-cygwin by MAKSYM SHYTE
中的步骤操作在为i686-nptl-linux-gnu目标生成交叉编译器时,crosstool无法构建gettext
build = x86_64-unknown-cygwin
host = x86_64-unknown-cygwin
target = i686-nptl-linux-gnu or x86_64-unknown-linux-gnu
注意:获取gettext模块需要此gnulib patch from Ken Brown。或者,如果我们只是在/usr/include/sys/types.h as per thorrr from bountysource中注释#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返回1退出状态”之前的所有日志
1)构建日志显示“构建和安装构建的gettext模块”成功但在“为主机构建和安装gettext模块”时失败 - 自构建和构建以来可能有什么不同主机架构是一样的 - x86 / cygwin ??我错过了任何配置设置吗?
2)如果有人使用crosstool-ng处理针对linux 64 / 32bit目标的最新cygwin版本,请分享详细的步骤或链接。
[UPDATE3]
由于我没有尝试为linux进行交叉编译(ubuntu),我尝试了 arm-unknown-linux-gnueabi和armv7-rpi2-linux-gnueabihf目标,cygwin可以生成交叉编译器目标即可。奇怪的是,在Cygwin中,32位和64位普通linux目标的交叉编译器生成失败了。我可能错过了一些微不足道的事情。
[/ UPDATE3]
最近在(x86 / i686)_linux目标上取得成功的人请分享您的步骤或链接。
答案 0 :(得分:0)
我遇到了同样的问题,但使用了不同的配置:
build = x86_64-unknown-cygwin
host = x86_64-w64-mingw32
target = x86_64-pc-linux-gnu
我无法将其链接到crosstool构建中,但是我通过从.config文件中删除以下内容来解决gettext链接器错误
通过从.config中删除expat行,我得到了gettext链接。但 只为#34;本机gdb"的最终配置错误以后。
[EXTRA] Building native gdb
[ERROR] configure: error: expat is missing or unusable