https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
a

Adam S

11/29/2023, 7:39 AM
quick question: in
~/.konan/dependencies
I can see
x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2
for Linux and
msys2-mingw-w64-x86_64-2
for Windows. Can someone with a Mac tell me what the macOS equivalent is? I'm trying to work out the directory with the gcc for each platform
Copy code
// build.gradle.kts
import org.jetbrains.kotlin.konan.target.HostManager
import org.jetbrains.kotlin.konan.target.HostManager.Companion.hostIsLinux
import org.jetbrains.kotlin.konan.target.HostManager.Companion.hostIsMac
import org.jetbrains.kotlin.konan.target.HostManager.Companion.hostIsMingw

val konanHostBin = when {
  hostIsMingw -> "dependencies/msys2-mingw-w64-x86_64-2/bin"
  hostIsMac   -> TODO("what's the Mac dir?")
  hostIsLinux -> "dependencies/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2/bin"
  else        -> {
    logger.warn("Unknown host family ${HostManager.host.family}")
    null
  }
}
j

Jeff Lockhart

11/29/2023, 8:07 AM
This is what I've got in
~/.konan/dependencies
on my Mac.
Looks like
clang-llvm-apple-8.0.0-darwin-macos
is probably the one you're looking for.
a

Adam S

11/29/2023, 8:23 AM
wonderful, thanks
👌🏼 1
o

Oleg Yukhnevich

11/29/2023, 8:33 AM
at my side I don't have
...apple-8...
🙂 Still I build for ALL K/N targets from mac and, there is no GCC for apple targets there AFAIR - only clang (which is in
apple-llvm-...
BTW, why do you need specifically GCC path?
a

Adam S

11/29/2023, 8:33 AM
hmm strange...
I want to build a C library, and afaik that requires the specific gcc that Kotlin Konan uses which isn't easily downloadable. I'm on a Windows machine right now and the gcc inside
dependencies/msys2-mingw-w64-x86_64-2/bin
is working
o

Oleg Yukhnevich

11/29/2023, 8:38 AM
Yeah, it should work, but for apple targets, you will need to use clang from llvm
a

Adam S

11/29/2023, 9:00 AM
that's a problem for future me :)
j

Jeff Lockhart

11/29/2023, 9:09 AM
Interesting, maybe that directory is specific to x64 Mac? And yeah, there's no gcc there. I just quick scanned and that directory looked the most similar with a bin subdirectory. It does have clang.
6 Views