Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory structure mismatch for new Android NDK - libgcc.a: No such file or directory #491

Closed
mastef opened this issue Jul 29, 2016 · 6 comments

Comments

@mastef
Copy link

mastef commented Jul 29, 2016

When compiling with the latest android NDK I'm getting a

arm-linux-androideabi-g++: error:
    /SDKs/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9/libgcc.a: No such file or directory

Error: error running
    arm-linux-androideabi-g++
     -olibApplicationMain-debug-v7.so
     -frtti
     -nostdlib
     -Wl,-shared,-Bsymbolic
     -Wl,--no-undefined
     -Wl,-z,noexecstack
     --sysroot=/SDKs/android-ndk/platforms/android-9/arch-arm
     -L/SDKs/android-ndk/platforms/android-9/arch-arm/usr/lib @obj/android-debug-v7/all_objs /SDKs/android-ndk/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/libgnustl_static.a /SDKs/android-ndk/platforms/android-9/arch-arm/usr/lib/crtbegin_so.o /SDKs/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9/libgcc.a /SDKs/android-ndk/platforms/android-9/arch-arm/usr/lib/libc.so /SDKs/android-ndk/platforms/android-9/arch-arm/usr/lib/libm.so
     -llog
     -ldl

This is because the folder structure has changed, android-toolchain.xml is looking in
lib name="${prebuiltBase}/lib/gcc/${EXEPREFIX}/${TOOLCHAIN_VERSION}/libgcc.a"/>
which results in :
/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9/libgcc.a
but the file is in :
/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a:

https://github.com/HaxeFoundation/hxcpp/blob/master/toolchain/android-toolchain.xml#L162

So although the TOOLCHAIN_VERSION is correctly set to 4.9 ( and works for all other folders ), the folder structure in this case should resolve to 4.9.x. I guess adding a new variable like TOOLCHAIN_SUBVERSION or detecting if the folder exists could resolve this

@hughsando
Copy link
Member

What a pain.
I wonder if I could get some kind of sysroot to work. I try before, but could not. The situation could be better now.

@mastef
Copy link
Author

mastef commented Aug 2, 2016

There must have been a similar issue with the 4.6 version as it had 4.6.x-google instead of 4.6 in the same spot.

@Misiur
Copy link

Misiur commented Aug 9, 2016

25247b4 - didn't this resolve it? (only for the problem in first post, not the 4.6.x-google)

@mastef
Copy link
Author

mastef commented Aug 9, 2016

Oh yeah that commit happened around the time when I posted the ticket, lgtm

@Misiur
Copy link

Misiur commented Aug 9, 2016

You were first. I think @jgranick saw your issue and fixed it right away, but didn't mention it in commit message/posted here.

Unrelated question: now we've got to wait for binary version bump to get this patch via haxelib?

@hughsando
Copy link
Member

Is this one working now?

@mastef mastef closed this as completed Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants