关于为 Xscale ARM 构建交叉编译器的建议?

发布于 2024-08-21 03:30:06 字数 237 浏览 4 评论 0原文

我正在使用 PXA270 Xscale 开发板(类似于 Gumstix),并提供了交叉编译器,但它是 GCC 3.3.3。我想学习如何构建自己的交叉编译器,这样我就可以自定义设置,但在使用 crosstools 和 crosstools-ng 来成功构建工具链时遇到了困难。我的主要需求是使用 GCC 4.2.X 和使用软浮动的能力。我正在运行 Ubuntu 9。有人对为这样的系统构建工具链有任何建议或建议吗?

预先感谢,

I am playing around with a PXA270 Xscale development board (similar to the Gumstix), and was provided a cross compiler, but it is GCC 3.3.3. I would like to learn how to build my own cross compiler, so I can customize the setup, but have had trouble getting crosstools and crosstools-ng to successfully build a toolchain. My main needs are using GCC 4.2.X and the ability to use soft float. I am running Ubuntu 9. Does anyone have any recommendations or advice on building a toolchain for such a system?

Thanks in advance,

Ben

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

最初的梦 2024-08-28 03:30:06

www.gnuarm.com 拥有 构建您自己的 ARM 交叉编译器以及可用于 下载。他们那里没有 GCC 4.2.x,但我使用与那些指令非常相似的步骤构建了它,没有太多问题。

为什么需要软件浮点?速度会非常慢;大多数应用程序实际上只需要使用定点实现(读取:整数)。

www.gnuarm.com has instructions for building your own ARM cross compiler as well as binaries available for download. They don't have GCC 4.2.x there, but I've built it using steps pretty similar to those instructions without too many problems.

Why do you want software floating point? It's going to be really slow; most applications only really need to use a fixed point implementation (read: integers).

不寐倦长更 2024-08-28 03:30:06

简短的回答,非常困难。更长的答案,继续尝试,你可能会偶然发现它,但很可能不会。具有硬浮动的 Xscale 更有可能,只是不使用任何浮点。我知道我尝试了很多组合但都失败了。您正在寻找的组合通常使用较旧的 gcc,即最后一个可以工作的 gcc,这是有原因的。您可以查看 codesourcery 以了解他们拥有什么,使用那里的工具或了解他们在做什么可能是您最好的选择。

Short answer, very difficult. Longer answer, keep trying, you may stumble upon it but likely not. Xscale with hard float is more likely and just dont use any floating point. I know I tried many combinations and failed. There is a reason why the combination you are looking for normally uses the older gcc, the last one to work. You might look at codesourcery to see what they have, using there tools or learning what they are up to is likely your best bet.

这样的小城市 2024-08-28 03:30:06

我使用 Dan Kegel 的 crosstool 来创建我的手臂交叉工具链。我尝试了几次,但最终还是成功了。

我建议查看各种架构的构建结果矩阵,以帮助确定gcc、glibc、binutils 和 linux 内核头文件的合适组合。

以下是我用来创建手臂交叉工具链的脚本。我意识到我的要求与您的有点不同,但您也许可以修改它以满足您的需要。

#!/bin/sh

set -ex

# Extract crosstool
tar zxf crosstool-0.43.tar.gz
ln -sf crosstool-0.43 crosstool

# Create .dat file for toolchain
cat << EOF > $HOME/arm-cross.dat

BINUTILS_DIR=binutils-2.15
GCC_DIR=gcc-3.4.5
GCC_EXTRA_CONFIG=--with-float=soft
GCC_LANGUAGES=c,c++
GLIBC_ADDON_OPTIONS==linuxthreads,
GLIBC_DIR=glibc-2.3.6
GLIBC_EXTRA_CONFIG=--without-fp
GDB_DIR=gdb-6.5
KERNELCONFIG="\$HOME/crosstool/arm.config"
LINUX_DIR=linux-2.6.12.6
LINUX_SANITIZED_HEADER_DIR=
SHARED_MODE=--enable-shared
TARGET=arm-softfloat-linux-gnu
TARGET_CFLAGS=-O

BUILD_DIR="\$HOME/crosstool/build/\$TARGET/\$GCC_DIR-\$GLIBC_DIR"
PREFIX="/usr/crossgnu/\$GCC_DIR-\$GLIBC_DIR/\$TARGET"
SRC_DIR="\$HOME/crosstool/build/\$TARGET/\$GCC_DIR-\$GLIBC_DIR"
TARBALLS_DIR="\$HOME/downloads"
TOP_DIR="\$HOME/crosstool"

EOF

# Create toolchain directory
sudo mkdir -p /usr/crossgnu
sudo chown $USER /usr/crossgnu

# Build toolchain
pushd crosstool
eval `cat $HOME/arm-cross.dat` sh all.sh --gdb --notest
popd

注意:我有crosstool-0.43.tar。 gz tarball 位于我运行脚本的同一目录中。

I used Dan Kegel's crosstool for creating my arm cross toolchain. It took a few tries, but I was eventually able to get it right.

I recommend reviewing the matrix of build results for various architectures to help determine a suitable combination of gcc, glibc, binutils, and linux kernel headers.

The following is the script that I used to create my arm cross toolchain. I realize that my requirements are a bit different that yours, but you may be able to modify it to suit your needs.

#!/bin/sh

set -ex

# Extract crosstool
tar zxf crosstool-0.43.tar.gz
ln -sf crosstool-0.43 crosstool

# Create .dat file for toolchain
cat << EOF > $HOME/arm-cross.dat

BINUTILS_DIR=binutils-2.15
GCC_DIR=gcc-3.4.5
GCC_EXTRA_CONFIG=--with-float=soft
GCC_LANGUAGES=c,c++
GLIBC_ADDON_OPTIONS==linuxthreads,
GLIBC_DIR=glibc-2.3.6
GLIBC_EXTRA_CONFIG=--without-fp
GDB_DIR=gdb-6.5
KERNELCONFIG="\$HOME/crosstool/arm.config"
LINUX_DIR=linux-2.6.12.6
LINUX_SANITIZED_HEADER_DIR=
SHARED_MODE=--enable-shared
TARGET=arm-softfloat-linux-gnu
TARGET_CFLAGS=-O

BUILD_DIR="\$HOME/crosstool/build/\$TARGET/\$GCC_DIR-\$GLIBC_DIR"
PREFIX="/usr/crossgnu/\$GCC_DIR-\$GLIBC_DIR/\$TARGET"
SRC_DIR="\$HOME/crosstool/build/\$TARGET/\$GCC_DIR-\$GLIBC_DIR"
TARBALLS_DIR="\$HOME/downloads"
TOP_DIR="\$HOME/crosstool"

EOF

# Create toolchain directory
sudo mkdir -p /usr/crossgnu
sudo chown $USER /usr/crossgnu

# Build toolchain
pushd crosstool
eval `cat $HOME/arm-cross.dat` sh all.sh --gdb --notest
popd

Note: I had the crosstool-0.43.tar.gz tarball in the same directory I ran the script from.

懒的傷心 2024-08-28 03:30:06

如果您无法使用 crosstool* 构建交叉编译器,那么没有它们您就不可能做到这一点。这并不简单!

但是,您可以通过编辑 /etc/apt/sources.list 来最轻松地将最新的交叉编译器安装到 Ubuntu 上,然后

deb http://www.emdebian.org/debian/ lenny main

apt-get update
apt-get install g{cc,++}-4.3-arm-linux-gnueabi

If you can't manage to build a crosscompiler using crosstool*, you're unlikely be able to do so without them. It is not straightforward!

However, you can most easily get recent cross-compilers onto Ubuntu by editing /etc/apt/sources.list to include


deb http://www.emdebian.org/debian/ lenny main

then saying


apt-get update
apt-get install g{cc,++}-4.3-arm-linux-gnueabi

↘人皮目录ツ 2024-08-28 03:30:06

我也使用crosstool,并且能够在Cygwin下构建arm-xscale-linux-gcc。说明在这里: http://sourceforge.net/apps /mediawiki/imote2-linux/index.php?title=ToolsGccArm

I too used crosstool, and was able to build an arm-xscale-linux-gcc under Cygwin. The instructions are here: http://sourceforge.net/apps/mediawiki/imote2-linux/index.php?title=ToolsGccArm

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文