Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 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 | Lifted from Fedora https://src.fedoraproject.org/rpms/syslinux/blob/master/f/0005-Workaround-multiple-definition-of-symbol-errors.patch |
| 7 | |
| 8 | Upstream-Status: Pending |
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 10 | |
| 11 | --- |
| 12 | com32/cmenu/Makefile | 2 +- |
| 13 | com32/elflink/ldlinux/Makefile | 2 +- |
| 14 | com32/gpllib/Makefile | 2 +- |
| 15 | com32/hdt/Makefile | 2 +- |
| 16 | core/Makefile | 2 +- |
| 17 | dos/Makefile | 2 +- |
| 18 | efi/Makefile | 2 +- |
| 19 | 7 files changed, 7 insertions(+), 7 deletions(-) |
| 20 | |
| 21 | --- a/com32/cmenu/Makefile |
| 22 | +++ b/com32/cmenu/Makefile |
| 23 | @@ -49,7 +49,7 @@ makeoutputdirs: |
| 24 | @mkdir -p $(OBJ)/libmenu |
| 25 | |
| 26 | libmenu/libmenu.elf: $(LIBMENU) |
| 27 | - $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) \ |
| 28 | + $(LD) -shared $(LDFLAGS) -z muldefs -soname $(patsubst %.elf,%.c32,$(@F)) \ |
| 29 | -o $@ $^ |
| 30 | |
| 31 | tidy dist: |
| 32 | --- a/com32/elflink/ldlinux/Makefile |
| 33 | +++ b/com32/elflink/ldlinux/Makefile |
| 34 | @@ -33,7 +33,7 @@ endif |
| 35 | all: $(BTARGET) ldlinux_lnx.a |
| 36 | |
| 37 | ldlinux.elf : $(OBJS) |
| 38 | - $(LD) $(LDFLAGS) -soname $(SONAME) -o $@ $^ $(LIBS) |
| 39 | + $(LD) $(LDFLAGS) -z muldefs -soname $(SONAME) -o $@ $^ $(LIBS) |
| 40 | |
| 41 | LNXCFLAGS += -D__export='__attribute__((visibility("default")))' |
| 42 | LNXLIBOBJS = get_key.lo |
| 43 | --- a/com32/gpllib/Makefile |
| 44 | +++ b/com32/gpllib/Makefile |
| 45 | @@ -24,7 +24,7 @@ makeoutputdirs: |
| 46 | $(addprefix $(OBJ),$(sort $(dir $(LIBOBJS)))),$(b)) |
| 47 | |
| 48 | libgpl.elf : $(LIBOBJS) |
| 49 | - $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^ |
| 50 | + $(LD) -shared $(LDFLAGS) -z muldefs -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^ |
| 51 | |
| 52 | tidy dist clean: |
| 53 | find . \( -name \*.o -o -name .\*.d -o -name \*.tmp \) -print0 | \ |
| 54 | --- a/com32/hdt/Makefile |
| 55 | +++ b/com32/hdt/Makefile |
| 56 | @@ -52,7 +52,7 @@ QEMU ?= qemu-kvm |
| 57 | all: $(MODULES) $(TESTFILES) |
| 58 | |
| 59 | hdt.elf : $(OBJS) $(LIBS) $(C_LIBS) |
| 60 | - $(LD) $(LDFLAGS) -o $@ $^ |
| 61 | + $(LD) $(LDFLAGS) -z muldefs -o $@ $^ |
| 62 | |
| 63 | memtest: |
| 64 | -[ ! -f $(FLOPPY_DIR)/$(MEMTEST) ] && $(WGET) $(MEMTEST_URL) -O $(FLOPPY_DIR)/$(MEMTEST) |
| 65 | --- a/core/Makefile |
| 66 | +++ b/core/Makefile |
| 67 | @@ -156,7 +156,7 @@ LDSCRIPT = $(SRC)/$(ARCH)/syslinux.ld |
| 68 | NASM_ELF = elf |
| 69 | |
| 70 | %.elf: %.o $(LIBDEP) $(LDSCRIPT) $(AUXLIBS) |
| 71 | - $(LD) $(LDFLAGS) -pie -Bsymbolic \ |
| 72 | + $(LD) $(LDFLAGS) -z muldefs -pie -Bsymbolic \ |
| 73 | -T $(LDSCRIPT) \ |
| 74 | --unresolved-symbols=report-all \ |
| 75 | -E --hash-style=gnu -M -o $@ $< \ |
| 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 | |
| 82 | -LDFLAGS = -T $(SRC)/dosexe.ld |
| 83 | +LDFLAGS = -T $(SRC)/dosexe.ld -z muldefs |
| 84 | OPTFLAGS = -g |
| 85 | INCLUDES = -include code16.h -nostdinc -iwithprefix include \ |
| 86 | -I$(SRC) -I$(SRC)/.. -I$(SRC)/../libfat \ |
| 87 | --- a/efi/Makefile |
| 88 | +++ b/efi/Makefile |
| 89 | @@ -71,7 +71,7 @@ $(OBJS): | $(OBJ)/$(ARCH) |
| 90 | BTARGET = syslinux.efi |
| 91 | |
| 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 | |
| 96 | # We need to rename the .hash section because the EFI firmware |
| 97 | # linker really doesn't like it. |