无法在 cygwin 下为 raspberry pi 交叉工具链构建 eglibc

Unable to build eglibc under cygwin for raspberry pi cross-toolchain

我正在使用 Mikhail Kupchik's tutorial to build a raspberry pi cross-toolchain for Windows. For avoiding problems related to usage of too recent packages I used Cygwin Time Machine. The packages I got are listed here

根据手册,我在 VirtualBox 中安装了 Windows XP 并下载了所有需要的档案。我将准备构建的步骤合并到一个 shell 脚本中:

#!/bin/bash

cd /opt/crosstool/src
for i in `ls -1 *.tar.gz`
do
    tar -xf $i
    rm -f $i
done

mkdir patches
mv *.diff patches

mkdir -p /opt/crosstool/gcc-4.6.3-eglibc-2.13/arm-linux-gnueabi
mkdir /opt/crosstool/gcc-4.6.3-eglibc-2.13/arm-linux-gnueabihf

cp -r gcc-4.6.3 gcc-4.6.3.noarmhf
cd gcc-4.6.3
cat ../patches/gcc--armhf-triplet.diff | patch -p2
cat ../patches/gcc--arm-dynamic-linker.diff | patch -p2
cat ../patches/gcc--arm-multilib-defaults.diff | patch -p2
cd ../eglibc-2.13
cat ../patches/eglibc--remove-manual.diff | patch -p1
cat ../patches/eglibc--cross-cygwin.diff | patch -p1
cd ..
cp -r eglibc-2.13 eglibc-2.13.noarmhf
cd eglibc-2.13
cat ../patches/eglibc--armhf-triplet.diff | patch -p1
cat ../patches/eglibc--armhf-linker.diff | patch -p1
cat ../patches/eglibc--ldconfig-cache-abi.diff | patch -p1
cat ../patches/eglibc--soname-hack.diff | patch -p1
cd ..
tar -h -zcf gcc-4.6.3-all.tar.gz \
    gcc-4.6.3 gcc-4.6.3.noarmhf

replace () {
    for i in extra-lib.mk Makeconfig Makerules linuxthreads/Makefile \
             nptl/Makefile sysdeps/i386/i686/Makefile sysdeps/sparc/sparc32/sparcv9/Makefile
    do
        sed -i.bak s/\.oS/\.oZ/ $i
    done
}

cd /opt/crosstool/src/eglibc-2.13
replace
cd /opt/crosstool/src/eglibc-2.13.noarmhf
replace

cd /opt/crosstool/src
for i in build-gmp build-mpfr build-mpc build-binutils build-gcc build-eglibc build-linux
do
    mkdir $i
done

然后我一口气执行构建:for i in ``seq 1 4``; do ./build_gcc_cross_$i.sh; done。这些脚本包含构建集,它们也来自教程。清单:1 (original) 2 (original) 3 (original) 4 (original)

前三个构建集进展顺利。但是第四次失败了。在控制台上,我看到大量 "file not found" 错误。我很乐意提供完整的 stout+stderr and config.log.

如能就我的问题提供帮助,我将不胜感激。

真丢人:我没有正确阅读第三个脚本的输出,错过了错误消息:

/bin/sh: perl: Command not found.

这可能是因为脚本的输出是:

=== build script: OK ===

然后我注意到脚本中完全没有错误处理。

我安装好perl后,就可以进行交叉编译环境的搭建了