Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Compiling on Android's TermuxArch (aarch64) #3889

Closed
alxgrk opened this issue Feb 19, 2020 · 3 comments
Closed

Compiling on Android's TermuxArch (aarch64) #3889

alxgrk opened this issue Feb 19, 2020 · 3 comments

Comments

@alxgrk
Copy link

alxgrk commented Feb 19, 2020

Hi there,

I'm not sure, if this is of interest for a lot of people, but I'm trying to compile a Kotlin Multiplatform Project using Gradle on Android's TermuxArch - which is essentially an ArchLinux.
The project itself is quite basic, I just used the template from IntelliJ > New... > Project > Kotlin > Multiplatform Library

However, for the following task I get this error:

> Task :client:linkDebugTestLinux                          e: Compilation failed: /root/.konan/kotlin-native-linux-1.3.61/konan/nativelib/libllvmstubs.so: /root/.konan/kotlin-native-linux-1.3.61/konan/nativelib/libllvmstubs.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64-bit .so on a AARCH64-bit platform)
                                                                           
  * Source files: 
  * Compiler version info: Konan: 1.3.61 / Kotlin: 1.3.60  
  * Output kind: PROGRAM         
                                                                                      
e: java.lang.UnsatisfiedLinkError: /root/.konan/kotlin-native-linux-1.3.61/konan/nativelib/libllvmstubs.so: /root/.konan/kotlin-native-linux-1.3.61/konan/nativelib/libllvmstubs.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64-bit .so on a AARCH64-bit platform)
  at java.lang.ClassLoader$NativeLibrary.load(Native Method)
  at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)                                       
  at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)                                               
  at java.lang.Runtime.loadLibrary0(Runtime.java:870)   
  at java.lang.System.loadLibrary(System.java:1122)      
  at llvm.llvm.<clinit>(llvm.kt:5474)              
  at org.jetbrains.kotlin.backend.konan.llvm.BitcodePhasesKt$contextLLVMSetupPhase$1.invoke(BitcodePhases.kt:29)     
  at org.jetbrains.kotlin.backend.konan.llvm.BitcodePhasesKt$contextLLVMSetupPhase$1.invoke(BitcodePhases.kt)        
  at org.jetbrains.kotlin.backend.konan.KonanLoweringPhasesKt$makeKonanModuleOpPhase$1.invoke(KonanLoweringPhases.kt:58)                                                       
  at org.jetbrains.kotlin.backend.konan.KonanLoweringPhasesKt$makeKonanModuleOpPhase$1.invoke(KonanLoweringPhases.kt:56)                                                        
  at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper$runBody$1.invoke(CompilerPhase.kt:128)      
  at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.downlevel(CompilerPhase.kt:24)                        
  at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.runBody(CompilerPhase.kt:127)               
  at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.invoke(CompilerPhase.kt:105)                
  at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:28)                           
  at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper$runBody$1.invoke(CompilerPhase.kt:128)      
  at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.downlevel(CompilerPhase.kt:24)                        
  at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.runBody(CompilerPhase.kt:127)               
  at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.invoke(CompilerPhase.kt:105)                
  at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:28)                            
  at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper$runBody$1.invoke(CompilerPhase.kt:128)      
  at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.downlevel(CompilerPhase.kt:24)                        
  at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.runBody(CompilerPhase.kt:127)               
  at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.invoke(CompilerPhase.kt:105)                
  at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:28)                            
  at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper$runBody$1.invoke(CompilerPhase.kt:128)      
  at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.downlevel(CompilerPhase.kt:24)                        
  at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.runBody(CompilerPhase.kt:127)               
  at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.invoke(CompilerPhase.kt:105)                
  at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.invokeToplevel(CompilerPhase.kt:42)                  
  at org.jetbrains.kotlin.backend.konan.KonanDriverKt.runTopLevelPhases(KonanDriver.kt:27)                            
  at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:74)                                                   
  at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:34)                                                  
  at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:84)                                          
  at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:42)                                          
  at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:104)                                                     
  at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:82)                                                      
  at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:50)                                                      
  at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:215)                                    
  at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMain(CLITool.kt:207)                                         
  at org.jetbrains.kotlin.cli.bc.K2Native$Companion$main$1.invoke(K2Native.kt:225)                                    
  at org.jetbrains.kotlin.cli.bc.K2Native$Companion$main$1.invoke(K2Native.kt:222)                                   
  at org.jetbrains.kotlin.util.UtilKt.profileIf(Util.kt:27)                                                           
  at org.jetbrains.kotlin.util.UtilKt.profile(Util.kt:21)                                                             
  at org.jetbrains.kotlin.cli.bc.K2Native$Companion.main(K2Native.kt:224)                                             
  at org.jetbrains.kotlin.cli.bc.K2NativeKt.main(K2Native.kt:304)                                                    
  at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:16)                                                                                                                                                                      

> Task :client:linkDebugTestLinux FAILED

The error message suggests, that the problem is related to aarch64. So I just wanted to ask, if it might be doable within reasonable effort to fix this.

Thanks in advance.

@artdfel
Copy link
Contributor

artdfel commented Feb 20, 2020

Hello, @alxgrk! It seems like the problem here is that we support only x86_64 host machines, while you are trying to use the compiler from a different one. Presumably, it is possible to add such an option, but I'm not sure it can be stated as a high-priority feature.
I also filed the YouTrack issue to track this suggestion, see here. We can try to estimate the community interest by the upvotes there, okay?

@alxgrk
Copy link
Author

alxgrk commented Feb 20, 2020

Hey @artdfel , first: thank you very much for your quick response!

Your assumption sounds reasonable, so thanks for taking it onto YouTrack. And since this is not that urgent to me, I'm also fine with waiting for upvotes over there.

@SvyatoslavScherbina
Copy link
Collaborator

According to migrating issue tracking to YouTrack, closing this issue in favour of https://youtrack.jetbrains.com/issue/KT-36871

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants