0

我正在尝试使用ctosstool-ng-1.24.0在 Windows 10 上的 cygwin 上构建 arm RPI4 交叉编译器和工具链

该过程工作正常,从 ubuntu 20.4 主机生成 arm RPI4 工具链,但在 Windows 10 上失败

Raspberry Pi的预构建 Windows 工具链 有黄金链接器问题,无法解决 Windows 上的 gtk-3 和 gdk-3 依赖库。所以我想看看新生成的是否可以解决问题。

ctosstool-ng 在 cygwin 上为 armv8-rpi3-linux-gnueabihf 构建失败,伴随着一阵阵

[ERROR]      /usr/include/sys/features.h:322:5: error: "_FORTIFY_SOURCE" is not defined, evaluates to 0 [-Werror=undef]

其次是

[EXTRA]      Installing C library start files
[ERROR]      ../include/link.h:43:57: error: unknown type name 'Lmid_t'; did you mean 'pid_t'?
[ERROR]      ../sysdeps/posix/dl-fileid.h:27:5: error: unknown type name 'ino64_t'
[ERROR]      ../sysdeps/posix/dl-fileid.h:35:17: error: storage size of 'st' isn't known
[ERROR]      ../sysdeps/posix/dl-fileid.h:37:37: error: '_STAT_VER' undeclared (first use in this function)
[ERROR]      /usr/include/cygwin/core_dump.h:19:10: fatal error: windows.h: No such file or directory
[ERROR]      /usr/include/cygwin/core_dump.h:19:10: fatal error: windows.h: No such file or directory
[ERROR]      make[3]: *** [../Makerules:287: /cygdrive/c/repo/ctng124/bld/.build/arm-unknown-linux-gnueabihf/build/build-libc-startfiles/multilib/tlsdesc.h] Error 1
[ERROR]      make[3]: *** Waiting for unfinished jobs....
[ERROR]      make[3]: *** [../Makerules:287: /cygdrive/c/repo/ctng124/bld/.build/arm-unknown-linux-gnueabihf/build/build-libc-startfiles/multilib/tcb-offsets.h] Error 1
[ERROR]      /usr/include/cygwin/core_dump.h:19:10: fatal error: windows.h: No such file or directory
[ERROR]      make[3]: *** [../Makerules:287: /cygdrive/c/repo/ctng124/bld/.build/arm-unknown-linux-gnueabihf/build/build-libc-startfiles/multilib/rtld-global-offsets.h] Error 1
[ERROR]      make[2]: *** [Makefile:258: csu/subdir_lib] Error 2
[ERROR]      make[1]: *** [Makefile:9: csu/subdir_lib] Error 2
[ERROR]  /
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Building for multilib 1/1: '''
[ERROR]  >>        called in step 'Installing C library headers & start files'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@376]
[ERROR]  >>        called from: glibc_backend_once[scripts/build/libc/glibc.sh@374]
[ERROR]  >>        called from: CT_IterateMultilibs[scripts/functions@1586]
[ERROR]  >>        called from: glibc_backend[scripts/build/libc/glibc.sh@74]
[ERROR]  >>        called from: glibc_start_files[scripts/build/libc/glibc.sh@38]
[ERROR]  >>        called from: do_libc_start_files[scripts/build/libc.sh@28]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@696]
[ERROR]  >>
[ERROR]  >>  For more info on this error, look at the file: 'build.log'
[ERROR]  >>  There is a list of known issues, some with workarounds, in:
[ERROR]  >>      https://crosstool-ng.github.io/docs/known-issues/
[ERROR]  >>
[ERROR]  >>  If you feel this is a bug in crosstool-NG, report it at:
[ERROR]  >>      https://github.com/crosstool-ng/crosstool-ng/issues/
[ERROR]  >>
[ERROR]  >>  Make sure your report includes all the information pertinent to this issue.
[ERROR]  >>  Read the bug reporting guidelines here:
[ERROR]  >>      http://crosstool-ng.github.io/support/
[ERROR]  /
[ERROR]  (elapsed: 130:50.55)
[131:02] / make: *** [ct-ng:261: build] Error 2

我已经尝试过 cygwin gcc 版本 9.3 和 11.3 以及在 menuconfig、glib2.28 和 glib2.24 下。在安装 kernel_headers 后,它们都在“libc_start_files”步骤中失败。

从以下步骤开始:

$ ../configure --prefix=<install-dir>
$ make
$ make install
$ ./ct-ng armv8-rpi3-linux-gnueabihf
$ ./ct-ng menuconfig (choose glib 2.28)
$ ./ct-ng build

链接到:构建日志 .config make 和 make-install 日志

如果有人在 Windows 主机上成功构建了这个,请分享您的步骤/配置。

===[更新 1] ===

看起来c:/cygwin64//usr/includecygwin env 已包含在编译器选项中。我ac_cv_env_CPPFLAGS_value=-Ic:/cygwin64//usr/include位于build/build-libc-startfiles/multilib/config.cache. 但不确定这是否是导致 linux 文件进入 cygwin64 的原因。

gawk -f ../scripts/gen-as-const.awk ../sysdeps/arm/tlsdesc.sym |
arm-unknown-linux-gnueabihf-gcc  -O2 -D_FORTIFY_SOURCE=0  
-mlittle-endian   -mcpu=cortex-a53  -mfpu=neon-vfpv4 -mhard-float    
-S -o /cygdrive/c/repo/ctng124/bld/.build/arm-unknown-linux-gnueabihf/build/build-libc-startfiles/multilib/tlsdesc.hT3 
-std=gnu11 -fgnu89-inline  -O2 -Wall -Wundef -Wwrite-strings 
-fmerge-all-constants -fno-stack-protector -frounding-math -g 
-Wstrict-prototypes -Wold-style-definition -fno-math-errno     
-ftls-model=initial-exec   

-U_FORTIFY_SOURCE -Ic:/cygwin64//usr/include  

< rest pf of the includes are from under the .build dir >
... -I.. -I../libio -I. -nostdinc -isystem  .... 
-DTOP_NAMESPACE=glibc       -DGEN_AS_CONST_HEADERS -x c -   
-MD -MP -MF /cygdrive/c/repo/ctng124/bld/.build/arm-unknown-linux-gnueabihf/build/build-libc-startfiles/multilib/tlsdesc.h.dT 
-MT '/cygdrive/c/repo/ctng124/bld/.build/arm-unknown-linux-gnueabihf/build/build-libc-startfiles/multilib/tlsdesc.h.d 
/cygdrive/c/repo/ctng124/bld/.build/arm-unknown-linux-gnueabihf/build/build-libc-startfiles/multilib/tlsdesc.h'

同样不清楚这些是如何从根构建目录传播到组件构建/编译器选项的。

任何跟踪/调试编译器选项的建议都将是最有帮助的。

===

有没有人遇到过这些错误?

可能是什么原因造成的?

请分享您在上述方面的任何经验。

4

0 回答 0