Fixed
Status Update
Comments
xa...@android.com <xa...@android.com>
[Deleted User] <[Deleted User]> #2
An easier workaround is to fix the directory structure:
mv $TOOLCH/arm-linux-androideabi/include/c++/{4.6,4.6.x-google}
mv $TOOLCH/arm-linux-androideabi/include/c++/{4.6,4.6.x-google}
an...@google.com <an...@google.com> #3
Thanks for reporting and workaround. The fix has been submitted to https://android-review.googlesource.com/#/c/39878/ for review, and will be available in the next release.
sh...@gmail.com <sh...@gmail.com> #4
What can we move the directory structure to fix this?
sh...@gmail.com <sh...@gmail.com> #5
mv $NDK_TOOLCHAIN/arm-linux-androideabi/include/c++/4.6 $NDK_TOOLCHAIN/arm-linux-androideabi/include/c++/4.6.x-google
an...@google.com <an...@google.com> #6
cd <yourstandalonetoolchain>/arm-linux-androideabi/include/c++
mv 4.6 4.6.x-google
Alternatively, please use the updated make-standalone-toolchain.sh enclosed (also available in AOSP)
Sorry for the inconvenience!
mv 4.6 4.6.x-google
Alternatively, please use the updated make-standalone-toolchain.sh enclosed (also available in AOSP)
Sorry for the inconvenience!
sh...@gmail.com <sh...@gmail.com> #7
The attached file is empty.
sh...@gmail.com <sh...@gmail.com> #8
The fix submitted above does not work. I just tested it.
It fixes the include directories but the libs are still coming out as undefined references.
It fixes the include directories but the libs are still coming out as undefined references.
an...@google.com <an...@google.com> #9
By undefined references you mean issue similar to http://code.google.com/p/android/issues/detail?id=35616 ?
If not, please provide more details (error message, etc)
Reattach make-standalone-toolchain.sh for both issues
cd $NDK/build/tools/
unzip -o make-standalone-toolchain._ip
If not, please provide more details (error message, etc)
Reattach make-standalone-toolchain.sh for both issues
cd $NDK/build/tools/
unzip -o make-standalone-toolchain._ip
sh...@gmail.com <sh...@gmail.com> #10
All my projects have been working since NDKr5 including NDKr8. I realize the jump to gcc4.6 was likely going to cause an issue. Here is my errors now (after using the fixed make-standalone-toolchain).
Just to name a few (since it generates 100k+ errors):
undefined reference to '__gxx_personality_v0'
undefined reference to '__cxa_end_cleanup'
undefined reference to '__cxa_rethrow'
undefined reference to '__cxa_begin_catch'
undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const'
undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
I don't use exceptions anywhere which I believe some of those are related to. Seeing basic_string undefined is a bit troubling. The VTABLE looks like RTTI.
Just to name a few (since it generates 100k+ errors):
undefined reference to '__gxx_personality_v0'
undefined reference to '__cxa_end_cleanup'
undefined reference to '__cxa_rethrow'
undefined reference to '__cxa_begin_catch'
undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const'
undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
I don't use exceptions anywhere which I believe some of those are related to. Seeing basic_string undefined is a bit troubling. The VTABLE looks like RTTI.
an...@google.com <an...@google.com> #11
I just double-checked those functions do exist in libgnustl_shared.so and libstdc++.a. May I see linker command line?
Note that by default make-standalone-toolchain.sh create 4.6 toolchain. You may use the following to create 4.4.3 one. I wonder if 4.4.3 works.
./build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=<path> --toolchain=arm-linux-androideabi-4.4.3
Changes of toolchain requires manually cleaning of project (ie. Makefile normally don't contain dependency on toolchain)
Note that by default make-standalone-toolchain.sh create 4.6 toolchain. You may use the following to create 4.4.3 one. I wonder if 4.4.3 works.
./build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=<path> --toolchain=arm-linux-androideabi-4.4.3
Changes of toolchain requires manually cleaning of project (ie. Makefile normally don't contain dependency on toolchain)
sh...@gmail.com <sh...@gmail.com> #12
In my linker line I had to change the following:
-lstdc++ to -lgnustl_shared
Then I had to add:
-lsupc++
Again, my build system and projects have been working fine on previous NDK toolchains. I always use the standalone toolchain. So something either changed in the NDK or GCC4.6 didn't like my Makefiles.
-lstdc++ to -lgnustl_shared
Then I had to add:
-lsupc++
Again, my build system and projects have been working fine on previous NDK toolchains. I always use the standalone toolchain. So something either changed in the NDK or GCC4.6 didn't like my Makefiles.
sh...@gmail.com <sh...@gmail.com> #13
Of course changing to gnustl_shared means I can't deploy the app to android without copying the .so along. This solution won't stand.
an...@google.com <an...@google.com> #14
May I confirm that r8b 4.4.3 standalone work or not for project statically linked?
sh...@gmail.com <sh...@gmail.com> #15
Broken on NDKr8b using GCC4.4.3 or GCC4.6 (both STANDALONE toolchain). I verified the version being used before compiling in both cases.
Working in NDKr8 using GCC4.4.3.
In all tests the project was cloned clean and compiled.
Working in NDKr8 using GCC4.4.3.
In all tests the project was cloned clean and compiled.
an...@google.com <an...@google.com> #16
Just curious, is $NDK/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/libgnustl_static.a readable to you? Likewise for the one copied to <standalone-path>/arm-linux-androideabi/lib/libstdc++.a and others.
sh...@gmail.com <sh...@gmail.com> #17
libstdc++.a in the NDK tarball is readable.
libstdc++.a in the standalone was owned by root:root and was only 0600 for permissions.
This fixed the problem entirely. GCC does not report it can't read the file anywhere.
Thanks!!!
Now, cause. If I build the standalone again the permissions are again broken:
-rwxr-x--- 1 halss halss 1228531 Jul 3 01:18 libgnustl_shared.so
-rw-r----- 1 root root 2773822 Aug 1 13:04 libstdc++.a
-rw-r----- 1 halss halss 290420 Jul 3 01:18 libsupc++.a
Marking that one file unreadable again.
libstdc++.a in the standalone was owned by root:root and was only 0600 for permissions.
This fixed the problem entirely. GCC does not report it can't read the file anywhere.
Thanks!!!
Now, cause. If I build the standalone again the permissions are again broken:
-rwxr-x--- 1 halss halss 1228531 Jul 3 01:18 libgnustl_shared.so
-rw-r----- 1 root root 2773822 Aug 1 13:04 libstdc++.a
-rw-r----- 1 halss halss 290420 Jul 3 01:18 libsupc++.a
Marking that one file unreadable again.
an...@google.com <an...@google.com> #18
Glad to see root cause is identified! I guess you ran the script with root privilege. I have submitted fix for review: https://android-review.googlesource.com/#/c/40093 (also enclosed). Fixes for GCC to report unreadable header/lib will come later.
sh...@gmail.com <sh...@gmail.com> #19
Yes I do run the script with root privis. I generate a set of toolchains for all users on the machine.
Quick job on the fix. I just tested it and all seems well.
Quick job on the fix. I just tested it and all seems well.
an...@google.com <an...@google.com> #21
released in r8c
an...@gmail.com <an...@gmail.com> #22
Same error with the default /usr/lib/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ from google-android-ndk-installer 13b: Unable to find its own iostream header, and often cstddef as well.
The NDK documentation is scattered, outdated, has unbalance quotes in the code snippets. Many of the suggested flags are rejected as invalid syntax. None of the linker flags are working for me :(
I'm using Ubuntu.
The NDK documentation is scattered, outdated, has unbalance quotes in the code snippets. Many of the suggested flags are rejected as invalid syntax. None of the linker flags are working for me :(
I'm using Ubuntu.
an...@google.com <an...@google.com>
da...@google.com <da...@google.com> #23
r13 is not supported. Try r21. If you have issues with r21, file new bugs.
Description
NDK with bug: 8b
NDK 8 does not have the bug.
Let's create standalone toolchain by running
make-standalone-toolchain.sh --platform=android-14 --install-dir=toolchain-new --ndk-dir=$ANDROID_NDK_PATH
and do the same with the old NDK r8 into toolchain-old
Let's compile
#include <iostream>
int main(int argc, char *argv[])
{
std::cout << "Hello World" << std::endl;
return 0;
}
by running
toolchain-new/bin/arm-linux-androideabi-g++ -o test-new test.cpp
The compilation will fail:
test.cpp:2:20: fatal error: iostream: No such file or directory
compilation terminated.
while with the good old one
toolchain-old/bin/arm-linux-androideabi-g++ -o test-old test.cpp
it will succeed and create the test-old file.
Note:
compilation with the new NDK r8b and command line
toolchain-new/bin/arm-linux-androideabi-g++ -o test-new test.cpp
--sysroot=$TOOLCH/sysroot
-I$TOOLCH/lib/gcc/arm-linux-androideabi/4.6.x-google/include
-I$TOOLCH/lib/gcc/arm-linux-androideabi/4.6.x-google/include-fixed
-I$TOOLCH/arm-linux-androideabi/include/c++/4.6
-I$TOOLCH/arm-linux-androideabi/include/c++/4.6/arm-linux-androideabi
-I$TOOLCH/sysroot/usr/include
will succeed but it is ugly as hell.