58 lines
2.2 KiB
Diff
58 lines
2.2 KiB
Diff
Make musl a native libc.
|
|
|
|
--- substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/linux/libc/MuslLibC.java.orig
|
|
+++ substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/linux/libc/MuslLibC.java
|
|
@@ -43,13 +43,12 @@
|
|
|
|
@Override
|
|
public List<String> getAdditionalQueryCodeCompilerOptions() {
|
|
- /* Avoid the dependency to muslc for builds cross compiling to muslc. */
|
|
- return Collections.singletonList("--static");
|
|
+ return Collections.emptyList();
|
|
}
|
|
|
|
@Override
|
|
public String getTargetCompiler() {
|
|
- return "musl-gcc";
|
|
+ return "gcc";
|
|
}
|
|
|
|
@Override
|
|
@@ -59,14 +58,11 @@
|
|
|
|
@Override
|
|
public boolean requiresLibCSpecificStaticJDKLibraries() {
|
|
- return true;
|
|
+ return false;
|
|
}
|
|
|
|
@Override
|
|
public void checkIfLibCSupported() {
|
|
- if (!SubstrateOptions.StaticExecutable.getValue()) {
|
|
- throw UserError.abort("Musl can only be used for statically linked executables.");
|
|
- }
|
|
if (JavaVersionUtil.JAVA_SPEC != 11) {
|
|
throw UserError.abort("Musl can only be used with labsjdk 11.");
|
|
}
|
|
--- substratevm/src/com.oracle.svm.native.jvm.posix/src/JvmFuncs.c.orig
|
|
+++ substratevm/src/com.oracle.svm.native.jvm.posix/src/JvmFuncs.c
|
|
@@ -128,7 +128,7 @@
|
|
return listen(fd, count);
|
|
}
|
|
|
|
-JNIEXPORT int JNICALL JVM_Send(int fd, char* buf, size_t nBytes, uint flags) {
|
|
+JNIEXPORT int JNICALL JVM_Send(int fd, char* buf, size_t nBytes, unsigned int flags) {
|
|
RESTARTABLE_RETURN_INT(send(fd, buf, nBytes, flags));
|
|
}
|
|
|
|
--- substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/linux/libc/LibCFeature.java.orig
|
|
+++ substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/linux/libc/LibCFeature.java
|
|
@@ -55,7 +55,7 @@
|
|
@Override
|
|
public String getValueOrDefault(UnmodifiableEconomicMap<OptionKey<?>, Object> values) {
|
|
if (!values.containsKey(this)) {
|
|
- return Platform.includedIn(Platform.ANDROID.class) ? "bionic" : "glibc";
|
|
+ return Platform.includedIn(Platform.ANDROID.class) ? "bionic" : "musl";
|
|
}
|
|
return (String) values.get(this);
|
|
}
|