diff --git a/glob/glob.c b/glob/glob.c
index f3911bc..8ec8511 100644
--- a/glob/glob.c
+++ b/glob/glob.c
@@ -208,7 +208,7 @@ my_realloc (p, n)
 #endif /* __GNU_LIBRARY__ || __DJGPP__ */
 
 
-#if !defined __alloca && !defined __GNU_LIBRARY__
+#if (!defined __alloca && defined __GNU_LIBRARY__ && __linux__) || (!defined __alloca && !defined __GNU_LIBRARY__)
 
 # ifdef	__GNUC__
 #  undef alloca
