0005-Workaround-multiple-definition-of-symbol-errors.patch 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. From 951928f2cad5682c2844e6bd0f7201236c5d9b66 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. ---
  6. com32/cmenu/Makefile | 2 +-
  7. com32/elflink/ldlinux/Makefile | 2 +-
  8. com32/gpllib/Makefile | 2 +-
  9. com32/hdt/Makefile | 2 +-
  10. core/Makefile | 2 +-
  11. dos/Makefile | 2 +-
  12. efi/Makefile | 2 +-
  13. 7 files changed, 7 insertions(+), 7 deletions(-)
  14. diff --git a/com32/cmenu/Makefile b/com32/cmenu/Makefile
  15. index b81b68ed..2ae989c4 100644
  16. --- a/com32/cmenu/Makefile
  17. +++ b/com32/cmenu/Makefile
  18. @@ -49,7 +49,7 @@ makeoutputdirs:
  19. @mkdir -p $(OBJ)/libmenu
  20. libmenu/libmenu.elf: $(LIBMENU)
  21. - $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) \
  22. + $(LD) -shared $(LDFLAGS) -z muldefs -soname $(patsubst %.elf,%.c32,$(@F)) \
  23. -o $@ $^
  24. tidy dist:
  25. diff --git a/com32/elflink/ldlinux/Makefile b/com32/elflink/ldlinux/Makefile
  26. index 87c0d362..2be2a01a 100644
  27. --- a/com32/elflink/ldlinux/Makefile
  28. +++ b/com32/elflink/ldlinux/Makefile
  29. @@ -33,7 +33,7 @@ endif
  30. all: $(BTARGET) ldlinux_lnx.a
  31. ldlinux.elf : $(OBJS)
  32. - $(LD) $(LDFLAGS) -soname $(SONAME) -o $@ $^ $(LIBS)
  33. + $(LD) $(LDFLAGS) -z muldefs -soname $(SONAME) -o $@ $^ $(LIBS)
  34. LNXCFLAGS += -D__export='__attribute__((visibility("default")))'
  35. LNXLIBOBJS = get_key.lo
  36. diff --git a/com32/gpllib/Makefile b/com32/gpllib/Makefile
  37. index 1fec9145..2d764d0b 100644
  38. --- a/com32/gpllib/Makefile
  39. +++ b/com32/gpllib/Makefile
  40. @@ -24,7 +24,7 @@ makeoutputdirs:
  41. $(addprefix $(OBJ),$(sort $(dir $(LIBOBJS)))),$(b))
  42. libgpl.elf : $(LIBOBJS)
  43. - $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^
  44. + $(LD) -shared $(LDFLAGS) -z muldefs -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^
  45. tidy dist clean:
  46. find . \( -name \*.o -o -name .\*.d -o -name \*.tmp \) -print0 | \
  47. diff --git a/com32/hdt/Makefile b/com32/hdt/Makefile
  48. index 61736d05..1d947857 100644
  49. --- a/com32/hdt/Makefile
  50. +++ b/com32/hdt/Makefile
  51. @@ -52,7 +52,7 @@ QEMU ?= qemu-kvm
  52. all: $(MODULES) $(TESTFILES)
  53. hdt.elf : $(OBJS) $(LIBS) $(C_LIBS)
  54. - $(LD) $(LDFLAGS) -o $@ $^
  55. + $(LD) $(LDFLAGS) -z muldefs -o $@ $^
  56. memtest:
  57. -[ ! -f $(FLOPPY_DIR)/$(MEMTEST) ] && $(WGET) $(MEMTEST_URL) -O $(FLOPPY_DIR)/$(MEMTEST)
  58. diff --git a/core/Makefile b/core/Makefile
  59. index 46cb037c..f0cfcbe9 100644
  60. --- a/core/Makefile
  61. +++ b/core/Makefile
  62. @@ -156,7 +156,7 @@ LDSCRIPT = $(SRC)/$(ARCH)/syslinux.ld
  63. NASM_ELF = elf
  64. %.elf: %.o $(LIBDEP) $(LDSCRIPT) $(AUXLIBS)
  65. - $(LD) $(LDFLAGS) -pie -Bsymbolic \
  66. + $(LD) $(LDFLAGS) -z muldefs -pie -Bsymbolic \
  67. -T $(LDSCRIPT) \
  68. --unresolved-symbols=report-all \
  69. -E --hash-style=gnu -M -o $@ $< \
  70. diff --git a/dos/Makefile b/dos/Makefile
  71. index 4c930d19..5d1c72ca 100644
  72. --- a/dos/Makefile
  73. +++ b/dos/Makefile
  74. @@ -19,7 +19,7 @@ include $(MAKEDIR)/embedded.mk
  75. CFLAGS += -D__MSDOS__ -mregparm=3 -DREGPARM=3
  76. # CFLAGS += -DDEBUG
  77. -LDFLAGS = -T $(SRC)/dosexe.ld
  78. +LDFLAGS = -T $(SRC)/dosexe.ld -z muldefs
  79. OPTFLAGS = -g
  80. INCLUDES = -include code16.h -nostdinc -iwithprefix include \
  81. -I$(SRC) -I$(SRC)/.. -I$(SRC)/../libfat \
  82. diff --git a/efi/Makefile b/efi/Makefile
  83. index bbf23f24..3dd922d5 100644
  84. --- a/efi/Makefile
  85. +++ b/efi/Makefile
  86. @@ -69,7 +69,7 @@ $(OBJS): | $(OBJ)/$(ARCH)
  87. BTARGET = syslinux.efi
  88. syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS)
  89. - $(LD) $(LDFLAGS) --strip-debug -o $@ $^ -lgnuefi -lefi
  90. + $(LD) $(LDFLAGS) -z muldefs --strip-debug -o $@ $^ -lgnuefi -lefi
  91. # We need to rename the .hash section because the EFI firmware
  92. # linker really doesn't like it.
  93. --
  94. 2.25.1