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