Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-boot/syslinux/, sys-boot/syslinux/files/6.04_pre1/
Date: Tue, 31 May 2022 01:42:15
Message-Id: 1653961328.700a3d7c40c57f7ec7c207a907baced1aebddbf8.floppym@gentoo
1 commit: 700a3d7c40c57f7ec7c207a907baced1aebddbf8
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 31 01:37:35 2022 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Tue May 31 01:42:08 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=700a3d7c
7
8 sys-boot/syslinux: backport ebuild changes to 6.04-pre1
9
10 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
11
12 ...he-.note.gnu.property-section-for-the-mbr.patch | 47 ++++
13 ...inker-to-put-all-sections-into-a-single-P.patch | 311 +++++++++++++++++++++
14 .../0003-GCC-10-compatibility-patch.patch | 99 +++++++
15 ...4-Inherit-toolchain-vars-from-environment.patch | 72 +++++
16 sys-boot/syslinux/syslinux-6.04_pre1-r3.ebuild | 87 ++++++
17 5 files changed, 616 insertions(+)
18
19 diff --git a/sys-boot/syslinux/files/6.04_pre1/0001-Strip-the-.note.gnu.property-section-for-the-mbr.patch b/sys-boot/syslinux/files/6.04_pre1/0001-Strip-the-.note.gnu.property-section-for-the-mbr.patch
20 new file mode 100644
21 index 000000000000..5d823436bec8
22 --- /dev/null
23 +++ b/sys-boot/syslinux/files/6.04_pre1/0001-Strip-the-.note.gnu.property-section-for-the-mbr.patch
24 @@ -0,0 +1,47 @@
25 +From 60fef313164d1048cf11423656732953776e5e2f Mon Sep 17 00:00:00 2001
26 +From: Lukas Schwaighofer <lukas@××××××××××××.name>
27 +Date: Sat, 18 Aug 2018 12:48:21 +0200
28 +Subject: [PATCH 1/5] Strip the .note.gnu.property section for the mbr
29 +
30 +This section is added since binutils Debian version 2.31.1-2 and causes mbr.bin
31 +to grow in size beyond what can fit into the master boot record.
32 +
33 +Forwarded: https://www.syslinux.org/archives/2018-August/026168.html
34 +---
35 + mbr/i386/mbr.ld | 6 +++++-
36 + mbr/x86_64/mbr.ld | 6 +++++-
37 + 2 files changed, 10 insertions(+), 2 deletions(-)
38 +
39 +diff --git a/mbr/i386/mbr.ld b/mbr/i386/mbr.ld
40 +index d14ba802..6d489904 100644
41 +--- a/mbr/i386/mbr.ld
42 ++++ b/mbr/i386/mbr.ld
43 +@@ -69,5 +69,9 @@ SECTIONS
44 + .debug_funcnames 0 : { *(.debug_funcnames) }
45 + .debug_typenames 0 : { *(.debug_typenames) }
46 + .debug_varnames 0 : { *(.debug_varnames) }
47 +- /DISCARD/ : { *(.note.GNU-stack) }
48 ++ /DISCARD/ :
49 ++ {
50 ++ *(.note.GNU-stack)
51 ++ *(.note.gnu.property)
52 ++ }
53 + }
54 +diff --git a/mbr/x86_64/mbr.ld b/mbr/x86_64/mbr.ld
55 +index ae27d49a..5b46db66 100644
56 +--- a/mbr/x86_64/mbr.ld
57 ++++ b/mbr/x86_64/mbr.ld
58 +@@ -68,5 +68,9 @@ SECTIONS
59 + .debug_funcnames 0 : { *(.debug_funcnames) }
60 + .debug_typenames 0 : { *(.debug_typenames) }
61 + .debug_varnames 0 : { *(.debug_varnames) }
62 +- /DISCARD/ : { *(.note.GNU-stack) }
63 ++ /DISCARD/ :
64 ++ {
65 ++ *(.note.GNU-stack)
66 ++ *(.note.gnu.property)
67 ++ }
68 + }
69 +--
70 +2.35.1
71 +
72
73 diff --git a/sys-boot/syslinux/files/6.04_pre1/0002-Force-the-linker-to-put-all-sections-into-a-single-P.patch b/sys-boot/syslinux/files/6.04_pre1/0002-Force-the-linker-to-put-all-sections-into-a-single-P.patch
74 new file mode 100644
75 index 000000000000..33b6a36c63ea
76 --- /dev/null
77 +++ b/sys-boot/syslinux/files/6.04_pre1/0002-Force-the-linker-to-put-all-sections-into-a-single-P.patch
78 @@ -0,0 +1,311 @@
79 +From 0c646f067a6b766a5ce0434e5e4e7b839b511331 Mon Sep 17 00:00:00 2001
80 +From: Lukas Schwaighofer <lukas@××××××××××××.name>
81 +Date: Sat, 18 Aug 2018 16:56:35 +0200
82 +Subject: [PATCH 2/5] Force the linker to put all sections into a single
83 + PT_LOAD segment
84 +
85 +This is required when using binutils >= 2.31 which writes two PT_LOAD segments
86 +by default. This is not supported by the wrapper.c script used to convert the
87 +shared object into an elf binary.
88 +
89 +Forwarded: https://www.syslinux.org/archives/2018-August/026167.html
90 +---
91 + efi/i386/syslinux.ld | 37 +++++++++++++++++++++----------------
92 + efi/x86_64/syslinux.ld | 37 +++++++++++++++++++++----------------
93 + 2 files changed, 42 insertions(+), 32 deletions(-)
94 +
95 +diff --git a/efi/i386/syslinux.ld b/efi/i386/syslinux.ld
96 +index bab3fc74..19c16479 100644
97 +--- a/efi/i386/syslinux.ld
98 ++++ b/efi/i386/syslinux.ld
99 +@@ -19,6 +19,11 @@ OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
100 + OUTPUT_ARCH(i386)
101 + ENTRY(_start)
102 +
103 ++PHDRS
104 ++{
105 ++ all PT_LOAD ;
106 ++}
107 ++
108 + SECTIONS
109 + {
110 + . = 0;
111 +@@ -31,7 +36,7 @@ SECTIONS
112 + *(.text)
113 + *(.text.*)
114 + __text_end = .;
115 +- }
116 ++ } :all
117 +
118 + . = ALIGN(16);
119 +
120 +@@ -40,7 +45,7 @@ SECTIONS
121 + *(.rodata)
122 + *(.rodata.*)
123 + __rodata_end = .;
124 +- }
125 ++ } :all
126 +
127 + . = ALIGN(4);
128 +
129 +@@ -49,14 +54,14 @@ SECTIONS
130 + KEEP (*(SORT(.ctors.*)))
131 + KEEP (*(.ctors))
132 + __ctors_end = .;
133 +- }
134 ++ } :all
135 +
136 + .dtors : {
137 + __dtors_start = .;
138 + KEEP (*(SORT(.dtors.*)))
139 + KEEP (*(.dtors))
140 + __dtors_end = .;
141 +- }
142 ++ } :all
143 +
144 + . = ALIGN(4096);
145 + .rel : {
146 +@@ -64,7 +69,7 @@ SECTIONS
147 + *(.rel.data)
148 + *(.rel.data.*)
149 + *(.rel.ctors)
150 +- }
151 ++ } :all
152 +
153 + . = ALIGN(4);
154 +
155 +@@ -72,14 +77,14 @@ SECTIONS
156 + __gnu_hash_start = .;
157 + *(.gnu.hash)
158 + __gnu_hash_end = .;
159 +- }
160 ++ } :all
161 +
162 +
163 + .dynsym : {
164 + __dynsym_start = .;
165 + *(.dynsym)
166 + __dynsym_end = .;
167 +- }
168 ++ } :all
169 +
170 + . = ALIGN(4);
171 +
172 +@@ -87,7 +92,7 @@ SECTIONS
173 + __dynstr_start = .;
174 + *(.dynstr)
175 + __dynstr_end = .;
176 +- }
177 ++ } :all
178 +
179 + . = ALIGN(4);
180 +
181 +@@ -104,7 +109,7 @@ SECTIONS
182 + KEEP (*(.got.plt))
183 + KEEP (*(.got))
184 + __got_end = .;
185 +- }
186 ++ } :all
187 +
188 + . = ALIGN(4);
189 +
190 +@@ -112,7 +117,7 @@ SECTIONS
191 + __dynamic_start = .;
192 + *(.dynamic)
193 + __dynamic_end = .;
194 +- }
195 ++ } :all
196 +
197 + . = ALIGN(16);
198 +
199 +@@ -122,19 +127,19 @@ SECTIONS
200 + *(.data.*)
201 + *(.lowmem)
202 + __data_end = .;
203 +- }
204 ++ } :all
205 +
206 + .reloc : {
207 + *(.reloc)
208 +- }
209 ++ } :all
210 +
211 + .symtab : {
212 + *(.symtab)
213 +- }
214 ++ } :all
215 +
216 + .strtab : {
217 + *(.strtab)
218 +- }
219 ++ } :all
220 +
221 + .bss (NOLOAD) : {
222 + /* the EFI loader doesn't seem to like a .bss section,
223 +@@ -148,7 +153,7 @@ SECTIONS
224 + __bss_end = .;
225 + *(.sbss)
226 + *(.scommon)
227 +- }
228 ++ } :all
229 + __bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start);
230 + __bss_dwords = (__bss_len + 3) >> 2;
231 +
232 +@@ -161,7 +166,7 @@ SECTIONS
233 + *(.hugebss)
234 + *(.hugebss.*)
235 + __hugebss_end = .;
236 +- }
237 ++ } :all
238 +
239 + _end = .;
240 +
241 +diff --git a/efi/x86_64/syslinux.ld b/efi/x86_64/syslinux.ld
242 +index 450641c6..a2c124fd 100644
243 +--- a/efi/x86_64/syslinux.ld
244 ++++ b/efi/x86_64/syslinux.ld
245 +@@ -19,6 +19,11 @@ OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
246 + OUTPUT_ARCH(i386:x86-64)
247 + ENTRY(_start)
248 +
249 ++PHDRS
250 ++{
251 ++ all PT_LOAD ;
252 ++}
253 ++
254 + SECTIONS
255 + {
256 + . = 0;
257 +@@ -31,7 +36,7 @@ SECTIONS
258 + *(.text)
259 + *(.text.*)
260 + __text_end = .;
261 +- }
262 ++ } :all
263 +
264 + . = ALIGN(16);
265 +
266 +@@ -40,7 +45,7 @@ SECTIONS
267 + *(.rodata)
268 + *(.rodata.*)
269 + __rodata_end = .;
270 +- }
271 ++ } :all
272 +
273 + . = ALIGN(4);
274 +
275 +@@ -49,14 +54,14 @@ SECTIONS
276 + KEEP (*(SORT(.ctors.*)))
277 + KEEP (*(.ctors))
278 + __ctors_end = .;
279 +- }
280 ++ } :all
281 +
282 + .dtors : {
283 + __dtors_start = .;
284 + KEEP (*(SORT(.dtors.*)))
285 + KEEP (*(.dtors))
286 + __dtors_end = .;
287 +- }
288 ++ } :all
289 +
290 + . = ALIGN(4096);
291 + .rel : {
292 +@@ -64,7 +69,7 @@ SECTIONS
293 + *(.rel.data)
294 + *(.rel.data.*)
295 + *(.rel.ctors)
296 +- }
297 ++ } :all
298 +
299 + . = ALIGN(4);
300 +
301 +@@ -72,14 +77,14 @@ SECTIONS
302 + __gnu_hash_start = .;
303 + *(.gnu.hash)
304 + __gnu_hash_end = .;
305 +- }
306 ++ } :all
307 +
308 +
309 + .dynsym : {
310 + __dynsym_start = .;
311 + *(.dynsym)
312 + __dynsym_end = .;
313 +- }
314 ++ } :all
315 +
316 + . = ALIGN(4);
317 +
318 +@@ -87,7 +92,7 @@ SECTIONS
319 + __dynstr_start = .;
320 + *(.dynstr)
321 + __dynstr_end = .;
322 +- }
323 ++ } :all
324 +
325 + . = ALIGN(4);
326 +
327 +@@ -104,7 +109,7 @@ SECTIONS
328 + KEEP (*(.got.plt))
329 + KEEP (*(.got))
330 + __got_end = .;
331 +- }
332 ++ } :all
333 +
334 + . = ALIGN(4);
335 +
336 +@@ -112,7 +117,7 @@ SECTIONS
337 + __dynamic_start = .;
338 + *(.dynamic)
339 + __dynamic_end = .;
340 +- }
341 ++ } :all
342 +
343 + . = ALIGN(16);
344 +
345 +@@ -122,19 +127,19 @@ SECTIONS
346 + *(.data.*)
347 + *(.lowmem)
348 + __data_end = .;
349 +- }
350 ++ } :all
351 +
352 + .reloc : {
353 + *(.reloc)
354 +- }
355 ++ } :all
356 +
357 + .symtab : {
358 + *(.symtab)
359 +- }
360 ++ } :all
361 +
362 + .strtab : {
363 + *(.strtab)
364 +- }
365 ++ } :all
366 +
367 + .bss (NOLOAD) : {
368 + /* the EFI loader doesn't seem to like a .bss section,
369 +@@ -148,7 +153,7 @@ SECTIONS
370 + __bss_end = .;
371 + *(.sbss)
372 + *(.scommon)
373 +- }
374 ++ } :all
375 + __bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start);
376 + __bss_dwords = (__bss_len + 3) >> 2;
377 +
378 +@@ -161,7 +166,7 @@ SECTIONS
379 + *(.hugebss)
380 + *(.hugebss.*)
381 + __hugebss_end = .;
382 +- }
383 ++ } :all
384 +
385 + _end = .;
386 +
387 +--
388 +2.35.1
389 +
390
391 diff --git a/sys-boot/syslinux/files/6.04_pre1/0003-GCC-10-compatibility-patch.patch b/sys-boot/syslinux/files/6.04_pre1/0003-GCC-10-compatibility-patch.patch
392 new file mode 100644
393 index 000000000000..6d60eab14bbb
394 --- /dev/null
395 +++ b/sys-boot/syslinux/files/6.04_pre1/0003-GCC-10-compatibility-patch.patch
396 @@ -0,0 +1,99 @@
397 +From b92e6e8f624c96acf2ce80192a893ee25de527a1 Mon Sep 17 00:00:00 2001
398 +From: Lukas Schwaighofer <lukas@××××××××××××.name>
399 +Date: Sun, 16 Aug 2020 15:23:21 +0200
400 +Subject: [PATCH 3/5] GCC-10 compatibility patch
401 +
402 +* Add `-fcommon` to most gcc invocations to allow duplicate definitions
403 +* __builtin_strlen is not really a "builtin" an implementation still
404 + needs to be provided (source:
405 + https://bugzilla.suse.com/show_bug.cgi?id=1166605#c5). Work around the
406 + issue by supplying an inline function. The strlen function added to
407 + dos/string.h was copied from com32/lib/strlen.c.
408 +---
409 + dos/string.h | 11 ++++++++++-
410 + mk/efi.mk | 1 +
411 + mk/elf.mk | 1 +
412 + mk/embedded.mk | 2 +-
413 + mk/lib.mk | 2 +-
414 + 5 files changed, 14 insertions(+), 3 deletions(-)
415 +
416 +diff --git a/dos/string.h b/dos/string.h
417 +index f648de2d..c4649f5f 100644
418 +--- a/dos/string.h
419 ++++ b/dos/string.h
420 +@@ -5,12 +5,21 @@
421 + #ifndef _STRING_H
422 + #define _STRING_H
423 +
424 ++#include <stddef.h>
425 ++
426 + /* Standard routines */
427 + #define memcpy(a,b,c) __builtin_memcpy(a,b,c)
428 + #define memmove(a,b,c) __builtin_memmove(a,b,c)
429 + #define memset(a,b,c) __builtin_memset(a,b,c)
430 + #define strcpy(a,b) __builtin_strcpy(a,b)
431 +-#define strlen(a) __builtin_strlen(a)
432 ++
433 ++static inline size_t strlen(const char *s)
434 ++{
435 ++ const char *ss = s;
436 ++ while (*ss)
437 ++ ss++;
438 ++ return ss - s;
439 ++}
440 +
441 + /* This only returns true or false */
442 + static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n)
443 +diff --git a/mk/efi.mk b/mk/efi.mk
444 +index f097ad22..407bc077 100644
445 +--- a/mk/efi.mk
446 ++++ b/mk/efi.mk
447 +@@ -25,6 +25,7 @@ FORMAT=efi-app-$(EFI_SUBARCH)
448 +
449 + CFLAGS = -I$(EFIINC) -I$(EFIINC)/$(EFI_SUBARCH) \
450 + -DEFI_FUNCTION_WRAPPER -fPIC -fshort-wchar -ffreestanding \
451 ++ -fcommon \
452 + -Wall -I$(com32)/include -I$(com32)/include/sys \
453 + -I$(core)/include -I$(core)/ $(ARCHOPT) \
454 + -I$(com32)/lib/ -I$(com32)/libutil/include -std=gnu99 \
455 +diff --git a/mk/elf.mk b/mk/elf.mk
456 +index b46dbd06..dc265ce9 100644
457 +--- a/mk/elf.mk
458 ++++ b/mk/elf.mk
459 +@@ -55,6 +55,7 @@ GPLINCLUDE =
460 + endif
461 +
462 + CFLAGS = $(GCCOPT) $(GCCWARN) -W -Wall \
463 ++ -fcommon \
464 + -fomit-frame-pointer -D__COM32__ -D__FIRMWARE_$(FIRMWARE)__ -DDYNAMIC_MODULE \
465 + -nostdinc -iwithprefix include \
466 + -I$(com32)/libutil/include -I$(com32)/include \
467 +diff --git a/mk/embedded.mk b/mk/embedded.mk
468 +index 488dc0fc..fae13e20 100644
469 +--- a/mk/embedded.mk
470 ++++ b/mk/embedded.mk
471 +@@ -57,7 +57,7 @@ LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc)
472 + LD += -m elf_$(ARCH)
473 +
474 + # Note: use += for CFLAGS and SFLAGS in case something is set in MCONFIG.local
475 +-CFLAGS += $(GCCOPT) -g $(GCCWARN) -Wno-sign-compare $(OPTFLAGS) $(INCLUDES)
476 ++CFLAGS += $(GCCOPT) -g $(GCCWARN) -Wno-sign-compare -fcommon $(OPTFLAGS) $(INCLUDES)
477 + SFLAGS += $(CFLAGS) -D__ASSEMBLY__
478 +
479 + .SUFFIXES: .c .o .S .s .i .elf .com .bin .asm .lst .c32 .lss
480 +diff --git a/mk/lib.mk b/mk/lib.mk
481 +index f8591e56..6dd54295 100644
482 +--- a/mk/lib.mk
483 ++++ b/mk/lib.mk
484 +@@ -49,7 +49,7 @@ OPTFLAGS = -Os -march=$(MARCH) -falign-functions=0 -falign-jumps=0 \
485 + -falign-labels=0 -ffast-math -fomit-frame-pointer
486 + WARNFLAGS = $(GCCWARN) -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline
487 +
488 +-CFLAGS = $(OPTFLAGS) $(REQFLAGS) $(WARNFLAGS) $(LIBFLAGS)
489 ++CFLAGS = $(OPTFLAGS) $(REQFLAGS) -fcommon $(WARNFLAGS) $(LIBFLAGS)
490 +
491 + ifeq ($(FWCLASS),EFI)
492 + CFLAGS += -mno-red-zone
493 +--
494 +2.35.1
495 +
496
497 diff --git a/sys-boot/syslinux/files/6.04_pre1/0004-Inherit-toolchain-vars-from-environment.patch b/sys-boot/syslinux/files/6.04_pre1/0004-Inherit-toolchain-vars-from-environment.patch
498 new file mode 100644
499 index 000000000000..40784f9b2698
500 --- /dev/null
501 +++ b/sys-boot/syslinux/files/6.04_pre1/0004-Inherit-toolchain-vars-from-environment.patch
502 @@ -0,0 +1,72 @@
503 +From 46d58e2b03e15a863aed8661b9ee922da4930a3e Mon Sep 17 00:00:00 2001
504 +From: Mike Gilbert <floppym@g.o>
505 +Date: Mon, 30 May 2022 11:57:07 -0400
506 +Subject: [PATCH 4/5] Inherit toolchain vars from environment
507 +
508 +---
509 + mk/syslinux.mk | 36 ++++++++++++++++++------------------
510 + 1 file changed, 18 insertions(+), 18 deletions(-)
511 +
512 +diff --git a/mk/syslinux.mk b/mk/syslinux.mk
513 +index 593ff75f..91d984e8 100644
514 +--- a/mk/syslinux.mk
515 ++++ b/mk/syslinux.mk
516 +@@ -37,7 +37,7 @@ ifdef DEBUG
517 + DEBUGOPT = -DDEBUG=$(DEBUG)
518 + endif
519 +
520 +-NASM = nasm
521 ++NASM ?= nasm
522 + NASMOPT = -Ox $(DEBUGOPT)
523 +
524 + PERL = perl
525 +@@ -46,29 +46,29 @@ UPX = upx
526 +
527 + CHMOD = chmod
528 +
529 +-CC = gcc
530 ++CC ?= gcc
531 + gcc_ok = $(shell tmpf=gcc_ok.$$$$.tmp; \
532 + if $(CC) $(GCCOPT) $(1) -c $(topdir)/dummy.c \
533 + -o $$tmpf 2>/dev/null ; \
534 + then echo '$(1)'; else echo '$(2)'; fi; \
535 + rm -f $$tmpf)
536 +
537 +-LD = ld
538 +-OBJDUMP = objdump
539 +-OBJCOPY = objcopy
540 +-STRIP = strip
541 +-AR = ar
542 +-NM = nm
543 +-RANLIB = ranlib
544 +-STRIP = strip
545 +-GZIPPROG = gzip
546 +-XZ = xz
547 +-PNGTOPNM = pngtopnm
548 +-MCOPY = mcopy
549 +-MFORMAT = mformat
550 +-MKISOFS = mkisofs
551 +-SED = sed
552 +-WGET = wget
553 ++LD ?= ld
554 ++OBJDUMP ?= objdump
555 ++OBJCOPY ?= objcopy
556 ++STRIP ?= strip
557 ++AR ?= ar
558 ++NM ?= nm
559 ++RANLIB ?= ranlib
560 ++STRIP ?= strip
561 ++GZIPPROG ?= gzip
562 ++XZ ?= xz
563 ++PNGTOPNM ?= pngtopnm
564 ++MCOPY ?= mcopy
565 ++MFORMAT ?= mformat
566 ++MKISOFS ?= mkisofs
567 ++SED ?= sed
568 ++WGET ?= wget
569 +
570 + com32 = $(topdir)/com32
571 +
572 +--
573 +2.35.1
574 +
575
576 diff --git a/sys-boot/syslinux/syslinux-6.04_pre1-r3.ebuild b/sys-boot/syslinux/syslinux-6.04_pre1-r3.ebuild
577 new file mode 100644
578 index 000000000000..4fba6cac1462
579 --- /dev/null
580 +++ b/sys-boot/syslinux/syslinux-6.04_pre1-r3.ebuild
581 @@ -0,0 +1,87 @@
582 +# Copyright 1999-2022 Gentoo Authors
583 +# Distributed under the terms of the GNU General Public License v2
584 +
585 +EAPI=8
586 +
587 +inherit toolchain-funcs
588 +
589 +DESCRIPTION="SYSLINUX, PXELINUX, ISOLINUX, EXTLINUX and MEMDISK bootloaders"
590 +HOMEPAGE="https://www.syslinux.org/"
591 +MY_P=${P/_/-}
592 +SRC_URI="https://www.kernel.org/pub/linux/utils/boot/syslinux/Testing/6.04/${MY_P}.tar.xz"
593 +
594 +LICENSE="GPL-2"
595 +SLOT="0"
596 +KEYWORDS="-* ~amd64 ~x86"
597 +IUSE="abi_x86_32 abi_x86_64 +bios +efi"
598 +REQUIRED_USE="|| ( bios efi )
599 + efi? ( || ( abi_x86_32 abi_x86_64 ) )"
600 +
601 +BDEPEND="
602 + dev-lang/perl
603 + bios? (
604 + app-arch/upx
605 + app-text/asciidoc
606 + dev-lang/nasm
607 + )
608 +"
609 +RDEPEND="
610 + sys-apps/util-linux
611 + sys-fs/mtools
612 + dev-perl/Crypt-PasswdMD5
613 + dev-perl/Digest-SHA1
614 +"
615 +DEPEND="${RDEPEND}
616 + virtual/os-headers
617 +"
618 +
619 +S=${WORKDIR}/${MY_P}
620 +
621 +QA_EXECSTACK="usr/share/syslinux/*"
622 +QA_WX_LOAD="usr/share/syslinux/*"
623 +QA_PRESTRIPPED="usr/share/syslinux/.*"
624 +QA_FLAGS_IGNORED=".*"
625 +
626 +src_prepare() {
627 + local PATCHES=(
628 + "${FILESDIR}/syslinux-6.03-sysmacros.patch"
629 + "${FILESDIR}/${PV}"
630 + )
631 + default
632 +}
633 +src_compile() {
634 + local DATE=$(date -u -r NEWS +%Y%m%d)
635 + local HEXDATE=$(printf '0x%08x' "${DATE}")
636 +
637 + tc-export AR CC LD OBJCOPY RANLIB
638 + unset LDFLAGS
639 +
640 + if use bios; then
641 + emake bios DATE="${DATE}" HEXDATE="${HEXDATE}"
642 + fi
643 + if use efi; then
644 + if use abi_x86_32; then
645 + emake efi32 DATE="${DATE}" HEXDATE="${HEXDATE}"
646 + fi
647 + if use abi_x86_64; then
648 + emake efi64 DATE="${DATE}" HEXDATE="${HEXDATE}"
649 + fi
650 + fi
651 +}
652 +
653 +src_install() {
654 + local firmware=( $(usev bios) )
655 + if use efi; then
656 + use abi_x86_32 && firmware+=( efi32 )
657 + use abi_x86_64 && firmware+=( efi64 )
658 + fi
659 + local args=(
660 + INSTALLROOT="${ED}"
661 + MANDIR='$(DATADIR)/man'
662 + "${firmware[@]}"
663 + install
664 + )
665 + emake -j1 "${args[@]}"
666 + einstalldocs
667 + dostrip -x /usr/share/syslinux
668 +}