]> birchwood-abbey.net Git - mit-scheme.git/commitdiff
microcode: Tweak for musl libc.
authorTaylor R Campbell <campbell+mit-scheme@mumble.net>
Thu, 14 Jul 2022 20:55:02 +0000 (20:55 +0000)
committerTaylor R Campbell <campbell+mit-scheme@mumble.net>
Thu, 14 Jul 2022 21:05:18 +0000 (21:05 +0000)
src/microcode/configure.ac
src/microcode/ux.h
src/relnotes/bug-musl-libc [new file with mode: 0644]

index 2ff69c0c678e61c4f98e04925ad600e7013b4071..ea2ab1e02ce07dd4a30a3395666615e3e125f5f8 100644 (file)
@@ -310,6 +310,12 @@ linux-gnu)
     DO_GCC_TESTS=yes
     GNU_LD=yes
     ;;
+linux-musl)
+    M4_FLAGS="${M4_FLAGS} -P __linux__,1"
+    CPPFLAGS="${CPPFLAGS} -DMUSL"
+    DO_GCC_TESTS=yes
+    GNU_LD=yes
+    ;;
 freebsd*)
     M4_FLAGS="${M4_FLAGS} -P SUPPRESS_LEADING_UNDERSCORE,1"
     DO_GCC_TESTS=yes
index 377687b8c763b91d42f0928bd0a2fa4e1966d3ac..3658f80a448bf72d8971f477ea1202a567884b63 100644 (file)
@@ -137,8 +137,11 @@ USA.
 #  define USE_MAP_FIXED 1
 #endif
 
-/* GNU C library defines environ if __USE_GNU is defined.  */
-#ifndef __USE_GNU
+/* GNU C library defines environ if __USE_GNU is defined.  musl libc
+   defines environ unconditionally, even though, when combined with
+   -Wredundant-decls, this breaks the POSIX requirement that users must
+   explicitly declare environ.  */
+#if !defined __USE_GNU && !defined MUSL
   extern char ** environ;
 #endif
 
diff --git a/src/relnotes/bug-musl-libc b/src/relnotes/bug-musl-libc
new file mode 100644 (file)
index 0000000..f774288
--- /dev/null
@@ -0,0 +1,5 @@
+Fix build with musl libc.
+
+Work around problem with musl's declaration of environ in unistd.h,
+which causes gcc -Wredundant-decls warnings to reject the POSIX
+requirement that users declare `extern char **environ'.