Share
Embed
Transcript
75 slides
-
αϙʔτ͍ͯ͠ΔϓϥοτϑΥʔϜ • iOS (arm32, arm64, simulator x86_64) • MacOS (x86_64)
• Android (arm32, arm64) • Windows (mingw x86_64, x86) • Linux (x86_64, arm32, MIPS, MIPS little endian, Raspberry Pi) • WebAssembly (wasm32) -
ඪ४ϥΠϒϥϦ • kotlin.*͔Β࢝·Δύοέʔδͷͭ • Kotlin Native༻ʹඪ४ϥΠϒϥϦΛҰ͔Β࣮ • جຊతʹC++Ͱ࣮ • ࣮͜ͷล
https://github.com/JetBrains/kotlin-native/tree/master/runtime/src/main -
package kotlin.io /** Prints the given [message] to the standard
output stream. */ @SymbolName("Kotlin_io_Console_print") external public fun print(message: String) Kotlinଆ -
package kotlin.io /** Prints the given [message] to the standard
output stream. */ @SymbolName("Kotlin_io_Console_print") external public fun print(message: String) Kotlinଆ -
package kotlin.io /** Prints the given [message] to the standard
output stream. */ @SymbolName("Kotlin_io_Console_print") external public fun print(message: String) Kotlinଆ ίϯύΠϥʹରͯؔ͠ͷ࣮ମ֎ ෦ʹ͋Δͱڭ͑Δҝͷͷ ؔͷ࣮ମͷγϯϘϧ໊ $ ໊ؔ Λද͢ -
void Kotlin_io_Console_print(KString message) { if (message->type_info() != theStringTypeInfo) { ThrowClassCastException(message->obj(),
theStringTypeInfo); } // TODO: system stdout must be aware about UTF-8. const KChar* utf16 = CharArrayAddressOfElementAt(message, 0); KStdString utf8; // Replace incorrect sequences with a default codepoint (see utf8::with_replacement::default_replacement) utf8::with_replacement::utf16to8(utf16, utf16 + message->count_, back_inserter(utf8)); konan::consoleWriteUtf8(utf8.c_str(), utf8.size()); } package kotlin.io /** Prints the given [message] to the standard output stream. */ @SymbolName("Kotlin_io_Console_print") external public fun print(message: String) Kotlinଆ C++ଆ -
ϓϥοτϑΥʔϜʹΑͬͯKotlinϓϩάϥϜͷىಈํ๏͕ҧ͏ • Mac, Linux, Windowsͩͱ… ࣮ߦͨ͠ͱ͖ • Androidͩͱ… Activity͕࡞ΒΕͨͱ͖ •
Wasmͩͱ… ϒϥβ্ͰJSʹݺΕͨͱ͖ -
extern "C" RUNTIME_USED int Init_and_run_start(int argc, const char** argv, int
memoryDeInit) { #ifdef KONAN_NO_CTORS_SECTION extern void _Konan_constructors(void); _Konan_constructors(); #endif Kotlin_initRuntimeIfNeeded(); // GCͷॳظԽ KInt exitStatus = Konan_run_start(argc, argv); // KotlinϓϩάϥϜͷىಈ if (memoryDeInit) Kotlin_deinitRuntimeIfNeeded(); // ϝϞϦղ์ return exitStatus; } // Mainؔ extern "C" RUNTIME_USED int Konan_main(int argc, const char** argv) { return Init_and_run_start(argc, argv, 1); } -
extern "C" RUNTIME_USED int Init_and_run_start(int argc, const char** argv, int
memoryDeInit) { #ifdef KONAN_NO_CTORS_SECTION extern void _Konan_constructors(void); _Konan_constructors(); #endif Kotlin_initRuntimeIfNeeded(); // GCͷॳظԽ KInt exitStatus = Konan_run_start(argc, argv); // KotlinϓϩάϥϜͷىಈ if (memoryDeInit) Kotlin_deinitRuntimeIfNeeded(); // ϝϞϦղ์ return exitStatus; } // Mainؔ extern "C" RUNTIME_USED int Konan_main(int argc, const char** argv) { return Init_and_run_start(argc, argv, 1); } .BJOؔ -
extern "C" RUNTIME_USED int Init_and_run_start(int argc, const char** argv, int
memoryDeInit) { #ifdef KONAN_NO_CTORS_SECTION extern void _Konan_constructors(void); _Konan_constructors(); #endif Kotlin_initRuntimeIfNeeded(); // GCͷॳظԽ KInt exitStatus = Konan_run_start(argc, argv); // KotlinϓϩάϥϜͷىಈ if (memoryDeInit) Kotlin_deinitRuntimeIfNeeded(); // ϝϞϦղ์ return exitStatus; } // Mainؔ extern "C" RUNTIME_USED int Konan_main(int argc, const char** argv) { return Init_and_run_start(argc, argv, 1); } -
extern "C" RUNTIME_USED int Init_and_run_start(int argc, const char** argv, int
memoryDeInit) { #ifdef KONAN_NO_CTORS_SECTION extern void _Konan_constructors(void); _Konan_constructors(); #endif Kotlin_initRuntimeIfNeeded(); // GCͷॳظԽ KInt exitStatus = Konan_run_start(argc, argv); // KotlinϓϩάϥϜͷىಈ if (memoryDeInit) Kotlin_deinitRuntimeIfNeeded(); // ϝϞϦղ์ return exitStatus; } // Mainؔ extern "C" RUNTIME_USED int Konan_main(int argc, const char** argv) { return Init_and_run_start(argc, argv, 1); } ($ͷॳظԽ -
extern "C" RUNTIME_USED int Init_and_run_start(int argc, const char** argv, int
memoryDeInit) { #ifdef KONAN_NO_CTORS_SECTION extern void _Konan_constructors(void); _Konan_constructors(); #endif Kotlin_initRuntimeIfNeeded(); // GCͷॳظԽ KInt exitStatus = Konan_run_start(argc, argv); // KotlinϓϩάϥϜͷىಈ if (memoryDeInit) Kotlin_deinitRuntimeIfNeeded(); // ϝϞϦղ์ return exitStatus; } // Mainؔ extern "C" RUNTIME_USED int Konan_main(int argc, const char** argv) { return Init_and_run_start(argc, argv, 1); } ,PUMJOͷϓϩάϥϜΛىಈͤ͞Δؔ ͷݺͼग़͠ -
extern "C" RUNTIME_USED int Init_and_run_start(int argc, const char** argv, int
memoryDeInit) { #ifdef KONAN_NO_CTORS_SECTION extern void _Konan_constructors(void); _Konan_constructors(); #endif Kotlin_initRuntimeIfNeeded(); // GCͷॳظԽ KInt exitStatus = Konan_run_start(argc, argv); // KotlinϓϩάϥϜͷىಈ if (memoryDeInit) Kotlin_deinitRuntimeIfNeeded(); // ϝϞϦղ์ return exitStatus; } // Mainؔ extern "C" RUNTIME_USED int Konan_main(int argc, const char** argv) { return Init_and_run_start(argc, argv, 1); } ϝϞϦղ์ -
extern "C" RUNTIME_USED int Init_and_run_start(int argc, const char** argv, int
memoryDeInit) { #ifdef KONAN_NO_CTORS_SECTION extern void _Konan_constructors(void); _Konan_constructors(); #endif Kotlin_initRuntimeIfNeeded(); // GCͷॳظԽ KInt exitStatus = Konan_run_start(argc, argv); // KotlinϓϩάϥϜͷىಈ if (memoryDeInit) Kotlin_deinitRuntimeIfNeeded(); // ϝϞϦղ์ return exitStatus; } // Mainؔ extern "C" RUNTIME_USED int Konan_main(int argc, const char** argv) { return Init_and_run_start(argc, argv, 1); } -
extern "C" RUNTIME_USED int Init_and_run_start(int argc, const char** argv, int
memoryDeInit) { #ifdef KONAN_NO_CTORS_SECTION extern void _Konan_constructors(void); _Konan_constructors(); #endif Kotlin_initRuntimeIfNeeded(); // GCͷॳظԽ KInt exitStatus = Konan_run_start(argc, argv); // KotlinϓϩάϥϜͷىಈ if (memoryDeInit) Kotlin_deinitRuntimeIfNeeded(); // ϝϞϦղ์ return exitStatus; } // Mainؔ extern "C" RUNTIME_USED int Konan_main(int argc, const char** argv) { return Init_and_run_start(argc, argv, 1); } -
// macos posix.def depends = package = platform.posix headers =
alloca.h ar.h assert.h complex.h dirent.h dlfcn.h err.h errno.h fcntl.h \ fenv.h float.h fnmatch.h fts.h ftw.h getopt.h grp.h inttypes.h libgen.h limits.h \ locale.h math.h memory.h netdb.h paths.h poll.h \ pthread.h pwd.h regex.h resolv.h sched.h search.h semaphore.h setjmp.h sgtty.h signal.h \ stdatomic.h stdint.h stdio.h stdlib.h string.h strings.h syslog.h termios.h \ time.h ucontext.h unistd.h utime.h utmp.h wchar.h wctype.h xlocale.h \ net/ethernet.h net/if.h net/if_arp.h net/route.h \ netinet/icmp6.h netinet/if_ether.h netinet/in.h netinet/in_systm.h \ netinet/ip.h netinet/ip6.h netinet/ip_icmp.h netinet/tcp.h netinet/udp.h \ sys/acl.h sys/ioctl.h sys/ipc.h sys/mman.h sys/poll.h sys/ptrace.h \ sys/queue.h sys/select.h sys/shm.h sys/socket.h sys/stat.h \ sys/syslimits.h sys/time.h sys/times.h sys/utsname.h sys/wait.h compilerOpts = -D_XOPEN_SOURCE -DSHARED_LIBBIND -D_DARWIN_NO_64_BIT_INODE # -D_ANSI_SOURCE, sigh, breaks user_addr_t excludedFunctions = KERNEL_AUDIT_TOKEN KERNEL_SECURITY_TOKEN add_profil \ addrsel_policy_init \ in6addr_linklocal_allv2routers \ pfctlinput regwnexec_l res_send_setqhook res_send_setrhook \ unwhiteout zopen profil openat acl_valid_link_np linkerOpts = -ldl -lresolv -
// macos posix.def depends = package = platform.posix headers =
alloca.h ar.h assert.h complex.h dirent.h dlfcn.h err.h errno.h fcntl.h \ fenv.h float.h fnmatch.h fts.h ftw.h getopt.h grp.h inttypes.h libgen.h limits.h \ locale.h math.h memory.h netdb.h paths.h poll.h \ pthread.h pwd.h regex.h resolv.h sched.h search.h semaphore.h setjmp.h sgtty.h signal.h \ stdatomic.h stdint.h stdio.h stdlib.h string.h strings.h syslog.h termios.h \ time.h ucontext.h unistd.h utime.h utmp.h wchar.h wctype.h xlocale.h \ net/ethernet.h net/if.h net/if_arp.h net/route.h \ netinet/icmp6.h netinet/if_ether.h netinet/in.h netinet/in_systm.h \ netinet/ip.h netinet/ip6.h netinet/ip_icmp.h netinet/tcp.h netinet/udp.h \ sys/acl.h sys/ioctl.h sys/ipc.h sys/mman.h sys/poll.h sys/ptrace.h \ sys/queue.h sys/select.h sys/shm.h sys/socket.h sys/stat.h \ sys/syslimits.h sys/time.h sys/times.h sys/utsname.h sys/wait.h compilerOpts = -D_XOPEN_SOURCE -DSHARED_LIBBIND -D_DARWIN_NO_64_BIT_INODE # -D_ANSI_SOURCE, sigh, breaks user_addr_t excludedFunctions = KERNEL_AUDIT_TOKEN KERNEL_SECURITY_TOKEN add_profil \ addrsel_policy_init \ in6addr_linklocal_allv2routers \ pfctlinput regwnexec_l res_send_setqhook res_send_setrhook \ unwhiteout zopen profil openat acl_valid_link_np linkerOpts = -ldl -lresolv ੜ͞ΕΔ,PUMJO༻ελϒͷ 1BDLBHF໊Λࢦఆ -
// macos posix.def depends = package = platform.posix headers =
alloca.h ar.h assert.h complex.h dirent.h dlfcn.h err.h errno.h fcntl.h \ fenv.h float.h fnmatch.h fts.h ftw.h getopt.h grp.h inttypes.h libgen.h limits.h \ locale.h math.h memory.h netdb.h paths.h poll.h \ pthread.h pwd.h regex.h resolv.h sched.h search.h semaphore.h setjmp.h sgtty.h signal.h \ stdatomic.h stdint.h stdio.h stdlib.h string.h strings.h syslog.h termios.h \ time.h ucontext.h unistd.h utime.h utmp.h wchar.h wctype.h xlocale.h \ net/ethernet.h net/if.h net/if_arp.h net/route.h \ netinet/icmp6.h netinet/if_ether.h netinet/in.h netinet/in_systm.h \ netinet/ip.h netinet/ip6.h netinet/ip_icmp.h netinet/tcp.h netinet/udp.h \ sys/acl.h sys/ioctl.h sys/ipc.h sys/mman.h sys/poll.h sys/ptrace.h \ sys/queue.h sys/select.h sys/shm.h sys/socket.h sys/stat.h \ sys/syslimits.h sys/time.h sys/times.h sys/utsname.h sys/wait.h compilerOpts = -D_XOPEN_SOURCE -DSHARED_LIBBIND -D_DARWIN_NO_64_BIT_INODE # -D_ANSI_SOURCE, sigh, breaks user_addr_t excludedFunctions = KERNEL_AUDIT_TOKEN KERNEL_SECURITY_TOKEN add_profil \ addrsel_policy_init \ in6addr_linklocal_allv2routers \ pfctlinput regwnexec_l res_send_setqhook res_send_setrhook \ unwhiteout zopen profil openat acl_valid_link_np linkerOpts = -ldl -lresolv ελϒੜͷରͷϔομϑΝΠϧ -
// macos posix.def depends = package = platform.posix headers =
alloca.h ar.h assert.h complex.h dirent.h dlfcn.h err.h errno.h fcntl.h \ fenv.h float.h fnmatch.h fts.h ftw.h getopt.h grp.h inttypes.h libgen.h limits.h \ locale.h math.h memory.h netdb.h paths.h poll.h \ pthread.h pwd.h regex.h resolv.h sched.h search.h semaphore.h setjmp.h sgtty.h signal.h \ stdatomic.h stdint.h stdio.h stdlib.h string.h strings.h syslog.h termios.h \ time.h ucontext.h unistd.h utime.h utmp.h wchar.h wctype.h xlocale.h \ net/ethernet.h net/if.h net/if_arp.h net/route.h \ netinet/icmp6.h netinet/if_ether.h netinet/in.h netinet/in_systm.h \ netinet/ip.h netinet/ip6.h netinet/ip_icmp.h netinet/tcp.h netinet/udp.h \ sys/acl.h sys/ioctl.h sys/ipc.h sys/mman.h sys/poll.h sys/ptrace.h \ sys/queue.h sys/select.h sys/shm.h sys/socket.h sys/stat.h \ sys/syslimits.h sys/time.h sys/times.h sys/utsname.h sys/wait.h compilerOpts = -D_XOPEN_SOURCE -DSHARED_LIBBIND -D_DARWIN_NO_64_BIT_INODE # -D_ANSI_SOURCE, sigh, breaks user_addr_t excludedFunctions = KERNEL_AUDIT_TOKEN KERNEL_SECURITY_TOKEN add_profil \ addrsel_policy_init \ in6addr_linklocal_allv2routers \ pfctlinput regwnexec_l res_send_setqhook res_send_setrhook \ unwhiteout zopen profil openat acl_valid_link_np linkerOpts = -ldl -lresolv ελϒΛੜ͢Δͱ͖ʹ͏ίϯύ ΠϥΦϓγϣϯΛࢦఆ -
// macos posix.def depends = package = platform.posix headers =
alloca.h ar.h assert.h complex.h dirent.h dlfcn.h err.h errno.h fcntl.h \ fenv.h float.h fnmatch.h fts.h ftw.h getopt.h grp.h inttypes.h libgen.h limits.h \ locale.h math.h memory.h netdb.h paths.h poll.h \ pthread.h pwd.h regex.h resolv.h sched.h search.h semaphore.h setjmp.h sgtty.h signal.h \ stdatomic.h stdint.h stdio.h stdlib.h string.h strings.h syslog.h termios.h \ time.h ucontext.h unistd.h utime.h utmp.h wchar.h wctype.h xlocale.h \ net/ethernet.h net/if.h net/if_arp.h net/route.h \ netinet/icmp6.h netinet/if_ether.h netinet/in.h netinet/in_systm.h \ netinet/ip.h netinet/ip6.h netinet/ip_icmp.h netinet/tcp.h netinet/udp.h \ sys/acl.h sys/ioctl.h sys/ipc.h sys/mman.h sys/poll.h sys/ptrace.h \ sys/queue.h sys/select.h sys/shm.h sys/socket.h sys/stat.h \ sys/syslimits.h sys/time.h sys/times.h sys/utsname.h sys/wait.h compilerOpts = -D_XOPEN_SOURCE -DSHARED_LIBBIND -D_DARWIN_NO_64_BIT_INODE # -D_ANSI_SOURCE, sigh, breaks user_addr_t excludedFunctions = KERNEL_AUDIT_TOKEN KERNEL_SECURITY_TOKEN add_profil \ addrsel_policy_init \ in6addr_linklocal_allv2routers \ pfctlinput regwnexec_l res_send_setqhook res_send_setrhook \ unwhiteout zopen profil openat acl_valid_link_np linkerOpts = -ldl -lresolv -
//posix.kt @CCall("knifunptr_platform_posix2") external fun printf(@CCall.CString arg0: String?, vararg variadicArguments: Any?):
Int fun putc(arg0: Int, arg1: CValuesRef<FILE>?): Int { memScoped { return kniBridge24(arg0, arg1?.getPointer(memScope).rawValue) } } //(தུ) -
Frontend: Frontend builds AST CreateSymbolTable: Create SymbolTable ObjCExport: Objective-C header
generation BuildCExports: Build C exports Psi2Ir: Psi to IR conversion DestroySymbolTable: Destroy SymbolTable IrGeneratorPlugins: Plugged-in ir generators CopyDefaultValuesToActual: Copy default values from expect to actual declarations Serializer: Serialize descriptor tree and inline IR bodies Backend: All backend IrLowering: IR Lowering (தུ) LowerLibIR: Lower library's IR Bitcode: LLVM Bitcode generation (தུ) VerifyBitcode: Verify bitcode PrintBitcode: Print bitcode ProduceOutput: Produce output Link: Link stage ObjectFiles: Bitcode to object file Linker: Linker $ kotlinc-native -Xlist-phases -
Frontend: Frontend builds AST CreateSymbolTable: Create SymbolTable ObjCExport: Objective-C header
generation BuildCExports: Build C exports Psi2Ir: Psi to IR conversion DestroySymbolTable: Destroy SymbolTable IrGeneratorPlugins: Plugged-in ir generators CopyDefaultValuesToActual: Copy default values from expect to actual declarations Serializer: Serialize descriptor tree and inline IR bodies Backend: All backend IrLowering: IR Lowering (தུ) LowerLibIR: Lower library's IR Bitcode: LLVM Bitcode generation (தུ) VerifyBitcode: Verify bitcode PrintBitcode: Print bitcode ProduceOutput: Produce output Link: Link stage ObjectFiles: Bitcode to object file Linker: Linker $ kotlinc-native -Xlist-phases ϑΣʔζ໊ -
Frontend: Frontend builds AST CreateSymbolTable: Create SymbolTable ObjCExport: Objective-C header
generation BuildCExports: Build C exports Psi2Ir: Psi to IR conversion DestroySymbolTable: Destroy SymbolTable IrGeneratorPlugins: Plugged-in ir generators CopyDefaultValuesToActual: Copy default values from expect to actual declarations Serializer: Serialize descriptor tree and inline IR bodies Backend: All backend IrLowering: IR Lowering (தུ) LowerLibIR: Lower library's IR Bitcode: LLVM Bitcode generation (தུ) VerifyBitcode: Verify bitcode PrintBitcode: Print bitcode ProduceOutput: Produce output Link: Link stage ObjectFiles: Bitcode to object file Linker: Linker $ kotlinc-native -Xlist-phases ϑΣʔζͷઆ໌ -
Frontend: Frontend builds AST CreateSymbolTable: Create SymbolTable ObjCExport: Objective-C header
generation BuildCExports: Build C exports Psi2Ir: Psi to IR conversion DestroySymbolTable: Destroy SymbolTable IrGeneratorPlugins: Plugged-in ir generators CopyDefaultValuesToActual: Copy default values from expect to actual declarations Serializer: Serialize descriptor tree and inline IR bodies Backend: All backend IrLowering: IR Lowering (தུ) LowerLibIR: Lower library's IR Bitcode: LLVM Bitcode generation (தུ) VerifyBitcode: Verify bitcode PrintBitcode: Print bitcode ProduceOutput: Produce output Link: Link stage ObjectFiles: Bitcode to object file Linker: Linker $ kotlinc-native -Xlist-phases -
---------------------------------------------- MODULE_FRAGMENT name:<program> FILE fqName:<root> fileName:/Users/youta1119/Sandbox/main.kt FUN name:main visibility:public modality:FINAL
<> () returnType:kotlin.Unit BLOCK_BODY VAR name:a type:kotlin.Int [val] CONST Int type=kotlin.Int value=10 CALL 'public final fun println (message: kotlin.String): kotlin.Unit [external] declared in kotlin.io' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value="hello world" fun main() { val a: Int = 10 println("hello world") } -
/Applications/Xcode.app/Contents/Developer/Toolchains/ \ XcodeDefault.xctoolchain/usr/bin/clang++ \ -cc1 -emit-obj -disable-llvm-passes -x ir \
-triple x86_64-apple-macosx10.11.0 -O1 -fembed-bitcode=off \ -mllvm -debug-pass=Structure ./tmp/program.kt.bc -o./tmp/result.o -
/Applications/Xcode.app/Contents/Developer/Toolchains/ XcodeDefault.xctoolchain/usr/bin/clang++ \ -cc1 -emit-obj -disable-llvm-passes -x ir \ -triple
x86_64-apple-macosx10.11.0 -O1 -fembed-bitcode=off \ -mllvm -debug-pass=Structure ./tmp/program.kt.bc -o ./tmp/result.o -
/Applications/Xcode.app/Contents/Developer/Toolchains/ XcodeDefault.xctoolchain/usr/bin/clang++ \ -cc1 -emit-obj -disable-llvm-passes -x ir \ -triple
x86_64-apple-macosx10.11.0 -O1 -fembed-bitcode=off \ -mllvm -debug-pass=Structure ./tmp/program.kt.bc -o ./tmp/result.o -
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld \ -demangle -dynamic -arch x86_64 -macosx_version_min 10.11.0 \ -syslibroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/ SDKs/MacOSX10.14.sdk \ -o /Users/youta1119/Sandbox/program.kexe \ /Users/youta1119/Sandbox/./tmp/result.o -S \ -lSystem -lc++ -lobjc -framework Foundation /Applications/Xcode.app/Contents/Developer/ Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin/libclang_rt.osx.a / Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/ 10.0.1/lib/darwin/libclang_rt.profile_osx.a -alias _Konan_main _main -rpath @executable_path/../Frameworks -
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld \ -demangle -dynamic -arch x86_64 -macosx_version_min 10.11.0 \ -syslibroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/ SDKs/MacOSX10.14.sdk \ -o /Users/youta1119/Sandbox/program.kexe \ /Users/youta1119/Sandbox/./tmp/result.o -S \ -lSystem -lc++ -lobjc -framework Foundation /Applications/Xcode.app/Contents/Developer/ Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin/libclang_rt.osx.a / Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/ 10.0.1/lib/darwin/libclang_rt.profile_osx.a -alias _Konan_main _main -rpath @executable_path/../Frameworks -
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld \ -demangle -dynamic -arch x86_64 -macosx_version_min 10.11.0 \ -syslibroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/ SDKs/MacOSX10.14.sdk \ -o /Users/youta1119/Sandbox/program.kexe \ /Users/youta1119/Sandbox/./tmp/result.o -S \ -lSystem -lc++ -lobjc -framework Foundation /Applications/Xcode.app/Contents/Developer/ Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin/libclang_rt.osx.a / Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/ 10.0.1/lib/darwin/libclang_rt.profile_osx.a -alias _Konan_main _main -rpath @executable_path/../Frameworks