[packages/syslinux] - re; 2; add patches from debian
arekm
arekm at pld-linux.org
Tue Jan 28 15:26:39 CET 2020
commit 2a3ac018044f24eb37e32d5296b4fa9a37cdd4ff
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Tue Jan 28 15:26:29 2020 +0100
- re; 2; add patches from debian
0005-gnu-efi-version-compatibility.patch | 41 +++++
0016-strip-gnu-property.patch | 43 +++++
0017-single-load-segment.patch | 306 +++++++++++++++++++++++++++++++
0018-prevent-pow-optimization.patch | 36 ++++
syslinux.spec | 13 +-
5 files changed, 438 insertions(+), 1 deletion(-)
---
diff --git a/syslinux.spec b/syslinux.spec
index 9046d48..04b976f 100644
--- a/syslinux.spec
+++ b/syslinux.spec
@@ -16,14 +16,20 @@ Summary(pt_BR.UTF-8): Carregador de boot simples
Summary(zh_CN.UTF-8): Linux操作系统的启动管理器
Name: syslinux
Version: 6.04
-Release: 1
+Release: 2
License: GPL v2+
Group: Applications/System
# Source0: https://www.kernel.org/pub/linux/utils/boot/syslinux/%{name}-%{version}.tar.xz
Source0: https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/Testing/6.04/syslinux-6.04-pre1.tar.xz
# Source0-md5: f9c956fde0de29be297402ecbc8ff4d0
+# FC:
Patch0: 0002-ext4-64bit-feature.patch
Patch1: 0003-include-sysmacros-h.patch
+# Debian:
+Patch10: 0005-gnu-efi-version-compatibility.patch
+Patch11: 0016-strip-gnu-property.patch
+Patch12: 0017-single-load-segment.patch
+Patch13: 0018-prevent-pow-optimization.patch
URL: http://syslinux.zytor.com/
BuildRequires: gnu-efi >= 3.0u
BuildRequires: libuuid-devel
@@ -97,6 +103,11 @@ jeśli chcemy tworzyć lub kompilować własnych klientów syslinuksa.
%patch0 -p1
%patch1 -p1
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
+%patch13 -p1
+
%{__sed} -i 's/-march=i386//' sample/Makefile
%build
diff --git a/0005-gnu-efi-version-compatibility.patch b/0005-gnu-efi-version-compatibility.patch
new file mode 100644
index 0000000..fda0937
--- /dev/null
+++ b/0005-gnu-efi-version-compatibility.patch
@@ -0,0 +1,41 @@
+From: Lukas Schwaighofer <lukas at schwaighofer.name>
+Date: Mon, 6 May 2019 00:43:10 +0200
+Subject: Strip memtest and memcpy from libefi
+
+Repack libefi.a to not contain the memset and memcpy symbols to make sure the
+implementation from syslinux is used and no multiple symbol definitions are
+present.
+---
+ efi/Makefile | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/efi/Makefile b/efi/Makefile
+index f4501e7..adae73f 100644
+--- a/efi/Makefile
++++ b/efi/Makefile
+@@ -43,8 +43,10 @@ CORE_OBJS += $(addprefix $(OBJ)/../core/, \
+ fs/pxe/pxe.o fs/pxe/tftp.o fs/pxe/urlparse.o fs/pxe/dhcp_option.o \
+ fs/pxe/ftp.o fs/pxe/ftp_readdir.o fs/pxe/http.o fs/pxe/http_readdir.o)
+
++LIBEFI_STRIPPED = $(objdir)/libefi_stripped.a
++
+ LIB_OBJS = $(addprefix $(objdir)/com32/lib/,$(CORELIBOBJS)) \
+- $(LIBEFI)
++ $(LIBEFI_STRIPPED)
+
+ CSRC = $(sort $(wildcard $(SRC)/*.c))
+ OBJS = $(subst $(SRC)/,,$(filter-out %wrapper.o, $(patsubst %.c,%.o,$(CSRC))))
+@@ -73,6 +75,13 @@ BTARGET = syslinux.efi
+ syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS)
+ $(LD) $(LDFLAGS) --strip-debug -o $@ $^ -lgnuefi -lefi
+
++$(LIBEFI_STRIPPED): $(LIBEFI)
++ cp $(LIBEFI) $(LIBEFI_STRIPPED)
++ ar x $(LIBEFI_STRIPPED) init.o
++ strip -N memset -N memcpy init.o
++ ar r $(LIBEFI_STRIPPED) init.o
++ rm init.o
++
+ # We need to rename the .hash section because the EFI firmware
+ # linker really doesn't like it.
+ # $(OBJCOPY) --rename-section .gnu.hash=.sdata,load,data,alloc $^ $@
diff --git a/0016-strip-gnu-property.patch b/0016-strip-gnu-property.patch
new file mode 100644
index 0000000..69656f9
--- /dev/null
+++ b/0016-strip-gnu-property.patch
@@ -0,0 +1,43 @@
+From: Lukas Schwaighofer <lukas at schwaighofer.name>
+Date: Sat, 18 Aug 2018 12:48:21 +0200
+Subject: Strip the .note.gnu.property section for the mbr
+
+This section is added since binutils Debian version 2.31.1-2 and causes mbr.bin
+to grow in size beyond what can fit into the master boot record.
+
+Forwarded: https://www.syslinux.org/archives/2018-August/026168.html
+---
+ mbr/i386/mbr.ld | 6 +++++-
+ mbr/x86_64/mbr.ld | 6 +++++-
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/mbr/i386/mbr.ld b/mbr/i386/mbr.ld
+index d14ba80..6d48990 100644
+--- a/mbr/i386/mbr.ld
++++ b/mbr/i386/mbr.ld
+@@ -69,5 +69,9 @@ SECTIONS
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+- /DISCARD/ : { *(.note.GNU-stack) }
++ /DISCARD/ :
++ {
++ *(.note.GNU-stack)
++ *(.note.gnu.property)
++ }
+ }
+diff --git a/mbr/x86_64/mbr.ld b/mbr/x86_64/mbr.ld
+index ae27d49..5b46db6 100644
+--- a/mbr/x86_64/mbr.ld
++++ b/mbr/x86_64/mbr.ld
+@@ -68,5 +68,9 @@ SECTIONS
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+- /DISCARD/ : { *(.note.GNU-stack) }
++ /DISCARD/ :
++ {
++ *(.note.GNU-stack)
++ *(.note.gnu.property)
++ }
+ }
diff --git a/0017-single-load-segment.patch b/0017-single-load-segment.patch
new file mode 100644
index 0000000..7fd53b1
--- /dev/null
+++ b/0017-single-load-segment.patch
@@ -0,0 +1,306 @@
+From: Lukas Schwaighofer <lukas at schwaighofer.name>
+Date: Sat, 18 Aug 2018 16:56:35 +0200
+Subject: Force the linker to put all sections into a single PT_LOAD segment
+
+This is required when using binutils >= 2.31 which writes two PT_LOAD segments
+by default. This is not supported by the wrapper.c script used to convert the
+shared object into an elf binary.
+
+Forwarded: https://www.syslinux.org/archives/2018-August/026167.html
+---
+ efi/i386/syslinux.ld | 37 +++++++++++++++++++++----------------
+ efi/x86_64/syslinux.ld | 37 +++++++++++++++++++++----------------
+ 2 files changed, 42 insertions(+), 32 deletions(-)
+
+diff --git a/efi/i386/syslinux.ld b/efi/i386/syslinux.ld
+index bab3fc7..19c1647 100644
+--- a/efi/i386/syslinux.ld
++++ b/efi/i386/syslinux.ld
+@@ -19,6 +19,11 @@ OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
+ OUTPUT_ARCH(i386)
+ ENTRY(_start)
+
++PHDRS
++{
++ all PT_LOAD ;
++}
++
+ SECTIONS
+ {
+ . = 0;
+@@ -31,7 +36,7 @@ SECTIONS
+ *(.text)
+ *(.text.*)
+ __text_end = .;
+- }
++ } :all
+
+ . = ALIGN(16);
+
+@@ -40,7 +45,7 @@ SECTIONS
+ *(.rodata)
+ *(.rodata.*)
+ __rodata_end = .;
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -49,14 +54,14 @@ SECTIONS
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ __ctors_end = .;
+- }
++ } :all
+
+ .dtors : {
+ __dtors_start = .;
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ __dtors_end = .;
+- }
++ } :all
+
+ . = ALIGN(4096);
+ .rel : {
+@@ -64,7 +69,7 @@ SECTIONS
+ *(.rel.data)
+ *(.rel.data.*)
+ *(.rel.ctors)
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -72,14 +77,14 @@ SECTIONS
+ __gnu_hash_start = .;
+ *(.gnu.hash)
+ __gnu_hash_end = .;
+- }
++ } :all
+
+
+ .dynsym : {
+ __dynsym_start = .;
+ *(.dynsym)
+ __dynsym_end = .;
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -87,7 +92,7 @@ SECTIONS
+ __dynstr_start = .;
+ *(.dynstr)
+ __dynstr_end = .;
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -104,7 +109,7 @@ SECTIONS
+ KEEP (*(.got.plt))
+ KEEP (*(.got))
+ __got_end = .;
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -112,7 +117,7 @@ SECTIONS
+ __dynamic_start = .;
+ *(.dynamic)
+ __dynamic_end = .;
+- }
++ } :all
+
+ . = ALIGN(16);
+
+@@ -122,19 +127,19 @@ SECTIONS
+ *(.data.*)
+ *(.lowmem)
+ __data_end = .;
+- }
++ } :all
+
+ .reloc : {
+ *(.reloc)
+- }
++ } :all
+
+ .symtab : {
+ *(.symtab)
+- }
++ } :all
+
+ .strtab : {
+ *(.strtab)
+- }
++ } :all
+
+ .bss (NOLOAD) : {
+ /* the EFI loader doesn't seem to like a .bss section,
+@@ -148,7 +153,7 @@ SECTIONS
+ __bss_end = .;
+ *(.sbss)
+ *(.scommon)
+- }
++ } :all
+ __bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start);
+ __bss_dwords = (__bss_len + 3) >> 2;
+
+@@ -161,7 +166,7 @@ SECTIONS
+ *(.hugebss)
+ *(.hugebss.*)
+ __hugebss_end = .;
+- }
++ } :all
+
+ _end = .;
+
+diff --git a/efi/x86_64/syslinux.ld b/efi/x86_64/syslinux.ld
+index 450641c..a2c124f 100644
+--- a/efi/x86_64/syslinux.ld
++++ b/efi/x86_64/syslinux.ld
+@@ -19,6 +19,11 @@ OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
+ OUTPUT_ARCH(i386:x86-64)
+ ENTRY(_start)
+
++PHDRS
++{
++ all PT_LOAD ;
++}
++
+ SECTIONS
+ {
+ . = 0;
+@@ -31,7 +36,7 @@ SECTIONS
+ *(.text)
+ *(.text.*)
+ __text_end = .;
+- }
++ } :all
+
+ . = ALIGN(16);
+
+@@ -40,7 +45,7 @@ SECTIONS
+ *(.rodata)
+ *(.rodata.*)
+ __rodata_end = .;
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -49,14 +54,14 @@ SECTIONS
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ __ctors_end = .;
+- }
++ } :all
+
+ .dtors : {
+ __dtors_start = .;
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ __dtors_end = .;
+- }
++ } :all
+
+ . = ALIGN(4096);
+ .rel : {
+@@ -64,7 +69,7 @@ SECTIONS
+ *(.rel.data)
+ *(.rel.data.*)
+ *(.rel.ctors)
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -72,14 +77,14 @@ SECTIONS
+ __gnu_hash_start = .;
+ *(.gnu.hash)
+ __gnu_hash_end = .;
+- }
++ } :all
+
+
+ .dynsym : {
+ __dynsym_start = .;
+ *(.dynsym)
+ __dynsym_end = .;
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -87,7 +92,7 @@ SECTIONS
+ __dynstr_start = .;
+ *(.dynstr)
+ __dynstr_end = .;
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -104,7 +109,7 @@ SECTIONS
+ KEEP (*(.got.plt))
+ KEEP (*(.got))
+ __got_end = .;
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -112,7 +117,7 @@ SECTIONS
+ __dynamic_start = .;
+ *(.dynamic)
+ __dynamic_end = .;
+- }
++ } :all
+
+ . = ALIGN(16);
+
+@@ -122,19 +127,19 @@ SECTIONS
+ *(.data.*)
+ *(.lowmem)
+ __data_end = .;
+- }
++ } :all
+
+ .reloc : {
+ *(.reloc)
+- }
++ } :all
+
+ .symtab : {
+ *(.symtab)
+- }
++ } :all
+
+ .strtab : {
+ *(.strtab)
+- }
++ } :all
+
+ .bss (NOLOAD) : {
+ /* the EFI loader doesn't seem to like a .bss section,
+@@ -148,7 +153,7 @@ SECTIONS
+ __bss_end = .;
+ *(.sbss)
+ *(.scommon)
+- }
++ } :all
+ __bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start);
+ __bss_dwords = (__bss_len + 3) >> 2;
+
+@@ -161,7 +166,7 @@ SECTIONS
+ *(.hugebss)
+ *(.hugebss.*)
+ __hugebss_end = .;
+- }
++ } :all
+
+ _end = .;
+
diff --git a/0018-prevent-pow-optimization.patch b/0018-prevent-pow-optimization.patch
new file mode 100644
index 0000000..0c42c7b
--- /dev/null
+++ b/0018-prevent-pow-optimization.patch
@@ -0,0 +1,36 @@
+From: Lukas Schwaighofer <lukas at schwaighofer.name>
+Date: Tue, 26 Feb 2019 23:13:58 +0100
+Subject: Prevent optimizing the pow() function
+
+With the current GCC 8.2.0 from Debian, a section of code calling pow() in
+zzjson_parse.c is turned into a sequence calling exp(). Since no exp()
+implementation is available in syslinux those optimizations need to be
+disabled.
+---
+ com32/gpllib/zzjson/zzjson_parse.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/com32/gpllib/zzjson/zzjson_parse.c b/com32/gpllib/zzjson/zzjson_parse.c
+index ecb6f61..e66a9d8 100644
+--- a/com32/gpllib/zzjson/zzjson_parse.c
++++ b/com32/gpllib/zzjson/zzjson_parse.c
+@@ -138,6 +138,10 @@ static ZZJSON *parse_string2(ZZJSON_CONFIG *config) {
+ return zzjson;
+ }
+
++static double __attribute__((optimize("O0"))) pow_noopt(double x, double y) {
++ return pow(x, y);
++}
++
+ static ZZJSON *parse_number(ZZJSON_CONFIG *config) {
+ ZZJSON *zzjson;
+ unsigned long long ival = 0, expo = 0;
+@@ -213,7 +217,7 @@ skipexpo:
+ if (dbl) {
+ dval = sign * (long long) ival;
+ dval += sign * frac;
+- dval *= pow(10.0, (double) signexpo * expo);
++ dval *= pow_noopt(10.0, (double) signexpo * expo);
+ }
+
+ zzjson = config->calloc(1, sizeof(ZZJSON));
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/syslinux.git/commitdiff/2a3ac018044f24eb37e32d5296b4fa9a37cdd4ff
More information about the pld-cvs-commit
mailing list