summaryrefslogtreecommitdiff
path: root/hints/linux.sh
diff options
context:
space:
mode:
authorAndy Dougherty <doughera@lafayette.edu>2019-01-31 14:05:41 -0500
committerAndy Dougherty <doughera@lafayette.edu>2019-01-31 14:05:41 -0500
commit04db542212fdad3a62f13afe741c99028f4bf799 (patch)
treeed1d41aee969b96cc4b00c5a77d39ca30a139934 /hints/linux.sh
parentba73a4cb8f472480a2d630613d1e9e1172d518d3 (diff)
downloadperl-04db542212fdad3a62f13afe741c99028f4bf799.tar.gz
Define _GNU_SOURCE if using the musl libc on linux.
Together with prior commits ba73a4cb8f, f8d82a1010, and 63c1fa6a98, this should close [perl #133760].
Diffstat (limited to 'hints/linux.sh')
-rw-r--r--hints/linux.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/hints/linux.sh b/hints/linux.sh
index 3f38ea07f1..a985a8ee1b 100644
--- a/hints/linux.sh
+++ b/hints/linux.sh
@@ -178,6 +178,16 @@ case "$plibpth" in
;;
esac
+# For the musl libc, perl should #define _GNU_SOURCE. Otherwise, some
+# available functions, like memem, won't be used. See the discussion in
+# [perl #133760]. musl doesn't offer an easy way to identify it, but,
+# at least on alpine linux, the ldd --version output contains the
+# string 'musl.'
+case `ldd --version 2>&1` in
+ musl*) ccflags="$ccflags -D_GNU_SOURCE" ;;
+ *) ;;
+esac
+
# libquadmath is sometimes installed as gcc internal library,
# so contrary to our usual policy of *not* looking at gcc internal
# directories we now *do* look at them, in case they contain