Commit Graph

137 Commits

Author SHA1 Message Date
Andrew Hsieh
556182feb4 Fix SEGV when unwinding stack pasts __libc_init
Changed "jump __libc_init" to "call __libc_init" otherwise stack unwinding
past __libc_init may get wrong return address and crash the program or do
wield things.  With "call", return address is pushed on stack and unwinding
stops correctly at _start.  Note that __libc_init never returns, so this
fix wonʼt affect normal program execution.  But just in case it "does"
return, jump to address 0 and halt.

Change-Id: Id194fb32adcbf89ae59939cee33c50b5bbdd36fe
2012-06-28 14:28:21 -07:00
Andrew Hsieh
5e30a6ae14 ndk: Add crtbrand.c ; crtbegin_static.S includes "atexit.S" for x86/mips
"atexit" isn't defined in libc.a for x86/mips (unlike their arm's counterpart).
Include atexit.S otherwise app using atexit() may fail to link statically.

Also, add crtbegin.c to brand crtbegin_static/dynamic.c with .note.ABI-tag
section of given API level.  See $NDK/gen-platforms.sh

Change-Id: I2fdbb92119e3ca2da2c1ced6d77e63136ec35c34
2012-06-25 17:58:12 -07:00
David 'Digit' Turner
5e7c4e6a57 ndk: Remove prebuilt C runtime objects. Add sources instead.
This patch removes all prebuilt C runtime object files from
the ndk/platforms/ directory. We replace them with equivalent
assembly sources lifted from the following directories:

  bionic/libc/private/      (for __dso_handle.S and __dso_handle_so.S)
  bionic/libc/arch-$ARCH/   (for all others)

Note: This requires that your NDK's gen-platforms.sh script be
      capable of rebuilding the object files from sources.
      See https://android-review.googlesource.com/36822

The goal here is to make it much easier to update these files,
and track their changes relative to the content of bionic/lib.
For example to fix the following issues in the future:

Change-Id: If4c84e2584b0e58ca3585b034bb8a13a8add8ab9
http://code.google.com/p/android/issues/detail?id=26911
http://code.google.com/p/android/issues/detail?id=23203
2012-05-31 10:58:57 +02:00
Raghu Gandham
ae9a5f960c [MIPS] Import signal.h from bionic. This version fixes the
warning emitted by the toolchain
2012-05-02 18:46:58 -07:00
Andrew Hsieh
d0e65433d0 Fixed compilation error #include <android/*h>
Fixed compilation error when header in #include <android/*h> is
included alone.

Fix for rect.h already exists in $ANDROID/frameworks/native/include/android

Change-Id: I7c49e044507581c5ad591f26f99cda6870b411c5
2012-04-20 15:50:10 +08:00
Andrew Hsieh
dab6072046 Refresh development/ndk/platforms/android-9/arch-x86/include/machine
Apply changes in bionic/libc/arch-x86/include/machine to
development/ndk/platforms/android-9/arch-x86/include/machine:

   commit 5fbf2e09921723cfdea75e83c1fac2080f0ad564

Change-Id: Ie0fe711ae4c866d9c1300430d5e9613ccb82da22
2012-04-06 13:29:08 +08:00
David 'Digit' Turner
16c0f25354 ndk: ANativeActivity: Fix 'clazz' member documentation.
As discussed on android-ndk, the member is misnamed

Change-Id: I2a5a1c8dce327ddf9ab7a4d14f4e2fdf62808753
2012-04-03 19:30:08 +08:00
David 'Digit' Turner
e43487b854 ndk: android-9: Add missing <sys/eventfd.h> header
For some reason, the header was missing from previous NDK releases.
Note: the function symbols are properly listed in arch-$ARCH/symbols/libc.so.functions.txt
2012-04-02 18:05:57 +08:00
David 'Digit' Turner
015d0543d2 ndk: <pthread.h>: formatting + updates
This patch improves the formatting of <pthread.h> as exposed by the NDK:

- change '#if __cplusplus' into '#ifdef __cplusplus'
- change C++-style comment into C-style comment

Change-Id: Ib093058e8d7a7554d8329a40e102cde11d065932
2012-04-02 17:59:26 +08:00
David 'Digit' Turner
002d5366b6 ndk: <unistd.h>: minor cleanup
- Cleanup declaration of lseek64() to use off64_t instead of loff_t
- Cleanup declaration of prctl() to use variable number of arguments

The cleanups are performed to better match upstream.

Change-Id: I3c9420e328c3772bbb57dc9108dc879aa698a981
2012-04-02 17:54:27 +08:00
David 'Digit' Turner
6c32dacf97 ndk: Fix <sys/atomics.h> declarations.
The atomic operations exported by the platform's C library do not
provide full memory barriers. This can result in incorrect results
when NDK machine code linked against them runs on multi-core devices.

While the bug has been fixed in the platform, this NDK header change
ensures that any source code that includes <sys/atomics.h> will end
up using a correct implementation of these functions, based on the
corresponding GCC builtins.

These builtins always provide a full barrier and have reasonable
performance. Application developers who depend on <sys/atomics.h>
should recompile their unmodified sources against this version
of the NDK as soon as possible.
2012-04-02 15:59:46 +08:00
Andrew Hsieh
a79e56e2f8 Fixed inconsistent minSdkVersion and target= in NDK samples
Also removed Dummy.java and auto-gen files
Inspired by http://code.google.com/p/android/issues/detail?id=20017
2012-04-02 15:00:03 +08:00
Andrew Hsieh
0523af7ca2 Fixed to #include correct 32-bit headers
Corrected for example <asm/io.h> to include io_32.h instead of io_64.h
(which is missing, BTW).

Copied from the results of commit (same title) in bionic.git:
126601dd3f5303b50033dcb88945d928aa764aa4
2012-04-02 14:35:36 +08:00
Andrew Hsieh
2c9504731b Merge "MIPS platform files for building the NDK" 2012-03-30 19:10:05 -07:00
Raghu Gandham
22d3d88a7a [MIPS] crt* Object files generated from .S files.
The object files are generated with the assembler
built from binutils-2.21
2012-03-30 18:27:51 -07:00
Chao-Ying Fu
718e73cf26 MIPS platform files for building the NDK
Change-Id: If19af75003aeb8872d23d7901f01c434bdc58a5f
2012-03-30 18:09:22 -07:00
Andrew Hsieh
1a94764ca2 Merge "ndk: Add MIPS Platform files which contain C runtime headers and sources of crt* assembler files" 2012-03-28 18:18:15 -07:00
Raghu Gandham
a8a0638b9e ndk: Add MIPS Platform files which contain C runtime headers
and sources of crt* assembler files

Change-Id: I10547e8b589d36a7937a0833d86d4406a232aa2c
Signed-off-by: Raghu Gandham <raghu@mips.com>
2012-03-27 15:45:08 -07:00
Andrew Hsieh
2038b5acc5 am 799fada5: Merge "ndk: Include limits.h in wchar.h as it contains the definitions for INT_MAX and INT_MIN. Without this fix, the following lines will fail when configuring gnu stdlibc++ library. (INT_MAX and INT_MIN are undefined.)"
* commit '799fada598b048b02bf63c0eea9b6d676f9be142':
  ndk: Include limits.h in wchar.h as it contains the definitions for INT_MAX and INT_MIN. Without this fix, the following lines will fail when configuring gnu stdlibc++ library. (INT_MAX and INT_MIN are undefined.)
2012-03-27 09:39:02 -07:00
Raghu Gandham
c06e37eb51 ndk: Include limits.h in wchar.h as it contains the definitions for INT_MAX and
INT_MIN. Without this fix, the following lines will fail when configuring
gnu stdlibc++ library. (INT_MAX and INT_MIN are undefined.)

    #define  WCHAR_MAX   INT_MAX
    #define  WCHAR_MIN   INT_MIN

Change-Id: Ifa87cf011cf7068c48755fc9ce5c0d73e95ef2dc
Signed-off-by: Chao-Ying Fu <fu@mips.com>
2012-03-15 17:24:23 -07:00
Scott Main
41b5bb95c3 docs: fix minsdkversion for native activity sample
Change-Id: I2d45207182f6a5b1743b574f7ab10251efd3a17a
2012-02-09 12:10:27 -08:00
Glenn Kasten
ccdb9cb2b0 Update native-audio example app
Additions:
 - volume
 - stereo position
 - mute / solo
 - explicit pause / play / loop buttons
 - spinner for URI strings

Change-Id: I92f3a191f715567531d03998d4b80e32cc9aceed
2011-10-19 17:28:37 -07:00
David 'Digit' Turner
085e2b14d5 ndk: remove obsolete libthread_db.a binaries
We don't use these since NDK r5, since we now provide
customized versions of the library under
$NDK/sources/android/libthread_db

Change-Id: I2e3103b85c14e75a00ba9cece7a872d2156f5ef9
2011-10-12 03:07:48 +02:00
David 'Digit' Turner
0d7f537fea ndk: Refresh EGL/GLES Khronos headers
This patch updates the Khronos headers with updated version.
This mostly brings definitions (constants and types) related to
a bunch of new extensions. Since each extension is optional and
must be actively probed at runtime by the client program, this
doesn't change the NDK ABI at all. Moreover, which extension is
available depends on the specific hardware, not the Android system
version.

+ Define GLchar and GLvoid and adjust function signatures to
  use them instead of 'char' and 'void'

List of new extensions supported:

GLES 1.x
--------
GL_OES_vertex_array_object
GL_OES_EGL_image_external
GL_APPLE_texture_2D_limited_npot
GL_EXT_blend_minmax
GL_EXT_discard_framebuffer
GL_EXT_multi_draw_arrays
GL_EXT_read_format_bgra
GL_EXT_texture_filter_anisotropic
GL_EXT_texture_format_BGRA8888
GL_EXT_texture_lod_bias
GL_IMG_read_format
GL_IMG_texture_compression_pvrtc
GL_IMG_texture_env_enhanced_fixed_function
GL_IMG_user_clip_plane
GL_IMG_multisampled_render_to_texture
GL_NV_fence
GL_QCOM_driver_control
GL_QCOM_extended_get
GL_QCOM_extended_get2
GL_QCOM_perfmon_global_mode
GL_QCOM_writeonly_rendering
GL_QCOM_tiled_rendering

GLES 2.0
--------
GL_OES_element_index_uint
GL_OES_get_program_binary
GL_OES_mapbuffer
GL_OES_packed_depth_stencil
GL_OES_texture_3D
GL_OES_texture_float
GL_OES_texture_float_linear
GL_OES_texture_half_float_linear
GL_OES_texture_npot
GL_OES_vertex_array_object
GL_OES_EGL_image_external
GL_AMD_program_binary_Z400
GL_EXT_blend_minmax
GL_EXT_discard_framebuffer
GL_EXT_multi_draw_arrays
GL_EXT_read_format_bgra
GL_EXT_texture_format_BGRA8888
GL_EXT_texture_compression_dxt1
GL_IMG_program_binary
GL_IMG_read_format
GL_IMG_shader_binary
GL_IMG_texture_compression_pvrtc
GL_IMG_multisampled_render_to_texture
GL_NV_coverage_sample
GL_NV_depth_nonlinear
GL_QCOM_extended_get
GL_QCOM_extended_get2
GL_QCOM_writeonly_rendering
GL_QCOM_tiled_rendering

EGL:
----
EGL_ANDROID_recordable
EGL_NV_system_time

Change-Id: I26ae2aeb499539017cc35d0271f13bcfbf6f8a65
2011-10-12 03:07:48 +02:00
David 'Digit' Turner
c63ce7a143 ndk: remove obsolete <android/api-level.h> headers
These are now auto-generated by the gen-platforms.sh NDK script

Change-Id: I5a38e956b58a34c5db96e24f2a46bc1ca1554376
2011-10-12 03:07:48 +02:00
David 'Digit' Turner
4fee0994c3 ndk: Fix GB x86 definitions for libm.so
The previous header and implementation were incorrect and didn't produce
correct results. This has been fixed in the internal Gingerbread branch.

Technically, this could result in ABI breakage, but the chances are very
low, and there are no official x86 Gingerbread release yet.

Change-Id: I0b2d857399358775d1490b72a1b75baac362f839
2011-10-12 03:07:47 +02:00
David 'Digit' Turner
e872f4e101 ndk: Remove obsolete platform files
Remove the prebuilt system shared libraries and unified symbol files
from development/ndk. We don't need them anymore:

  - the unified symbol files are replaced by separate functions/variables
    symbol list, which were added in a previous commit, i.e.:

	libc.so.txt  --> libc.so.functions.txt
	                 libc.so.variables.txt

 - the shared libraries are now generated on the fly by the NDK
   gen-platforms.sh script, from the functions/variables symbol lists.

Note that we need to keep the static libraries and runtime objects,
they are required to build the cross-toolchains and target binaries.

Change-Id: Ifa0a7f2d741ed32b80216561ca3f17e67df06ce9
2011-10-10 21:52:17 +02:00
David 'Digit' Turner
02053eb7a1 ndk: separate functions and variables symbol lists
This change introduces separate symbol lists for functions
and variables of each NDK system shared library.

Note that we don't remove the unified symbol files yet. This
will be done later when we complete other changes under ndk/,
namely the ability to generate platforms trees containing shell
libraries generated directly from them.

These files were generated using the following:

  cd development/ndk
  for DIR in platforms/*/*/lib; do
    for ARCH in arm x86; do
      $NDK/build/tools/gen-system-symbols $DIR $DIR/../symbols
    done
  done

This means that the symbol lists were generated by parsing the
existing prebuilt shared libraries under platforms/ and extracting
their function and variable names.

Change-Id: Ie1e791d98260a7f0d8d2e9f71323a7ea448f2dd4
2011-10-10 21:52:09 +02:00
David Turner
5647257e6e am 3374f8ad: am 254a7090: am 0f97bab8: Merge changes Ibee74a22,Ifef4dc98
* commit '3374f8ad2cd4fcff7ab40bd80672b8b380242c84':
  NDK: x86 header file has incorrect definition for ptrdiff_t
  Fix size_t definition in x86 NDK header file
2011-08-09 13:37:17 -07:00
Mark D Horn
f907f4f9d4 NDK: x86 header file has incorrect definition for ptrdiff_t
See Bug http://code.google.com/p/android/issues/detail?id=19042

Change-Id: Ibee74a22ca8cb1e62b7a6faff01291c6c7a56775
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2011-08-04 17:11:15 -07:00
Mark D Horn
36f0d56517 Fix size_t definition in x86 NDK header file
Bug: http://code.google.com/p/android/issues/detail?id=19011

The incorrect #define was being used which caused the incorrect
definition for size_t when the standalone toolchain is used.

Change-Id: Ifef4dc987c542a9c5d8bb43d84d3fe1431de9aa0
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2011-08-03 15:11:56 -07:00
David 'Digit' Turner
e89c5e20a0 am 5853cce9: am 97c9b03f: am a6896d75: am 402b02f8: Merge "ndk: x86: Update android-9 x86 platform files"
* commit '5853cce9d0a28ff4ee64909af86dc40e1639e9b8':
  ndk: x86: Update android-9 x86 platform files
2011-06-27 14:15:43 -07:00
David 'Digit' Turner
2409c5a6d7 ndk: x86: Update android-9 x86 platform files
This updates the platform files for API level 9 on x86 to
the binaries built from the internal Gingerbread branch
containing the back-ported AOSP x86 support patches.

Change-Id: I5bc43b4a5c346f7fab8eb57289803edc0c0f2d75
2011-06-24 22:39:14 +02:00
David 'Digit' Turner
5ac5b707bb am b257bb8a: am e9c7386b: am e011bed4: Merge "ndk: x86: Sanitize platform headers and libraries."
* commit 'b257bb8ab4a18e6683aec64389305e179f6eb86b':
  ndk: x86: Sanitize platform headers and libraries.
2011-06-07 17:16:35 -07:00
David 'Digit' Turner
3e1498c4c4 ndk: x86: Sanitize platform headers and libraries.
This change sanitizes the x86-specific platform headers and libraries.
It does two things:

- Remove the stuff under android-3/arch-x86

- Update the content of android-9/arch-x86 from a recent AOSP
  full_x86-eng build (see caveats below).

Some files appear to move because they didn't change (e.g. kernel headers).

This change was generated by following these steps:

1/ Build full_x86-eng from the AOSP tree

2/ From $ANDROID_ROOT/ndk, run:

   build/tools/dev-system-import.sh --direct --arch=x86 9

3/ Under $ANDROID_ROOT/development/ndk, do:

   git rm -r android-3/arch-x86
   git add android-9/arch-x86
   git checkout -- android-9/include
   git ls-files -o | xargs rm
   git commit

IMPORTANT:
   The AOSP tip-of-tree used to generate these files
   includes post-Gingerbread changes !!

   The final version of the android-9/arch-x86 files will have to
   be generated from the gingerbread branch after we back-port all
   x86-support changes to it.

   These binaries are thus not final, but can be used to generate
   working experimental NDK packages, including prebuilt GNU libstdc++
   and STLport binaries that implement -fstack-protector correctly.

Change-Id: I260896185a098b9b356bd26f492692e4a4f66f8f
2011-05-27 06:14:16 +02:00
Iliyan Malchev
d78fc7acbc android_native_buffer_t -> ANativeWindowBuffer
Change-Id: I246690d0ecd83b6da8dc0abeff68887abd92fc92
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 15:49:31 -07:00
David 'Digit' Turner
74ca761b11 am 13e07e5c: am 28eeece2: am 755d75f4: Merge "ndk: Add missing update arm C library for android-9 platform."
* commit '13e07e5c66d20c95f7c8dd668f1e7d9d50da2c9c':
  ndk: Add missing update arm C library for android-9 platform.
2011-04-14 04:02:18 -07:00
David 'Digit' Turner
f76679f6ba ndk: Add missing update arm C library for android-9 platform.
The C library was updated in Gingerbread to support. The corresponding
headers were updated, but the change was missing an updated library,
used for proper linking of new functions (e.g. pthread_rwlock_init).

Fix for http://code.google.com/p/android/issues/detail?id=12990

For the record, this binary was simply pulled from an AVD created
with the standard SDK platform image for Gingerbread.

Change-Id: Ic30921582f143adfc4bcfe3f70a6293530fe0202
2011-04-14 11:44:04 +02:00
David 'Digit' Turner
773c80fdb1 am ffb13684: am 957b0ebe: am bfdff660: Merge "ndk: x86: Update libc.so and libstdc++.so"
* commit 'ffb13684024154fc98c27d32c40c090a4ea82e4e':
  ndk: x86: Update libc.so and libstdc++.so
2011-04-11 17:38:17 -07:00
David 'Digit' Turner
7e9db3d22b ndk: x86: Update libc.so and libstdc++.so
This patch updates the system C and C++ libraries used for
the x86 ABI. We remove the old binary targetting API level 5
(Eclair) since we don't support x86 on it anyway, and put new ones
generated from the AOSP tree with the full_x86-eng build product.

This is necessary to be able to prebuild STLport binaries for
the x86 NDK.

The binaries corresponding to the AOSP platform/bionic.git tree
using the following SHA-1, when building full_x86-eng:

    4c090434a4fcffb3a8bb7ebee7cc6e52befceeae

Change-Id: I63c71554c655f18a6a6f9135074792a8681098bb
2011-04-07 17:22:28 +02:00
David 'Digit' Turner
360270d5e9 am 5aaf5c28: am 282bd952: am 9dacf7ee: Merge "Fix two incorrect <android/input.h> function declarations."
* commit '5aaf5c288c34853725a3bed4d369d25108073101':
  Fix two incorrect <android/input.h> function declarations.
2011-03-21 07:51:41 -07:00
David 'Digit' Turner
9d0136004f Fix two incorrect <android/input.h> function declarations.
The <android/input.h> header file provided with the NDK contained
two invalid function declarations. This patch fixes them.

Note that this breaks the API, but fixes the ABI (which was previously
broken). It is likely that any application developer that tried to use
these function had problems with them anyway.

Another patch to ndk.git will add a note to the changelog and to
the documentation to explain the issue.

+ Fix some documentation typos.

Change-Id: I0f4517458257ff3242127de9f9099f39948c0a56
2011-03-21 13:57:12 +01:00
David 'Digit' Turner
64afc658c5 am a7414978: am 799afe8a: am c5db1533: Merge "Fix pwrite() declaration in NDK platform headers."
* commit 'a74149786dd7ea48b257337d6c22e19f52a30b45':
  Fix pwrite() declaration in NDK platform headers.
2011-03-15 12:57:23 -07:00
David 'Digit' Turner
9ad28785ba Fix pwrite() declaration in NDK platform headers.
The corresponding fix is already in the Bionic libc source tree.

See http://code.google.com/p/android/issues/detail?id=8908

Change-Id: Id1329f996cd6708e46f48d33d998b8b3d26bf5d7
2011-03-15 16:30:35 +01:00
Iliyan Malchev
1dcd97644a development: remove LOCAL_PRELINK_MODULE
Change-Id: I6ae5c92aba05c3991bda260c264de835244f7f3e
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-03-14 14:24:21 -07:00
David 'Digit' Turner
114db2a1c4 ndk: Fixes PTHREAD_RWLOCK_INITIALIZER definition.
This is a fix for http://code.google.com/p/android/issues/detail?id=15306

Also see https://review.source.android.com//#change,21699 for the corresponding
fix in the C library headers.

Change-Id: I1c46ee9fc7eb120a98f47719a0407b81001f5ac0
2011-03-10 10:24:52 +01:00
David 'Digit' Turner
90887627f1 ndk: Update headers and libraries for API level 9
Change-Id: I39eded0065145803b51b22cdc18abef43abe426c
2010-12-10 17:16:24 +01:00
David 'Digit' Turner
1e7011fcd5 ndk: Add auto-generated <android/api-level.h>
See ndk.git/build/tools/dev-generate-api-levels.sh

Change-Id: Id64e565e7da6bf23f4bfa0fca52a06dbfe843c37
2010-11-22 22:38:57 +01:00
Glenn Kasten
809ec924d2 Native audio example
Change-Id: Ia48597d3e94d178ec95a396c545e4a95de7c88f8
2010-11-05 17:38:11 -07:00
David 'Digit' Turner
186ce6d543 Merge "NDK: Last cleanup of the platform headers" into gingerbread 2010-11-04 04:09:48 -07:00