[Native] Enable real Android Native executables (#4624)

* Add AndroidProgramType binary option, override entry point, fix linker flags

* Add Konan_main_standalone entry point to the Android runtime

* Add compiler warning

* Make standalone programs print to stdout

* Fix warning message and readability
This commit is contained in:
Mattia Iavarone
2021-10-26 06:33:17 +02:00
committed by GitHub
parent 6a59dc7fa5
commit c92e34ca9f
14 changed files with 148 additions and 17 deletions
@@ -145,8 +145,11 @@ class AndroidLinker(targetProperties: AndroidConfigurables)
return listOf(Command(clang).apply {
+"-o"
+executable
+"-fPIC"
+"-shared"
when (kind) {
LinkerOutputKind.EXECUTABLE -> +listOf("-fPIE", "-pie")
LinkerOutputKind.DYNAMIC_LIBRARY -> +listOf("-fPIC", "-shared")
LinkerOutputKind.STATIC_LIBRARY -> {}
}
+"-target"
+clangTarget
+libDirs