gnu: glibc-bootstrap-system.patch: Update for glibc-2.25.
[jackhill/guix/guix.git] / gnu / packages / patches / glibc-bootstrap-system.patch
1 We want to allow builds in chroots that lack /bin/sh. Thus, system(3)
2 and popen(3) need to be tweaked to use the right shell. For the bootstrap
3 glibc, we just use whatever `sh' can be found in $PATH. The final glibc
4 instead uses the hard-coded absolute file name of `bash'.
5
6 The second part that touches fcntl-linux.h reverts a change from glibc-2.25
7 which would require the statically compiled glibc used in bootstrapping to
8 depend on the linux kernel headers.
9
10 --- a/sysdeps/posix/system.c
11 +++ b/sysdeps/posix/system.c
12 @@ -134,7 +134,7 @@ do_system (const char *line)
13 INIT_LOCK ();
14
15 /* Exec the shell. */
16 - (void) __execve (SHELL_PATH, (char *const *) new_argv, __environ);
17 + (void) __execvpe (SHELL_NAME, (char *const *) new_argv, __environ);
18 _exit (127);
19 }
20 else if (pid < (pid_t) 0)
21
22 --- b/libio/iopopen.c 2012-06-30 21:12:34.000000000 +0200
23 +++ b/libio/iopopen.c 2012-12-19 12:52:29.000000000 +0100
24 @@ -226,7 +226,7 @@ _IO_new_proc_open (fp, command, mode)
25 _IO_close (fd);
26 }
27
28 - _IO_execl ("/bin/sh", "sh", "-c", command, (char *) 0);
29 + execlp ("sh", "sh", "-c", command, (char *) 0);
30 _IO__exit (127);
31 }
32 _IO_close (child_end);
33
34 --- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
35 +++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
36 @@ -318,7 +318,15 @@ struct f_owner_ex
37
38
39 /* Flags for fallocate. */
40 +# define FALLOC_FL_KEEP_SIZE 1 /* Don't extend size of file
41 + even if offset + len is
42 + greater than file size. */
43 +# define FALLOC_FL_PUNCH_HOLE 2 /* Create a hole in the file. */
44 +# define FALLOC_FL_COLLAPSE_RANGE 8 /* Remove a range of a file
45 + without leaving a
46 + hole. */
47 +# define FALLOC_FL_ZERO_RANGE 16 /* Convert a range of a
48 + file to zeros. */
49 -# include <linux/falloc.h>
50
51
52 /* File handle structure. */