如何重新编译 Ubuntu 工具链?

How to recompile Ubuntu Toolchain?

在哪里可以找到 Ubuntu 工具链 (https://launchpad.net/~ubuntu-toolchain-r) 4.1/4.7/4.9/等构建服务器上使用的环境描述和构建选项?我如何重现此流程?

请建议如何构建相同的构建服务器。

此致。

来自 Ubuntu 回购:

#cat /etc/apt/sources.list.d/ubuntu-toolchain-r-test-precise.list

deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main
deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main

预构建步骤:

apt-get build-dep -y gcc-4.9-multilib
apt-get source -y gcc-4.9-multilib
dpkg-source -x gcc-4.9_4.9.2-0ubuntu1~12.04.dsc
cd gcc-4.9-4.9.2

如果你想制作相同的包:

dpkg-buildpackage -rfakeroot -b

如果要提供自定义参数:

mkdir -p src && tar -xf gcc-*.tar.xz -C src
cd src && ./contrib/download_prerequisites && cd ..
mkdir -p /opt/dev-tools-4.9
../src/configure --prefix=//opt/dev-tools-4.9 \
-v --with-pkgversion='Ubuntu/Linaro 4.9.2-0ubuntu1~12.04' \
--program-suffix=-4.9 --enable-shared --enable-linker-build-id --with-system-zlib \
--libexecdir=//opt/dev-tools-4.9/lib --without-included-gettext \
--enable-threads=posix --with-gxx-include-dir=//opt/dev-tools-4.9/include/c++/4.9 \
--libdir=//opt/dev-tools-4.9/lib --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes \
--enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror \
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64 --with-tune=generic \
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu  --with-sysroot=/  --enable-nls

make -j $(grep -c ^processor /proc/cpuinfo ) && make install