syslinux: fix build on gcc10

authored by Lucas Ransan and committed by Frederik Rietdijk 68a4db34 97a279c7

+35 -3
+1
pkgs/os-specific/linux/syslinux/default.nix
··· 47 url = mkURL "26f0e7b2" "0018-prevent-pow-optimization.patch"; 48 sha256 = "1c8g0jz5yj9a0rsmryx9vdjsw4hw8mjfcg05c9pmyjg85w3dfp3m"; 49 }) 50 ]; 51 52 postPatch = ''
··· 47 url = mkURL "26f0e7b2" "0018-prevent-pow-optimization.patch"; 48 sha256 = "1c8g0jz5yj9a0rsmryx9vdjsw4hw8mjfcg05c9pmyjg85w3dfp3m"; 49 }) 50 + ./gcc10.patch 51 ]; 52 53 postPatch = ''
+33
pkgs/os-specific/linux/syslinux/gcc10.patch
···
··· 1 + diff --git a/dos/string.h b/dos/string.h 2 + index f648de2..a502132 100644 3 + --- a/dos/string.h 4 + +++ b/dos/string.h 5 + @@ -5,12 +5,13 @@ 6 + #ifndef _STRING_H 7 + #define _STRING_H 8 + 9 + +#include <stddef.h> 10 + + 11 + /* Standard routines */ 12 + #define memcpy(a,b,c) __builtin_memcpy(a,b,c) 13 + #define memmove(a,b,c) __builtin_memmove(a,b,c) 14 + #define memset(a,b,c) __builtin_memset(a,b,c) 15 + #define strcpy(a,b) __builtin_strcpy(a,b) 16 + -#define strlen(a) __builtin_strlen(a) 17 + 18 + /* This only returns true or false */ 19 + static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n) 20 + @@ -21,6 +22,13 @@ static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n) 21 + return rv; 22 + } 23 + 24 + +static inline size_t strlen(const char *s) 25 + +{ 26 + + size_t len = 0; 27 + + while (*s++) len++; 28 + + return len; 29 + +} 30 + + 31 + extern char *strchr(const char *s, int c); 32 + 33 + #endif /* _STRING_H */
+1 -3
pkgs/top-level/all-packages.nix
··· 19326 19327 sysklogd = callPackage ../os-specific/linux/sysklogd { }; 19328 19329 - syslinux = callPackage ../os-specific/linux/syslinux { 19330 - stdenv = gcc9Stdenv; # Fails with "undefined reference to `strlen'" on gcc10 19331 - }; 19332 19333 sysstat = callPackage ../os-specific/linux/sysstat { }; 19334
··· 19326 19327 sysklogd = callPackage ../os-specific/linux/sysklogd { }; 19328 19329 + syslinux = callPackage ../os-specific/linux/syslinux { }; 19330 19331 sysstat = callPackage ../os-specific/linux/sysstat { }; 19332