交叉编译GLibC 2.24失败,错误1

时间:2017-01-21 11:36:47

标签: android linux makefile cross-compiling glibc

我正在尝试使用gcc-arm-linux-androideabi编译器为ARM(Android)交叉编译GLibC 2.24。这是我使用的./configure语法:

../glibc-2.24/configure --prefix=/usr --host=arm-linux-androideabi --with-headers=/usr/include

但是,当我运行make时,它会因以下错误而失败:

In file included from
../sysdeps/arm/libc-tls.c:19:0:
../csu/libc-tls.c: In function '__libc_setup_tls':
../csu/libc-tls.c:191:1: error: '__ARM_NR_set_tls' undeclared (first use in this function)
../csu/libc-tls.c:191:1: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [/home/red/glibc-build/csu/libc-tls.o] Error 1
make[2]: Leaving directory `/home/red/glibc-2.24/csu'
make[1]: *** [csu/subdir_lib] Error 2
make[1]: Leaving directory `/home/red/glibc-2.24'
make: *** [all] Error 2

我在网上浏览了它为什么会发生,没有找到任何东西。可能是造成此错误的原因是什么?

我正在运行Ubuntu 14.04.5 LTS 64位。

1 个答案:

答案 0 :(得分:1)

  

我正在运行Ubuntu 14.04.5 LTS 64位。

这是一个毫无意义的国家。 64位是什么?它是public class MyDownloadHandler : IDownloadHandler { private ProgressBar _bar; public MyDownloadHandler(ProgressBar bar) { _bar = bar; } public void OnBeforeDownload(IBrowser browser, DownloadItem downloadItem, IBeforeDownloadCallback callback) { } public void OnDownloadUpdated(IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { _bar.Dispatcher.Invoke(new Action(() => { Debug.Print("{0}/{1} bytes", downloadItem.ReceivedBytes, downloadItem.TotalBytes); _bar.Maximum = downloadItem.TotalBytes; _bar.Value = downloadItem.ReceivedBytes; })); } } sparc64aarch64还是其他什么?

您很可能正在使用x86_64。在这种情况下,您使用x86_64全部错误。 configure告诉--host=arm-linux-androideabi你正在构建一个ARM linux机器,这是不可能的。

您可能意味着您要为configure 目标构建,在这种情况下,正确的arm-linux-androideabi命令是这样的:

configure

您的configure --target=arm-linux-androideabi --prefix=/usr ... 设置也很可能不正确:您几乎肯定不想使用--with-headers主机中的/usr/include来构建arm目标。