1 |
commit: 332268554a5fa329c3ebea901c2456fc7dc02980 |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Mar 10 00:41:10 2017 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Mar 10 01:58:12 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33226855 |
7 |
|
8 |
sys-fs/mtools: fix builds w/clang for Chromium OS |
9 |
|
10 |
sys-fs/mtools/files/mtools-4.0.18-attr.patch | 51 ++++++++++++++++++++++ |
11 |
sys-fs/mtools/files/mtools-4.0.18-memset.patch | 27 ++++++++++++ |
12 |
...ls-4.0.18-r1.ebuild => mtools-4.0.18-r2.ebuild} | 4 +- |
13 |
3 files changed, 81 insertions(+), 1 deletion(-) |
14 |
|
15 |
diff --git a/sys-fs/mtools/files/mtools-4.0.18-attr.patch b/sys-fs/mtools/files/mtools-4.0.18-attr.patch |
16 |
new file mode 100644 |
17 |
index 00000000000..3cd770be8bd |
18 |
--- /dev/null |
19 |
+++ b/sys-fs/mtools/files/mtools-4.0.18-attr.patch |
20 |
@@ -0,0 +1,51 @@ |
21 |
+From e8437f906ca86fd5b1cac20d240a0e114c5df7a9 Mon Sep 17 00:00:00 2001 |
22 |
+From: Mike Frysinger <vapier@g.o> |
23 |
+Date: Thu, 9 Mar 2017 16:06:54 -0800 |
24 |
+Subject: [PATCH] fix unused attribute in func definition |
25 |
+ |
26 |
+UNUSED is for wrapping variable decls, not for variables in a function |
27 |
+definition. It will insert a semi-colon into the mix which makes clang |
28 |
+upset: |
29 |
+x86_64-cros-linux-gnu-clang -DHAVE_CONFIG_H -DSYSCONFDIR=\"/etc/mtools\" \ |
30 |
+ -DCPU_x86_64 -DVENDOR_cros -DOS_linux_gnu -O2 -pipe -O2 -pipe \ |
31 |
+ -march=x86-64 -msse3 -g -fno-exceptions -fno-unwind-tables \ |
32 |
+ -fno-asynchronous-unwind-tables -clang-syntax -Wall \ |
33 |
+ -fno-strict-aliasing -I. -I. -c mainloop.c |
34 |
+mainloop.c:89:15: error: expected ')' |
35 |
+int unix_loop(UNUSED(Stream_t *Stream), MainParam_t *mp, char *arg, |
36 |
+ ^ |
37 |
+./sysincludes.h:106:47: note: expanded from macro 'UNUSED' |
38 |
+ ^ |
39 |
+ |
40 |
+Arguably this should fail on gcc too, but it doesn't today. |
41 |
+ |
42 |
+URL: https://crbug.com/644387 |
43 |
+--- |
44 |
+ mainloop.c | 4 ++-- |
45 |
+ 1 file changed, 2 insertions(+), 2 deletions(-) |
46 |
+ |
47 |
+diff --git a/mainloop.c b/mainloop.c |
48 |
+index f5f8349f1472..69af9a80c3e4 100644 |
49 |
+--- a/mainloop.c |
50 |
++++ b/mainloop.c |
51 |
+@@ -86,7 +86,7 @@ static const char *fix_mcwd(char *ans) |
52 |
+ } |
53 |
+ |
54 |
+ int unix_dir_loop(Stream_t *Stream, MainParam_t *mp); |
55 |
+-int unix_loop(UNUSED(Stream_t *Stream), MainParam_t *mp, char *arg, |
56 |
++int unix_loop(Stream_t *Stream UNUSEDP, MainParam_t *mp, char *arg, |
57 |
+ int follow_dir_link); |
58 |
+ |
59 |
+ static int _unix_loop(Stream_t *Dir, MainParam_t *mp, |
60 |
+@@ -95,7 +95,7 @@ static int _unix_loop(Stream_t *Dir, MainParam_t *mp, |
61 |
+ return unix_dir_loop(Dir, mp); |
62 |
+ } |
63 |
+ |
64 |
+-int unix_loop(UNUSED(Stream_t *Stream), MainParam_t *mp, |
65 |
++int unix_loop(Stream_t *Stream UNUSEDP, MainParam_t *mp, |
66 |
+ char *arg, int follow_dir_link) |
67 |
+ { |
68 |
+ int ret; |
69 |
+-- |
70 |
+2.12.0 |
71 |
+ |
72 |
|
73 |
diff --git a/sys-fs/mtools/files/mtools-4.0.18-memset.patch b/sys-fs/mtools/files/mtools-4.0.18-memset.patch |
74 |
new file mode 100644 |
75 |
index 00000000000..cf8d724406d |
76 |
--- /dev/null |
77 |
+++ b/sys-fs/mtools/files/mtools-4.0.18-memset.patch |
78 |
@@ -0,0 +1,27 @@ |
79 |
+From bafeabbc474a98314e8cecf42c8339e1da21fea2 Mon Sep 17 00:00:00 2001 |
80 |
+From: Mike Frysinger <vapier@g.o> |
81 |
+Date: Thu, 9 Mar 2017 16:23:19 -0800 |
82 |
+Subject: [PATCH] fix typo in scsi_cmd setup |
83 |
+ |
84 |
+The memset call ends up referring to the function scsi_cmd and |
85 |
+clearing its memory instead of the local my_scsi_cmd variable. |
86 |
+--- |
87 |
+ scsi.c | 2 +- |
88 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
89 |
+ |
90 |
+diff --git a/scsi.c b/scsi.c |
91 |
+index 7510edcefe95..85ff3bc3dc55 100644 |
92 |
+--- a/scsi.c |
93 |
++++ b/scsi.c |
94 |
+@@ -170,7 +170,7 @@ int scsi_cmd(int fd, unsigned char *cdb, int cmdlen, scsi_io_mode_t mode, |
95 |
+ /* |
96 |
+ ** Init the command |
97 |
+ */ |
98 |
+- memset(&scsi_cmd,0,sizeof(scsi_cmd)); |
99 |
++ memset(&my_scsi_cmd,0,sizeof(my_scsi_cmd)); |
100 |
+ my_scsi_cmd.interface_id = 'S'; |
101 |
+ my_scsi_cmd.dxfer_direction = (mode == SCSI_IO_READ)?(SG_DXFER_FROM_DEV):(SG_DXFER_TO_DEV); |
102 |
+ my_scsi_cmd.cmd_len = cmdlen; |
103 |
+-- |
104 |
+2.12.0 |
105 |
+ |
106 |
|
107 |
diff --git a/sys-fs/mtools/mtools-4.0.18-r1.ebuild b/sys-fs/mtools/mtools-4.0.18-r2.ebuild |
108 |
similarity index 88% |
109 |
rename from sys-fs/mtools/mtools-4.0.18-r1.ebuild |
110 |
rename to sys-fs/mtools/mtools-4.0.18-r2.ebuild |
111 |
index 21dfc20509b..c58be8b13a7 100644 |
112 |
--- a/sys-fs/mtools/mtools-4.0.18-r1.ebuild |
113 |
+++ b/sys-fs/mtools/mtools-4.0.18-r2.ebuild |
114 |
@@ -1,4 +1,4 @@ |
115 |
-# Copyright 1999-2016 Gentoo Foundation |
116 |
+# Copyright 1999-2017 Gentoo Foundation |
117 |
# Distributed under the terms of the GNU General Public License v2 |
118 |
|
119 |
EAPI="5" |
120 |
@@ -30,6 +30,8 @@ src_prepare() { |
121 |
sed -i -e "s:mkdir:mkdir -p:" mkinstalldirs || die |
122 |
|
123 |
epatch "${FILESDIR}"/${P}-locking.patch # https://crbug.com/508713 |
124 |
+ epatch "${FILESDIR}"/${P}-attr.patch # https://crbug.com/644387 |
125 |
+ epatch "${FILESDIR}"/${P}-memset.patch |
126 |
} |
127 |
|
128 |
src_configure() { |