diff --git a/pkgs/os-specific/linux/syslinux/default.nix b/pkgs/os-specific/linux/syslinux/default.nix index 28681aed5640..559fb6219b43 100644 --- a/pkgs/os-specific/linux/syslinux/default.nix +++ b/pkgs/os-specific/linux/syslinux/default.nix @@ -47,6 +47,7 @@ stdenv.mkDerivation { url = mkURL "26f0e7b2" "0018-prevent-pow-optimization.patch"; sha256 = "1c8g0jz5yj9a0rsmryx9vdjsw4hw8mjfcg05c9pmyjg85w3dfp3m"; }) + ./gcc10.patch ]; postPatch = '' diff --git a/pkgs/os-specific/linux/syslinux/gcc10.patch b/pkgs/os-specific/linux/syslinux/gcc10.patch new file mode 100644 index 000000000000..f4893a912313 --- /dev/null +++ b/pkgs/os-specific/linux/syslinux/gcc10.patch @@ -0,0 +1,33 @@ +diff --git a/dos/string.h b/dos/string.h +index f648de2..a502132 100644 +--- a/dos/string.h ++++ b/dos/string.h +@@ -5,12 +5,13 @@ + #ifndef _STRING_H + #define _STRING_H + ++#include ++ + /* Standard routines */ + #define memcpy(a,b,c) __builtin_memcpy(a,b,c) + #define memmove(a,b,c) __builtin_memmove(a,b,c) + #define memset(a,b,c) __builtin_memset(a,b,c) + #define strcpy(a,b) __builtin_strcpy(a,b) +-#define strlen(a) __builtin_strlen(a) + + /* This only returns true or false */ + static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n) +@@ -21,6 +22,13 @@ static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n) + return rv; + } + ++static inline size_t strlen(const char *s) ++{ ++ size_t len = 0; ++ while (*s++) len++; ++ return len; ++} ++ + extern char *strchr(const char *s, int c); + + #endif /* _STRING_H */ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 96d4027e6a58..452468e2435f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19326,9 +19326,7 @@ in sysklogd = callPackage ../os-specific/linux/sysklogd { }; - syslinux = callPackage ../os-specific/linux/syslinux { - stdenv = gcc9Stdenv; # Fails with "undefined reference to `strlen'" on gcc10 - }; + syslinux = callPackage ../os-specific/linux/syslinux { }; sysstat = callPackage ../os-specific/linux/sysstat { };