0016-Workaround-multiple-definition-of-symbol-errors.patch 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. From 16f293d67eace501c98494976030f4319778ebf5 Mon Sep 17 00:00:00 2001
  2. From: Merlin Mathesius <mmathesi@redhat.com>
  3. Date: Wed, 13 May 2020 08:02:27 -0500
  4. Subject: [PATCH] Workaround multiple definition of symbol errors
  5. [From https://src.fedoraproject.org/rpms/syslinux/raw/rawhide/f/0005-Workaround-multiple-definition-of-symbol-errors.patch
  6. plus adding '-z muldefs' for gpxe]
  7. Signed-off-by: Peter Seiderer <ps.report@gmx.net>
  8. ---
  9. com32/cmenu/Makefile | 2 +-
  10. com32/elflink/ldlinux/Makefile | 2 +-
  11. com32/gpllib/Makefile | 2 +-
  12. com32/hdt/Makefile | 2 +-
  13. core/Makefile | 2 +-
  14. dos/Makefile | 2 +-
  15. efi/Makefile | 2 +-
  16. gpxe/src/arch/i386/Makefile | 2 +-
  17. 8 files changed, 8 insertions(+), 8 deletions(-)
  18. diff --git a/com32/cmenu/Makefile b/com32/cmenu/Makefile
  19. index 6bb52316..66cdd649 100644
  20. --- a/com32/cmenu/Makefile
  21. +++ b/com32/cmenu/Makefile
  22. @@ -49,7 +49,7 @@ makeoutputdirs:
  23. @mkdir -p $(OBJ)/libmenu
  24. libmenu/libmenu.elf: $(LIBMENU)
  25. - $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) \
  26. + $(LD) -shared $(LDFLAGS) -z muldefs -soname $(patsubst %.elf,%.c32,$(@F)) \
  27. -o $@ $^
  28. tidy dist:
  29. diff --git a/com32/elflink/ldlinux/Makefile b/com32/elflink/ldlinux/Makefile
  30. index d948da43..67434a1f 100644
  31. --- a/com32/elflink/ldlinux/Makefile
  32. +++ b/com32/elflink/ldlinux/Makefile
  33. @@ -33,7 +33,7 @@ endif
  34. all: $(BTARGET) ldlinux_lnx.a
  35. ldlinux.elf : $(OBJS)
  36. - $(LD) $(LDFLAGS) -soname $(SONAME) -o $@ $^ $(LIBS)
  37. + $(LD) $(LDFLAGS) -z muldefs -soname $(SONAME) -o $@ $^ $(LIBS)
  38. LNXCFLAGS += -D__export='__attribute__((visibility("default")))'
  39. LNXLIBOBJS = get_key.lo
  40. diff --git a/com32/gpllib/Makefile b/com32/gpllib/Makefile
  41. index e3e30d76..17520a1e 100644
  42. --- a/com32/gpllib/Makefile
  43. +++ b/com32/gpllib/Makefile
  44. @@ -24,7 +24,7 @@ makeoutputdirs:
  45. $(addprefix $(OBJ),$(sort $(dir $(LIBOBJS)))),$(b))
  46. libgpl.elf : $(LIBOBJS)
  47. - $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^
  48. + $(LD) -shared $(LDFLAGS) -z muldefs -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^
  49. tidy dist clean:
  50. find . \( -name \*.o -o -name .\*.d -o -name \*.tmp \) -print0 | \
  51. diff --git a/com32/hdt/Makefile b/com32/hdt/Makefile
  52. index 80f2d0a0..8509cd96 100644
  53. --- a/com32/hdt/Makefile
  54. +++ b/com32/hdt/Makefile
  55. @@ -52,7 +52,7 @@ QEMU ?= qemu-kvm
  56. all: $(MODULES) $(TESTFILES)
  57. hdt.elf : $(OBJS) $(LIBS) $(C_LIBS)
  58. - $(LD) $(LDFLAGS) -o $@ $^
  59. + $(LD) $(LDFLAGS) -z muldefs -o $@ $^
  60. memtest:
  61. -[ ! -f $(FLOPPY_DIR)/$(MEMTEST) ] && $(WGET) $(MEMTEST_URL) -O $(FLOPPY_DIR)/$(MEMTEST)
  62. diff --git a/core/Makefile b/core/Makefile
  63. index ad0acb5a..3bee4dc9 100644
  64. --- a/core/Makefile
  65. +++ b/core/Makefile
  66. @@ -164,7 +164,7 @@ AUXLIBS = libisolinux.a libisolinux-debug.a libldlinux.a \
  67. LDSCRIPT = $(SRC)/$(ARCH)/syslinux.ld
  68. %.elf: %.o $(LIBDEP) $(LDSCRIPT) $(AUXLIBS)
  69. - $(LD) $(LDFLAGS) -Bsymbolic $(LD_PIE) -E --hash-style=gnu -T $(LDSCRIPT) -M -o $@ $< \
  70. + $(LD) $(LDFLAGS) -z muldefs -Bsymbolic $(LD_PIE) -E --hash-style=gnu -T $(LDSCRIPT) -M -o $@ $< \
  71. --start-group $(LIBS) $(subst $(*F).elf,lib$(*F).a,$@) --end-group \
  72. > $(@:.elf=.map)
  73. $(OBJDUMP) -h $@ > $(@:.elf=.sec)
  74. diff --git a/dos/Makefile b/dos/Makefile
  75. index b9c337d5..2af87346 100644
  76. --- a/dos/Makefile
  77. +++ b/dos/Makefile
  78. @@ -19,7 +19,7 @@ include $(MAKEDIR)/embedded.mk
  79. CFLAGS += -D__MSDOS__ -mregparm=3 -DREGPARM=3
  80. # CFLAGS += -DDEBUG
  81. -LDFLAGS = -T $(SRC)/dosexe.ld
  82. +LDFLAGS = -T $(SRC)/dosexe.ld -z muldefs
  83. OPTFLAGS = -g
  84. INCLUDES = -include code16.h -nostdinc -iwithprefix include \
  85. -I$(SRC) -I$(SRC)/.. -I$(SRC)/../libfat \
  86. diff --git a/efi/Makefile b/efi/Makefile
  87. index d24d16db..7c714ebf 100644
  88. --- a/efi/Makefile
  89. +++ b/efi/Makefile
  90. @@ -70,7 +70,7 @@ $(OBJS): subdirs
  91. BTARGET = syslinux.efi
  92. syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS)
  93. - $(LD) $(LDFLAGS) --strip-debug -o $@ $^ -lgnuefi -lefi
  94. + $(LD) $(LDFLAGS) -z muldefs --strip-debug -o $@ $^ -lgnuefi -lefi
  95. # We need to rename the .hash section because the EFI firmware
  96. # linker really doesn't like it.
  97. diff --git a/gpxe/src/arch/i386/Makefile b/gpxe/src/arch/i386/Makefile
  98. index dd8da802..be1d00ff 100644
  99. --- a/gpxe/src/arch/i386/Makefile
  100. +++ b/gpxe/src/arch/i386/Makefile
  101. @@ -55,7 +55,7 @@ ASFLAGS += --32
  102. ifeq ($(HOST_OS),FreeBSD)
  103. LDFLAGS += -m elf_i386_fbsd
  104. else
  105. -LDFLAGS += -m elf_i386
  106. +LDFLAGS += -z muldefs -m elf_i386
  107. endif
  108. # EFI requires -fshort-wchar, and nothing else currently uses wchar_t
  109. --
  110. 2.30.1