Using dlopen/dlsym works, but eglGetProcAddress is a little easier and
more consistent with how GL extension functions (rather than these
non-extension functions) are loaded.
Change-Id: I082c193f08f7d5456389ab783a06cd38a9632d53
* Headers were copied from frameworks/native/opengl/include/GLES3/.
* Symbol lists were generated with ndk/build/tools/gen-system-symbols.sh.
* Symbols are identical between architectures
Change-Id: I011094ea3b479cf166ffb6bef3778cde683fc502
1. __set_errno is deprecated and subject to removal in future release
2. elf.h is seen to be included alone, causing compilation error due
to undefined uint32_t and uint64_t
Change-Id: I4ca348a8ba0689eb3880622dcf5c53be470c57e8
File arch-mips/sigsetjmp.S includes <asm-generic/portability.h>
already defined in LOCAL_CFLAGS, and build system prior JB
passes LOCAL_CFLAGS for building *.S as well, but no more >=JB.
Use LOCAL_C_INCLUDES instead (pass for *.S too)
Change-Id: I7e6d6e838d632f980aa6c9b6b2b2862bd7de11b1
Developers report that concurrent events generated from different
sources/devices can lead to application freezes then ANRs.
See https://code.google.com/p/android/issues/detail?id=41755
where it is suggested that handling all incoming events in
the "process_input" callback solves the issue. Hence this patch
implements the suggestion, however it's unclear whether this
solves the symptom, or the root cause of the problem.
Change-Id: Ic6b0ad05d192763a6d8842c8befcb87db9714a3c
errno in MIPS is macro for "*__errno)()". Use of errno inside
WRAP(__errno)() cause infinite loop. This may happen in other
wrapper functions which access errno.
Change all error to *REAL(__error)()
Change-Id: I1c09d84a58855bd7896fcd4e70f740b8a0f0b386
Linker --wrap option resolves to __wrap_symbol for undefined symbol.
During the compilation of host libportable.a, __HOST__ is defined
to rename all portable functions to __wrap_symbol, and the
real function to __real_symbol. This way libportable.a can be
validated at host w/o changes of user's source code.
See http://sourceware.org/binutils/docs/ld/Options.html
Change-Id: Idcbe53dd642536f3dc2be85a875f95535b9dc0b1
Both exist in header android-X/arch-<arch>/usr/include/setjmp.h
already. Add to X86 to be consistent with header and other archs
ARM/MIPS
See https://code.google.com/p/android/issues/detail?id=19851
Change-Id: I635c6c0491f5bf2aaa9013f23cb4b1bf7cb57a40
ARM expanse some functions to others. For example,
_Unwind_GetIP will be inlined to _Unwind_GetGR, which
will be inlined to _Unwind_VRS_Get. This happens at
header-included level.
However, we use Itanium _Unwind_* header as portable one.
We do the inlining in ARM libportable to prevent
undefined reference to these functions.
Change-Id: Iad94c4a92531cdcfbcf535443fb257d02cb24c43
Signed-off-by: WenHan Gu <Wenhan.gu@mediatek.com>
mmap_portable() was calling madvise() and disrupting errno.
The call to madvise() has been dropped in bionic's version of
mmap() and now we just call that.
Updated helper functions to use the newer <class>_pton() style.
Added logging calls; like the rest of Lib-Portable,
it frequently helps save time.
Change-Id: I39f77899f0808e3af5fd2f6610355d2e33c09d85
Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
The portable (ARM) jmp_buf and sigjmp_buf structures are smaller than the native
(MIPS) structures so it is not safe to simply call the standard bionic routines.
Luckily there is a lot of redundant space in the standard MIPS structures
and it is possible to save all of the needed registers in the area provided by the
ARM application.
Change-Id: I694a90516cdf96d581863e833776092830afe3cc
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
Signed-off-by: Paul Lind <paul.lind@imgtec.com>
sflags() returns open() flags via a pointer passed to sflags().
Change-Id: I854dc4302bf09318e97eb3129a8debf98dbe8735
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
Signed-off-by: Paul Lind <paul.lind@imgtec.com>
Improved Logging, tweaked func names, fixed double mappings
of mips_command.
While debugging the LTP fcntl07* set of failures I modified
a few ALOGV() calls to make logging more helpful in
fcntl_cmd_pton().
Change-Id: Idc9a7c8dd27883dff1e555769d6a8e331f4fdeb9
Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Paul Lind <paul.lind@imgtec.com>
Both MIPS and ARM use signals 32 to 64 for real-time signals.
ARM signals 32 to 64 can't be masked due to the signal
mask being limited to 32 bits. MIPS signals 32 to 64 can be
masked, and Lib-Portable correctly supports this feature.
Fixes LTP tests rt_sigaction01 and ptrace05.
Fixed a few signal problems; Ex last Real Time Signal
1. The signal handler for signal number 64, the last real
time signal, wasn't being intercepted. Now catching
signal number 64.
2. sigaction() to only change *oldact when return
value is zero.
3. Fixed rt_sigqueue_portable() to set errno when
returning a -1.
4. Fixed a few cases where signal 0 was being added
to the table of signal handlers for signal remapping.
Harmless but a bit silly.
Change-Id: I1a71113d7ce4b60f3a587dae4e243dc88dd6d6bc
Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Paul Lind <paul.lind@imgtec.com>
Specifically these functions are now supported:
signalfd4(), eventfd(), timerfd_create(),
pipe(), and inotify_init1()
Modified syscall_portable() to call signalfd4_portable(),
eventfd_portable(), eventfd2_portable(), and timerfd_create().
These system calls enable the read system calls to access
kernel data structures.
The signalfd4() enables read to return a signalfd_siginfo structure
which have the signal number and errno mapped until an execve().
This is similar to the maintaining a table of signal handlers to
map the signal numbers done earlier. This mapping is extended to
the process after an execve() by passing the final set of mapped
file descriptors via a pair of environment variables.
Disabling signal and file descriptor read mapping in parent
if the child would break the mapping algorithms.
This code passes at least all of the non-POSIX LTP tests,
including an updated LTP signalfd4 test that posts SIGNALS
and uses this read() mechanism to get signal info.
inotify_init1 is similar to signalfd(), timerfd() and other
filefd functions which map read() calls. Unlike signalfd(), and
similar to timerfd(), the reads don't appear to need to be mapped.
The members of the inotify_event structure appear to be generic.
The mask bits like IN_MOVE_FROM and IN_MOVE_TO are defined in
generic files. The LTP test in testcases/kernel/syscalls/inotify
test for the inotify_event structure being inotify_event structure
being read and does seem to check it contents being correct.
Change-Id: I3f2dcd4e33437ac953cd9f67f56dccc6ec6e5e6f
Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Paul Lind <paul.lind@imgtec.com>
Just mapping struct addrinfo socktype member; everything else is
identical in ARM vs MIPS cpp comparison.
Lots of tests in getaddrinfo_01 fail on Android, but test 9 and 20
were breaking with lib-portable only. This fix corrects that
difference in the test results.
Change-Id: I93c7948cc206ec60b867844857e3e19350c5f5e9
Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Paul Lind <paul.lind@imgtec.com>
1. Added:
rt_sigaction(),
rt_sigprocmask(), and
rt_sigtimedwait portable syscalls.
2. Fixed a bug in signal.c.
3. Added a new pair of functions to map siginfo_t
between portable and native formats.
4. Fixed LTP rt_siqqueueinfo01 and siqqueue() test failures.
5. Using these new siginfo_t mapping functions in functions
that were previously doing this functionality internally:
a. mips_sigaction_handler()
b. __rt_sigtimedwait_portable()
6. Modified rt_sigqueueinfo_portable():
a. Added a call to this new siginfo_pton() function.
b. Fixed native_sig calculation; it was converting
with the wrong function (ntop instead of pton).
7. Added the Thread Group Flavor of Real Time version of
sigqueueinfo().
8. Added and tested the sigqueue() implementation thought it's
not supported by Android yet. Using a LTP library function
to implement it via syscall for now. Android has a
sysconf() regression that will be addressed in a separate
commit.
9. Modified some of the variable names in:
__rt_sigtimedwait_portable()
to make it easier/faster to read.
10. Fixed a SIGTERM --> SIGTERM_PORTABLE mapping bug.
Most LTP Posix sigqueue() tests and the rt_sigqueueinfo01() test
now pass with this commit.
Change-Id: I5a2c28c4f5863cc013fe0c7fce819fa5b7a6dcc7
Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
Signed-off-by: Douglas Leung <douglas.leung@imgtec.com>
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Paul Lind <paul.lind@imgtec.com>
Unifying around the <class>_ntop() style;
changing ntop_*() and pton_* to *_ntop() and *_pton().
Also added portable versions of strerror() and strerror_r()
while updating the errno.c file.
Change-Id: I2a0f40963f293ef9387b0dbcb3426276d301a17c
Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Paul Lind <paul.lind@imgtec.com>
File poll.c had a wide line and the reason for the asymmetric
mapping of the event flags wasn't obvious on my reviewing
this code. Seemed to justify adding some clarification.
Both signal.c and socket.c were using lengthy function names
for Portable <--> Native mappings. Switch to the newer *_ntop()
style in wide files and made the ALOGV() messages more useful.
Also changed mapping of portable SIGSTKFLT to native SIGEMT
while editing a wide line in the signal.c file. MIPS has no
SIGSTKFLT signal, nor ARM a signal SIGEMT. Using SIGEMT as a
proxy for SIGSTKFLT_PORTABLE for Lib-Portable applications.
This makes the signal mapping reversible during signal handling.
Fixed ALOGV() Entry/Exit brackets to match.
Change-Id: I9a91992e67ab24322db608424bf69c47fad8e18d
Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Paul Lind <paul.lind@imgtec.com>
Also fixed syscall.c to use curly brackets in case
statements to be more like bionic.
Change-Id: I20ffab9a474a2132b47fb4e765966c956aab2aff
Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Paul Lind <paul.lind@imgtec.com>
To be the same as bionic's. See
ec37237d69289e2bb9836bfa0d071ab958234d00
The new one also no longer undef offsetof and replaces it with
"((size_t) &((TYPE *)0)->MEMBER)" if __compiler_offsetof isn't
defined. The problem with the old behavior are that
1. __compiler_offsetof isn't defined in linux/compiler.h even though
all Android compilers support __builtin_offsetof
2. As as result, offsetof defined in stddef.h to use __builtin_offsetof
is undefined and replaced here. Problem is,
"((size_t) &((TYPE *)0)->MEMBER)" isn't considered a compile-time
constant, and fails some code expect offsetof to be.
Change-Id: I3ebb0de9e1d95305a0890a099360ff6936d24b2f
With --enable-libgomp, gcc/gcc-4.4.3/libiberty/configure line #2124 tries
to link a trivial program but fails w/o the presence of libc.so and libdl.so
and sets "gcc_no_link=yes" at line #2131. Confiugre later fails with
cryptic message reads "Link tests are not allowed after GCC_NO_EXECUTABLES."
See
https://android-review.googlesource.com/#/c/34491, 48617, and 48619
Change-Id: I6e761c5fb12f413dca04a26b39f27e9f026d75d3