Commit Graph

21 Commits

Author SHA1 Message Date
florian
6915d2d483 * manually added statx syscall numbers for android
git-svn-id: trunk@43850 -
(cherry picked from commit a79b8a145f)
2023-12-16 10:51:56 +01:00
yury
0654857ce1 Merged aarch64-android, x86_64-android targets and fixes for the Android target.
Revision(s) 39739, 39749, 39860, 39862, 39865, 39869, 39871, 39903, 39905, 39917, 39956, 39959-39960, 39969, 39971, 39980, 39987, 40198-40201, 40472, 40532, 40535-40536 from trunk:
* Android: The list of supported syscalls has been auto-generated directly from android sources for each CPU.
* Minor adjustments to make all compilable with the proper list of Android syscalls.
........
* Re-generated lists of android syscalls by a new script. The lists are more correct now. The script's location: https://svn.freepascal.org/svn/fpcbuild/scripts/android
........
* Fixed UnhookSignal when RTL_SIGDEFAULT is passed. The bug have caused crash on aarch64-android due to out of bounds read of the rtlsig2ossig[] array.
........
+ Added support for the aarch64-android target.
........
* Set ICU data dir if it is not set by the system. It fixes issues on newer Android versions.
* Added more predefined ICU versions.
........
* android: Use the current dir as temp.
........
* Corrected TUContext record for aarch64-linux and aarch64-android. It fixes obtaining of an address of the instruction where a signal has thrown.
........
* Enabled safecall support for aarch64 to be on par with other cpus.
........
* Android: Reworked the startup code to use no assembly instructions. Generic assembler startup files contains only section data and are compiled for each CPU.
* Android: argc and argv are correct for shared libraries.
........
* Use syscall_nr_renameat for android.
........
+ added support for x86_64-android target.
........
+ Added the auto-generated list syscalls for mips64-android. It will be needed when mips64 is supported.
........
* x86_64-android requires sigreturn for proper signal handling.
........
* Register external gas assembler for aarch64-android and x86_64-android.
........
* Enabled compilation of the cpu unit for arm-android and x86_64-android.
........
* ucnv_open() must be called with some SSE exception masked on x86_64-android.
* Call u_init() during initialization.
........
* Create the ".note.gnu.build-id" section for android. It fixes debugging of shared libs in Android Studio.
........
* android: Removed cwstring from the uses clause of the unix unit. Use cwstring indirectly. It allows to avoid using cwstring if needed.
........
* ICU v3.8 on Android 1.5-2.1 is buggy and can't be unloaded properly.
........
* Fixed locale detection on new Android versions.
........
* Fixed obtaining a time zone information for 64-bit android.
........
* Since Android 8 the net.dnsX properties can't be read. Use Google Public DNS servers.

........
* android: Use libc for sockets since the "accept" syscall is blocked by SECCOMP, but the "accept4" alternative is not available on old Android versions (2.3 and older). 
........
* android: Regenerated syscalls.
........
* android: Disabled usage of the "pselect6" and "ppoll" syscalls for arm-android. These syscalls are not available on old Android versions (2.3 or older).
........

git-svn-id: branches/fixes_3_2@40540 -
2018-12-13 18:08:42 +00:00
yury
af0fdea815 * Android: Include list of supported syscalls for each CPU.
Adjust Linux RTL to work with supported Android syscalls. 
  It should fix issues with Android 8.

git-svn-id: trunk@37480 -
2017-10-17 18:15:02 +00:00
yury
2ae3ce79bb * ARM: Never use the "BLX label" instruction. Use "BL label" instead.
The linker will always change BL to BLX if necessary, but not vice versa (linker version dependent).
  "BLX label" ALWAYS changes the instruction set. It changes a processor in ARM state to Thumb state,
  or a processor in Thumb state to ARM state.

git-svn-id: trunk@36086 -
2017-05-04 15:55:55 +00:00
yury
a0d6873331 * android: Android versions prior to 4.1 do not support recursive dlopen() calls.
Therefore if a shared library is loaded by JVM ( using dlopen() ),
          it is not possible to use dlopen() in a units initialization code -
          dlopen() simply hangs.
          To workaround this issue, if a library exports JNI_OnLoad(), then
          no unit initialization is performed during library load.
          The initialization is called when JVM has loaded the library and calls
          JNI_OnLoad().

git-svn-id: trunk@34406 -
2016-09-01 23:22:41 +00:00
yury
63813f3e96 * android: Fixed crash when using writeln during shared library finalization on Android 4.4+.
git-svn-id: trunk@32033 -
2015-10-12 22:35:51 +00:00
yury
accf3a6150 * arm-android: Use PIC in the program start-up code.
git-svn-id: trunk@32024 -
2015-10-12 08:58:19 +00:00
yury
6fc8059a1f * arm-android: Simplified _haltproc for dll.
git-svn-id: trunk@32022 -
2015-10-12 08:41:17 +00:00
yury
f9f8c931f3 * arm-android: Do not use register r4, since it must be preserved. Use r3 instead.
git-svn-id: trunk@31719 -
2015-09-16 16:28:41 +00:00
yury
30b8137994 * arm-android: PIC compatible library startup code.
git-svn-id: trunk@31682 -
2015-09-14 23:22:26 +00:00
yury
7e5af23ace * Android: There are cases when libc "environ" var may be NULL. Check for such case and provide fake valid environment. Bug #24519.
git-svn-id: trunk@24804 -
2013-06-04 15:21:29 +00:00
yury
5d061a7efa * Do not use persistent register r5 in the library init code. It fixes crash during library load on some versions of Android. Issue #23974.
* Made the startup code Thumb-safe.

git-svn-id: trunk@23694 -
2013-03-04 23:49:41 +00:00
yury
0abe1d270b * Fixed file description.
git-svn-id: branches/targetandroid@23450 -
2013-01-18 23:27:45 +00:00
yury
04fd0eeee2 * Simplify arm startup code.
git-svn-id: branches/targetandroid@23449 -
2013-01-18 23:27:02 +00:00
yury
12fe3bb65d * Removed leftover from my experiments (calling directly pascal main).
git-svn-id: branches/targetandroid@23434 -
2013-01-17 22:28:59 +00:00
yury
97dd19b04f * cprt0.as is not needed, since we link to libc always.
git-svn-id: branches/targetandroid@23286 -
2013-01-02 00:01:43 +00:00
yury
6ccb152647 * Rework of Android startup code. It is needed to always link to libc on android to implement finalization and environment variables in shared libraries.
* Cleanup of Android linker.
* Use only INSERT command in the linker script to inject custom .fpc sections. Whole linker script duplication is nor needed anymore.
* Use BFD linker, since GOLD linker does not support INSERT command. Other incompatibilities may also exist.
* Enable tf_smartlink_sections for i386-android.
* i386-android is broken after this commit. Will be fixed later.

git-svn-id: branches/targetandroid@23284 -
2013-01-01 23:49:12 +00:00
tom_at_work
75e57faba1 re-apply the changes of r22045 to correct files after recent revert
git-svn-id: branches/targetandroid@22048 -
2012-08-09 14:13:51 +00:00
tom_at_work
19238eafde - revert r22045: applied changes to wrong files, i.e. linux system files, instead of android ones
git-svn-id: branches/targetandroid@22047 -
2012-08-09 13:57:34 +00:00
tom_at_work
787ca1c0bc Made cprt0 startup files to compile. Static executables using them likely do not work though.
Removed obsolete startup files (?prt21*).

git-svn-id: branches/targetandroid@22045 -
2012-08-09 08:05:38 +00:00
tom_at_work
c520f713f4 - commit missing new files
git-svn-id: branches/targetandroid@21062 -
2012-04-26 09:41:13 +00:00