Android NDK r7-crystax-1 released

901 views
Skip to first unread message

Dmitry Moskalchuk

unread,
Dec 19, 2011, 10:04:57 AM12/19/11
to andro...@googlegroups.com
Hi all,

Just want to inform I've just released CrystaX NDK r7-crystax-1. See it
here: http://www.crystax.net/android/ndk/7. There are prebuilt
distributions for Windows, Mac or Linux and, for geeks, instructions how
to rebuild them from scratch.

This is Android NDK which I've rebuilt from Google's sources but with
many own additions. Main features of CrystaX NDK:

1. Wide characters.

Google's NDK doesn't support wide chars properly - neither in C or
C++. Using CrystaX NDK you get full standard compliance wide characters
support. You can easily port existing code which use wide
characters/strings/streams or write new one.

2. New 4.6.3 toolchain

Starting from r7-crystax-1, CrystaX NDK contains two versions of
compiler toolchain: 4.4.3 (old one, the same as Google use) and 4.6.3
(new one).
New toolchain contains GCC 4.6.3 with enabled Graphite framework
allowing gcc do high-level memory optimizations.
4.6.3 toolchain is not enabled by default to be compatible with
Google's NDK. To enable it for your application, just add following to
the app's Application.mk:

APP_TOOLCHAIN_VERSION := 4.6.3

3. C++11 support (formerly known as C++0x)

Google's NDK offer GCC 4.4.3 which is good compiler but doesn't
support some modern features. One of such features is support of new
International Standard known as C++11 (formerly known as C++0x). There
is very limited support of C++0x features in GCC 4.4.3.
Using CrystaX NDK you can start use many of new C++0x features right
now. Of course, there is no yet full C++11 support in GCC 4.6.3 but GCC
team works very intensively on that and it already contains many very
usable features (lambdas, decltype, auto and many others). To see full
list of C++0x features supported, look to GCC C++ Support page.
To use C++0x features in your project, just add following to the
app's Application.mk:

APP_USE_CPP0X := true

Note that in this case new 4.6.3 toolchain implicitly selected.

Hope it would be helpful to you, peoples :)


--
Dmitry Moskalchuk

0xB4F63B81.asc
signature.asc

Nasif Noorudeen

unread,
Dec 19, 2011, 12:33:46 PM12/19/11
to andro...@googlegroups.com
nice update

Dmitry Moskalchuk

unread,
Dec 21, 2011, 12:07:15 PM12/21/11
to andro...@googlegroups.com
Thanks all for feedback, new bug-fix release r7-crystax-2 published.
Download and enjoy!


--
Dmitry Moskalchuk

0xB4F63B81.asc
signature.asc

mingw android

unread,
Dec 21, 2011, 1:49:16 PM12/21/11
to andro...@googlegroups.com

What did you fix Dmitry?

Dmitry Moskalchuk

unread,
Dec 21, 2011, 2:12:20 PM12/21/11
to andro...@googlegroups.com
Well, there was several fixes. Here is full list:

1. Undefined reference to sincos - http://www.crystax.net/trac/ndk/ticket/54
2. Streaming a double into stringstream crashes under 4.6.3 ARM toolset
- http://www.crystax.net/trac/ndk/ticket/55
3. Fix build of Leopard host binaries on Snow Leopard and Lion (Mac OS X).
4. Fix wchar io functions behavior
(wprintf/swprintf/fwprintf/wscanf/swscanf/fwscanf).
5. Fix cygwin build - now windows users can work in both native windows
and cygwin environment, which is preferable.
6. Included several bug-fixes from mainline.

--
Dmitry Moskalchuk

On 12/21/2011 10:49 PM, mingw android wrote:
> What did you fix Dmitry?
>
> On Dec 21, 2011 12:07 PM, "Dmitry Moskalchuk" <cry...@gmail.com

> --
> You received this message because you are subscribed to the Google
> Groups "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-ndk...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/android-ndk?hl=en.

0xB4F63B81.asc
signature.asc

Michael

unread,
Dec 22, 2011, 7:16:19 AM12/22/11
to android-ndk
Thanks for releasing this immensely useful update!
I'm having some issues getting my application to run after compiling
with your NDK (crystax-2 on Mac OS X Lion; the official NDK r7 works
fine). Everything compiles without issues, but at runtime I get an
'unsatisfied link error':

12-22 12:47:47.380: E/AndroidRuntime(30645): Caused by:
java.lang.UnsatisfiedLinkError: Cannot load library:
link_image[1963]: 2599 could not load needed library 'libcrystax.so'
for 'libXXXX.so' (load_library[1105]: Library 'libcrystax.so' not
found)

where libXXXX.so is the library comprising my native code.
It doesn't matter whether I build my application using gnustl_shared
(in which case there is a libcrystax_shared.so which I can import
using System.loadLibrary("crystax_shared");) or using gnustl_static
(in which case there is no libcrystax file). Which toolchain I use
(4.6.3 or 4.4.3) also doesn't make a difference.
I noticed that the ndk-build script emits this as its first visible
output (when building with gnustl_shared, similar output when using
gnustl_static):

make: Circular obj/local/armeabi/libcrystax.a <- obj/local/armeabi/
libcrystax_shared.so dependency dropped.
make: Circular obj/local/armeabi/libcrystax.a <- obj/local/armeabi/
libcrystax_shared.so dependency dropped.
make: Circular obj/local/armeabi-v7a/libcrystax.a <- obj/local/armeabi-
v7a/libcrystax_shared.so dependency dropped.
make: Circular obj/local/armeabi-v7a/libcrystax.a <- obj/local/armeabi-
v7a/libcrystax_shared.so dependency dropped.

Is there anything I have to specify in the Makefile or in the Java
code when using your NDK?

Michael
>  0xB4F63B81.asc
> 2KViewDownload
>
>  signature.asc
> < 1KViewDownload

Peterdk

unread,
Dec 22, 2011, 11:32:41 AM12/22/11
to android-ndk
Getting same circular dependency on this one. Will try older ndk to
see if it has the same issues.

Dmitry Moskalchuk

unread,
Dec 22, 2011, 1:07:02 PM12/22/11
to andro...@googlegroups.com, Peterdk
This bug is already fixed. Please wait for r7-crystax-3 (couple of
hours), it'll include this fix.


--
Dmitry Moskalchuk

0xB4F63B81.asc
signature.asc

Dmitry Moskalchuk

unread,
Dec 22, 2011, 1:12:39 PM12/22/11
to andro...@googlegroups.com
Hi Michael,

Circular dependency problem is fixed and it'll be included to the
upcoming r7-crystax-3. Anyway, this is just warning, not an error so it
doesn't affect build.

Now, lets figure out what's wrong with libcrystax.so. How you build your
app? Is it done with NDK build system or you use standalone toolchain?
There are bit different approaches used for linking with libcrystax.


--
Dmitry Moskalchuk

0xB4F63B81.asc
signature.asc

Dmitry Moskalchuk

unread,
Dec 22, 2011, 1:29:43 PM12/22/11
to andro...@googlegroups.com
BTW, it looks like you have built libXXXX.so with r7-crystax-1 - there
was problem with libcrystax_shared soname, it was 'libcrystax.so'. In
r7-crystax-2 I've fixed this so now it shouldn't refer to libcrystax.so
anymore. To check this, please run (<NDK> is path to NDK installation):

<NDK>/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-objdump
-x libXXXX.so | grep NEEDED

There should be displayed 'libcrystax_shared.so'. If there is just
'libcrystax.so', then just rebuild your libXXXX.so.


--
Dmitry Moskalchuk

0xB4F63B81.asc
signature.asc

Michael

unread,
Dec 23, 2011, 4:49:25 AM12/23/11
to android-ndk
I had both 'libcrystax_shared.so' and 'libcrystax.so' in there. But it
seems the problem went away after manual removal of all generated
object files. 'ndk-build -B' apparently wasn't enough, so I suspect I
might have been bitten in the ass by ccache.
In any case, all seems to work great now. Thanks again for your help!

Michael
>  0xB4F63B81.asc
> 2KViewDownload
>
>  signature.asc
> < 1KViewDownload

Louise Cypher

unread,
Dec 28, 2011, 6:07:39 AM12/28/11
to andro...@googlegroups.com
Hi

The NEON support in your build is totally broken :(

1> Device.cpp
1> C:\Users\mxadd\AppData\Local\Temp\ccrRrgjX.s: Assembler messages:
1>C:\Users\mxadd\AppData\Local\Temp\ccrRrgjX.s(2405): error : ']'
expected -- `vld1.32 {d20-d21},[r3:64]'
1>C:\Users\mxadd\AppData\Local\Temp\ccrRrgjX.s(2423): error : ']'
expected -- `vld1.32 {d18-d19},[ip:64]'
1>C:\Users\mxadd\AppData\Local\Temp\ccrRrgjX.s(2427): error : ']'
expected -- `vld1.32 {d26-d27},[r3:64]'
1>C:\Users\mxadd\AppData\Local\Temp\ccrRrgjX.s(2433): error : ']'
expected -- `vld1.32 {d4-d5},[r3:64]'

(win32 build)

the couse of this is that there is mismatch between the syntax
expected by 'as' (the 'old' syntax in your case)
and the syntax exported to *.s by gcc (it's exportedy an the 'new'
standard) - any source files that have 'a lot' (or any ?) of neon
intrinsics are first converted by gcc to *.s, and then 'as' is invoked
on them.
Could you fix this ?
(this is related to the version of 'binutils' 2.21.53 seems to be
minimum for 'as' to interop correcly with gcc when compiling gcc 4.6.1
for android - i dont know what is the minimum for 4.6.3)

> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>

--
--
Code it black!

Dmitry Moskalchuk

unread,
Dec 28, 2011, 6:55:56 AM12/28/11
to andro...@googlegroups.com
Yes, I was already notified about this. I'm preparing new build right
now and will publish it in a few days.

Anyway, thanks for report.


--
Dmitry Moskalchuk

0xB4F63B81.asc
signature.asc

mingw android

unread,
Dec 28, 2011, 10:34:15 AM12/28/11
to andro...@googlegroups.com

I had to upgrade all the way up to 2.22 to fix this.

Kai Yang

unread,
Aug 30, 2012, 10:35:03 PM8/30/12
to andro...@googlegroups.com
Building x264 failed with r7-crystax-5,  APP_TOOLCHAIN_VERSION := 4.6.3.
The error is:
requires unsupported dynamic reloc R_ARM_MOVW_ABS_NC; recompile with -fPIC

I add the -fPIC in Android.mk like this:LOCAL_CFLAGS += -fPIC -std=c99 -pthread.

Could you give me any clue about this ?
Thanks a lot.

在 2011年12月19日星期一UTC+8下午11时04分57秒,Dmitry Moskalchuk写道:
Reply all
Reply to author
Forward
0 new messages