gpt4 book ai didi

linux - gettext 编译在 cygwin 上的 crosstool-ng 构建中失败

转载 作者:太空宇宙 更新时间:2023-11-04 12:45:55 25 4
gpt4 key购买 nike

我是交叉编译的新手,我按照 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

注意:这个 gnulib patch from Ken Brown需要获取 gettext 模块编译。或者,如果我们只是在/usr/include/sys/types.h 中注释掉#include as per thorrr from bountysource,它也会编译。

[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 returned 1 exit status”之前的所有日志

1) 构建日志显示“为构建构建和安装 gettext 模块”成功但在“为 host 构建和安装 gettext 模块”时失败 - 自构建和主机架构相同 - x86/cygwin ??我是否缺少任何配置设置?

2) 如果有人在 linux 64/32 位目标的最新 cygwin 版本上使用 crosstool-ng,请分享详细步骤或链接。

[更新3]

因为我没有尝试为 linux(ubuntu) 进行交叉编译,所以我尝试了 arm-unknown-linux-gnueabi 和 armv7-rpi2-linux-gnueabihf 目标,cygwin 可以为两者生成交叉编译器目标。奇怪的是,32 位和 64 位普通 linux 目标的交叉编译器生成在 Cygwin 中失败。我可能遗漏了一些微不足道的东西。

[/UPDATE3]

最近在 (x86/i686)_linux 目标上取得成功的任何人请分享您的步骤或链接。

最佳答案

undefined symbol (XML_GetFeatureList XML_GetCurrentLineNumber XML_GetCurrentColumnNumber XML_ParserCreate XML_SetElementHandler XML_Parse XML_ParserFree XML_GetErrorCode XML_ErrorString) 在 expat-2.1.0.tar - 一个单独的包中定义。我无法将其链接到 crosstool 构建中,但我通过从 .config 文件中删除以下内容

克服了 gettext 链接器错误
CT_EXPAT=y 
CT_EXPAT_NEEDED=y
CT_EXPAT_VERSION="2.1.0"
CT_EXPAT_V_2_1_0=y

关于linux - gettext 编译在 cygwin 上的 crosstool-ng 构建中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38740555/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com