HaxeFoundation / HaxeFoundation/hxcpp
hxcpp runtime not compiling on Apple Silicon
- Lingua principale
- C++
- Stelle
- 330
- Fork
- 227
- Merge medio
- 2g 16h
- PR unite (30g)
- 18
Descrizione
Using:
* haxe 4.2.2 from brew
* hxcpp 4.2.1
* Apple MacBook Pro 2020 with M1 chip (arm64)
Trying to compile simple hello world:
```haxe
## main.hx:
import lib.Logger;
class Main {
static public function main():Void {
var l = new Logger();
l.log("Hello, world");
}
}
## lib/Logger.hx:
package lib;
class Logger {
public function new() {}
public function log(message:String):Void {
trace(message);
}
}
```
With:
```
haxe --main Main --cpp ./.build/cpp
```
And getting assembly errors for runtime complilation:
```
Compiling group: runtime
g++ -D_CRT_SECURE_NO_DEPRECATE -DHX_UNDEFINE_H -c -fvisibility=hidden -stdlib=libc++ -Qunused-arguments -O2 -I/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/include -DHX_MACOS -m64 -Wno-parentheses -Wno-unused-value -Wno-format-extra-args -Wno-overflow -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS(haxe) -DHX_SMART_STRINGS(haxe) -DHXCPP_API_LEVEL=400(haxe) ... tags=[haxe]
- src/Enum.cpp
- src/Array.cpp
- src/hx/Anon.cpp
- src/hx/Date.cpp
- src/hx/Interface.cpp
- src/hx/CFFI.cpp [haxe,static]
- src/hx/Object.cpp
- src/hx/Boot.cpp
- src/hx/Class.cpp
- src/Dynamic.cpp
- src/hx/gc/GcRegCapture.cpp [haxe,gc]
- src/Math.cpp
Error: /Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:69:12: error: unknown token in expression
asm ("movq %%rbx, %0\n\t" : "=r" (regBx) );
^
:1:7: note: instantiated into assembly here
movq %rbx, x8
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:69:12: error: invalid operand
asm ("movq %%rbx, %0\n\t" : "=r" (regBx) );
^
:1:7: note: instantiated into assembly here
movq %rbx, x8
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:70:12: error: unknown token in expression
asm ("movq %%rbp, %0\n\t" : "=r" (regBp) );
^
:1:7: note: instantiated into assembly here
movq %rbp, x9
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:70:12: error: invalid operand
asm ("movq %%rbp, %0\n\t" : "=r" (regBp) );
^
:1:7: note: instantiated into assembly here
movq %rbp, x9
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:72:12: error: unknown token in expression
asm ("movq %%r12, %0\n\t" : "=r" (reg12) );
^
:1:7: note: instantiated into assembly here
movq %r12, x8
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:72:12: error: invalid operand
asm ("movq %%r12, %0\n\t" : "=r" (reg12) );
^
:1:7: note: instantiated into assembly here
movq %r12, x8
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:73:12: error: unknown token in expression
asm ("movq %%r13, %0\n\t" : "=r" (reg13) );
^
:1:7: note: instantiated into assembly here
movq %r13, x9
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:73:12: error: invalid operand
asm ("movq %%r13, %0\n\t" : "=r" (reg13) );
^
:1:7: note: instantiated into assembly here
movq %r13, x9
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:74:12: error: unknown token in expression
asm ("movq %%r14, %0\n\t" : "=r" (reg14) );
^
:1:7: note: instantiated into assembly here
movq %r14, x10
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:74:12: error: invalid operand
asm ("movq %%r14, %0\n\t" : "=r" (reg14) );
^
:1:7: note: instantiated into assembly here
movq %r14, x10
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:75:12: error: unknown token in expression
asm ("movq %%r15, %0\n\t" : "=r" (reg15) );
^
:1:7: note: instantiated into assembly here
movq %r15, x11
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:75:12: error: invalid operand
asm ("movq %%r15, %0\n\t" : "=r" (reg15) );
^
:1:7: note: instantiated into assembly here
movq %r15, x11
^
12 errors generated.
Error: Build failed
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia da src/hx/gc/GcRegCapture.cpp, in particolare dall’assembly inline intorno alle righe 69-75, e riproduci il problema con il comando fornito haxe --main Main --cpp su un Mac Apple Silicon. Confronta le aspettative sull’assembly generato con gli errori del compilatore M1. Il lavoro è completato quando il semplice runtime hello-world viene compilato correttamente senza gli errori di assembly riportati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp
- Ambito
- build-system
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100