crtbegin_so.o缺少为Android工具链(定制) [英] crtbegin_so.o missing for android toolchain (custom build)

查看:2173
本文介绍了crtbegin_so.o缺少为Android工具链(定制)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用了Android build-gcc.sh脚本GCC编译在一起GDC,并包括在建/核心/ definitions.mk一个新的存根,以应对D语言文件作为构建过程的一部分。我知道事情是在这一点上编译好了,但我的问题是链接:

I have compiled gdc together with gcc using the android build-gcc.sh script, and have included a new stub in build/core/definitions.mk to deal with D language files as a part of the build process. I know things are compiling OK at this point, but my problem is linking:

当我建立一个项目,我得到这个错误:

When I build a project, I get this error:

ld: crtbegin_so.o: No such file: No such file or directory

这是正规C-只有项目也是如此。现在,我跑了一个快速的找到自己构建目录的,并发现该文件(crtbegin_so.o)不指定我当我的gcc编译(或者说SYSROOT,中存在时build-gcc.sh建它)。

This is true for regular c-only projects as well. Now I ran a quick find in my build directory, and found that the file (crtbegin_so.o) does exist within the sysroot I specified when I compiled gcc (or rather, when build-gcc.sh built it).


  • 什么是一些事情,我可以寻找到找到解决这个问题的?

  • What are some things I could look for to find a solution to this problem?

在本地会复制文件并直接链接到他们是在一个体面的解决办法
中期?

Would copying the files locally and linking directly to them be a decent solution in the interim?

为什么会LD(或collect2)试图以包括这些的GDC(D语言)联动?

Why would ld (or collect2) be trying to include these for a gdc (D Language) linkage?

推荐答案

这个问题上NDK R7C出现的Linux以及。

The issue arises on NDK r7c for linux as well.

我发现工具链忽略了平台位置($ NDK_ROOT /平台/ Android的-8 /弓臂/ usr / lib目录/)和搜索它在工具链的路径,这是不正确

I found that the toolchain ignores the platform location ($NDK_ROOT/platforms/android-8/arch-arm/usr/lib/) and searches for it in the toolchain path, which is incorrect.

不过,由于工具链也搜索在当前目录中的文件,一种解决方案是符号链接正确的平台crtbegin_so.o和crtend_so.o到源代码目录:

However, as the toolchain also searches for the file in the current directory, one solution is to symlink the correct platform crtbegin_so.o and crtend_so.o into the source directory:

CD SRC和放大器;&安培; LN -s NDK_ROOT /平台/ Android的-8 /弓臂/ usr / lib目录/ crtbegin_so.a

CD SRC和放大器;&安培; LN -s NDK_ROOT /平台/ Android的-8 /弓臂/ usr / lib目录/ crtend_so.a

这样你的第二个点应制定出(在这里你可以做一个符号链接,而不是复制)

Thus your second point should work out (where you can do a symlink, instead of a copy)

注意1:此假设code被编译为API8(Android 2.2的)使用NDK。请改变路径,以正确的路径按照您的要求。

NOTE 1:This assumes that the code is being compiled for API8 (Android 2.2) using the NDK. Please alter the path to the correct path as per your requirement.

注意2:的配置使用的标志:

./configure \
--host=arm-linux-androideabi \
CC=arm-linux-androideabi-gcc \
CPPFLAGS="-I$NDK_ROOT/platforms/android-8/arch-arm/usr/include/" \
CFLAGS="-nostdlib" \
LDFLAGS="-Wl,-rpath-link=$NDK_ROOT/platforms/android-8/arch-arm/usr/lib/ -L$NDK_ROOT/platforms/android-8/arch-arm/usr/lib/" \
LIBS="-lc"

这篇关于crtbegin_so.o缺少为Android工具链(定制)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆