Upgrade to Pro — share decks privately, control downloads, hide ads and more …

KotlinFest2019

youta ogino
August 24, 2019
11k

 KotlinFest2019

youta ogino

August 24, 2019
Tweet

Transcript

  1. αϙʔτ͍ͯ͠ΔϓϥοτϑΥʔϜ • 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)
  2. package kotlin.io /** Prints the given [message] to the standard

    output stream. */ @SymbolName("Kotlin_io_Console_print") external public fun print(message: String) Kotlinଆ
  3. package kotlin.io /** Prints the given [message] to the standard

    output stream. */ @SymbolName("Kotlin_io_Console_print") external public fun print(message: String) Kotlinଆ
  4. package kotlin.io /** Prints the given [message] to the standard

    output stream. */ @SymbolName("Kotlin_io_Console_print") external public fun print(message: String) Kotlinଆ ίϯύΠϥʹରͯؔ͠਺ͷ࣮ମ͸֎ ෦ʹ͋Δͱڭ͑Δҝͷ΋ͷ ؔ਺ͷ࣮ମͷγϯϘϧ໊ $ ؔ਺໊ Λද͢
  5. 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++ଆ
  6. 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); }
  7. 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ؔ਺
  8. 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); }
  9. 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); } ($ͷॳظԽ
  10. 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ͷϓϩάϥϜΛىಈͤ͞Δؔ਺ ͷݺͼग़͠
  11. 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); } ϝϞϦղ์
  12. 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); }
  13. 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); }
  14. // 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
  15. // 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໊Λࢦఆ
  16. // 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 ελϒੜ੒ͷର৅ͷϔομϑΝΠϧ
  17. // 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 ελϒΛੜ੒͢Δͱ͖ʹ࢖͏ίϯύ ΠϥΦϓγϣϯΛࢦఆ
  18. // 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
  19. //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) } } //(தུ)
  20. 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
  21. 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 ϑΣʔζ໊
  22. 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 ϑΣʔζͷઆ໌
  23. 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
  24. ---------------------------------------------- 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") }
  25. /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
  26. /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
  27. /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
  28. /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
  29. /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
  30. /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