--- getopt.c.orig	1998-11-23 08:59:47.000000000 +0800
+++ getopt.c	2023-02-23 23:30:19.000000000 +0800
@@ -62,6 +62,9 @@
 
 #ifndef ELIDE_CODE
 
+#ifdef __APPLE__
+#include <string.h>
+#endif
 
 /* This needs to come after some library #include
    to get __GNU_LIBRARY__ defined.  */