void-packages/srcpkgs/mandrel/files/musl.patch

49 lines
2.0 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
@@ -41,5 +41,4 @@
@Override
public List<String> getAdditionalQueryCodeCompilerOptions() {
- /* Avoid the dependency to muslc for builds cross compiling to muslc. */
- return Collections.singletonList("--static");
+ return Collections.emptyList();
}
@@ -58,13 +52,6 @@
@Override
public boolean requiresLibCSpecificStaticJDKLibraries() {
- return true;
- }
-
- @Override
- public void checkIfLibCSupported() {
- if (!SubstrateOptions.StaticExecutable.getValue()) {
- throw UserError.abort("Musl can only be used for statically linked executables.");
- }
+ return false;
}
}
--- 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);
}