We already depend on zlib in binutils.in, but currently the version bundled with binutils is used unnecessarily. Signed-off-by: Roland Hieber <rhi@pengutronix.de> --- PATCH v3: new in v3 --- rules/binutils.make | 1 + 1 file changed, 1 insertion(+) diff --git a/rules/binutils.make b/rules/binutils.make index bec8436d62fb..20bb5d60f700 100644 --- a/rules/binutils.make +++ b/rules/binutils.make @@ -43,6 +43,7 @@ BINUTILS_CONF_TOOL := autoconf BINUTILS_CONF_OPT := \ $(CROSS_AUTOCONF_USR) \ --target=$(PTXCONF_GNU_TARGET) \ + --with-system-zlib \ --disable-werror BINUTILS_CFLAGS := \ -- 2.30.2
Only readelf and objdump are installed to the target, but they are statically linked to the bundled zlib, libbfd, libctf, libiberty, and libopcodes, which don't have the same licenses. Try a divide-and-conquer strategy here to keep the clarity. libiberty includes an "unknown" portion in libiberty/xatexit.c, which only carries the following lines: | /* | * Copyright (c) 1990 Regents of the University of California. | * All rights reserved. | * | * %sccs.include.redist.c% | */ Reported-by: Felicitas Jung <f.jung@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de> --- PATCH v3: - unravel the sub-libs into clearly arranged license statements - this is the last patch that remained open from the original PULL v1. PATCH v2: https://lore.ptxdist.org/ptxdist/20211205004208.2306245-13-rhi@pengutronix.de - use "custom-exception" instead of "unknown" - rebase to current master, review and adapt MD5 sums accordingly PULL v1: https://lore.ptxdist.org/ptxdist/20200527112204.ll7ij44ahllid6ip@pengutronix.de --- rules/binutils.make | 56 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/rules/binutils.make b/rules/binutils.make index 20bb5d60f700..aed4d9226b35 100644 --- a/rules/binutils.make +++ b/rules/binutils.make @@ -23,6 +23,62 @@ BINUTILS_URL := $(call ptx/mirror, GNU, binutils/$(BINUTILS).$(BINUTILS_SUFFIX) BINUTILS_SOURCE := $(SRCDIR)/$(BINUTILS).$(BINUTILS_SUFFIX) BINUTILS_DIR := $(BUILDDIR)/$(BINUTILS) +# License statements are in the same order as the source files below. +BINUTILS_BFD_LICENSE := GPL-3.0-or-later +BINUTILS_BFD_LICENSE_FILES := \ + file://bfd/bfd.c;startline=5;endline=15;md5=b7b581fedc11dc385067404eaeae9800 \ + file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 + +BINUTILS_LIBCTF_LICENSE := GPL-3.0-or-later AND LGPL-2.1-or-later +BINUTILS_LIBCTF_LICENSE_FILES := \ + file://libctf/ctf-util.c;startline=6;endline=14;md5=38a5e03a16917995968d6d736de395db \ + file://libctf/ctf-qsort_r.c;endline=13;md5=e149b8b69a7204f8ac2fe93ab123f31d \ + file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 + +BINUTILS_LIBIBERTY_LICENSE := \ + LGPL-2.0-or-later AND \ + LGPL-2.1-or-later AND \ + GPL-2.0-or-later AND \ + GPL-2.0-or-later WITH custom-exception AND \ + BSD-3-Clause AND \ + unknown +BINUTILS_LIBIBERTY_LICENSE_FILES := \ + file://libiberty/argv.c;startline=5;endline=14;md5=08db703b891f91d3a8fc9999542179af \ + file://libiberty/regex.c;startline=6;endline=17;md5=c72bdec9ed083f08c5b1bc8632a3e979 \ + file://libiberty/lrealpath.c;startline=4;endline=16;md5=0aa876bb807f8967dccce7a9817f258e \ + file://libiberty/stack-limit.c;startline=2;endline=24;md5=c60505f167a6feb04717588ba816be47 \ + file://libiberty/bsearch_r.c;startline=2;endline=28;md5=5667e8fce08f09ba2e25add9e9a6e473 \ + file://libiberty/xatexit.c;startline=2;endline=3;md5=41d62d5f9e9ca92a606810e6f166ff67 \ + file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674 \ + file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 + # note: no LGPL-2.1-or-later text is bundled with the tarball + +BINUTILS_LIBINTL_LICENSE := GPL-2.0-or-later +BINUTILS_LIBINTL_LICENSE_FILES := \ + file://intl/gettext.c;startline=2;endline=12;md5=8139932faceda74df576a94577fd3278 \ + file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 + +BINUTILS_OPCODES_LICENSE := GPL-3.0-or-later +BINUTILS_OPCODES_LICENSE_FILES := \ + file://opcodes/disassemble.c;startline=4;endline=14;md5=0bc0a7deb30bb3bb26b635969252f69b \ + file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 + +# note: currently only objdump and readelf (GPL-3.0-or-later) are installed +BINUTILS_LICENSE := \ + GPL-3.0-or-later AND \ + ($(BINUTILS_LIBCTF_LICENSE)) AND \ + ($(BINUTILS_LIBINTL_LICENSE)) AND \ + ($(BINUTILS_LIBIBERTY_LICENSE)) +# remove duplicates via $(sort) +BINUTILS_LICENSE_FILES := \ + file://binutils/readelf.c;startline=2;endline=17;md5=6648f535c93eb66f65b8f07e6682999f \ + file://binutils/objdump.c;startline=2;endline=14;md5=6e71d2f00adf38566c920ff03e9b05c8 \ + $(sort \ + $(BINUTILS_LIBCTF_LICENSE_FILES) \ + $(BINUTILS_LIBINTL_LICENSE_FILES) \ + $(BINUTILS_LIBIBERTY_LICENSE_FILES) \ + ) + # ---------------------------------------------------------------------------- # Prepare # ---------------------------------------------------------------------------- -- 2.30.2
On Mon, Dec 12, 2022 at 11:17:26PM +0100, Roland Hieber wrote: > Only readelf and objdump are installed to the target, but they are > statically linked to the bundled zlib, libbfd, libctf, libiberty, and > libopcodes, which don't have the same licenses. Try a divide-and-conquer > strategy here to keep the clarity. > > libiberty includes an "unknown" portion in libiberty/xatexit.c, which > only carries the following lines: > > | /* > | * Copyright (c) 1990 Regents of the University of California. > | * All rights reserved. > | * > | * %sccs.include.redist.c% > | */ > > Reported-by: Felicitas Jung <f.jung@pengutronix.de> > Signed-off-by: Roland Hieber <rhi@pengutronix.de> > --- > PATCH v3: > - unravel the sub-libs into clearly arranged license statements > - this is the last patch that remained open from the original PULL v1. > > PATCH v2: https://lore.ptxdist.org/ptxdist/20211205004208.2306245-13-rhi@pengutronix.de > - use "custom-exception" instead of "unknown" > - rebase to current master, review and adapt MD5 sums accordingly > > PULL v1: https://lore.ptxdist.org/ptxdist/20200527112204.ll7ij44ahllid6ip@pengutronix.de > --- > rules/binutils.make | 56 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 56 insertions(+) > > diff --git a/rules/binutils.make b/rules/binutils.make > index 20bb5d60f700..aed4d9226b35 100644 > --- a/rules/binutils.make > +++ b/rules/binutils.make > @@ -23,6 +23,62 @@ BINUTILS_URL := $(call ptx/mirror, GNU, binutils/$(BINUTILS).$(BINUTILS_SUFFIX) > BINUTILS_SOURCE := $(SRCDIR)/$(BINUTILS).$(BINUTILS_SUFFIX) > BINUTILS_DIR := $(BUILDDIR)/$(BINUTILS) Oh my. I just discovered that the binutils version depends on the toolchain version too, so this patch only works cleanly with OSELAS.Toolchain 2022.10.0 which brings us binutils 2.39 … So I guess we need to find a similar versioning strategy for the license variables, as with the kernel package. - Roland > > +# License statements are in the same order as the source files below. > +BINUTILS_BFD_LICENSE := GPL-3.0-or-later > +BINUTILS_BFD_LICENSE_FILES := \ > + file://bfd/bfd.c;startline=5;endline=15;md5=b7b581fedc11dc385067404eaeae9800 \ > + file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 > + > +BINUTILS_LIBCTF_LICENSE := GPL-3.0-or-later AND LGPL-2.1-or-later > +BINUTILS_LIBCTF_LICENSE_FILES := \ > + file://libctf/ctf-util.c;startline=6;endline=14;md5=38a5e03a16917995968d6d736de395db \ > + file://libctf/ctf-qsort_r.c;endline=13;md5=e149b8b69a7204f8ac2fe93ab123f31d \ > + file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 > + > +BINUTILS_LIBIBERTY_LICENSE := \ > + LGPL-2.0-or-later AND \ > + LGPL-2.1-or-later AND \ > + GPL-2.0-or-later AND \ > + GPL-2.0-or-later WITH custom-exception AND \ > + BSD-3-Clause AND \ > + unknown > +BINUTILS_LIBIBERTY_LICENSE_FILES := \ > + file://libiberty/argv.c;startline=5;endline=14;md5=08db703b891f91d3a8fc9999542179af \ > + file://libiberty/regex.c;startline=6;endline=17;md5=c72bdec9ed083f08c5b1bc8632a3e979 \ > + file://libiberty/lrealpath.c;startline=4;endline=16;md5=0aa876bb807f8967dccce7a9817f258e \ > + file://libiberty/stack-limit.c;startline=2;endline=24;md5=c60505f167a6feb04717588ba816be47 \ > + file://libiberty/bsearch_r.c;startline=2;endline=28;md5=5667e8fce08f09ba2e25add9e9a6e473 \ > + file://libiberty/xatexit.c;startline=2;endline=3;md5=41d62d5f9e9ca92a606810e6f166ff67 \ > + file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674 \ > + file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 > + # note: no LGPL-2.1-or-later text is bundled with the tarball > + > +BINUTILS_LIBINTL_LICENSE := GPL-2.0-or-later > +BINUTILS_LIBINTL_LICENSE_FILES := \ > + file://intl/gettext.c;startline=2;endline=12;md5=8139932faceda74df576a94577fd3278 \ > + file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 > + > +BINUTILS_OPCODES_LICENSE := GPL-3.0-or-later > +BINUTILS_OPCODES_LICENSE_FILES := \ > + file://opcodes/disassemble.c;startline=4;endline=14;md5=0bc0a7deb30bb3bb26b635969252f69b \ > + file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 > + > +# note: currently only objdump and readelf (GPL-3.0-or-later) are installed > +BINUTILS_LICENSE := \ > + GPL-3.0-or-later AND \ > + ($(BINUTILS_LIBCTF_LICENSE)) AND \ > + ($(BINUTILS_LIBINTL_LICENSE)) AND \ > + ($(BINUTILS_LIBIBERTY_LICENSE)) > +# remove duplicates via $(sort) > +BINUTILS_LICENSE_FILES := \ > + file://binutils/readelf.c;startline=2;endline=17;md5=6648f535c93eb66f65b8f07e6682999f \ > + file://binutils/objdump.c;startline=2;endline=14;md5=6e71d2f00adf38566c920ff03e9b05c8 \ > + $(sort \ > + $(BINUTILS_LIBCTF_LICENSE_FILES) \ > + $(BINUTILS_LIBINTL_LICENSE_FILES) \ > + $(BINUTILS_LIBIBERTY_LICENSE_FILES) \ > + ) > + > # ---------------------------------------------------------------------------- > # Prepare > # ---------------------------------------------------------------------------- > -- > 2.30.2 > > > -- Roland Hieber, Pengutronix e.K. | r.hieber@pengutronix.de | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
On Mon, Dec 12, 2022 at 11:26:55PM +0100, Roland Hieber wrote: > On Mon, Dec 12, 2022 at 11:17:26PM +0100, Roland Hieber wrote: > > Only readelf and objdump are installed to the target, but they are > > statically linked to the bundled zlib, libbfd, libctf, libiberty, and > > libopcodes, which don't have the same licenses. Try a divide-and-conquer > > strategy here to keep the clarity. > > > > libiberty includes an "unknown" portion in libiberty/xatexit.c, which > > only carries the following lines: > > > > | /* > > | * Copyright (c) 1990 Regents of the University of California. > > | * All rights reserved. > > | * > > | * %sccs.include.redist.c% > > | */ > > > > Reported-by: Felicitas Jung <f.jung@pengutronix.de> > > Signed-off-by: Roland Hieber <rhi@pengutronix.de> > > --- > > PATCH v3: > > - unravel the sub-libs into clearly arranged license statements > > - this is the last patch that remained open from the original PULL v1. > > > > PATCH v2: https://lore.ptxdist.org/ptxdist/20211205004208.2306245-13-rhi@pengutronix.de > > - use "custom-exception" instead of "unknown" > > - rebase to current master, review and adapt MD5 sums accordingly > > > > PULL v1: https://lore.ptxdist.org/ptxdist/20200527112204.ll7ij44ahllid6ip@pengutronix.de > > --- > > rules/binutils.make | 56 +++++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 56 insertions(+) > > > > diff --git a/rules/binutils.make b/rules/binutils.make > > index 20bb5d60f700..aed4d9226b35 100644 > > --- a/rules/binutils.make > > +++ b/rules/binutils.make > > @@ -23,6 +23,62 @@ BINUTILS_URL := $(call ptx/mirror, GNU, binutils/$(BINUTILS).$(BINUTILS_SUFFIX) > > BINUTILS_SOURCE := $(SRCDIR)/$(BINUTILS).$(BINUTILS_SUFFIX) > > BINUTILS_DIR := $(BUILDDIR)/$(BINUTILS) > > Oh my. I just discovered that the binutils version depends on the > toolchain version too, so this patch only works cleanly with > OSELAS.Toolchain 2022.10.0 which brings us binutils 2.39 … > > So I guess we need to find a similar versioning strategy for the license > variables, as with the kernel package. I think, something like what we do for glibc would make sense: Provide a file to include with the toolchain for the simple case. For toolchains that don't have it yet, I think a rules/binutils.license.make is needed in the BSP. Michael -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Thanks, applied as ebf89fd91ae7a27f52761f994b494fbdfeecb826.
Michael
[sent from post-receive hook]
On Tue, 03 Jan 2023 12:08:16 +0100, Roland Hieber <rhi@pengutronix.de> wrote:
> We already depend on zlib in binutils.in, but currently the version
> bundled with binutils is used unnecessarily.
>
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> Message-Id: <20221212221726.3643397-1-rhi@pengutronix.de>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
>
> diff --git a/rules/binutils.make b/rules/binutils.make
> index bec8436d62fb..20bb5d60f700 100644
> --- a/rules/binutils.make
> +++ b/rules/binutils.make
> @@ -43,6 +43,7 @@ BINUTILS_CONF_TOOL := autoconf
> BINUTILS_CONF_OPT := \
> $(CROSS_AUTOCONF_USR) \
> --target=$(PTXCONF_GNU_TARGET) \
> + --with-system-zlib \
> --disable-werror
>
> BINUTILS_CFLAGS := \