nixpkgs/pkgs/development/libraries/libelf/fix-configure-main.patch
Randy Eckenrode 9cd4e84a4d
libelf: fix build with clang 16 on Darwin
Clang 16 does not allow `main` with an implicit `int`, which causes the
configure script to misdetect clang as a non-working compiler. Patching
`configure.in` and regenerating `configure` allows libelf to build.

Due to the comment regarding bootstrap tools, this patching is only done
on Darwin with clang.
2023-06-01 21:11:00 -04:00

12 lines
368 B
Diff

diff -ur a/configure.in b/configure.in
--- a/configure.in 2008-05-23 04:17:56.000000000 -0400
+++ b/configure.in 2023-06-01 19:16:04.801921924 -0400
@@ -282,7 +282,7 @@
#define memmove(d,s,n) bcopy((s),(d),(n))
#endif
extern int strcmp();
-main() {
+int main() {
char buf[] = "0123456789";
memmove(buf + 1, buf, 9);
if (strcmp(buf, "0012345678")) exit(1);