diff options
| author | Alexander Kanavin <alex.kanavin@gmail.com> | 2021-11-17 16:35:23 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-21 11:05:02 +0000 |
| commit | f1cd79a9992706684c04d8889fdbb2a52fa5579a (patch) | |
| tree | 1d1db833be14306daf538bf9ce8caa3453494b38 | |
| parent | d93aa6305e5a9cbfb4f9ea0c8f30e0a06d01ab9c (diff) | |
| download | poky-f1cd79a9992706684c04d8889fdbb2a52fa5579a.tar.gz | |
busybox: drop 0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch
This was added 10 years ago, is almost certainly non-upstreamable
and it isn't clear what the issues it aims to fix are:
the AB revealed no problems when the patch is removed.
(From OE-Core rev: e4831586ee03f189f7cf90aa444f7dc71544d3ec)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-core/busybox/busybox/0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch | 114 | ||||
| -rw-r--r-- | meta/recipes-core/busybox/busybox_1.34.1.bb | 1 |
2 files changed, 0 insertions, 115 deletions
diff --git a/meta/recipes-core/busybox/busybox/0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch b/meta/recipes-core/busybox/busybox/0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch deleted file mode 100644 index 2bf2b91c7e..0000000000 --- a/meta/recipes-core/busybox/busybox/0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch +++ /dev/null | |||
| @@ -1,114 +0,0 @@ | |||
| 1 | From a9333eb6a7b8dbda735947cd5bc981ff9352a2c9 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Nathan Phillip Brink <ohnobinki@ohnopublishing.net> | ||
| 3 | Date: Thu, 10 Mar 2011 00:27:08 -0500 | ||
| 4 | Subject: [PATCH 1/2] Use $(CC) when linking instead of $(LD) and use $(CFLAGS) | ||
| 5 | and $(EXTRA_CFLAGS) when linking. | ||
| 6 | |||
| 7 | This fixes the issue where LDFLAGS escaped with -Wl are ignored during | ||
| 8 | compilation. It also simplifies using CFLAGS or EXTRA_CFLAGS (such as | ||
| 9 | -m32 on x86_64 or -flto) which apply to both compilation and linking | ||
| 10 | situations. | ||
| 11 | |||
| 12 | Signed-off-by: Nathan Phillip Brink <ohnobinki@ohnopublishing.net> | ||
| 13 | --- | ||
| 14 | Upstream-Status: Pending | ||
| 15 | |||
| 16 | Makefile | 7 ++++--- | ||
| 17 | scripts/Makefile.build | 8 ++++---- | ||
| 18 | scripts/Makefile.lib | 13 +++---------- | ||
| 19 | 3 files changed, 11 insertions(+), 17 deletions(-) | ||
| 20 | |||
| 21 | Index: busybox-1.23.2/Makefile | ||
| 22 | =================================================================== | ||
| 23 | --- busybox-1.23.2.orig/Makefile | ||
| 24 | +++ busybox-1.23.2/Makefile | ||
| 25 | @@ -309,7 +309,8 @@ CHECKFLAGS := -D__linux__ -Dlinux -D | ||
| 26 | MODFLAGS = -DMODULE | ||
| 27 | CFLAGS_MODULE = $(MODFLAGS) | ||
| 28 | AFLAGS_MODULE = $(MODFLAGS) | ||
| 29 | -LDFLAGS_MODULE = -r | ||
| 30 | +LDFLAGS_RELOCATABLE = -r -nostdlib | ||
| 31 | +LDFLAGS_MODULE = $(LDFLAGS_RELOCATABLE) | ||
| 32 | CFLAGS_KERNEL = | ||
| 33 | AFLAGS_KERNEL = | ||
| 34 | |||
| 35 | @@ -331,7 +332,7 @@ KERNELVERSION = $(VERSION).$(PATCHLEVEL) | ||
| 36 | export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION \ | ||
| 37 | ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \ | ||
| 38 | CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \ | ||
| 39 | - HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS | ||
| 40 | + HOSTCXX HOSTCXXFLAGS LDFLAGS_RELOCATABLE LDFLAGS_MODULE CHECK CHECKFLAGS | ||
| 41 | |||
| 42 | export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS | ||
| 43 | export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE | ||
| 44 | @@ -610,7 +611,7 @@ quiet_cmd_busybox__ ?= LINK $@ | ||
| 45 | cmd_busybox__ ?= $(srctree)/scripts/trylink \ | ||
| 46 | "$@" \ | ||
| 47 | "$(CC)" \ | ||
| 48 | - "$(CFLAGS) $(CFLAGS_busybox)" \ | ||
| 49 | + "$(CFLAGS) $(CFLAGS_busybox) $(EXTRA_CFLAGS)" \ | ||
| 50 | "$(LDFLAGS) $(EXTRA_LDFLAGS)" \ | ||
| 51 | "$(core-y)" \ | ||
| 52 | "$(libs-y)" \ | ||
| 53 | Index: busybox-1.23.2/scripts/Makefile.build | ||
| 54 | =================================================================== | ||
| 55 | --- busybox-1.23.2.orig/scripts/Makefile.build | ||
| 56 | +++ busybox-1.23.2/scripts/Makefile.build | ||
| 57 | @@ -174,7 +174,7 @@ cmd_modversions = \ | ||
| 58 | | $(GENKSYMS) -a $(ARCH) \ | ||
| 59 | > $(@D)/.tmp_$(@F:.o=.ver); \ | ||
| 60 | \ | ||
| 61 | - $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ | ||
| 62 | + $(CC) $(ld_flags_partial) $(LDFLAGS_RELOCATABLE) -o $@ $(@D)/.tmp_$(@F) \ | ||
| 63 | -T $(@D)/.tmp_$(@F:.o=.ver); \ | ||
| 64 | rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ | ||
| 65 | else \ | ||
| 66 | @@ -257,7 +257,7 @@ quiet_cmd_link_o_target = LD $@ | ||
| 67 | # If the list of objects to link is empty, just create an empty built-in.o | ||
| 68 | # -nostdlib is added to make "make LD=gcc ..." work (some people use that) | ||
| 69 | cmd_link_o_target = $(if $(strip $(obj-y)),\ | ||
| 70 | - $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\ | ||
| 71 | + $(CC) $(ld_flags_partial) $(LDFLAGS_RELOCATABLE) -o $@ $(filter $(obj-y), $^),\ | ||
| 72 | rm -f $@; $(AR) rcs $@) | ||
| 73 | |||
| 74 | $(builtin-target): $(obj-y) FORCE | ||
| 75 | @@ -292,10 +292,10 @@ $($(subst $(obj)/,,$(@:.o=-objs))) \ | ||
| 76 | $($(subst $(obj)/,,$(@:.o=-y)))), $^) | ||
| 77 | |||
| 78 | quiet_cmd_link_multi-y = LD $@ | ||
| 79 | -cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) | ||
| 80 | +cmd_link_multi-y = $(CC) $(ld_flags_partial) $(LDFLAGS_RELOCATABLE) -o $@ $(link_multi_deps) | ||
| 81 | |||
| 82 | quiet_cmd_link_multi-m = LD [M] $@ | ||
| 83 | -cmd_link_multi-m = $(LD) $(ld_flags) $(LDFLAGS_MODULE) -o $@ $(link_multi_deps) | ||
| 84 | +cmd_link_multi-m = $(CC) $(ld_flags) $(LDFLAGS_MODULE) -o $@ $(link_multi_deps) | ||
| 85 | |||
| 86 | # We would rather have a list of rules like | ||
| 87 | # foo.o: $(foo-objs) | ||
| 88 | Index: busybox-1.23.2/scripts/Makefile.lib | ||
| 89 | =================================================================== | ||
| 90 | --- busybox-1.23.2.orig/scripts/Makefile.lib | ||
| 91 | +++ busybox-1.23.2/scripts/Makefile.lib | ||
| 92 | @@ -121,7 +121,8 @@ cpp_flags = -Wp,-MD,$(depfile) $(NO | ||
| 93 | # yet ld_flags is fed to ld. | ||
| 94 | #ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS) | ||
| 95 | # Remove the -Wl, prefix from linker options normally passed through gcc | ||
| 96 | -ld_flags = $(filter-out -Wl$(comma)%,$(LDFLAGS) $(EXTRA_LDFLAGS)) | ||
| 97 | +ld_flags = $(filter-out -Wl$(comma)%,$(LDFLAGS) $(EXTRA_LDFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)) | ||
| 98 | +ld_flags_partial = $($(filter-out -shared%, $(filter-out -pie%,$(ld_flags)))) | ||
| 99 | |||
| 100 | |||
| 101 | # Finds the multi-part object the current object will be linked into | ||
| 102 | @@ -151,10 +152,8 @@ $(obj)/%:: $(src)/%_shipped | ||
| 103 | # Linking | ||
| 104 | # --------------------------------------------------------------------------- | ||
| 105 | |||
| 106 | -# TODO: LDFLAGS usually is supposed to contain gcc's flags, not ld's. | ||
| 107 | -# but here we feed them to ld! | ||
| 108 | -quiet_cmd_ld = LD $@ | ||
| 109 | -cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \ | ||
| 110 | +quiet_cmd_ld = CC $@ | ||
| 111 | +cmd_ld = $(CC) $(ld_flags) $(LDFLAGS_$(@F)) \ | ||
| 112 | $(filter-out FORCE,$^) -o $@ | ||
| 113 | |||
| 114 | # Objcopy | ||
diff --git a/meta/recipes-core/busybox/busybox_1.34.1.bb b/meta/recipes-core/busybox/busybox_1.34.1.bb index 6aed0f0476..3651c06126 100644 --- a/meta/recipes-core/busybox/busybox_1.34.1.bb +++ b/meta/recipes-core/busybox/busybox_1.34.1.bb | |||
| @@ -26,7 +26,6 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ | |||
| 26 | file://login-utilities.cfg \ | 26 | file://login-utilities.cfg \ |
| 27 | file://recognize_connmand.patch \ | 27 | file://recognize_connmand.patch \ |
| 28 | file://busybox-cross-menuconfig.patch \ | 28 | file://busybox-cross-menuconfig.patch \ |
| 29 | file://0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch \ | ||
| 30 | file://mount-via-label.cfg \ | 29 | file://mount-via-label.cfg \ |
| 31 | file://sha1sum.cfg \ | 30 | file://sha1sum.cfg \ |
| 32 | file://sha256sum.cfg \ | 31 | file://sha256sum.cfg \ |
