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 <[email protected]>
> Signed-off-by: Roland Hieber <[email protected]>
> ---
> 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/[email protected]
>  - use "custom-exception" instead of "unknown"
>  - rebase to current master, review and adapt MD5 sums accordingly
> 
> PULL v1: 
> https://lore.ptxdist.org/ptxdist/[email protected]
> ---
>  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.          | [email protected]     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

Reply via email to