diff options
author | Tim Orling <timothy.t.orling@linux.intel.com> | 2016-07-17 11:37:23 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-27 08:33:38 +0100 |
commit | 54086de15853994a25e4d3a681cfab229d3815bd (patch) | |
tree | 6b4f946aafd750d941f2623ff76fe93acc03cd76 /meta/recipes-support | |
parent | 6dca3c67c31cc9456594b9e0bc53bafd1d36878c (diff) | |
download | poky-54086de15853994a25e4d3a681cfab229d3815bd.tar.gz |
nss: fix build for gcc-6
[YOCTO #9897] (Fedora-24 host is gcc-6)
(From OE-Core rev: 1882abd101d211e5ab3f1a0a77580395778e6301)
Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support')
-rw-r--r-- | meta/recipes-support/nss/nss/nss-gcc6-fix.patch | 343 | ||||
-rw-r--r-- | meta/recipes-support/nss/nss_3.21.bb | 1 |
2 files changed, 344 insertions, 0 deletions
diff --git a/meta/recipes-support/nss/nss/nss-gcc6-fix.patch b/meta/recipes-support/nss/nss/nss-gcc6-fix.patch new file mode 100644 index 0000000000..97422f6286 --- /dev/null +++ b/meta/recipes-support/nss/nss/nss-gcc6-fix.patch | |||
@@ -0,0 +1,343 @@ | |||
1 | Fix gcc-6 -Werror=misleading-indentation errors | ||
2 | |||
3 | Patch did not apply cleanly, so re-create the same changes. | ||
4 | Also fixed some whitespace errors not addressed in the original patch. | ||
5 | |||
6 | Upstream-Status: Backport | ||
7 | Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> | ||
8 | |||
9 | From: Michel Normand <normand@linux.vnet.ibm.com> | ||
10 | Subject: nss gcc6 change | ||
11 | Date: Mon, 18 Apr 2016 19:11:03 +0200 | ||
12 | |||
13 | nss changes required to avoid build error with gcc6 like: | ||
14 | === | ||
15 | [ 58s] h_page.c: In function 'new_lseek': | ||
16 | [ 58s] h_page.c:117:8: error: this 'if' clause does not guard... [-Werror=misleading-indentation] | ||
17 | [ 58s] if(offset < 1) | ||
18 | [ 58s] ^~ | ||
19 | [ 58s] h_page.c:120:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' | ||
20 | [ 58s] cur_pos = lseek(fd, 0, SEEK_CUR); | ||
21 | [ 58s] ^~~~~~~ | ||
22 | === | ||
23 | |||
24 | Signed-off-by: Michel Normand <normand@linux.vnet.ibm.com> | ||
25 | |||
26 | Index: nss-3.21/nss/cmd/bltest/blapitest.c | ||
27 | =================================================================== | ||
28 | --- nss-3.21.orig/nss/cmd/bltest/blapitest.c | ||
29 | +++ nss-3.21/nss/cmd/bltest/blapitest.c | ||
30 | @@ -1571,8 +1571,7 @@ bltest_seed_init(bltestCipherInfo *ciphe | ||
31 | cipherInfo->cipher.symmkeyCipher = seed_Encrypt; | ||
32 | else | ||
33 | cipherInfo->cipher.symmkeyCipher = seed_Decrypt; | ||
34 | - | ||
35 | - return SECSuccess; | ||
36 | + return SECSuccess; | ||
37 | } | ||
38 | |||
39 | SECStatus | ||
40 | Index: nss-3.21/nss/cmd/vfychain/vfychain.c | ||
41 | =================================================================== | ||
42 | --- nss-3.21.orig/nss/cmd/vfychain/vfychain.c | ||
43 | +++ nss-3.21/nss/cmd/vfychain/vfychain.c | ||
44 | @@ -439,7 +439,8 @@ main(int argc, char *argv[], char *envp[ | ||
45 | case 0 : /* positional parameter */ goto breakout; | ||
46 | case 'a' : isAscii = PR_TRUE; break; | ||
47 | case 'b' : secStatus = DER_AsciiToTime(&time, optstate->value); | ||
48 | - if (secStatus != SECSuccess) Usage(progName); break; | ||
49 | + if (secStatus != SECSuccess) Usage(progName); | ||
50 | + break; | ||
51 | case 'd' : certDir = PL_strdup(optstate->value); break; | ||
52 | case 'e' : ocsp_fetchingFailureIsAFailure = PR_FALSE; break; | ||
53 | case 'f' : certFetching = PR_TRUE; break; | ||
54 | Index: nss-3.21/nss/lib/dbm/src/h_page.c | ||
55 | =================================================================== | ||
56 | --- nss-3.21.orig/nss/lib/dbm/src/h_page.c | ||
57 | +++ nss-3.21/nss/lib/dbm/src/h_page.c | ||
58 | @@ -112,26 +112,25 @@ long new_lseek(int fd, long offset, int | ||
59 | long end_pos=0; | ||
60 | long seek_pos=0; | ||
61 | |||
62 | - if(origin == SEEK_CUR) | ||
63 | - { | ||
64 | - if(offset < 1) | ||
65 | - return(lseek(fd, offset, SEEK_CUR)); | ||
66 | + if (origin == SEEK_CUR) { | ||
67 | + if (offset < 1) | ||
68 | + return(lseek(fd, offset, SEEK_CUR)); | ||
69 | |||
70 | cur_pos = lseek(fd, 0, SEEK_CUR); | ||
71 | |||
72 | - if(cur_pos < 0) | ||
73 | + if (cur_pos < 0) | ||
74 | return(cur_pos); | ||
75 | - } | ||
76 | - | ||
77 | + } | ||
78 | + | ||
79 | end_pos = lseek(fd, 0, SEEK_END); | ||
80 | - if(end_pos < 0) | ||
81 | + if (end_pos < 0) | ||
82 | return(end_pos); | ||
83 | |||
84 | - if(origin == SEEK_SET) | ||
85 | + if (origin == SEEK_SET) | ||
86 | seek_pos = offset; | ||
87 | - else if(origin == SEEK_CUR) | ||
88 | + else if (origin == SEEK_CUR) | ||
89 | seek_pos = cur_pos + offset; | ||
90 | - else if(origin == SEEK_END) | ||
91 | + else if (origin == SEEK_END) | ||
92 | seek_pos = end_pos + offset; | ||
93 | else | ||
94 | { | ||
95 | @@ -143,7 +142,7 @@ long new_lseek(int fd, long offset, int | ||
96 | * end of the file. We don't need | ||
97 | * to do anything special except the seek. | ||
98 | */ | ||
99 | - if(seek_pos <= end_pos) | ||
100 | + if (seek_pos <= end_pos) | ||
101 | return(lseek(fd, seek_pos, SEEK_SET)); | ||
102 | |||
103 | /* the seek position is beyond the end of the | ||
104 | @@ -161,7 +160,7 @@ long new_lseek(int fd, long offset, int | ||
105 | memset(buffer, 0, 1024); | ||
106 | while(len > 0) | ||
107 | { | ||
108 | - if(write(fd, buffer, (size_t)(1024 > len ? len : 1024)) < 0) | ||
109 | + if (write(fd, buffer, (size_t)(1024 > len ? len : 1024)) < 0) | ||
110 | return(-1); | ||
111 | len -= 1024; | ||
112 | } | ||
113 | @@ -245,10 +244,10 @@ __delpair(HTAB *hashp, BUFHEAD *bufp, in | ||
114 | * Once we know dst_offset is < BSIZE, we can subtract it from BSIZE | ||
115 | * to get an upper bound on length. | ||
116 | */ | ||
117 | - if(dst_offset > (uint32)hashp->BSIZE) | ||
118 | + if (dst_offset > (uint32)hashp->BSIZE) | ||
119 | return(DATABASE_CORRUPTED_ERROR); | ||
120 | |||
121 | - if(length > (uint32)(hashp->BSIZE - dst_offset)) | ||
122 | + if (length > (uint32)(hashp->BSIZE - dst_offset)) | ||
123 | return(DATABASE_CORRUPTED_ERROR); | ||
124 | |||
125 | memmove(dst, src, length); | ||
126 | @@ -324,7 +323,7 @@ __split_page(HTAB *hashp, uint32 obucket | ||
127 | * off. If it is then the database has | ||
128 | * been corrupted. | ||
129 | */ | ||
130 | - if(ino[n] > off) | ||
131 | + if (ino[n] > off) | ||
132 | return(DATABASE_CORRUPTED_ERROR); | ||
133 | |||
134 | key.size = off - ino[n]; | ||
135 | @@ -355,7 +354,7 @@ __split_page(HTAB *hashp, uint32 obucket | ||
136 | * wrong. LJM | ||
137 | */ | ||
138 | tmp_uint16_array = (uint16*)np; | ||
139 | - if(!PAIRFITS(tmp_uint16_array, &key, &val)) | ||
140 | + if (!PAIRFITS(tmp_uint16_array, &key, &val)) | ||
141 | return(DATABASE_CORRUPTED_ERROR); | ||
142 | |||
143 | putpair(np, &key, &val); | ||
144 | @@ -440,7 +439,7 @@ ugly_split(HTAB *hashp, uint32 obucket, | ||
145 | */ | ||
146 | loop_detection++; | ||
147 | |||
148 | - if(loop_detection > MAX_UGLY_SPLIT_LOOPS) | ||
149 | + if (loop_detection > MAX_UGLY_SPLIT_LOOPS) | ||
150 | return DATABASE_CORRUPTED_ERROR; | ||
151 | |||
152 | if (ino[2] < REAL_KEY && ino[2] != OVFLPAGE) { | ||
153 | @@ -736,7 +735,7 @@ __get_page(HTAB *hashp, | ||
154 | * the maximum number of entries | ||
155 | * in the array | ||
156 | */ | ||
157 | - if((unsigned)max > (size / sizeof(uint16))) | ||
158 | + if ((unsigned)max > (size / sizeof(uint16))) | ||
159 | return(DATABASE_CORRUPTED_ERROR); | ||
160 | |||
161 | /* do the byte order swap | ||
162 | @@ -749,7 +748,7 @@ __get_page(HTAB *hashp, | ||
163 | /* check the validity of the page here | ||
164 | * (after doing byte order swaping if necessary) | ||
165 | */ | ||
166 | - if(!is_bitmap && bp[0] != 0) | ||
167 | + if (!is_bitmap && bp[0] != 0) | ||
168 | { | ||
169 | uint16 num_keys = bp[0]; | ||
170 | uint16 offset; | ||
171 | @@ -760,11 +759,11 @@ __get_page(HTAB *hashp, | ||
172 | * bp[0] is too large (larger than the whole | ||
173 | * page) then the page is corrupted | ||
174 | */ | ||
175 | - if(bp[0] > (size / sizeof(uint16))) | ||
176 | + if (bp[0] > (size / sizeof(uint16))) | ||
177 | return(DATABASE_CORRUPTED_ERROR); | ||
178 | |||
179 | /* bound free space */ | ||
180 | - if(FREESPACE(bp) > size) | ||
181 | + if (FREESPACE(bp) > size) | ||
182 | return(DATABASE_CORRUPTED_ERROR); | ||
183 | |||
184 | /* check each key and data offset to make | ||
185 | @@ -776,10 +775,10 @@ __get_page(HTAB *hashp, | ||
186 | for(i=1 ; i <= num_keys; i+=2) | ||
187 | { | ||
188 | /* ignore overflow pages etc. */ | ||
189 | - if(bp[i+1] >= REAL_KEY) | ||
190 | + if (bp[i+1] >= REAL_KEY) | ||
191 | { | ||
192 | |||
193 | - if(bp[i] > offset || bp[i+1] > bp[i]) | ||
194 | + if (bp[i] > offset || bp[i+1] > bp[i]) | ||
195 | return(DATABASE_CORRUPTED_ERROR); | ||
196 | |||
197 | offset = bp[i+1]; | ||
198 | @@ -832,7 +831,7 @@ __put_page(HTAB *hashp, char *p, uint32 | ||
199 | * the maximum number of entries | ||
200 | * in the array | ||
201 | */ | ||
202 | - if((unsigned)max > (size / sizeof(uint16))) | ||
203 | + if ((unsigned)max > (size / sizeof(uint16))) | ||
204 | return(DATABASE_CORRUPTED_ERROR); | ||
205 | |||
206 | for (i = 0; i <= max; i++) | ||
207 | @@ -1091,7 +1090,7 @@ __free_ovflpage(HTAB *hashp, BUFHEAD *ob | ||
208 | uint32 bit_address, free_page, free_bit; | ||
209 | uint16 ndx; | ||
210 | |||
211 | - if(!obufp || !obufp->addr) | ||
212 | + if (!obufp || !obufp->addr) | ||
213 | return; | ||
214 | |||
215 | addr = obufp->addr; | ||
216 | Index: nss-3.21/nss/lib/dbm/src/hash.c | ||
217 | =================================================================== | ||
218 | --- nss-3.21.orig/nss/lib/dbm/src/hash.c | ||
219 | +++ nss-3.21/nss/lib/dbm/src/hash.c | ||
220 | @@ -154,7 +154,7 @@ __hash_open(const char *file, int flags, | ||
221 | return NULL; | ||
222 | } | ||
223 | hashp->fp = NO_FILE; | ||
224 | - if(file) | ||
225 | + if (file) | ||
226 | hashp->filename = strdup(file); | ||
227 | |||
228 | /* | ||
229 | @@ -172,7 +172,7 @@ __hash_open(const char *file, int flags, | ||
230 | errno = 0; /* Just in case someone looks at errno */ | ||
231 | new_table = 1; | ||
232 | } | ||
233 | - else if(statbuf.st_mtime && statbuf.st_size == 0) | ||
234 | + else if (statbuf.st_mtime && statbuf.st_size == 0) | ||
235 | { | ||
236 | /* check for a zero length file and delete it | ||
237 | * if it exists | ||
238 | @@ -288,7 +288,7 @@ hash_close(DB *dbp) | ||
239 | return (DBM_ERROR); | ||
240 | |||
241 | hashp = (HTAB *)dbp->internal; | ||
242 | - if(!hashp) | ||
243 | + if (!hashp) | ||
244 | return (DBM_ERROR); | ||
245 | |||
246 | retval = hdestroy(hashp); | ||
247 | @@ -304,7 +304,7 @@ static int hash_fd(const DB *dbp) | ||
248 | return (DBM_ERROR); | ||
249 | |||
250 | hashp = (HTAB *)dbp->internal; | ||
251 | - if(!hashp) | ||
252 | + if (!hashp) | ||
253 | return (DBM_ERROR); | ||
254 | |||
255 | if (hashp->fp == -1) { | ||
256 | @@ -480,7 +480,7 @@ hdestroy(HTAB *hashp) | ||
257 | if (hashp->fp != -1) | ||
258 | (void)close(hashp->fp); | ||
259 | |||
260 | - if(hashp->filename) { | ||
261 | + if (hashp->filename) { | ||
262 | #if defined(_WIN32) || defined(_WINDOWS) || defined(XP_OS2) | ||
263 | if (hashp->is_temp) | ||
264 | (void)unlink(hashp->filename); | ||
265 | @@ -578,7 +578,7 @@ hash_sync(const DB *dbp, uint flags) | ||
266 | return (DBM_ERROR); | ||
267 | |||
268 | hashp = (HTAB *)dbp->internal; | ||
269 | - if(!hashp) | ||
270 | + if (!hashp) | ||
271 | return (DBM_ERROR); | ||
272 | |||
273 | if (!hashp->save_file) | ||
274 | @@ -670,7 +670,7 @@ hash_get( | ||
275 | |||
276 | rv = hash_access(hashp, HASH_GET, (DBT *)key, data); | ||
277 | |||
278 | - if(rv == DATABASE_CORRUPTED_ERROR) | ||
279 | + if (rv == DATABASE_CORRUPTED_ERROR) | ||
280 | { | ||
281 | #if defined(unix) && defined(DEBUG) | ||
282 | printf("\n\nDBM Database has been corrupted, tell Lou...\n\n"); | ||
283 | @@ -707,7 +707,7 @@ hash_put( | ||
284 | rv = hash_access(hashp, flag == R_NOOVERWRITE ? | ||
285 | HASH_PUTNEW : HASH_PUT, (DBT *)key, (DBT *)data); | ||
286 | |||
287 | - if(rv == DATABASE_CORRUPTED_ERROR) | ||
288 | + if (rv == DATABASE_CORRUPTED_ERROR) | ||
289 | { | ||
290 | #if defined(unix) && defined(DEBUG) | ||
291 | printf("\n\nDBM Database has been corrupted, tell Lou...\n\n"); | ||
292 | @@ -741,7 +741,7 @@ hash_delete( | ||
293 | } | ||
294 | rv = hash_access(hashp, HASH_DELETE, (DBT *)key, NULL); | ||
295 | |||
296 | - if(rv == DATABASE_CORRUPTED_ERROR) | ||
297 | + if (rv == DATABASE_CORRUPTED_ERROR) | ||
298 | { | ||
299 | #if defined(unix) && defined(DEBUG) | ||
300 | printf("\n\nDBM Database has been corrupted, tell Lou...\n\n"); | ||
301 | @@ -802,27 +802,27 @@ hash_access( | ||
302 | ndx += 2; | ||
303 | } else if (bp[1] == OVFLPAGE) { | ||
304 | |||
305 | - /* database corruption: overflow loop detection */ | ||
306 | - if(last_overflow_page_no == (int32)*bp) | ||
307 | + /* database corruption: overflow loop detection */ | ||
308 | + if (last_overflow_page_no == (int32)*bp) | ||
309 | return (DATABASE_CORRUPTED_ERROR); | ||
310 | |||
311 | - last_overflow_page_no = *bp; | ||
312 | + last_overflow_page_no = *bp; | ||
313 | |||
314 | - rbufp = __get_buf(hashp, *bp, rbufp, 0); | ||
315 | - if (!rbufp) { | ||
316 | - save_bufp->flags &= ~BUF_PIN; | ||
317 | - return (DBM_ERROR); | ||
318 | - } | ||
319 | + rbufp = __get_buf(hashp, *bp, rbufp, 0); | ||
320 | + if (!rbufp) { | ||
321 | + save_bufp->flags &= ~BUF_PIN; | ||
322 | + return (DBM_ERROR); | ||
323 | + } | ||
324 | |||
325 | - ovfl_loop_count++; | ||
326 | - if(ovfl_loop_count > MAX_OVERFLOW_HASH_ACCESS_LOOPS) | ||
327 | + ovfl_loop_count++; | ||
328 | + if (ovfl_loop_count > MAX_OVERFLOW_HASH_ACCESS_LOOPS) | ||
329 | return (DATABASE_CORRUPTED_ERROR); | ||
330 | |||
331 | - /* FOR LOOP INIT */ | ||
332 | - bp = (uint16 *)rbufp->page; | ||
333 | - n = *bp++; | ||
334 | - ndx = 1; | ||
335 | - off = hashp->BSIZE; | ||
336 | + /* FOR LOOP INIT */ | ||
337 | + bp = (uint16 *)rbufp->page; | ||
338 | + n = *bp++; | ||
339 | + ndx = 1; | ||
340 | + off = hashp->BSIZE; | ||
341 | } else if (bp[1] < REAL_KEY) { | ||
342 | if ((ndx = | ||
343 | __find_bigpair(hashp, rbufp, ndx, kp, (int)size)) > 0) | ||
diff --git a/meta/recipes-support/nss/nss_3.21.bb b/meta/recipes-support/nss/nss_3.21.bb index d2e24112de..05d81c27e1 100644 --- a/meta/recipes-support/nss/nss_3.21.bb +++ b/meta/recipes-support/nss/nss_3.21.bb | |||
@@ -21,6 +21,7 @@ SRC_URI = "\ | |||
21 | file://nss-fix-incorrect-shebang-of-perl.patch \ | 21 | file://nss-fix-incorrect-shebang-of-perl.patch \ |
22 | file://nss-fix-nsinstall-build.patch \ | 22 | file://nss-fix-nsinstall-build.patch \ |
23 | file://0001-Fix-build-failure-on-opensuse-13.1.patch \ | 23 | file://0001-Fix-build-failure-on-opensuse-13.1.patch \ |
24 | file://nss-gcc6-fix.patch \ | ||
24 | file://nss.pc.in \ | 25 | file://nss.pc.in \ |
25 | file://signlibs.sh \ | 26 | file://signlibs.sh \ |
26 | " | 27 | " |