summaryrefslogtreecommitdiff
path: root/user/lilo/musl.patch
diff options
context:
space:
mode:
authorCyberLeo <cyberleo@cyberleo.net>2020-03-28 05:45:52 -0500
committerCyberLeo <cyberleo@cyberleo.net>2020-03-28 05:45:52 -0500
commit9297468fa579836e3a6a381b798feb6b78217c2d (patch)
tree53168212f427afbcf0693b534530a4af803152e9 /user/lilo/musl.patch
parenta63cc05c53a6f4c22422dc8c69808b14d87a6f6e (diff)
parentda5a69b65a8791fffa6e93366ee585f87eff136d (diff)
downloadpackages-9297468fa579836e3a6a381b798feb6b78217c2d.tar.gz
packages-9297468fa579836e3a6a381b798feb6b78217c2d.tar.bz2
packages-9297468fa579836e3a6a381b798feb6b78217c2d.tar.xz
packages-9297468fa579836e3a6a381b798feb6b78217c2d.zip
Merge branch 'master' into zfs
Diffstat (limited to 'user/lilo/musl.patch')
-rw-r--r--user/lilo/musl.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/user/lilo/musl.patch b/user/lilo/musl.patch
new file mode 100644
index 000000000..5b95e717f
--- /dev/null
+++ b/user/lilo/musl.patch
@@ -0,0 +1,81 @@
+Regarding O_NOACCESS:
+
+ > Using a value of 3 as the argument to open is a traditional Linux
+ > extension for getting an fd that's usable only for ioctls. That's
+ > reasonable. What's not reasonable or correct is using O_ACCMODE as a
+ > way to get a 3.
+
+https://www.openwall.com/lists/musl/2014/07/01/12
+
+--- lilo-24.2/src/common.h 2015-11-21 17:50:23.000000000 -0600
++++ lilo-24.2/src/common.h 2020-03-19 07:32:52.429998369 -0500
+@@ -26,12 +26,8 @@
+ # define PAGE_SIZE 4096U
+ #endif
+
+-#ifdef O_ACCMODE
+-# define O_NOACCESS O_ACCMODE
+-#else
+ /* open a file for "no access" */
+-# define O_NOACCESS 3
+-#endif
++#define O_NOACCESS 3
+
+ /* special for LILO, bypass the actual open in dev_open( , ,-1) */
+ #define O_BYPASS -1
+--- lilo-24.2/src/config.h 2011-06-22 02:13:58.000000000 -0500
++++ lilo-24.2/src/config.h 2020-03-19 04:43:53.769503552 -0500
+@@ -20,10 +20,6 @@
+ #endif
+
+ #if !__MSDOS__
+-#if !defined(__GLIBC__) || (__GLIBC__ < 2) || \
+- !defined(__GLIBC_MINOR__) || (__GLIBC_MINOR__ < 1)
+-# warning "glibc version 2.1 or later is recommended"
+-#endif /* !__MSDOS__ */
+
+ #define TMP_DEV "/tmp/dev.%d" /* temporary devices are created here */
+ #define MAX_TMP_DEV 50 /* highest temp. device number */
+--- lilo-24.2/src/lilo.c 2015-11-21 17:51:24.000000000 -0600
++++ lilo-24.2/src/lilo.c 2020-03-19 04:34:43.899511387 -0500
+@@ -182,7 +182,6 @@ extern int has_partitions_beta(dev_t dev
+ printf("Without");
+ #endif
+ printf(" device-mapper\n");
+- printf("\nglibc version %d.%d\n", __GLIBC__, __GLIBC_MINOR__);
+ printf("Kernel Headers included from %d.%d.%d\n",
+ LINUX_VERSION_CODE>>16,
+ LINUX_VERSION_CODE>>8 & 255,
+--- lilo-24.2/src/partition.c 2015-11-21 17:50:20.000000000 -0600
++++ lilo-24.2/src/partition.c 2020-03-19 04:41:05.339505952 -0500
+@@ -31,30 +31,6 @@
+ #include "boot.h"
+ #include "loader.h"
+
+-#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 1
+-#if defined(_syscall5) && defined(__NR__llseek)
+-
+- _syscall5(int, _llseek, unsigned int, fd, unsigned int, hi,
+- unsigned int, lo, lloff_t *, res, unsigned int, wh);
+- int _llseek(unsigned int fd, unsigned int offset_high,
+- unsigned int offset_low, lloff_t * result, unsigned int whence);
+-
+- lloff_t lseek64(unsigned int fd, lloff_t offs, unsigned int whence)
+- { lloff_t res;
+- return _llseek(fd, offs>>32, offs, &res, whence) < 0 ?
+- (lloff_t)(-1) : res;
+- }
+-
+-#else
+-/* last ditch attempt on small disks, and very old systems */
+-# warning "*****************************************"
+-# warning "***** no 64 bit lseek is available ******"
+-# warning "***** using 23 bit sector addresses *****"
+-# warning "*****************************************"
+-# define lseek64 lseek
+-#endif
+-#endif
+-
+ static
+ int anywhere(unsigned char *buf, char *str)
+ {