We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3847069 commit b59d444Copy full SHA for b59d444
Makefile
@@ -100,10 +100,18 @@ all: $(LIBRARY_RELEASE_$(OS)) libkrun.pc
100
101
debug: $(LIBRARY_DEBUG_$(OS)) libkrun.pc
102
103
+ifeq ($(SYSROOT_LINUX),)
104
+# Build on Linux host
105
+CC_LINUX=$(CC)
106
+else
107
+# Cross-compile on macOS with the LLVM linker (brew install lld)
108
+CC_LINUX=clang -target aarch64-linux-gnu -fuse-ld=lld -Wl,-strip-debug --sysroot $(SYSROOT_LINUX) -Wno-c23-extensions
109
+endif
110
+
111
ifeq ($(BUILD_INIT),1)
112
INIT_BINARY = init/init
113
$(INIT_BINARY): $(INIT_SRC)
- $(CC) -O2 -static -Wall $(INIT_DEFS) -o $@ $(INIT_SRC) $(INIT_DEFS)
114
+ $(CC_LINUX) -O2 -static -Wall $(INIT_DEFS) -o $@ $(INIT_SRC) $(INIT_DEFS)
115
endif
116
117
$(LIBRARY_RELEASE_$(OS)): $(INIT_BINARY)
0 commit comments