All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 01/21 RFC] package/libecore: do not build anything at patch time
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
@ 2015-11-16 22:46 ` Yann E. MORIN
  2015-11-17 11:16   ` Thomas Petazzoni
  2015-11-17 16:03   ` Peter Korsgaard
  2015-11-16 22:46 ` [Buildroot] [PATCH 02/21 RFC] core/legal-info: fix missing double-$ Yann E. MORIN
                   ` (19 subsequent siblings)
  20 siblings, 2 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:46 UTC (permalink / raw)
  To: buildroot

Trying to build anything at patch time will result in a broken
legal-info, as the needed host dependencies are not yet built.

Make that hook a pre-configure hook rather than a post-extract
hook.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Cc: Romain Naour <romain.naour@openwide.fr>
---
 package/efl/libecore/libecore.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/efl/libecore/libecore.mk b/package/efl/libecore/libecore.mk
index b5016dc..28a8bae 100644
--- a/package/efl/libecore/libecore.mk
+++ b/package/efl/libecore/libecore.mk
@@ -97,7 +97,7 @@ define LIBECORE_BUILD_MAKEKEYS_FOR_HOST
 	$(HOST_CONFIGURE_OPTS) $(MAKE1) -C $(@D)/src/util makekeys.o makekeys
 endef
 
-LIBECORE_POST_EXTRACT_HOOKS += LIBECORE_BUILD_MAKEKEYS_FOR_HOST
+LIBECORE_PRE_CONFIGURE_HOOKS += LIBECORE_BUILD_MAKEKEYS_FOR_HOST
 else
 LIBECORE_CONF_OPTS += --disable-ecore-x-xcb
 endif
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 02/21 RFC] core/legal-info: fix missing double-$
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
  2015-11-16 22:46 ` [Buildroot] [PATCH 01/21 RFC] package/libecore: do not build anything at patch time Yann E. MORIN
@ 2015-11-16 22:46 ` Yann E. MORIN
  2015-11-17 11:19   ` Thomas Petazzoni
  2015-11-17 16:03   ` Peter Korsgaard
  2015-11-16 22:46 ` [Buildroot] [PATCH 03/21 RFC] package/linux-headers: add licensing information Yann E. MORIN
                   ` (18 subsequent siblings)
  20 siblings, 2 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:46 UTC (permalink / raw)
  To: buildroot

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
---
 package/pkg-generic.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index a5d0e57..08f4f31 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -795,7 +795,7 @@ else
 
 ifeq ($$($(2)_REDISTRIBUTE),YES)
 ifneq ($$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_SOURCE))
-	$(call DOWNLOAD,$$($(2)_ACTUAL_SOURCE_SITE)/$$($(2)_ACTUAL_SOURCE_TARBALL))
+	$$(call DOWNLOAD,$$($(2)_ACTUAL_SOURCE_SITE)/$$($(2)_ACTUAL_SOURCE_TARBALL))
 endif
 # Copy the source tarball (just hardlink if possible)
 	@cp -l $$(DL_DIR)/$$($(2)_ACTUAL_SOURCE_TARBALL) $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4))) 2>/dev/null || \
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 03/21 RFC] package/linux-headers: add licensing information
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
  2015-11-16 22:46 ` [Buildroot] [PATCH 01/21 RFC] package/libecore: do not build anything at patch time Yann E. MORIN
  2015-11-16 22:46 ` [Buildroot] [PATCH 02/21 RFC] core/legal-info: fix missing double-$ Yann E. MORIN
@ 2015-11-16 22:46 ` Yann E. MORIN
  2015-11-17 11:19   ` Thomas Petazzoni
  2015-11-17 16:04   ` Peter Korsgaard
  2015-11-16 22:46 ` [Buildroot] [PATCH 04/21 RFC] core/legal-info: allow ignoring packages from the legal-info Yann E. MORIN
                   ` (17 subsequent siblings)
  20 siblings, 2 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:46 UTC (permalink / raw)
  To: buildroot

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
---
 package/linux-headers/linux-headers.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/linux-headers/linux-headers.mk b/package/linux-headers/linux-headers.mk
index ca68a5b..1b8b81b 100644
--- a/package/linux-headers/linux-headers.mk
+++ b/package/linux-headers/linux-headers.mk
@@ -16,6 +16,8 @@ else ifeq ($(findstring x4.,x$(LINUX_HEADERS_VERSION)),x4.)
 LINUX_HEADERS_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v4.x
 endif
 LINUX_HEADERS_SOURCE = linux-$(LINUX_HEADERS_VERSION).tar.xz
+LINUX_HEADERS_LICENSE = GPLv2
+LINUX_HEADERS_LICENSE_FILES = COPYING
 
 LINUX_HEADERS_INSTALL_STAGING = YES
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 04/21 RFC] core/legal-info: allow ignoring packages from the legal-info
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (2 preceding siblings ...)
  2015-11-16 22:46 ` [Buildroot] [PATCH 03/21 RFC] package/linux-headers: add licensing information Yann E. MORIN
@ 2015-11-16 22:46 ` Yann E. MORIN
  2015-11-17 11:22   ` Thomas Petazzoni
  2015-11-17 21:48   ` Arnout Vandecappelle
  2015-11-16 22:47 ` [Buildroot] [PATCH 05/21 RFC] core/pkg-virtual: ignore from legal-info output Yann E. MORIN
                   ` (16 subsequent siblings)
  20 siblings, 2 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:46 UTC (permalink / raw)
  To: buildroot

It might be necessary to not even mention a package in the output of
legal-info:

  - virtual package have virtually nothing to save in the legal-info
    output;

  - for Buildroot itself, host-gcc-initial and host-gcc-final are not
    real packages, they are just two different steps of the same
    package, gcc;

  - for proprietary packages, it might not even be legal to even mention
    them, being under NDA or some other such restrictive conditions.

Add the new 'IGNORE' keyword to the _REDISTRIBUTE package variable, so
that the legal-info infra will simply completely ignore that package.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
---
 docs/manual/adding-packages-generic.txt | 7 +++++--
 package/pkg-generic.mk                  | 8 +++++++-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt
index 1c25c4e..aec398b 100644
--- a/docs/manual/adding-packages-generic.txt
+++ b/docs/manual/adding-packages-generic.txt
@@ -390,7 +390,8 @@ information is (assuming the package name is +libfoo+) :
   See xref:legal-info[] for more information.
   This variable is optional. If it is not defined, a warning will be produced
   to let you know, and +not saved+ will appear in the +license files+ field
-  of the manifest file for this package.
+  of the manifest file for this package (unless +LIBFOO_REDISTRIBUTE+ is
+  set to +IGNORE+, see below...)
 
 * +LIBFOO_ACTUAL_SOURCE_TARBALL+ only applies to packages whose
   +LIBFOO_SITE+ / +LIBTOO_SOURCE+ pair points to an archive that does
@@ -414,7 +415,9 @@ information is (assuming the package name is +libfoo+) :
 * +LIBFOO_REDISTRIBUTE+ can be set to +YES+ (default) or +NO+ to indicate if
   the package source code is allowed to be redistributed. Set it to +NO+ for
   non-opensource packages: Buildroot will not save the source code for this
-  package when collecting the +legal-info+.
+  package when collecting the +legal-info+. Alternatively, you may set it to
+  +IGNORE+ so that Buildroot does not even mention that package in the
+  +legal-info+ output.
 
 * +LIBFOO_FLAT_STACKSIZE+ defines the stack size of an application built into
   the FLAT binary format. The application stack size on the NOMMU architecture
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 08f4f31..91c8fea 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -739,10 +739,12 @@ $(2)_MANIFEST_LICENSE_FILES ?= not saved
 
 # If the package declares _LICENSE_FILES, we need to extract it,
 # for overriden, local or normal remote packages alike, whether
-# we want to redistribute it or not.
+# we want to redistribute it or not, but not if we want to ignore it.
+ifneq ($$($(2)_REDISTRIBUTE),IGNORE)
 ifneq ($$($(2)_LICENSE_FILES),)
 $(1)-legal-info: $(1)-patch
 endif
+endif
 
 # We only save the sources of packages we want to redistribute, that are
 # non-local, and non-overriden. So only store, in the manifest, the tarball
@@ -766,6 +768,8 @@ $(2)_ACTUAL_SOURCE_SITE    ?= $$(call qstrip,$$($(2)_SITE))
 
 # legal-info: produce legally relevant info.
 $(1)-legal-info:
+ifneq ($$($(2)_REDISTRIBUTE),IGNORE)
+
 # Packages without a source are assumed to be part of Buildroot, skip them.
 	$$(foreach hook,$$($(2)_PRE_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep))
 ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
@@ -807,6 +811,8 @@ endif # other packages
 endif # ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
 	$$(foreach hook,$$($(2)_POST_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep))
 
+endif # REDISTRIBUTE == IGNORE
+
 # add package to the general list of targets if requested by the buildroot
 # configuration
 ifeq ($$($$($(2)_KCONFIG_VAR)),y)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 05/21 RFC] core/pkg-virtual: ignore from legal-info output
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (3 preceding siblings ...)
  2015-11-16 22:46 ` [Buildroot] [PATCH 04/21 RFC] core/legal-info: allow ignoring packages from the legal-info Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  2015-11-17 11:25   ` Thomas Petazzoni
  2015-11-16 22:47 ` [Buildroot] [PATCH 06/21 RFC] package/gcc: add licensing information Yann E. MORIN
                   ` (15 subsequent siblings)
  20 siblings, 1 reply; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

Virtual packages really have nothing to save for legal-info, so we just
ignore them.

Following patches will always extract-and-aptch non-ignored packages, so
we would potentially see spurious "extracting" and "patching" messages
on the console, which would be a bit strange. Ignoring virtual packages
will get us a cleaner log.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 package/pkg-virtual.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/pkg-virtual.mk b/package/pkg-virtual.mk
index 9c68b51..1471b95 100644
--- a/package/pkg-virtual.mk
+++ b/package/pkg-virtual.mk
@@ -57,6 +57,8 @@ endif
 # Add dependency against the provider
 $(2)_DEPENDENCIES += $$(call qstrip,$$(BR2_PACKAGE_PROVIDES_$(2)))
 
+$(2)_REDISTRIBUTE = IGNORE
+
 # Call the generic package infrastructure to generate the necessary
 # make targets
 $(call inner-generic-package,$(1),$(2),$(3),$(4))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 06/21 RFC] package/gcc: add licensing information
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (4 preceding siblings ...)
  2015-11-16 22:47 ` [Buildroot] [PATCH 05/21 RFC] core/pkg-virtual: ignore from legal-info output Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  2015-11-17 11:28   ` Thomas Petazzoni
  2015-11-16 22:47 ` [Buildroot] [PATCH 07/21 RFC] package/gcc: handle " Yann E. MORIN
                   ` (14 subsequent siblings)
  20 siblings, 1 reply; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

Currently, this is not used, since there is no host-gcc (or gcc)
package, and we only build host-gcc-initial and host-gcc-final.

So, this commit only really adds the licensing terms, installing
them in the legal-info output will be handled in a futur commit.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/gcc/gcc.mk | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index b9551e8..1c847e0 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -9,6 +9,15 @@
 #
 
 GCC_VERSION = $(call qstrip,$(BR2_GCC_VERSION))
+GCC_LICENSE = \
+	GPLv2+, GPLv3+, LGPLv2.1+ (w/ exception), LGPv3+ (w/ exception), \
+	BSD-3c, MIT, BSL-1.0
+GCC_LICENSE_FILES = \
+	COPYING COPYING3 COPYING.LIB COPYING3.LIB COPYING.RUNTIME \
+	libiberty/COPYING.LIB gcc/go/gofrontend/LICENSE \
+	gcc/COPYING gcc/COPYING.LIB gcc/COPYING3 gcc/COPYING3.LIB \
+	libquadmath/COPYING.LIB libsanitizer/LICENSE.TXT libffi/LICENSE \
+	include/COPYING include/COPYING3 zlib/contrib/dotzlib/LICENSE_1_0.txt
 
 ifeq ($(BR2_arc),y)
 GCC_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,gcc,$(GCC_VERSION))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 07/21 RFC] package/gcc: handle licensing information
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (5 preceding siblings ...)
  2015-11-16 22:47 ` [Buildroot] [PATCH 06/21 RFC] package/gcc: add licensing information Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  2015-11-17 11:31   ` Thomas Petazzoni
  2015-11-16 22:47 ` [Buildroot] [PATCH 08/21 RFC] package/gcc: add a patch for arc rather than using sed Yann E. MORIN
                   ` (13 subsequent siblings)
  20 siblings, 1 reply; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

We currently install no licensing information for gcc. But the way we
build gcc makes it tricky to add licensing information:

  - we do not build host-gcc; rather, we build host-gcc-initial and
    host-gcc-final,

  - we do not want to save licensing information for host-gcc-initial
    and host-gcc-final, because what really makes sense from a user's
    point of view is really host-gcc.

So, we make gcc a real host-generic-package for which we do not define
any configure, build or install command, but for which we do have
licensing information.

Then for both host-gcc-initial and host-gcc-final, we fake them to be
non-redistributable, because the licensing information for them is not
needed, nor is it needed to save their archives.

Finally, we make both host-gcc-initial and host-gc-final depend on
host-gcc, so that host-gcc is handled by the legal-info framework.

Thus, legal-info will now save the gcc source and licensing information,
and ignore host-gcc-initial and host-gcc-final.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/gcc/gcc-final/gcc-final.mk     | 6 ++++++
 package/gcc/gcc-initial/gcc-initial.mk | 6 ++++++
 package/gcc/gcc.mk                     | 5 +++++
 3 files changed, 17 insertions(+)

diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk
index 7802855..dcbf7bf 100644
--- a/package/gcc/gcc-final/gcc-final.mk
+++ b/package/gcc/gcc-final/gcc-final.mk
@@ -8,6 +8,12 @@ GCC_FINAL_VERSION = $(GCC_VERSION)
 GCC_FINAL_SITE = $(GCC_SITE)
 GCC_FINAL_SOURCE = $(GCC_SOURCE)
 
+# We only need to redistribute the gcc sources once, and that is handled by
+# the host-gcc package, not host-gcc-final. So, we fake a non-redistribuale
+# package, even though it *is* redistributable, but is already redistributed
+# thanks to host-gcc.
+GCC_FINAL_REDISTRIBUTE = IGNORE
+
 HOST_GCC_FINAL_DEPENDENCIES = \
 	$(HOST_GCC_COMMON_DEPENDENCIES) \
 	$(BR_LIBC)
diff --git a/package/gcc/gcc-initial/gcc-initial.mk b/package/gcc/gcc-initial/gcc-initial.mk
index 1e58d8b..19f8ced 100644
--- a/package/gcc/gcc-initial/gcc-initial.mk
+++ b/package/gcc/gcc-initial/gcc-initial.mk
@@ -8,6 +8,12 @@ GCC_INITIAL_VERSION = $(GCC_VERSION)
 GCC_INITIAL_SITE = $(GCC_SITE)
 GCC_INITIAL_SOURCE = $(GCC_SOURCE)
 
+# We only need to redistribute the gcc sources once, and that is handled by
+# the host-gcc package, not host-gcc-initial. So, we fake a non-redistribuale
+# package, even though it *is* redistributable, but is already redistributed
+# thanks to host-gcc.
+GCC_INITIAL_REDISTRIBUTE = IGNORE
+
 HOST_GCC_INITIAL_DEPENDENCIES = $(HOST_GCC_COMMON_DEPENDENCIES)
 
 HOST_GCC_INITIAL_EXCLUDES = $(HOST_GCC_EXCLUDES)
diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index 1c847e0..fe984a7 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -81,6 +81,7 @@ endef
 #
 
 HOST_GCC_COMMON_DEPENDENCIES = \
+	host-gcc \
 	host-binutils \
 	host-gmp \
 	host-mpfr \
@@ -310,4 +311,8 @@ define HOST_GCC_INSTALL_WRAPPER_AND_SIMPLE_SYMLINKS
 
 endef
 
+$(eval $(host-generic-package))
+
+# We can include other files, now that we've called the package
+# infrastructure, above.
 include $(sort $(wildcard package/gcc/*/*.mk))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 08/21 RFC] package/gcc: add a patch for arc rather than using sed
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (6 preceding siblings ...)
  2015-11-16 22:47 ` [Buildroot] [PATCH 07/21 RFC] package/gcc: handle " Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  2015-11-16 22:47 ` [Buildroot] [PATCH 09/21 RFC] package/gcc: properly extract and patch sources Yann E. MORIN
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

That way, we get the same sources for the -initial and -final passes,
which will ultimately allow us not to extract gcc for the two passes
and directly use the sources extracted for host-gcc.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 .../900-no-libgmon.a-when-inhibit_libc.patch       | 43 ++++++++++++++++++++++
 package/gcc/gcc-initial/gcc-initial.mk             | 13 -------
 2 files changed, 43 insertions(+), 13 deletions(-)
 create mode 100644 package/gcc/arc-2015.06/900-no-libgmon.a-when-inhibit_libc.patch

diff --git a/package/gcc/arc-2015.06/900-no-libgmon.a-when-inhibit_libc.patch b/package/gcc/arc-2015.06/900-no-libgmon.a-when-inhibit_libc.patch
new file mode 100644
index 0000000..e9fbf3f
--- /dev/null
+++ b/package/gcc/arc-2015.06/900-no-libgmon.a-when-inhibit_libc.patch
@@ -0,0 +1,43 @@
+libgcc: on ARC, do not build libgmon.a when inhibit_libc
+
+gcc on ARC has a bug: in its libgcc, even when no C library is available
+(--with-newlib is passed, and therefore inhibit_libc is defined), it
+tries to use the C library for the libgmon library.
+
+Only add it to the list of extra_parts if inhibit_libc is not true.
+
+inhibit_libc is not available to libgcc, so we use a dirty hack to get
+its value from the gcc/config.log. This is not really nice, but is not
+much worse than the sed invocation we previously had to tweak that file.
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+
+diff -durN host-gcc-arc-2015.06.orig/libgcc/config.host host-gcc-arc-2015.06/libgcc/config.host
+--- host-gcc-arc-2015.06.orig/libgcc/config.host	2015-11-15 23:01:57.588638300 +0100
++++ host-gcc-arc-2015.06/libgcc/config.host	2015-11-15 23:07:25.256450515 +0100
+@@ -75,6 +75,9 @@
+ md_unwind_header=no-unwind.h
+ unwind_header=unwind-generic.h
+ 
++# Hack to know whether we need to set inhibit_libc (to exclude libgmon.a)
++eval $(grep -E "^inhibit_libc='true'\$" ../../gcc/config.log 2>&1)
++
+ # Set default cpu_type so it can be updated in each machine entry.
+ cpu_type=`echo ${host} | sed 's/-.*$//'`
+ case ${host} in
+diff -durN host-gcc-arc-2015.06.orig/libgcc/config.host host-gcc-arc-2015.06/libgcc/config.host
+--- host-gcc-arc-2015.06.orig/libgcc/config.host	2015-06-26 12:34:27.000000000 +0200
++++ host-gcc-arc-2015.06/libgcc/config.host	2015-11-15 19:47:27.384690564 +0100
+@@ -327,7 +327,11 @@
+ 	;;
+ arc*-*-linux-uclibc*)
+ 	tmake_file="${tmake_file} t-slibgcc-libgcc t-slibgcc-nolc-override arc/t-arc700-uClibc arc/t-arc"
+-	extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o libgmon.a crtg.o crtgend.o"
++	extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o"
++	if [ ! "${inhibit_libc}" = "true" ]; then
++		extra_parts="${extra_parts} libgmon.a"
++	fi
++	extra_parts="${extra_parts} crtg.o crtgend.o"
+ 	;;
+ arm-wrs-vxworks)
+ 	tmake_file="$tmake_file arm/t-arm arm/t-vxworks t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
diff --git a/package/gcc/gcc-initial/gcc-initial.mk b/package/gcc/gcc-initial/gcc-initial.mk
index 19f8ced..e476c501 100644
--- a/package/gcc/gcc-initial/gcc-initial.mk
+++ b/package/gcc/gcc-initial/gcc-initial.mk
@@ -31,19 +31,6 @@ HOST_GCC_INITIAL_SUBDIR = build
 
 HOST_GCC_INITIAL_PRE_CONFIGURE_HOOKS += HOST_GCC_CONFIGURE_SYMLINK
 
-# gcc on ARC has a bug: in its libgcc, even when no C library is
-# available (--with-newlib is passed, and therefore inhibit_libc is
-# defined), it tries to use the C library for the libgmon
-# library. Since it's not needed in gcc-initial, we disabled it here.
-ifeq ($(BR2_GCC_VERSION_4_8_ARC),y)
-define HOST_GCC_INITIAL_DISABLE_LIBGMON
-	$(SED) 's/crtbeginS.o libgmon.a crtg.o/crtbeginS.o crtg.o/' \
-		$(@D)/libgcc/config.host
-endef
-HOST_GCC_INITIAL_POST_PATCH_HOOKS += HOST_GCC_INITIAL_DISABLE_LIBGMON
-HOST_GCC_INITIAL_POST_RSYNC_HOOKS += HOST_GCC_INITIAL_DISABLE_LIBGMON
-endif
-
 HOST_GCC_INITIAL_CONF_OPTS = \
 	$(HOST_GCC_COMMON_CONF_OPTS) \
 	--enable-languages=c \
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 09/21 RFC] package/gcc: properly extract and patch sources
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (7 preceding siblings ...)
  2015-11-16 22:47 ` [Buildroot] [PATCH 08/21 RFC] package/gcc: add a patch for arc rather than using sed Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  2015-11-16 22:47 ` [Buildroot] [PATCH 10/21 RFC] package/gcc: make host-gcc a pure host package Yann E. MORIN
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

Currently, we're extracting the gcc sources three times, which takes a
bit of place:
  - for host-gcc, just for the sake of legal-info,
  - for host-gcc-initial,
  - for host-gcc-final.

However, gcc does not support in-tree builds, and for host-gcc-initial
as well as for host-gcc-final, wiile we do not build anything for
host-gcc we build in a sub-directory, which leaves the three gcc source
trees intact.

Thus, we could re-use the sources from host-gcc for the two builds, but
they are so far not completely patched. Most notably, the special Xtensa
tarball is not extracted, and the powerpc patch is not applied when
needed.

Re-organise the way the host-gcc package is defined, so that the source
tree is properly prepared. We need to move blocks around, so that hooks
are registered in the correct order; as a reference, we use the ordering
as seen in host-gcc-initial and host-gcc-final (same order in both).

The "standard" patches are applied by the package infra, so we add a
post-patch hook to apply the powerpc patch.

The list of exclusions is defined earlier, as it looks more logical to
have all extract-related defintions come before the patch-related ones.

Ditto for the testsuite.

We for now keep the HOST_GCC_APPLY_PATCHES and HOST_GCC_CONFIGURE_SYMLINK
macros, as host-gcc-initial and host-gcc-final have not yet been
converted. Once that's been done, we can get rid of the macros.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/gcc/gcc.mk | 32 +++++++++++++++-----------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index fe984a7..fa5baa6 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -24,29 +24,37 @@ GCC_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,gcc,$(GCC_VERSION)
 GCC_SOURCE = gcc-$(GCC_VERSION).tar.gz
 else
 GCC_SITE = $(BR2_GNU_MIRROR:/=)/gcc/gcc-$(GCC_VERSION)
+GCC_SOURCE = gcc-$(GCC_VERSION).tar.bz2
 endif
 
-GCC_SOURCE ?= gcc-$(GCC_VERSION).tar.bz2
+HOST_GCC_EXCLUDES = \
+	libjava/* libgo/* \
+	gcc/testsuite/* libstdc++-v3/testsuite/*
+
+define HOST_GCC_FAKE_TESTSUITE
+	mkdir -p $(@D)/libstdc++-v3/testsuite/
+	echo "all:" > $(@D)/libstdc++-v3/testsuite/Makefile.in
+	echo "install:" >> $(@D)/libstdc++-v3/testsuite/Makefile.in
+endef
+HOST_GCC_POST_EXTRACT_HOOKS += HOST_GCC_FAKE_TESTSUITE
 
 #
 # Xtensa special hook
 #
-
+ifneq ($(call qstrip, $(BR2_XTENSA_CORE_NAME)),)
 HOST_GCC_XTENSA_OVERLAY_TAR = $(BR2_XTENSA_OVERLAY_DIR)/xtensa_$(call qstrip,$(BR2_XTENSA_CORE_NAME)).tar
-
 define HOST_GCC_XTENSA_OVERLAY_EXTRACT
 	tar xf $(HOST_GCC_XTENSA_OVERLAY_TAR) -C $(@D) --strip-components=1 gcc
 endef
-
-#
-# Apply patches
-#
+HOST_GCC_POST_EXTRACT_HOOKS += HOST_GCC_XTENSA_OVERLAY_EXTRACT
+endif # Xtensa
 
 ifeq ($(ARCH),powerpc)
 ifneq ($(BR2_SOFT_FLOAT),)
 define HOST_GCC_APPLY_POWERPC_PATCH
 	$(APPLY_PATCHES) $(@D) package/gcc/$(GCC_VERSION) 1000-powerpc-link-with-math-lib.patch.conditional
 endef
+HOST_GCC_POST_PATCH_HOOKS += HOST_GCC_APPLY_POWERPC_PATCH
 endif
 endif
 
@@ -57,16 +65,6 @@ define HOST_GCC_APPLY_PATCHES
 	$(HOST_GCC_APPLY_POWERPC_PATCH)
 endef
 
-HOST_GCC_EXCLUDES = \
-	libjava/* libgo/* \
-	gcc/testsuite/* libstdc++-v3/testsuite/*
-
-define HOST_GCC_FAKE_TESTSUITE
-	mkdir -p $(@D)/libstdc++-v3/testsuite/
-	echo "all:" > $(@D)/libstdc++-v3/testsuite/Makefile.in
-	echo "install:" >> $(@D)/libstdc++-v3/testsuite/Makefile.in
-endef
-
 #
 # Create 'build' directory and configure symlink
 #
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 10/21 RFC] package/gcc: make host-gcc a pure host package
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (8 preceding siblings ...)
  2015-11-16 22:47 ` [Buildroot] [PATCH 09/21 RFC] package/gcc: properly extract and patch sources Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  2015-11-16 22:47 ` [Buildroot] [PATCH 11/21 RFC] package/gcc: make -initial and -final use sources from host-gcc Yann E. MORIN
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

Currently, we define a mix of GCC_ and HOST_GCC_ variables, even though
we only have a host variant of the gcc package.

Prefix all variables with HOST_ since gcc is a pure host package.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/gcc/gcc-final/gcc-final.mk     |  6 ++--
 package/gcc/gcc-initial/gcc-initial.mk |  6 ++--
 package/gcc/gcc.mk                     | 64 +++++++++++++++++-----------------
 3 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk
index dcbf7bf..5479a4b 100644
--- a/package/gcc/gcc-final/gcc-final.mk
+++ b/package/gcc/gcc-final/gcc-final.mk
@@ -4,9 +4,9 @@
 #
 ################################################################################
 
-GCC_FINAL_VERSION = $(GCC_VERSION)
-GCC_FINAL_SITE = $(GCC_SITE)
-GCC_FINAL_SOURCE = $(GCC_SOURCE)
+GCC_FINAL_VERSION = $(HOST_GCC_VERSION)
+GCC_FINAL_SITE = $(HOST_GCC_SITE)
+GCC_FINAL_SOURCE = $(HOST_GCC_SOURCE)
 
 # We only need to redistribute the gcc sources once, and that is handled by
 # the host-gcc package, not host-gcc-final. So, we fake a non-redistribuale
diff --git a/package/gcc/gcc-initial/gcc-initial.mk b/package/gcc/gcc-initial/gcc-initial.mk
index e476c501..1c478a5 100644
--- a/package/gcc/gcc-initial/gcc-initial.mk
+++ b/package/gcc/gcc-initial/gcc-initial.mk
@@ -4,9 +4,9 @@
 #
 ################################################################################
 
-GCC_INITIAL_VERSION = $(GCC_VERSION)
-GCC_INITIAL_SITE = $(GCC_SITE)
-GCC_INITIAL_SOURCE = $(GCC_SOURCE)
+GCC_INITIAL_VERSION = $(HOST_GCC_VERSION)
+GCC_INITIAL_SITE = $(HOST_GCC_SITE)
+GCC_INITIAL_SOURCE = $(HOST_GCC_SOURCE)
 
 # We only need to redistribute the gcc sources once, and that is handled by
 # the host-gcc package, not host-gcc-initial. So, we fake a non-redistribuale
diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index fa5baa6..28346b2 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -8,11 +8,11 @@
 # Version, site and source
 #
 
-GCC_VERSION = $(call qstrip,$(BR2_GCC_VERSION))
-GCC_LICENSE = \
+HOST_GCC_VERSION = $(call qstrip,$(BR2_GCC_VERSION))
+HOST_GCC_LICENSE = \
 	GPLv2+, GPLv3+, LGPLv2.1+ (w/ exception), LGPv3+ (w/ exception), \
 	BSD-3c, MIT, BSL-1.0
-GCC_LICENSE_FILES = \
+HOST_GCC_LICENSE_FILES = \
 	COPYING COPYING3 COPYING.LIB COPYING3.LIB COPYING.RUNTIME \
 	libiberty/COPYING.LIB gcc/go/gofrontend/LICENSE \
 	gcc/COPYING gcc/COPYING.LIB gcc/COPYING3 gcc/COPYING3.LIB \
@@ -20,11 +20,11 @@ GCC_LICENSE_FILES = \
 	include/COPYING include/COPYING3 zlib/contrib/dotzlib/LICENSE_1_0.txt
 
 ifeq ($(BR2_arc),y)
-GCC_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,gcc,$(GCC_VERSION))
-GCC_SOURCE = gcc-$(GCC_VERSION).tar.gz
+HOST_GCC_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,gcc,$(HOST_GCC_VERSION))
+HOST_GCC_SOURCE = gcc-$(HOST_GCC_VERSION).tar.gz
 else
-GCC_SITE = $(BR2_GNU_MIRROR:/=)/gcc/gcc-$(GCC_VERSION)
-GCC_SOURCE = gcc-$(GCC_VERSION).tar.bz2
+HOST_GCC_SITE = $(BR2_GNU_MIRROR:/=)/gcc/gcc-$(HOST_GCC_VERSION)
+HOST_GCC_SOURCE = gcc-$(HOST_GCC_VERSION).tar.bz2
 endif
 
 HOST_GCC_EXCLUDES = \
@@ -52,15 +52,15 @@ endif # Xtensa
 ifeq ($(ARCH),powerpc)
 ifneq ($(BR2_SOFT_FLOAT),)
 define HOST_GCC_APPLY_POWERPC_PATCH
-	$(APPLY_PATCHES) $(@D) package/gcc/$(GCC_VERSION) 1000-powerpc-link-with-math-lib.patch.conditional
+	$(APPLY_PATCHES) $(@D) package/gcc/$(HOST_GCC_VERSION) 1000-powerpc-link-with-math-lib.patch.conditional
 endef
 HOST_GCC_POST_PATCH_HOOKS += HOST_GCC_APPLY_POWERPC_PATCH
 endif
 endif
 
 define HOST_GCC_APPLY_PATCHES
-	if test -d package/gcc/$(GCC_VERSION); then \
-	  $(APPLY_PATCHES) $(@D) package/gcc/$(GCC_VERSION) \*.patch ; \
+	if test -d package/gcc/$(HOST_GCC_VERSION); then \
+	  $(APPLY_PATCHES) $(@D) package/gcc/$(HOST_GCC_VERSION) \*.patch ; \
 	fi;
 	$(HOST_GCC_APPLY_POWERPC_PATCH)
 endef
@@ -102,28 +102,28 @@ HOST_GCC_COMMON_CONF_OPTS = \
 HOST_GCC_COMMON_CONF_ENV = \
 	MAKEINFO=missing
 
-GCC_COMMON_TARGET_CFLAGS = $(TARGET_CFLAGS)
-GCC_COMMON_TARGET_CXXFLAGS = $(TARGET_CXXFLAGS)
+HOST_GCC_COMMON_TARGET_CFLAGS = $(TARGET_CFLAGS)
+HOST_GCC_COMMON_TARGET_CXXFLAGS = $(TARGET_CXXFLAGS)
 
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810
 # Workaround until it's fixed in 4.5.4 or later
 ifeq ($(ARCH),powerpc)
-ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.)
-GCC_COMMON_TARGET_CFLAGS = $(filter-out -Os,$(GCC_COMMON_TARGET_CFLAGS))
-GCC_COMMON_TARGET_CXXFLAGS = $(filter-out -Os,$(GCC_COMMON_TARGET_CXXFLAGS))
+ifeq ($(findstring x4.5.,x$(HOST_GCC_VERSION)),x4.5.)
+HOST_GCC_COMMON_TARGET_CFLAGS = $(filter-out -Os,$(HOST_GCC_COMMON_TARGET_CFLAGS))
+HOST_GCC_COMMON_TARGET_CXXFLAGS = $(filter-out -Os,$(HOST_GCC_COMMON_TARGET_CXXFLAGS))
 endif
 endif
 
 # Xtensa libgcc can't be built with -mauto-litpools
 # because of the trick used to generate .init/.fini sections.
 ifeq ($(BR2_xtensa),y)
-GCC_COMMON_TARGET_CFLAGS = $(filter-out -mauto-litpools,$(TARGET_CFLAGS))
-GCC_COMMON_TARGET_CXXFLAGS = $(filter-out -mauto-litpools,$(TARGET_CXXFLAGS))
+HOST_GCC_COMMON_TARGET_CFLAGS = $(filter-out -mauto-litpools,$(TARGET_CFLAGS))
+HOST_GCC_COMMON_TARGET_CXXFLAGS = $(filter-out -mauto-litpools,$(TARGET_CXXFLAGS))
 endif
 
 # Propagate options used for target software building to GCC target libs
-HOST_GCC_COMMON_CONF_ENV += CFLAGS_FOR_TARGET="$(GCC_COMMON_TARGET_CFLAGS)"
-HOST_GCC_COMMON_CONF_ENV += CXXFLAGS_FOR_TARGET="$(GCC_COMMON_TARGET_CXXFLAGS)"
+HOST_GCC_COMMON_CONF_ENV += CFLAGS_FOR_TARGET="$(HOST_GCC_COMMON_TARGET_CFLAGS)"
+HOST_GCC_COMMON_CONF_ENV += CXXFLAGS_FOR_TARGET="$(HOST_GCC_COMMON_TARGET_CXXFLAGS)"
 
 # libitm needs sparc V9+
 ifeq ($(BR2_sparc_v8)$(BR2_sparc_leon3),y)
@@ -215,19 +215,19 @@ HOST_GCC_COMMON_CONF_OPTS += --with-cpu=$(call qstrip,$(BR2_GCC_TARGET_CPU))
 endif
 endif
 
-GCC_TARGET_FPU = $(call qstrip,$(BR2_GCC_TARGET_FPU))
-ifneq ($(GCC_TARGET_FPU),)
-HOST_GCC_COMMON_CONF_OPTS += --with-fpu=$(GCC_TARGET_FPU)
+HOST_GCC_TARGET_FPU = $(call qstrip,$(BR2_GCC_TARGET_FPU))
+ifneq ($(HOST_GCC_TARGET_FPU),)
+HOST_GCC_COMMON_CONF_OPTS += --with-fpu=$(HOST_GCC_TARGET_FPU)
 endif
 
-GCC_TARGET_FLOAT_ABI = $(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI))
-ifneq ($(GCC_TARGET_FLOAT_ABI),)
-HOST_GCC_COMMON_CONF_OPTS += --with-float=$(GCC_TARGET_FLOAT_ABI)
+HOST_GCC_TARGET_FLOAT_ABI = $(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI))
+ifneq ($(HOST_GCC_TARGET_FLOAT_ABI),)
+HOST_GCC_COMMON_CONF_OPTS += --with-float=$(HOST_GCC_TARGET_FLOAT_ABI)
 endif
 
-GCC_TARGET_MODE = $(call qstrip,$(BR2_GCC_TARGET_MODE))
-ifneq ($(GCC_TARGET_MODE),)
-HOST_GCC_COMMON_CONF_OPTS += --with-mode=$(GCC_TARGET_MODE)
+HOST_GCC_TARGET_MODE = $(call qstrip,$(BR2_GCC_TARGET_MODE))
+ifneq ($(HOST_GCC_TARGET_MODE),)
+HOST_GCC_COMMON_CONF_OPTS += --with-mode=$(HOST_GCC_TARGET_MODE)
 endif
 
 # Enable proper double/long double for SPE ABI
@@ -250,20 +250,20 @@ HOST_GCC_COMMON_MAKE_OPTS = \
 	gcc_cv_libc_provides_ssp=$(if $(BR2_TOOLCHAIN_HAS_SSP),yes,no)
 
 ifeq ($(BR2_CCACHE),y)
-HOST_GCC_COMMON_CCACHE_HASH_FILES += $(DL_DIR)/$(GCC_SOURCE)
+HOST_GCC_COMMON_CCACHE_HASH_FILES += $(DL_DIR)/$(HOST_GCC_SOURCE)
 # Cfr. PATCH_BASE_DIRS in .stamp_patched, but we catch both versioned and
 # unversioned patches unconditionally
 HOST_GCC_COMMON_CCACHE_HASH_FILES += \
 	$(sort $(wildcard \
-		package/gcc/$(GCC_VERSION)/*.patch \
-		$(addsuffix $((PKG)_RAWNAME)/$(GCC_VERSION)/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) \
+		package/gcc/$(HOST_GCC_VERSION)/*.patch \
+		$(addsuffix $((PKG)_RAWNAME)/$(HOST_GCC_VERSION)/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) \
 		$(addsuffix $((PKG)_RAWNAME)/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)))))
 ifeq ($(BR2_xtensa),y)
 HOST_GCC_COMMON_CCACHE_HASH_FILES += $(HOST_GCC_XTENSA_OVERLAY_TAR)
 endif
 ifeq ($(ARCH),powerpc)
 ifneq ($(BR2_SOFT_FLOAT),)
-HOST_GCC_COMMON_CCACHE_HASH_FILES += package/gcc/$(GCC_VERSION)/1000-powerpc-link-with-math-lib.patch.conditional
+HOST_GCC_COMMON_CCACHE_HASH_FILES += package/gcc/$(HOST_GCC_VERSION)/1000-powerpc-link-with-math-lib.patch.conditional
 endif
 endif
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 11/21 RFC] package/gcc: make -initial and -final use sources from host-gcc
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (9 preceding siblings ...)
  2015-11-16 22:47 ` [Buildroot] [PATCH 10/21 RFC] package/gcc: make host-gcc a pure host package Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  2015-11-16 22:47 ` [Buildroot] [PATCH 12/21 RFC] package/gcc: include the extensa overlay in the legal-info output Yann E. MORIN
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

gcc does not build in-tree. We currently catter to this situation by
building gcc in a sub-dir. This virtually leaves the gcc sources intact.

So, we have three locations where we have identical gcc sources:
  - host-gcc (for legal-info),
  - host-gcc-initial,
  - host-gcc-final.

The gcc sources are not so large, but they still take more than 350Mib
(so more than 1GiB total) and it takes quite some time to extract them.

This patch:

  - changes both host-gcc-initial and host-gc-final to re-use the
    sources from host-gcc;

  - makes host-gcc-initial and host-gcc-final pure host packages, by
    prefixing all variables with HOST_ (we really do not have the target
    variants since we do not support a compiler on the target); not
    defining HOST_GCC_INITIAL_SOURCE will make Buildroot try to download
    a taball for it, which we do not want; ditto HOST_GCC_FINAL_SOURCE;

  - no longer build in a sub-directory, since we no longer have gcc
    sources in the build directory;

  - changes the configure symlink to a wrapper script, otherwise
    configure gets really confused as it only expects the source tree
    to be in either '.' or '..' ;

  - ditches HOST_GCC_APPLY_PATCHES now that it is unused.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/gcc/gcc-final/gcc-final.mk     | 36 ++++++++++++----------------------
 package/gcc/gcc-initial/gcc-initial.mk | 26 +++++++-----------------
 package/gcc/gcc.mk                     | 21 +++++++-------------
 3 files changed, 26 insertions(+), 57 deletions(-)

diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk
index 5479a4b..43d2644 100644
--- a/package/gcc/gcc-final/gcc-final.mk
+++ b/package/gcc/gcc-final/gcc-final.mk
@@ -1,37 +1,25 @@
 ################################################################################
 #
-# gcc-final
+# host-gcc-final
 #
 ################################################################################
 
-GCC_FINAL_VERSION = $(HOST_GCC_VERSION)
-GCC_FINAL_SITE = $(HOST_GCC_SITE)
-GCC_FINAL_SOURCE = $(HOST_GCC_SOURCE)
+HOST_GCC_FINAL_VERSION = $(HOST_GCC_VERSION)
+HOST_GCC_FINAL_SOURCE =
 
 # We only need to redistribute the gcc sources once, and that is handled by
 # the host-gcc package, not host-gcc-final. So, we fake a non-redistribuale
 # package, even though it *is* redistributable, but is already redistributed
 # thanks to host-gcc.
-GCC_FINAL_REDISTRIBUTE = IGNORE
+HOST_GCC_FINAL_REDISTRIBUTE = IGNORE
 
 HOST_GCC_FINAL_DEPENDENCIES = \
 	$(HOST_GCC_COMMON_DEPENDENCIES) \
 	$(BR_LIBC)
 
-HOST_GCC_FINAL_EXCLUDES = $(HOST_GCC_EXCLUDES)
-HOST_GCC_FINAL_POST_EXTRACT_HOOKS += HOST_GCC_FAKE_TESTSUITE
-
-ifneq ($(call qstrip, $(BR2_XTENSA_CORE_NAME)),)
-HOST_GCC_FINAL_POST_EXTRACT_HOOKS += HOST_GCC_XTENSA_OVERLAY_EXTRACT
-endif
-
-HOST_GCC_FINAL_POST_PATCH_HOOKS += HOST_GCC_APPLY_PATCHES
-
-# gcc doesn't support in-tree build, so we create a 'build'
-# subdirectory in the gcc sources, and build from there.
-HOST_GCC_FINAL_SUBDIR = build
-
-HOST_GCC_FINAL_PRE_CONFIGURE_HOOKS += HOST_GCC_CONFIGURE_SYMLINK
+# gcc doesn't support in-tree build, so we re-use the sources extracted
+# # for the host-gcc package and do a complete out-of-tree build
+HOST_GCC_FINAL_POST_PATCH_HOOKS += HOST_GCC_CONFIGURE_WRAPPER
 
 define  HOST_GCC_FINAL_CONFIGURE_CMDS
 	(cd $(HOST_GCC_FINAL_SRCDIR) && rm -rf config.cache; \
@@ -49,14 +37,14 @@ endef
 
 
 # Languages supported by the cross-compiler
-GCC_FINAL_CROSS_LANGUAGES-y = c
-GCC_FINAL_CROSS_LANGUAGES-$(BR2_INSTALL_LIBSTDCPP) += c++
-GCC_FINAL_CROSS_LANGUAGES-$(BR2_TOOLCHAIN_BUILDROOT_FORTRAN) += fortran
-GCC_FINAL_CROSS_LANGUAGES = $(subst $(space),$(comma),$(GCC_FINAL_CROSS_LANGUAGES-y))
+HOST_GCC_FINAL_CROSS_LANGUAGES-y = c
+HOST_GCC_FINAL_CROSS_LANGUAGES-$(BR2_INSTALL_LIBSTDCPP) += c++
+HOST_GCC_FINAL_CROSS_LANGUAGES-$(BR2_TOOLCHAIN_BUILDROOT_FORTRAN) += fortran
+HOST_GCC_FINAL_CROSS_LANGUAGES = $(subst $(space),$(comma),$(HOST_GCC_FINAL_CROSS_LANGUAGES-y))
 
 HOST_GCC_FINAL_CONF_OPTS = \
 	$(HOST_GCC_COMMON_CONF_OPTS) \
-	--enable-languages=$(GCC_FINAL_CROSS_LANGUAGES) \
+	--enable-languages=$(HOST_GCC_FINAL_CROSS_LANGUAGES) \
 	--with-build-time-tools=$(HOST_DIR)/usr/$(GNU_TARGET_NAME)/bin
 
 HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*
diff --git a/package/gcc/gcc-initial/gcc-initial.mk b/package/gcc/gcc-initial/gcc-initial.mk
index 1c478a5..74debe9 100644
--- a/package/gcc/gcc-initial/gcc-initial.mk
+++ b/package/gcc/gcc-initial/gcc-initial.mk
@@ -1,35 +1,23 @@
 ################################################################################
 #
-# gcc-initial
+# host-gcc-initial
 #
 ################################################################################
 
-GCC_INITIAL_VERSION = $(HOST_GCC_VERSION)
-GCC_INITIAL_SITE = $(HOST_GCC_SITE)
-GCC_INITIAL_SOURCE = $(HOST_GCC_SOURCE)
+HOST_GCC_INITIAL_VERSION = $(HOST_GCC_VERSION)
+HOST_GCC_INITIAL_SOURCE =
 
 # We only need to redistribute the gcc sources once, and that is handled by
 # the host-gcc package, not host-gcc-initial. So, we fake a non-redistribuale
 # package, even though it *is* redistributable, but is already redistributed
 # thanks to host-gcc.
-GCC_INITIAL_REDISTRIBUTE = IGNORE
+HOST_GCC_INITIAL_REDISTRIBUTE = IGNORE
 
 HOST_GCC_INITIAL_DEPENDENCIES = $(HOST_GCC_COMMON_DEPENDENCIES)
 
-HOST_GCC_INITIAL_EXCLUDES = $(HOST_GCC_EXCLUDES)
-HOST_GCC_INITIAL_POST_EXTRACT_HOOKS += HOST_GCC_FAKE_TESTSUITE
-
-ifneq ($(call qstrip, $(BR2_XTENSA_CORE_NAME)),)
-HOST_GCC_INITIAL_POST_EXTRACT_HOOKS += HOST_GCC_XTENSA_OVERLAY_EXTRACT
-endif
-
-HOST_GCC_INITIAL_POST_PATCH_HOOKS += HOST_GCC_APPLY_PATCHES
-
-# gcc doesn't support in-tree build, so we create a 'build'
-# subdirectory in the gcc sources, and build from there.
-HOST_GCC_INITIAL_SUBDIR = build
-
-HOST_GCC_INITIAL_PRE_CONFIGURE_HOOKS += HOST_GCC_CONFIGURE_SYMLINK
+# gcc doesn't support in-tree build, so we re-use the sources extracted
+# for the host-gcc package and do a complete out-of-tree build
+HOST_GCC_INITIAL_POST_PATCH_HOOKS += HOST_GCC_CONFIGURE_WRAPPER
 
 HOST_GCC_INITIAL_CONF_OPTS = \
 	$(HOST_GCC_COMMON_CONF_OPTS) \
diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index 28346b2..be58d96 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -58,20 +58,13 @@ HOST_GCC_POST_PATCH_HOOKS += HOST_GCC_APPLY_POWERPC_PATCH
 endif
 endif
 
-define HOST_GCC_APPLY_PATCHES
-	if test -d package/gcc/$(HOST_GCC_VERSION); then \
-	  $(APPLY_PATCHES) $(@D) package/gcc/$(HOST_GCC_VERSION) \*.patch ; \
-	fi;
-	$(HOST_GCC_APPLY_POWERPC_PATCH)
-endef
-
-#
-# Create 'build' directory and configure symlink
-#
-
-define HOST_GCC_CONFIGURE_SYMLINK
-	mkdir -p $(@D)/build
-	ln -sf ../configure $(@D)/build/configure
+# Note: HOST_GCC_DIR is not yet defined, but this macro is only used in
+# the host-gcc-initial and host-gcc-final packages, which are included
+# only after we call the package infra, so HOST_GCC_DIR will be defined
+# when it is used.
+define HOST_GCC_CONFIGURE_WRAPPER
+	printf '#!/bin/sh\nexec "$(HOST_GCC_DIR)/configure" "$${@}"\n' >$(@D)/configure
+	chmod 755 $(@D)/configure
 endef
 
 #
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 12/21 RFC] package/gcc: include the extensa overlay in the legal-info output
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (10 preceding siblings ...)
  2015-11-16 22:47 ` [Buildroot] [PATCH 11/21 RFC] package/gcc: make -initial and -final use sources from host-gcc Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  2015-11-16 22:47 ` [Buildroot] [PATCH 13/21 RFC] package/perl: include perl-cross " Yann E. MORIN
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

the Xtensa overlay is combined with the gcc sources, so it must be
redistributed for proper compliance.

Add a post-legal-info hook that also installs the Xtensa overlay in the
legal-info output.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/gcc/gcc.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index be58d96..53aaf5c 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -43,10 +43,18 @@ HOST_GCC_POST_EXTRACT_HOOKS += HOST_GCC_FAKE_TESTSUITE
 #
 ifneq ($(call qstrip, $(BR2_XTENSA_CORE_NAME)),)
 HOST_GCC_XTENSA_OVERLAY_TAR = $(BR2_XTENSA_OVERLAY_DIR)/xtensa_$(call qstrip,$(BR2_XTENSA_CORE_NAME)).tar
+
 define HOST_GCC_XTENSA_OVERLAY_EXTRACT
 	tar xf $(HOST_GCC_XTENSA_OVERLAY_TAR) -C $(@D) --strip-components=1 gcc
 endef
 HOST_GCC_POST_EXTRACT_HOOKS += HOST_GCC_XTENSA_OVERLAY_EXTRACT
+
+define HOST_GCC_XTENSA_OVERLAY_LEGAL_INFO
+	$(Q)$(call hardlink-copy,$(HOST_GCC_XTENSA_OVERLAY_TAR),\
+				 $(HOST_GCC_REDIST_SOURCES_DIR))
+endef
+HOST_GCC_POST_LEGAL_INFO_HOOKS += HOST_GCC_XTENSA_OVERLAY_LEGAL_INFO
+
 endif # Xtensa
 
 ifeq ($(ARCH),powerpc)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 13/21 RFC] package/perl: include perl-cross in the legal-info output
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (11 preceding siblings ...)
  2015-11-16 22:47 ` [Buildroot] [PATCH 12/21 RFC] package/gcc: include the extensa overlay in the legal-info output Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  2015-11-16 22:47 ` [Buildroot] [PATCH 14/21 RFC] core: add a global variable with already-unquoted global patch dir Yann E. MORIN
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

The perl-cross sources are combined with the perl sources, so they must
be redistributed for proper compliance.

Add a post-legal-info hook that also installs them in the legal-info
output.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Francois Perrad <fperrad@gmail.com>
---
 package/perl/perl.mk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/package/perl/perl.mk b/package/perl/perl.mk
index f3b7b2b..25294e6 100644
--- a/package/perl/perl.mk
+++ b/package/perl/perl.mk
@@ -32,6 +32,13 @@ define PERL_CROSS_EXTRACT
 endef
 PERL_POST_EXTRACT_HOOKS += PERL_CROSS_EXTRACT
 
+# ... and as such should be part of the legal-info redistribution
+define PERL_CROSS_LEGAL_INFO
+	$(Q)$(call hardlink-copy,$(DL_DIR)/$(PERL_CROSS_SOURCE),\
+				 $(PERL_REDIST_SOURCES_DIR))
+endef
+PERL_POST_LEGAL_INFO_HOOKS += PERL_CROSS_LEGAL_INFO
+
 define PERL_CROSS_SET_POD
 	$(SED) s/$(PERL_CROSS_OLD_POD)/$(PERL_CROSS_NEW_POD)/g $(@D)/Makefile
 endef
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 14/21 RFC] core: add a global variable with already-unquoted global patch dir
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (12 preceding siblings ...)
  2015-11-16 22:47 ` [Buildroot] [PATCH 13/21 RFC] package/perl: include perl-cross " Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  2015-11-16 22:47 ` [Buildroot] [PATCH 15/21 RFC] core/pkg-generic: add macro to hardlink-or-copy Yann E. MORIN
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

... and use it instead of duplicating the qstrip everywhere it is
needed.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 Makefile               | 2 ++
 package/gcc/gcc.mk     | 4 ++--
 package/pkg-generic.mk | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 80c264f..033020d 100644
--- a/Makefile
+++ b/Makefile
@@ -187,6 +187,8 @@ ifneq ($(BR2_CCACHE_DIR),)
 BR_CACHE_DIR := $(BR2_CCACHE_DIR)
 endif
 
+BR_GLOBAL_PATCH_DIR := $(call qstrip,$(BR2_GLOBAL_PATCH_DIR))
+
 # Need that early, before we scan packages
 # Avoids doing the $(or...) everytime
 BR_GRAPH_OUT := $(or $(BR2_GRAPH_OUT),pdf)
diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index 53aaf5c..f1f06d2 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -257,8 +257,8 @@ HOST_GCC_COMMON_CCACHE_HASH_FILES += $(DL_DIR)/$(HOST_GCC_SOURCE)
 HOST_GCC_COMMON_CCACHE_HASH_FILES += \
 	$(sort $(wildcard \
 		package/gcc/$(HOST_GCC_VERSION)/*.patch \
-		$(addsuffix $((PKG)_RAWNAME)/$(HOST_GCC_VERSION)/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) \
-		$(addsuffix $((PKG)_RAWNAME)/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)))))
+		$(addsuffix $((PKG)_RAWNAME)/$(HOST_GCC_VERSION)/*.patch,$(BR_GLOBAL_PATCH_DIR)) \
+		$(addsuffix $((PKG)_RAWNAME)/*.patch,$(BR_GLOBAL_PATCH_DIR))))
 ifeq ($(BR2_xtensa),y)
 HOST_GCC_COMMON_CCACHE_HASH_FILES += $(HOST_GCC_XTENSA_OVERLAY_TAR)
 endif
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 91c8fea..544ae5c 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -147,7 +147,7 @@ $(BUILD_DIR)/%/.stamp_rsynced:
 # For BR2_GLOBAL_PATCH_DIR, only generate if it is defined
 $(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
 $(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS =  $(PKGDIR)
-$(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS += $(addsuffix /$(RAWNAME),$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)))
+$(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS += $(addsuffix /$(RAWNAME),$(BR_GLOBAL_PATCH_DIR))
 $(BUILD_DIR)/%/.stamp_patched:
 	@$(call step_start,patch)
 	@$(call MESSAGE,"Patching")
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 15/21 RFC] core/pkg-generic: add macro to hardlink-or-copy
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (13 preceding siblings ...)
  2015-11-16 22:47 ` [Buildroot] [PATCH 14/21 RFC] core: add a global variable with already-unquoted global patch dir Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  2015-11-18 15:40   ` Luca Ceresoli
  2015-11-16 22:47 ` [Buildroot] [PATCH 16/21 RFC] core/legal-info: use the macro to install source archives Yann E. MORIN
                   ` (5 subsequent siblings)
  20 siblings, 1 reply; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
---
 package/pkg-generic.mk | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 544ae5c..82fbeb0 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -305,6 +305,24 @@ endif
 endef
 
 ################################################################################
+# hardlink-copy -- hardlink source and destination if possible, otherwise
+# do a simple copy
+#
+# argument 1 is the source
+# argument 2 is the destination *directory*
+#
+# example:
+#   $(call hard-link-copy,source,destination)
+#
+# Note: we make that a single command, so se can:
+#  - use '$(Q)' in front of it and properly silence the whole macro,
+#  - use '|| exit 1' after it, so we can exit on error in compound commands.
+################################################################################
+define hardlink-copy
+	{ mkdir -p $(2) && { cp -l $(1) $(2) 2>/dev/null || cp $(1) $(2); } }
+endef
+
+################################################################################
 # inner-generic-package -- generates the make targets needed to build a
 # generic package
 #
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 16/21 RFC] core/legal-info: use the macro to install source archives
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (14 preceding siblings ...)
  2015-11-16 22:47 ` [Buildroot] [PATCH 15/21 RFC] core/pkg-generic: add macro to hardlink-or-copy Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  2015-11-16 22:47 ` [Buildroot] [PATCH 17/21 RFC] core/legal-info: install source archives in their own sub-dir Yann E. MORIN
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
---
 package/pkg-generic.mk | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 82fbeb0..a04adcf 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -819,9 +819,10 @@ ifeq ($$($(2)_REDISTRIBUTE),YES)
 ifneq ($$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_SOURCE))
 	$$(call DOWNLOAD,$$($(2)_ACTUAL_SOURCE_SITE)/$$($(2)_ACTUAL_SOURCE_TARBALL))
 endif
-# Copy the source tarball (just hardlink if possible)
-	@cp -l $$(DL_DIR)/$$($(2)_ACTUAL_SOURCE_TARBALL) $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4))) 2>/dev/null || \
-	    cp $$(DL_DIR)/$$($(2)_ACTUAL_SOURCE_TARBALL) $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4)))
+# Copy the source tarball
+	$$(Q)$$(call hardlink-copy,\
+		     $$(DL_DIR)/$$($(2)_ACTUAL_SOURCE_TARBALL),\
+		     $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4))))
 endif # redistribute
 
 endif # other packages
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch)
@ 2015-11-16 22:47 Yann E. MORIN
  2015-11-16 22:46 ` [Buildroot] [PATCH 01/21 RFC] package/libecore: do not build anything at patch time Yann E. MORIN
                   ` (20 more replies)
  0 siblings, 21 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

Hello All!

This series introduces core changs in how we handle the legal-info for
various packages.

The underlying reason for this series is that our legal-info content is
far from being complete. Most notably, the patches applied to packages
are not part of the legal-info output.

We do highly suggest users do redistribute Buildroot as part of their
compliance delivery, so the patches we bundle would be part of that
compliance deilvery.

However, patches that are downloaded or (most importantly) patches that
come from a global patch directory would be missing from that compliance
delivery.

The series starts with minor fixes to libecore and the legal-info infra,
and with adding licensing information to the Linux headers.

Then we add a new keyword to the _REDISTRIBUTE variable, so a package
can be completely ignored from the legal-info ouput (no source saved,
not license file saved, not listed in the manifest). Virtual packages
are forcibly set to be ignored that way.

Along the process of adding patches to the legal-info output, there was
an opportunity to cleanup and enhance the gcc package wrt. legal-info.
It was discovered that our legal-info for gcc was (besides the patches)
incomplete, as the Xtensa overlay was not saved. So, we took the burden
of cleaning, fixing and enhancing the gcc package:

  - have the same source tree for initial and final steps,
  - only extract sources once,
  - make the gcc package pure host packages,
  - add licensing information,
  - save the Xtensa overlay to the legal-info output.

Still side-tracked with all those changes, we fix the perl package to
also save the perl-cross sources in the legal-info putput.

Then, back to the legal-info infra, further changes allow saving the
patches alongside the source archives:

  - archives are saved in a subdirectory named package-version rarther
    than all in the same directory,
  - the directory where the kicense files are stores are also named
    similarly, for consistency, rather than with ust the name of the
    package,
  - patches ar eeventually saved alongside the corrsponding archive,
  - eventually, legal-info is made to work in full-offline mode.


Notes:

  - we considered saving the full content of _ALL_DOWNLOADS or just the
    content of _EXTRA_DOWNLOADS, but that does not play well with
    pre-configued toolchains, which use _EXTRA_DOWNLOAD to doenload
    additional tarballs with more binary stuff in there (sysroots), so
    it does not make sense to include those in the legal-info output.
    Since_ALL_DOWNLOADS also contains _EXTRA_DOWNLOADS, we can't use it
    either. Those are to be handled manually in post-legal-info hooks;

  - there might be other packages for which we are not saving 'extra'
    stuff, but they can be fixed (with post-legal-info hooks) in
    followup patches.

Regards,
Yann E. MORIN.


The following changes since commit 5f2cd8f5ecd7d035f00664c604fd8bfd5f1afcb8:

  lua-periphery: fix build on Sparc/Sparc64 (2015-11-16 23:19:27 +0100)

are available in the git repository at:

  git://git.busybox.net/~ymorin/git/buildroot yem/legal-patch

for you to fetch changes up to 0aa743543356cbe19450b672b435f016260ee7d6:

  core/pkg-infra: ensure legal-info works in off-line mode (2015-11-16 23:39:03 +0100)

----------------------------------------------------------------
Yann E. MORIN (21):
      package/libecore: do not build anything at patch time
      core/legal-info: fix missing double-$
      package/linux-headers: add licensing information
      core/legal-info: allow ignoring packages from the legal-info
      core/pkg-virtual: ignore from legal-info output
      package/gcc: add licensing information
      package/gcc: handle licensing information
      package/gcc: add a patch for arc rather than using sed
      package/gcc: properly extract and patch sources
      package/gcc: make host-gcc a pure host package
      package/gcc: make -initial and -final use sources from host-gcc
      package/gcc: include the extensa overlay in the legal-info output
      package/perl: include perl-cross in the legal-info output
      core: add a global variable with already-unquoted global patch dir
      core/pkg-generic: add macro to hardlink-or-copy
      core/legal-info: use the macro to install source archives
      core/legal-info: install source archives in their own sub-dir
      core/legal-info: add package version to license directory
      core/apply-patches: store full path of applied patches
      core/legal-info: also save patches
      core/pkg-infra: ensure legal-info works in off-line mode

 Makefile                                           |   2 +
 docs/manual/adding-packages-generic.txt            |   7 +-
 package/efl/libecore/libecore.mk                   |   2 +-
 .../900-no-libgmon.a-when-inhibit_libc.patch       |  43 +++++++
 package/gcc/gcc-final/gcc-final.mk                 |  40 +++---
 package/gcc/gcc-initial/gcc-initial.mk             |  43 ++-----
 package/gcc/gcc.mk                                 | 137 +++++++++++----------
 package/linux-headers/linux-headers.mk             |   2 +
 package/perl/perl.mk                               |   7 ++
 package/pkg-generic.mk                             |  74 ++++++++---
 package/pkg-virtual.mk                             |   2 +
 support/scripts/apply-patches.sh                   |   7 +-
 12 files changed, 228 insertions(+), 138 deletions(-)
 create mode 100644 package/gcc/arc-2015.06/900-no-libgmon.a-when-inhibit_libc.patch

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 17/21 RFC] core/legal-info: install source archives in their own sub-dir
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (15 preceding siblings ...)
  2015-11-16 22:47 ` [Buildroot] [PATCH 16/21 RFC] core/legal-info: use the macro to install source archives Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  2015-11-16 22:47 ` [Buildroot] [PATCH 18/21 RFC] core/legal-info: add package version to license directory Yann E. MORIN
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

Currently, we put all source archives side-by-side in the same
directory.

Since we're about to also save individual patches that were applied
on those sources, we don't want to make that directory a complete
mess of unassorted files.

So, we install each source archive in its own sub-directory, where
we'll later store the patches too. Store that location in a variable,
so it can be re-used later on (to install patches in a future commit).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
---
 package/pkg-generic.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index a04adcf..6e53c59 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -492,6 +492,8 @@ endif
 
 $(2)_REDISTRIBUTE		?= YES
 
+$(2)_REDIST_SOURCES_DIR = $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4)))/$$($(2)_RAWNAME)-$$($(2)_VERSION)
+
 # When a target package is a toolchain dependency set this variable to
 # 'NO' so the 'toolchain' dependency is not added to prevent a circular
 # dependency
@@ -822,7 +824,7 @@ endif
 # Copy the source tarball
 	$$(Q)$$(call hardlink-copy,\
 		     $$(DL_DIR)/$$($(2)_ACTUAL_SOURCE_TARBALL),\
-		     $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4))))
+		     $$($(2)_REDIST_SOURCES_DIR))
 endif # redistribute
 
 endif # other packages
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 18/21 RFC] core/legal-info: add package version to license directory
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (16 preceding siblings ...)
  2015-11-16 22:47 ` [Buildroot] [PATCH 17/21 RFC] core/legal-info: install source archives in their own sub-dir Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  2015-11-16 22:47 ` [Buildroot] [PATCH 19/21 RFC] core/apply-patches: store full path of applied patches Yann E. MORIN
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

Now that we save the source archives in a directory named after the
package and its version, do the same for the license files, for
consistenmcy.

Also save the version string in the all-licenses list.

However, do not print the version string when warning about undefined
_LICENSE_FILES (it's ugly otherwise).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
---
 package/pkg-generic.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 6e53c59..d808055 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -801,10 +801,10 @@ ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
 # is that the license still applies to the files distributed as part
 # of the rootfs, even if the sources are not themselves redistributed.
 ifeq ($$(call qstrip,$$($(2)_LICENSE_FILES)),)
-	@$$(call legal-license-nofiles,$$($(2)_RAWNAME),$$(call UPPERCASE,$(4)))
+	@$$(call legal-license-nofiles,$$($(2)_RAWNAME)-$$($(2)_VERSION),$$(call UPPERCASE,$(4)))
 	@$$(call legal-warning-pkg,$$($(2)_RAWNAME),cannot save license ($(2)_LICENSE_FILES not defined))
 else
-	@$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_RAWNAME),$$(F),$$($(2)_DIR)/$$(F),$$(call UPPERCASE,$(4)))$$(sep))
+	@$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_RAWNAME)-$$($(2)_VERSION),$$(F),$$($(2)_DIR)/$$(F),$$(call UPPERCASE,$(4)))$$(sep))
 endif # license files
 
 ifeq ($$($(2)_SITE_METHOD),local)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 19/21 RFC] core/apply-patches: store full path of applied patches
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (17 preceding siblings ...)
  2015-11-16 22:47 ` [Buildroot] [PATCH 18/21 RFC] core/legal-info: add package version to license directory Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  2015-11-16 22:47 ` [Buildroot] [PATCH 20/21 RFC] core/legal-info: also save patches Yann E. MORIN
  2015-11-16 22:47 ` [Buildroot] [PATCH 21/21 RFC] core/pkg-infra: ensure legal-info works in off-line mode Yann E. MORIN
  20 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

Currently, we only store the filename of the applied patches.

However, we are soon to want to install those ptches in the legal-info
directory, so we'll have to know where those patches come from.

Instead of duplicating the logic to find the patches, just store the
full path to each of those patches so we can retrieve them more easily
later on.

Also always create the list-file, even if empty, so that we need not
test for its existence before reading it.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 support/scripts/apply-patches.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
index af6df9e..3d538ba 100755
--- a/support/scripts/apply-patches.sh
+++ b/support/scripts/apply-patches.sh
@@ -64,6 +64,10 @@ find ${builddir}/ '(' -name '*.rej' -o -name '.*.rej' ')' -print0 | \
 function apply_patch {
     path=$1
     patch=$2
+    case "${path}" in
+        /*) ;;
+        *)  path="$(pwd)/${path}";;
+    esac
     case "$patch" in
 	*.gz)
 	type="gzip"; uncomp="gunzip -dc"; ;; 
@@ -94,7 +98,7 @@ function apply_patch {
 	echo "Error: missing patch file ${path}/$patch"
 	exit 1
     fi
-    echo $patch >> ${builddir}/.applied_patches_list
+    echo "${path}/${patch}" >> ${builddir}/.applied_patches_list
     ${uncomp} "${path}/$patch" | patch -g0 -p1 -E -d "${builddir}" -t -N $silent
     if [ $? != 0 ] ; then
         echo "Patch failed!  Please fix ${patch}!"
@@ -130,6 +134,7 @@ function scan_patchdir {
     fi
 }
 
+touch ${builddir}/.applied_patches_list
 scan_patchdir "$patchdir" "$patchpattern"
 
 # Check for rejects...
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 20/21 RFC] core/legal-info: also save patches
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (18 preceding siblings ...)
  2015-11-16 22:47 ` [Buildroot] [PATCH 19/21 RFC] core/apply-patches: store full path of applied patches Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  2015-11-16 22:47 ` [Buildroot] [PATCH 21/21 RFC] core/pkg-infra: ensure legal-info works in off-line mode Yann E. MORIN
  20 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

Currently, the legal-info infra only saves the source archive of a
package. However, that's not enough as we may aaply some patches on
packages sources.

We do suggest users to also redistribute the Buildroot sources as part
of their compliance distribution, so the patches bundled in Buildroot
would indeed be included in the compliance distribution.

However, that's not enough, since we may download some patches, or the
user may use a global patch directory. Patches in there might not end up
in the compliance distribution, and there are risks of non-conformity.

So, always include patches alongside the source archive.

To ensure reproducibility, we generate a series file, so patches can be
re-applied in the correct order.

We get the list of patches to include from the list of patches that were
applied by the package infrastructure (via the apply-patches support
script). So, we need to get packages properly extracted and patched
before we can save their legal-info, not only in the case they define
_LICENSE_FILES (however, we need not extract and patch a package if it
is set to be ignored for redistribution).

Note: this means that, when a (non-ignored) package is not patched and
defines no LICENSE_FILES, we will extract and patch it for nothing.
Trying to reduce the conditions under which a package has to be extracted
and patched prior to running legal-info would be pretty much complex and
error-prone. Also, a vast majorty of packages are either patched, or
define _LICENSE_FILES, so it is best to always extract-and-patch them
prior to legal-info.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
---
 package/pkg-generic.mk | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index d808055..8730a8d 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -759,12 +759,14 @@ $(2)_MANIFEST_LICENSE_FILES ?= not saved
 
 # If the package declares _LICENSE_FILES, we need to extract it,
 # for overriden, local or normal remote packages alike, whether
-# we want to redistribute it or not, but not if we want to ignore it.
+# we want to redistribute it or not.
+# To get the list of patches applied to a package, we need to
+# patch it.
+# If we want to ignore the package, we need not extract or patch
+# it, however.
 ifneq ($$($(2)_REDISTRIBUTE),IGNORE)
-ifneq ($$($(2)_LICENSE_FILES),)
 $(1)-legal-info: $(1)-patch
 endif
-endif
 
 # We only save the sources of packages we want to redistribute, that are
 # non-local, and non-overriden. So only store, in the manifest, the tarball
@@ -825,6 +827,10 @@ endif
 	$$(Q)$$(call hardlink-copy,\
 		     $$(DL_DIR)/$$($(2)_ACTUAL_SOURCE_TARBALL),\
 		     $$($(2)_REDIST_SOURCES_DIR))
+	$$(Q)while read f; do \
+		$$(call hardlink-copy,$$$${f},$$($(2)_REDIST_SOURCES_DIR)) || exit 1; \
+		printf "%s\n" "$$$${f##*/}" >>$$($(2)_REDIST_SOURCES_DIR)/series || exit 1; \
+	done <$$($(2)_DIR)/.applied_patches_list
 endif # redistribute
 
 endif # other packages
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 21/21 RFC] core/pkg-infra: ensure legal-info works in off-line mode
  2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
                   ` (19 preceding siblings ...)
  2015-11-16 22:47 ` [Buildroot] [PATCH 20/21 RFC] core/legal-info: also save patches Yann E. MORIN
@ 2015-11-16 22:47 ` Yann E. MORIN
  20 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-16 22:47 UTC (permalink / raw)
  To: buildroot

Almost all packages which are saved for legal-info have their source
archives downloaded as part of 'make source', which makes an off-line
build completely possible [0].

However, for the pre-configured external toolchains, the source tarball
is different, as the main tarball is a binary package. And that source
tarball is only downloaded during the legal-info phase, which makes it
inconvenient for full off-line builds.

We fix that in two steps:

  - first, we move the declaration of _ACTUAL_SOURCE_TARBALL and _SITE
    earlier in the pkg-generic.mk file, so we get those definitions at
    the time we define the -source and -all-source rules;

  - second, we add a new rule, $(1)-legal-source which only
    $(1)-all-source depends on, so that we only download it for a
    top-level 'make source', not as part of the standard download
    mechanism (i.e. only what is really needed to build).

This way, we can do a complete [0] off-line build and are still able to
generate legal-info, while at the same time we do not incur any download
overhead during a simple build.

[0] Save for nodejs which invarriably wants to download stuff at build
time. Sigh... :-( Fixing that is work for another time...

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
---
 package/pkg-generic.mk | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 8730a8d..9db0c62 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -438,6 +438,14 @@ ifndef $(2)_SOURCE
  endif
 endif
 
+# If FOO_ACTUAL_SOURCE_TARBALL is explicitly defined, it means FOO_SOURCE is
+# indeed a binary (e.g. external toolchain) and FOO_ACTUAL_SOURCE_TARBALL/_SITE
+# point to the actual sources tarball. Use the actual sources for legal-info.
+# For most packages the FOO_SITE/FOO_SOURCE pair points to real source code,
+# so these are the defaults for FOO_ACTUAL_*.
+$(2)_ACTUAL_SOURCE_TARBALL ?= $$($(2)_SOURCE)
+$(2)_ACTUAL_SOURCE_SITE    ?= $$(call qstrip,$$($(2)_SITE))
+
 ifndef $(2)_PATCH
  ifdef $(3)_PATCH
   $(2)_PATCH = $$($(3)_PATCH)
@@ -639,6 +647,13 @@ $(1)-depends:		$$($(2)_FINAL_DEPENDENCIES)
 
 $(1)-source:		$$($(2)_TARGET_SOURCE)
 
+$(1)-all-source:	$(1)-legal-source
+
+$(1)-legal-source:	$(1)-source
+ifneq ($$($(2)_ACTUAL_SOURCE_TARBALL),)
+	$$(call DOWNLOAD,$$($(2)_ACTUAL_SOURCE_SITE)/$$($(2)_ACTUAL_SOURCE_TARBALL))
+endif
+
 $(1)-source-check:
 	$$(foreach p,$$($(2)_ALL_DOWNLOADS),$$(call SOURCE_CHECK,$$(p))$$(sep))
 
@@ -780,14 +795,6 @@ endif
 endif
 endif
 
-# If FOO_ACTUAL_SOURCE_TARBALL is explicitly defined, it means FOO_SOURCE is
-# indeed a binary (e.g. external toolchain) and FOO_ACTUAL_SOURCE_TARBALL/_SITE
-# point to the actual sources tarball. Use the actual sources for legal-info.
-# For most packages the FOO_SITE/FOO_SOURCE pair points to real source code,
-# so these are the defaults for FOO_ACTUAL_*.
-$(2)_ACTUAL_SOURCE_TARBALL ?= $$($(2)_SOURCE)
-$(2)_ACTUAL_SOURCE_SITE    ?= $$(call qstrip,$$($(2)_SITE))
-
 # legal-info: produce legally relevant info.
 $(1)-legal-info:
 ifneq ($$($(2)_REDISTRIBUTE),IGNORE)
@@ -820,9 +827,6 @@ else
 # Other packages
 
 ifeq ($$($(2)_REDISTRIBUTE),YES)
-ifneq ($$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_SOURCE))
-	$$(call DOWNLOAD,$$($(2)_ACTUAL_SOURCE_SITE)/$$($(2)_ACTUAL_SOURCE_TARBALL))
-endif
 # Copy the source tarball
 	$$(Q)$$(call hardlink-copy,\
 		     $$(DL_DIR)/$$($(2)_ACTUAL_SOURCE_TARBALL),\
@@ -931,6 +935,7 @@ endif
 	$(1)-show-depends \
 	$(1)-show-version \
 	$(1)-source \
+	$(1)-legal-source \
 	$(1)-source-check
 
 ifeq ($$(patsubst %/,ERROR,$$($(2)_SITE)),ERROR)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 01/21 RFC] package/libecore: do not build anything at patch time
  2015-11-16 22:46 ` [Buildroot] [PATCH 01/21 RFC] package/libecore: do not build anything at patch time Yann E. MORIN
@ 2015-11-17 11:16   ` Thomas Petazzoni
  2015-11-17 12:20     ` Romain Naour
  2015-11-17 16:03   ` Peter Korsgaard
  1 sibling, 1 reply; 46+ messages in thread
From: Thomas Petazzoni @ 2015-11-17 11:16 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Mon, 16 Nov 2015 23:46:56 +0100, Yann E. MORIN wrote:
> Trying to build anything at patch time will result in a broken
> legal-info, as the needed host dependencies are not yet built.
> 
> Make that hook a pre-configure hook rather than a post-extract
> hook.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Peter Korsgaard <jacmet@uclibc.org>
> Cc: Romain Naour <romain.naour@openwide.fr>

Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Even though this will probably conflict with the EFL rework from
Romain. However I believe this patch should be merged in master, since
it actually fixes legal-info.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 02/21 RFC] core/legal-info: fix missing double-$
  2015-11-16 22:46 ` [Buildroot] [PATCH 02/21 RFC] core/legal-info: fix missing double-$ Yann E. MORIN
@ 2015-11-17 11:19   ` Thomas Petazzoni
  2015-11-17 16:03   ` Peter Korsgaard
  1 sibling, 0 replies; 46+ messages in thread
From: Thomas Petazzoni @ 2015-11-17 11:19 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Mon, 16 Nov 2015 23:46:57 +0100, Yann E. MORIN wrote:
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Luca Ceresoli <luca@lucaceresoli.net>
> ---
>  package/pkg-generic.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

I tested by running "make legal-info" on a configuration that uses an
external toolchain, and it properly downloaded the "actual source" for
the toolchain.

This should be applied on master I believe.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 03/21 RFC] package/linux-headers: add licensing information
  2015-11-16 22:46 ` [Buildroot] [PATCH 03/21 RFC] package/linux-headers: add licensing information Yann E. MORIN
@ 2015-11-17 11:19   ` Thomas Petazzoni
  2015-11-17 16:04   ` Peter Korsgaard
  1 sibling, 0 replies; 46+ messages in thread
From: Thomas Petazzoni @ 2015-11-17 11:19 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Mon, 16 Nov 2015 23:46:58 +0100, Yann E. MORIN wrote:
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Luca Ceresoli <luca@lucaceresoli.net>
> ---
>  package/linux-headers/linux-headers.mk | 2 ++
>  1 file changed, 2 insertions(+)

Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Should be applied on master.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 04/21 RFC] core/legal-info: allow ignoring packages from the legal-info
  2015-11-16 22:46 ` [Buildroot] [PATCH 04/21 RFC] core/legal-info: allow ignoring packages from the legal-info Yann E. MORIN
@ 2015-11-17 11:22   ` Thomas Petazzoni
  2015-11-17 17:35     ` Luca Ceresoli
  2015-11-17 21:43     ` Arnout Vandecappelle
  2015-11-17 21:48   ` Arnout Vandecappelle
  1 sibling, 2 replies; 46+ messages in thread
From: Thomas Petazzoni @ 2015-11-17 11:22 UTC (permalink / raw)
  To: buildroot

Yann, Luca,

On Mon, 16 Nov 2015 23:46:59 +0100, Yann E. MORIN wrote:
> It might be necessary to not even mention a package in the output of
> legal-info:
> 
>   - virtual package have virtually nothing to save in the legal-info
>     output;
> 
>   - for Buildroot itself, host-gcc-initial and host-gcc-final are not
>     real packages, they are just two different steps of the same
>     package, gcc;
> 
>   - for proprietary packages, it might not even be legal to even mention
>     them, being under NDA or some other such restrictive conditions.
> 
> Add the new 'IGNORE' keyword to the _REDISTRIBUTE package variable, so
> that the legal-info infra will simply completely ignore that package.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Luca Ceresoli <luca@lucaceresoli.net>

I understand the idea, but I'm not a big fan of a boolean variable that
is no longer a boolean variable.

So, let me question the current handling of <pkg>_REDISTRIBUTE = NO.
Does it make sense to mention such packages in the legal-info output,
since their source code is not saved anyway?

Shouldn't we simply change the behavior of <pkg>_REDISTRIBUTE = NO to
be that such packages are not listed at all in the legal-info output,
which would match what you're looking for for with this "IGNORE" thing ?

Luca, do you see any drawback in completely omitting REDISTRIBUTE = NO
packages from legal-info ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 05/21 RFC] core/pkg-virtual: ignore from legal-info output
  2015-11-16 22:47 ` [Buildroot] [PATCH 05/21 RFC] core/pkg-virtual: ignore from legal-info output Yann E. MORIN
@ 2015-11-17 11:25   ` Thomas Petazzoni
  2015-11-17 19:35     ` Yann E. MORIN
  0 siblings, 1 reply; 46+ messages in thread
From: Thomas Petazzoni @ 2015-11-17 11:25 UTC (permalink / raw)
  To: buildroot

Yann,

On Mon, 16 Nov 2015 23:47:00 +0100, Yann E. MORIN wrote:
> Virtual packages really have nothing to save for legal-info, so we just
> ignore them.
> 

> Following patches will always extract-and-aptch non-ignored packages, so
> we would potentially see spurious "extracting" and "patching" messages
> on the console, which would be a bit strange. Ignoring virtual packages
> will get us a cleaner log.

aptch -> patch. And the extract-and-patch can be just "extract and
patch".

It's also not really clear what you mean by "Following patches will
always extract and patch non-ignored packages". Aren't we already doing
that for legal-info ? (Note: I haven't looked at the following patches
yet, things might get clearer when I'll reach the next patches, but it
seems weird to not understand a commit log if you haven't read the next
patches).

Otherwise, I'm fine with the change, as soon as we reach an agreement
on PATCH 04/21.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 06/21 RFC] package/gcc: add licensing information
  2015-11-16 22:47 ` [Buildroot] [PATCH 06/21 RFC] package/gcc: add licensing information Yann E. MORIN
@ 2015-11-17 11:28   ` Thomas Petazzoni
  2015-11-17 21:15     ` Yann E. MORIN
  0 siblings, 1 reply; 46+ messages in thread
From: Thomas Petazzoni @ 2015-11-17 11:28 UTC (permalink / raw)
  To: buildroot

Yann,

On Mon, 16 Nov 2015 23:47:01 +0100, Yann E. MORIN wrote:

>  GCC_VERSION = $(call qstrip,$(BR2_GCC_VERSION))
> +GCC_LICENSE = \
> +	GPLv2+, GPLv3+, LGPLv2.1+ (w/ exception), LGPv3+ (w/ exception), \
> +	BSD-3c, MIT, BSL-1.0

What I dislike a bit with this is that we don't clearly differentiate
what goes on the target with what remains on the host. For many
companies, having GPLv3 or LGPLv3 stuff on the target is (unfortunately)
a no-go, so it would be good to make this clearer.

As per your implementation, such license information will only be part
of the "host packages" license information, while libgcc gets actually
installed in the target. To be honest, I am not entirely sure how to
handle this properly with our package infrastructure.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 07/21 RFC] package/gcc: handle licensing information
  2015-11-16 22:47 ` [Buildroot] [PATCH 07/21 RFC] package/gcc: handle " Yann E. MORIN
@ 2015-11-17 11:31   ` Thomas Petazzoni
  2015-11-17 21:20     ` Yann E. MORIN
  0 siblings, 1 reply; 46+ messages in thread
From: Thomas Petazzoni @ 2015-11-17 11:31 UTC (permalink / raw)
  To: buildroot

Yann,

On Mon, 16 Nov 2015 23:47:02 +0100, Yann E. MORIN wrote:
> We currently install no licensing information for gcc. But the way we
> build gcc makes it tricky to add licensing information:
> 
>   - we do not build host-gcc; rather, we build host-gcc-initial and
>     host-gcc-final,
> 
>   - we do not want to save licensing information for host-gcc-initial
>     and host-gcc-final, because what really makes sense from a user's
>     point of view is really host-gcc.
> 
> So, we make gcc a real host-generic-package for which we do not define
> any configure, build or install command, but for which we do have
> licensing information.
> 
> Then for both host-gcc-initial and host-gcc-final, we fake them to be
> non-redistributable, because the licensing information for them is not
> needed, nor is it needed to save their archives.
> 
> Finally, we make both host-gcc-initial and host-gc-final depend on
> host-gcc, so that host-gcc is handled by the legal-info framework.
> 
> Thus, legal-info will now save the gcc source and licensing information,
> and ignore host-gcc-initial and host-gcc-final.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Luca Ceresoli <luca@lucaceresoli.net>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

This I dislike very much. host-gcc is not a package, and it doesn't
exist. package/gcc/gcc.mk just contains common definitions to both
gcc-initial and gcc-final. Making 'gcc' a package is more confusing
than anything else.

I believe a much better approach is to simply add the licensing
informations to the gcc-final package, and leave gcc-initial with no
licensing information. If having a package named "gcc-final" in the
licensing report is really shocking for you, then we can rename
gcc-final to just "gcc", and have something like:

 + package/
   + gcc/
     + gcc-common.mk
     + gcc-initial/
       + gcc-initial.mk
     + gcc/
       + gcc.mk

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 01/21 RFC] package/libecore: do not build anything at patch time
  2015-11-17 11:16   ` Thomas Petazzoni
@ 2015-11-17 12:20     ` Romain Naour
  2015-11-17 20:16       ` Romain Naour
  0 siblings, 1 reply; 46+ messages in thread
From: Romain Naour @ 2015-11-17 12:20 UTC (permalink / raw)
  To: buildroot

Hello Yann, Thomas,
Le 17/11/2015 12:16, Thomas Petazzoni a ?crit :
> Dear Yann E. MORIN,
> 
> On Mon, 16 Nov 2015 23:46:56 +0100, Yann E. MORIN wrote:
>> Trying to build anything at patch time will result in a broken
>> legal-info, as the needed host dependencies are not yet built.
>>
>> Make that hook a pre-configure hook rather than a post-extract
>> hook.
>>
>> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>> Cc: Peter Korsgaard <jacmet@uclibc.org>
>> Cc: Romain Naour <romain.naour@openwide.fr>
> 
> Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> 
> Even though this will probably conflict with the EFL rework from
> Romain. However I believe this patch should be merged in master, since
> it actually fixes legal-info.

Ok, it's not a big problem. The merge conflict will be easily resolved by
removing the libecore package ;-)

Actually makekeys is not build by the upcoming host-efl package, I'll check if
we still need it.

Otherwise:
Reviewed-by: Romain Naour <romain.naour@openwide.fr>

Best regards,
Romain
> 
> Thanks,
> 
> Thomas
> 

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 01/21 RFC] package/libecore: do not build anything at patch time
  2015-11-16 22:46 ` [Buildroot] [PATCH 01/21 RFC] package/libecore: do not build anything at patch time Yann E. MORIN
  2015-11-17 11:16   ` Thomas Petazzoni
@ 2015-11-17 16:03   ` Peter Korsgaard
  1 sibling, 0 replies; 46+ messages in thread
From: Peter Korsgaard @ 2015-11-17 16:03 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > Trying to build anything at patch time will result in a broken
 > legal-info, as the needed host dependencies are not yet built.

 > Make that hook a pre-configure hook rather than a post-extract
 > hook.

 > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > Cc: Peter Korsgaard <jacmet@uclibc.org>
 > Cc: Romain Naour <romain.naour@openwide.fr>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 02/21 RFC] core/legal-info: fix missing double-$
  2015-11-16 22:46 ` [Buildroot] [PATCH 02/21 RFC] core/legal-info: fix missing double-$ Yann E. MORIN
  2015-11-17 11:19   ` Thomas Petazzoni
@ 2015-11-17 16:03   ` Peter Korsgaard
  1 sibling, 0 replies; 46+ messages in thread
From: Peter Korsgaard @ 2015-11-17 16:03 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > Cc: Luca Ceresoli <luca@lucaceresoli.net>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 03/21 RFC] package/linux-headers: add licensing information
  2015-11-16 22:46 ` [Buildroot] [PATCH 03/21 RFC] package/linux-headers: add licensing information Yann E. MORIN
  2015-11-17 11:19   ` Thomas Petazzoni
@ 2015-11-17 16:04   ` Peter Korsgaard
  1 sibling, 0 replies; 46+ messages in thread
From: Peter Korsgaard @ 2015-11-17 16:04 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > Cc: Luca Ceresoli <luca@lucaceresoli.net>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 04/21 RFC] core/legal-info: allow ignoring packages from the legal-info
  2015-11-17 11:22   ` Thomas Petazzoni
@ 2015-11-17 17:35     ` Luca Ceresoli
  2015-11-17 19:28       ` Yann E. MORIN
  2015-11-17 21:43     ` Arnout Vandecappelle
  1 sibling, 1 reply; 46+ messages in thread
From: Luca Ceresoli @ 2015-11-17 17:35 UTC (permalink / raw)
  To: buildroot

Dear Thomas, Yann, All,

Thomas Petazzoni wrote:
> Yann, Luca,
>
> On Mon, 16 Nov 2015 23:46:59 +0100, Yann E. MORIN wrote:
>> It might be necessary to not even mention a package in the output of
>> legal-info:
>>
>>    - virtual package have virtually nothing to save in the legal-info
>>      output;
>>
>>    - for Buildroot itself, host-gcc-initial and host-gcc-final are not
>>      real packages, they are just two different steps of the same
>>      package, gcc;
>>
>>    - for proprietary packages, it might not even be legal to even mention
>>      them, being under NDA or some other such restrictive conditions.
>>
>> Add the new 'IGNORE' keyword to the _REDISTRIBUTE package variable, so
>> that the legal-info infra will simply completely ignore that package.
>>
>> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>> Cc: Luca Ceresoli <luca@lucaceresoli.net>
>
> I understand the idea, but I'm not a big fan of a boolean variable that
> is no longer a boolean variable.
>
> So, let me question the current handling of <pkg>_REDISTRIBUTE = NO.
> Does it make sense to mention such packages in the legal-info output,
> since their source code is not saved anyway?
>
> Shouldn't we simply change the behavior of <pkg>_REDISTRIBUTE = NO to
> be that such packages are not listed at all in the legal-info output,
> which would match what you're looking for for with this "IGNORE" thing ?
>
> Luca, do you see any drawback in completely omitting REDISTRIBUTE = NO
> packages from legal-info ?

Indeed I think we need that behaviour for some binary-only packages.
imx-vpu looks like a good example. Its COPYING file contains the
following clause:

> 3.4.             You must reproduce any and all of Freescale's (or its third
> party licensor's) copyright notices and other proprietary legends on copies of
> Licensed Software.

To the best of my understanding this means we must mention the package
and its legal wording in legal-info.

Thus your proposed change of meaning for REDISTRIBUTE = NO is probably
not doable.

How about changing the entire REDISTRIBUTE meaning from a boolean to an
enumerative? Values would be:

  - ALL: equals current YES
  - METADATA: equals current NO, produces no tarball
  - NOTHING: equals Yann's IGNORE
  - YES: deprecated, for backward compatibility
  - NO: deprecated, for backward compatibility

In other words, change the meaning of REDISTRIBUTE from "do you want to
redistribute the tarball?" to "what do you want to redistribute?".

-- 
Luca

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 04/21 RFC] core/legal-info: allow ignoring packages from the legal-info
  2015-11-17 17:35     ` Luca Ceresoli
@ 2015-11-17 19:28       ` Yann E. MORIN
  2015-11-17 20:14         ` Thomas Petazzoni
  0 siblings, 1 reply; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-17 19:28 UTC (permalink / raw)
  To: buildroot

Luca, Thomas, All,

On 2015-11-17 18:35 +0100, Luca Ceresoli spake thusly:
> Thomas Petazzoni wrote:
> >On Mon, 16 Nov 2015 23:46:59 +0100, Yann E. MORIN wrote:
> >>It might be necessary to not even mention a package in the output of
> >>legal-info:
> >>
> >>   - virtual package have virtually nothing to save in the legal-info
> >>     output;
> >>
> >>   - for Buildroot itself, host-gcc-initial and host-gcc-final are not
> >>     real packages, they are just two different steps of the same
> >>     package, gcc;
> >>
> >>   - for proprietary packages, it might not even be legal to even mention
> >>     them, being under NDA or some other such restrictive conditions.
> >>
> >>Add the new 'IGNORE' keyword to the _REDISTRIBUTE package variable, so
> >>that the legal-info infra will simply completely ignore that package.
> >>
> >>Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> >>Cc: Luca Ceresoli <luca@lucaceresoli.net>
> >
> >I understand the idea, but I'm not a big fan of a boolean variable that
> >is no longer a boolean variable.
> >
> >So, let me question the current handling of <pkg>_REDISTRIBUTE = NO.
> >Does it make sense to mention such packages in the legal-info output,
> >since their source code is not saved anyway?
> >
> >Shouldn't we simply change the behavior of <pkg>_REDISTRIBUTE = NO to
> >be that such packages are not listed at all in the legal-info output,
> >which would match what you're looking for for with this "IGNORE" thing ?
> >
> >Luca, do you see any drawback in completely omitting REDISTRIBUTE = NO
> >packages from legal-info ?
> 
> Indeed I think we need that behaviour for some binary-only packages.
> imx-vpu looks like a good example. Its COPYING file contains the
> following clause:
> 
> >3.4.             You must reproduce any and all of Freescale's (or its third
> >party licensor's) copyright notices and other proprietary legends on copies of
> >Licensed Software.
> 
> To the best of my understanding this means we must mention the package
> and its legal wording in legal-info.
> 
> Thus your proposed change of meaning for REDISTRIBUTE = NO is probably
> not doable.
> 
> How about changing the entire REDISTRIBUTE meaning from a boolean to an
> enumerative? Values would be:
> 
>  - ALL: equals current YES
>  - METADATA: equals current NO, produces no tarball
>  - NOTHING: equals Yann's IGNORE
>  - YES: deprecated, for backward compatibility
>  - NO: deprecated, for backward compatibility
> 
> In other words, change the meaning of REDISTRIBUTE from "do you want to
> redistribute the tarball?" to "what do you want to redistribute?".

Well, I don't really care whether we call it IGNORE or NOTHING or
whatever makes more sense. I'm also fine with deprecating YES and NO
to replace them with more meaningful values.

What I care about is having the ability to mark a package for the
following conditions:

  - redistribute "source" archive, list in the manifest and save
    licensing files,

  - list in the manifest and save licensing files,

  - completely omit the package from legal-info.

As Luca explained, there are packages for which we should not
redistribute the "source" archive, but which we must list in the
manifest. Luca talked about imx-vpu, I was thinking about
nvidia-driver.

The new possibility that I would want is to completely ignore the
package from the legal-info output, as there might be legal reasons that
the mere existence of that package should not be disclosed.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 05/21 RFC] core/pkg-virtual: ignore from legal-info output
  2015-11-17 11:25   ` Thomas Petazzoni
@ 2015-11-17 19:35     ` Yann E. MORIN
  0 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-17 19:35 UTC (permalink / raw)
  To: buildroot

On 2015-11-17 12:25 +0100, Thomas Petazzoni spake thusly:
> Yann,
> 
> On Mon, 16 Nov 2015 23:47:00 +0100, Yann E. MORIN wrote:
> > Virtual packages really have nothing to save for legal-info, so we just
> > ignore them.
> > 
> 
> > Following patches will always extract-and-aptch non-ignored packages, so
> > we would potentially see spurious "extracting" and "patching" messages
> > on the console, which would be a bit strange. Ignoring virtual packages
> > will get us a cleaner log.
> 
> aptch -> patch. And the extract-and-patch can be just "extract and
> patch".

Damn, I missed fixing that (I used it elsewhere and then fixed those,
missed that one).

> It's also not really clear what you mean by "Following patches will
> always extract and patch non-ignored packages". Aren't we already doing
> that for legal-info ? (Note: I haven't looked at the following patches
> yet, things might get clearer when I'll reach the next patches, but it
> seems weird to not understand a commit log if you haven't read the next
> patches).

No, we only extract them if they define a non-empty _LICENSE_FILES.

> Otherwise, I'm fine with the change, as soon as we reach an agreement
> on PATCH 04/21.

Ack. Two options, then:

  - keep YES/NO, add IGNORE (or NOTHING)
  - replace YES/NO with ALL, METADATA, NOTHING (and keep YES/NO for
    backward compatibility to ALL/METADATA).

(or a third naming, whatever...)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 04/21 RFC] core/legal-info: allow ignoring packages from the legal-info
  2015-11-17 19:28       ` Yann E. MORIN
@ 2015-11-17 20:14         ` Thomas Petazzoni
  2015-11-17 21:26           ` Yann E. MORIN
  0 siblings, 1 reply; 46+ messages in thread
From: Thomas Petazzoni @ 2015-11-17 20:14 UTC (permalink / raw)
  To: buildroot

Yann,

On Tue, 17 Nov 2015 20:28:02 +0100, Yann E. MORIN wrote:

> Well, I don't really care whether we call it IGNORE or NOTHING or
> whatever makes more sense. I'm also fine with deprecating YES and NO
> to replace them with more meaningful values.
> 
> What I care about is having the ability to mark a package for the
> following conditions:
> 
>   - redistribute "source" archive, list in the manifest and save
>     licensing files,
> 
>   - list in the manifest and save licensing files,
> 
>   - completely omit the package from legal-info.

Right, understood.

> As Luca explained, there are packages for which we should not
> redistribute the "source" archive, but which we must list in the
> manifest. Luca talked about imx-vpu, I was thinking about
> nvidia-driver.

Seen the examples, it is more convincing now.

> The new possibility that I would want is to completely ignore the
> package from the legal-info output, as there might be legal reasons that
> the mere existence of that package should not be disclosed.

So, I understand the need. Now, I am wondering whether we should have
one single variable with "special" values as Luca/you suggest, or two
clearly separated boolean variables that control each aspects
(distribute the source, include in legal-info). Example:

<pkg>_GENERATE_LEGAL_INFO = YES/NO
<pkg>_REDISTRIBUTE_SOURCE = YES/NO

Of course, if <pkg>_GENERATE_LEGAL_INFO = NO, <pkg>_REDISTRIBUTE_SOURCE
is ignored.

This is just a proposal, I'm totally open to better names for the
variables.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 01/21 RFC] package/libecore: do not build anything at patch time
  2015-11-17 12:20     ` Romain Naour
@ 2015-11-17 20:16       ` Romain Naour
  0 siblings, 0 replies; 46+ messages in thread
From: Romain Naour @ 2015-11-17 20:16 UTC (permalink / raw)
  To: buildroot

Hello, Yann, Thomas,

Le 17/11/2015 13:20, Romain Naour a ?crit :
> Hello Yann, Thomas,
> Le 17/11/2015 12:16, Thomas Petazzoni a ?crit :
>> Dear Yann E. MORIN,
>>
>> On Mon, 16 Nov 2015 23:46:56 +0100, Yann E. MORIN wrote:
>>> Trying to build anything at patch time will result in a broken
>>> legal-info, as the needed host dependencies are not yet built.
>>>
>>> Make that hook a pre-configure hook rather than a post-extract
>>> hook.
>>>
>>> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>>> Cc: Peter Korsgaard <jacmet@uclibc.org>
>>> Cc: Romain Naour <romain.naour@openwide.fr>
>>
>> Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>>
>> Even though this will probably conflict with the EFL rework from
>> Romain. However I believe this patch should be merged in master, since
>> it actually fixes legal-info.
> 
> Ok, it's not a big problem. The merge conflict will be easily resolved by
> removing the libecore package ;-)
> 
> Actually makekeys is not build by the upcoming host-efl package, I'll check if
> we still need it.

We can just forget about makekeys tool since it's only used when X11 with XCB
support is enabled.

Best regards,
Romain

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 06/21 RFC] package/gcc: add licensing information
  2015-11-17 11:28   ` Thomas Petazzoni
@ 2015-11-17 21:15     ` Yann E. MORIN
  2015-11-17 21:25       ` Thomas Petazzoni
  0 siblings, 1 reply; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-17 21:15 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2015-11-17 12:28 +0100, Thomas Petazzoni spake thusly:
> On Mon, 16 Nov 2015 23:47:01 +0100, Yann E. MORIN wrote:
> >  GCC_VERSION = $(call qstrip,$(BR2_GCC_VERSION))
> > +GCC_LICENSE = \
> > +	GPLv2+, GPLv3+, LGPLv2.1+ (w/ exception), LGPv3+ (w/ exception), \
> > +	BSD-3c, MIT, BSL-1.0
> 
> What I dislike a bit with this is that we don't clearly differentiate
> what goes on the target with what remains on the host. For many
> companies, having GPLv3 or LGPLv3 stuff on the target is (unfortunately)
> a no-go, so it would be good to make this clearer.
> 
> As per your implementation, such license information will only be part
> of the "host packages" license information, while libgcc gets actually
> installed in the target. To be honest, I am not entirely sure how to
> handle this properly with our package infrastructure.

Yes, the current legalese will only apply to the host variant.

We could add a target gcc-final that defines the needed legal-info
stuff, but installs nothing (like I did so far with the host-gcc
package). But I don't like it much either.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 07/21 RFC] package/gcc: handle licensing information
  2015-11-17 11:31   ` Thomas Petazzoni
@ 2015-11-17 21:20     ` Yann E. MORIN
  0 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-17 21:20 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2015-11-17 12:31 +0100, Thomas Petazzoni spake thusly:
> On Mon, 16 Nov 2015 23:47:02 +0100, Yann E. MORIN wrote:
> > We currently install no licensing information for gcc. But the way we
> > build gcc makes it tricky to add licensing information:
> > 
> >   - we do not build host-gcc; rather, we build host-gcc-initial and
> >     host-gcc-final,
> > 
> >   - we do not want to save licensing information for host-gcc-initial
> >     and host-gcc-final, because what really makes sense from a user's
> >     point of view is really host-gcc.
> > 
> > So, we make gcc a real host-generic-package for which we do not define
> > any configure, build or install command, but for which we do have
> > licensing information.
> > 
> > Then for both host-gcc-initial and host-gcc-final, we fake them to be
> > non-redistributable, because the licensing information for them is not
> > needed, nor is it needed to save their archives.
> > 
> > Finally, we make both host-gcc-initial and host-gc-final depend on
> > host-gcc, so that host-gcc is handled by the legal-info framework.
> > 
> > Thus, legal-info will now save the gcc source and licensing information,
> > and ignore host-gcc-initial and host-gcc-final.
> > 
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > Cc: Luca Ceresoli <luca@lucaceresoli.net>
> > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> 
> This I dislike very much. host-gcc is not a package, and it doesn't
> exist. package/gcc/gcc.mk just contains common definitions to both
> gcc-initial and gcc-final. Making 'gcc' a package is more confusing
> than anything else.

OK.

> I believe a much better approach is to simply add the licensing
> informations to the gcc-final package, and leave gcc-initial with no
> licensing information. If having a package named "gcc-final" in the
> licensing report is really shocking for you, then we can rename
> gcc-final to just "gcc", and have something like:
> 
>  + package/
>    + gcc/
>      + gcc-common.mk
>      + gcc-initial/
>        + gcc-initial.mk
>      + gcc/
>        + gcc.mk

I have to admit this looks good to me. So, I'll be working with that new
goal in mind. Thanks! :-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 06/21 RFC] package/gcc: add licensing information
  2015-11-17 21:15     ` Yann E. MORIN
@ 2015-11-17 21:25       ` Thomas Petazzoni
  2015-11-17 21:40         ` Yann E. MORIN
  0 siblings, 1 reply; 46+ messages in thread
From: Thomas Petazzoni @ 2015-11-17 21:25 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 17 Nov 2015 22:15:49 +0100, Yann E. MORIN wrote:

> > As per your implementation, such license information will only be part
> > of the "host packages" license information, while libgcc gets actually
> > installed in the target. To be honest, I am not entirely sure how to
> > handle this properly with our package infrastructure.
> 
> Yes, the current legalese will only apply to the host variant.
> 
> We could add a target gcc-final that defines the needed legal-info
> stuff, but installs nothing (like I did so far with the host-gcc
> package). But I don't like it much either.

It's not super nice indeed, but I don't really see a better option. We
could always make this package actually do something "useful":
installing the gcc libraries to the target. I.e essentially move the
following part of host-gcc-final to this package:

# Handle the installation of libraries in /usr/lib
HOST_GCC_FINAL_USR_LIBS =

ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
HOST_GCC_FINAL_USR_LIBS += libstdc++
endif

ifeq ($(BR2_TOOLCHAIN_BUILDROOT_FORTRAN),y)
HOST_GCC_FINAL_USR_LIBS += libgfortran
endif

ifeq ($(BR2_GCC_ENABLE_OPENMP),y)
HOST_GCC_FINAL_USR_LIBS += libgomp
endif

ifeq ($(BR2_GCC_ENABLE_LIBMUDFLAP),y)
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
HOST_GCC_FINAL_USR_LIBS += libmudflapth
else
HOST_GCC_FINAL_USR_LIBS += libmudflap
endif
endif

ifneq ($(HOST_GCC_FINAL_USR_LIBS),)
define HOST_GCC_FINAL_INSTALL_STATIC_LIBS
        for i in $(HOST_GCC_FINAL_USR_LIBS) ; do \
                cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$${i}.a \
                        $(STAGING_DIR)/usr/lib/ ; \
        done
endef

ifeq ($(BR2_STATIC_LIBS),)
define HOST_GCC_FINAL_INSTALL_SHARED_LIBS
        for i in $(HOST_GCC_FINAL_USR_LIBS) ; do \
                cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$${i}.so* \
                        $(STAGING_DIR)/usr/lib/ ; \
                cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$${i}.so* \
                        $(TARGET_DIR)/usr/lib/ ; \
        done
endef
endif

define HOST_GCC_FINAL_INSTALL_USR_LIBS
        mkdir -p $(TARGET_DIR)/usr/lib
        $(HOST_GCC_FINAL_INSTALL_STATIC_LIBS)
        $(HOST_GCC_FINAL_INSTALL_SHARED_LIBS)
endef
HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_USR_LIBS
endif

This is really making the code more complicated just for the sake of
legal-info, though. Which isn't super nice. But at least we would have
the gcc libraries properly mentioned in the legal-info output for the
target.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 04/21 RFC] core/legal-info: allow ignoring packages from the legal-info
  2015-11-17 20:14         ` Thomas Petazzoni
@ 2015-11-17 21:26           ` Yann E. MORIN
  0 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-17 21:26 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2015-11-17 21:14 +0100, Thomas Petazzoni spake thusly:
> On Tue, 17 Nov 2015 20:28:02 +0100, Yann E. MORIN wrote:
> > Well, I don't really care whether we call it IGNORE or NOTHING or
> > whatever makes more sense. I'm also fine with deprecating YES and NO
> > to replace them with more meaningful values.
> > 
> > What I care about is having the ability to mark a package for the
> > following conditions:
> > 
> >   - redistribute "source" archive, list in the manifest and save
> >     licensing files,
> > 
> >   - list in the manifest and save licensing files,
> > 
> >   - completely omit the package from legal-info.
> 
> Right, understood.
> 
> > As Luca explained, there are packages for which we should not
> > redistribute the "source" archive, but which we must list in the
> > manifest. Luca talked about imx-vpu, I was thinking about
> > nvidia-driver.
> 
> Seen the examples, it is more convincing now.
> 
> > The new possibility that I would want is to completely ignore the
> > package from the legal-info output, as there might be legal reasons that
> > the mere existence of that package should not be disclosed.
> 
> So, I understand the need. Now, I am wondering whether we should have
> one single variable with "special" values as Luca/you suggest, or two
> clearly separated boolean variables that control each aspects
> (distribute the source, include in legal-info). Example:
> 
> <pkg>_GENERATE_LEGAL_INFO = YES/NO
> <pkg>_REDISTRIBUTE_SOURCE = YES/NO
> 
> Of course, if <pkg>_GENERATE_LEGAL_INFO = NO, <pkg>_REDISTRIBUTE_SOURCE
> is ignored.
> 
> This is just a proposal, I'm totally open to better names for the
> variables.

I would prefer we keep a single variable. Especially since we can easily
keep backward compatibility.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 06/21 RFC] package/gcc: add licensing information
  2015-11-17 21:25       ` Thomas Petazzoni
@ 2015-11-17 21:40         ` Yann E. MORIN
  0 siblings, 0 replies; 46+ messages in thread
From: Yann E. MORIN @ 2015-11-17 21:40 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2015-11-17 22:25 +0100, Thomas Petazzoni spake thusly:
> On Tue, 17 Nov 2015 22:15:49 +0100, Yann E. MORIN wrote:
> > > As per your implementation, such license information will only be part
> > > of the "host packages" license information, while libgcc gets actually
> > > installed in the target. To be honest, I am not entirely sure how to
> > > handle this properly with our package infrastructure.
> > 
> > Yes, the current legalese will only apply to the host variant.
> > 
> > We could add a target gcc-final that defines the needed legal-info
> > stuff, but installs nothing (like I did so far with the host-gcc
> > package). But I don't like it much either.
> 
> It's not super nice indeed, but I don't really see a better option. We
> could always make this package actually do something "useful":
> installing the gcc libraries to the target. I.e essentially move the
> following part of host-gcc-final to this package:

Yes, I like that idea. Even if that makes the package a bit more
complex, it helps in separating the host/target/staging stuff (like what
we already discussed about hte extrenal toolchain, remember?).

[--SNIP--]
> This is really making the code more complicated just for the sake of
> legal-info, though. Which isn't super nice. But at least we would have
> the gcc libraries properly mentioned in the legal-info output for the
> target.

Yes, and that's a very good reason for doing it.

I'll send patches and we can discuss further with actual code.

Thanks! :-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 04/21 RFC] core/legal-info: allow ignoring packages from the legal-info
  2015-11-17 11:22   ` Thomas Petazzoni
  2015-11-17 17:35     ` Luca Ceresoli
@ 2015-11-17 21:43     ` Arnout Vandecappelle
  1 sibling, 0 replies; 46+ messages in thread
From: Arnout Vandecappelle @ 2015-11-17 21:43 UTC (permalink / raw)
  To: buildroot

On 17-11-15 12:22, Thomas Petazzoni wrote:
> Yann, Luca,
> 
> On Mon, 16 Nov 2015 23:46:59 +0100, Yann E. MORIN wrote:
>> It might be necessary to not even mention a package in the output of
>> legal-info:
>>
>>   - virtual package have virtually nothing to save in the legal-info
>>     output;
>>
>>   - for Buildroot itself, host-gcc-initial and host-gcc-final are not
>>     real packages, they are just two different steps of the same
>>     package, gcc;
>>
>>   - for proprietary packages, it might not even be legal to even mention
>>     them, being under NDA or some other such restrictive conditions.
>>
>> Add the new 'IGNORE' keyword to the _REDISTRIBUTE package variable, so
>> that the legal-info infra will simply completely ignore that package.
>>
>> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>> Cc: Luca Ceresoli <luca@lucaceresoli.net>
> 
> I understand the idea, but I'm not a big fan of a boolean variable that
> is no longer a boolean variable.
> 
> So, let me question the current handling of <pkg>_REDISTRIBUTE = NO.
> Does it make sense to mention such packages in the legal-info output,
> since their source code is not saved anyway?
> 
> Shouldn't we simply change the behavior of <pkg>_REDISTRIBUTE = NO to
> be that such packages are not listed at all in the legal-info output,
> which would match what you're looking for for with this "IGNORE" thing ?

 Well, at least the manifest and license text files are for the legal team, not
for the end users. And I really would like them to be informed about these crazy
proprietary licenses that basically state that you're not allowed to use the
software.

 Regards,
 Arnout

> 
> Luca, do you see any drawback in completely omitting REDISTRIBUTE = NO
> packages from legal-info ?
> 
> Thanks,
> 
> Thomas
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 04/21 RFC] core/legal-info: allow ignoring packages from the legal-info
  2015-11-16 22:46 ` [Buildroot] [PATCH 04/21 RFC] core/legal-info: allow ignoring packages from the legal-info Yann E. MORIN
  2015-11-17 11:22   ` Thomas Petazzoni
@ 2015-11-17 21:48   ` Arnout Vandecappelle
  1 sibling, 0 replies; 46+ messages in thread
From: Arnout Vandecappelle @ 2015-11-17 21:48 UTC (permalink / raw)
  To: buildroot

On 16-11-15 23:46, Yann E. MORIN wrote:
> It might be necessary to not even mention a package in the output of
> legal-info:
> 
>   - virtual package have virtually nothing to save in the legal-info
>     output;
> 
>   - for Buildroot itself, host-gcc-initial and host-gcc-final are not
>     real packages, they are just two different steps of the same
>     package, gcc;
> 
>   - for proprietary packages, it might not even be legal to even mention
>     them, being under NDA or some other such restrictive conditions.
> 
> Add the new 'IGNORE' keyword to the _REDISTRIBUTE package variable, so
> that the legal-info infra will simply completely ignore that package.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Luca Ceresoli <luca@lucaceresoli.net>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 But see below.

> ---
>  docs/manual/adding-packages-generic.txt | 7 +++++--
>  package/pkg-generic.mk                  | 8 +++++++-
>  2 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt
> index 1c25c4e..aec398b 100644
> --- a/docs/manual/adding-packages-generic.txt
> +++ b/docs/manual/adding-packages-generic.txt
> @@ -390,7 +390,8 @@ information is (assuming the package name is +libfoo+) :
>    See xref:legal-info[] for more information.
>    This variable is optional. If it is not defined, a warning will be produced
>    to let you know, and +not saved+ will appear in the +license files+ field
> -  of the manifest file for this package.
> +  of the manifest file for this package (unless +LIBFOO_REDISTRIBUTE+ is
> +  set to +IGNORE+, see below...)
>  
>  * +LIBFOO_ACTUAL_SOURCE_TARBALL+ only applies to packages whose
>    +LIBFOO_SITE+ / +LIBTOO_SOURCE+ pair points to an archive that does
> @@ -414,7 +415,9 @@ information is (assuming the package name is +libfoo+) :
>  * +LIBFOO_REDISTRIBUTE+ can be set to +YES+ (default) or +NO+ to indicate if
>    the package source code is allowed to be redistributed. Set it to +NO+ for
>    non-opensource packages: Buildroot will not save the source code for this
> -  package when collecting the +legal-info+.
> +  package when collecting the +legal-info+. Alternatively, you may set it to
> +  +IGNORE+ so that Buildroot does not even mention that package in the
> +  +legal-info+ output.

 Perhaps add:

This is done automatically for virtual packages.

 Regards,
 Arnout

>  
>  * +LIBFOO_FLAT_STACKSIZE+ defines the stack size of an application built into
>    the FLAT binary format. The application stack size on the NOMMU architecture
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 08f4f31..91c8fea 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -739,10 +739,12 @@ $(2)_MANIFEST_LICENSE_FILES ?= not saved
>  
>  # If the package declares _LICENSE_FILES, we need to extract it,
>  # for overriden, local or normal remote packages alike, whether
> -# we want to redistribute it or not.
> +# we want to redistribute it or not, but not if we want to ignore it.
> +ifneq ($$($(2)_REDISTRIBUTE),IGNORE)
>  ifneq ($$($(2)_LICENSE_FILES),)
>  $(1)-legal-info: $(1)-patch
>  endif
> +endif
>  
>  # We only save the sources of packages we want to redistribute, that are
>  # non-local, and non-overriden. So only store, in the manifest, the tarball
> @@ -766,6 +768,8 @@ $(2)_ACTUAL_SOURCE_SITE    ?= $$(call qstrip,$$($(2)_SITE))
>  
>  # legal-info: produce legally relevant info.
>  $(1)-legal-info:
> +ifneq ($$($(2)_REDISTRIBUTE),IGNORE)
> +
>  # Packages without a source are assumed to be part of Buildroot, skip them.
>  	$$(foreach hook,$$($(2)_PRE_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep))
>  ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
> @@ -807,6 +811,8 @@ endif # other packages
>  endif # ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
>  	$$(foreach hook,$$($(2)_POST_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep))
>  
> +endif # REDISTRIBUTE == IGNORE
> +
>  # add package to the general list of targets if requested by the buildroot
>  # configuration
>  ifeq ($$($$($(2)_KCONFIG_VAR)),y)
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Buildroot] [PATCH 15/21 RFC] core/pkg-generic: add macro to hardlink-or-copy
  2015-11-16 22:47 ` [Buildroot] [PATCH 15/21 RFC] core/pkg-generic: add macro to hardlink-or-copy Yann E. MORIN
@ 2015-11-18 15:40   ` Luca Ceresoli
  0 siblings, 0 replies; 46+ messages in thread
From: Luca Ceresoli @ 2015-11-18 15:40 UTC (permalink / raw)
  To: buildroot

Dear Yann,

Yann E. MORIN wrote:
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Luca Ceresoli <luca@lucaceresoli.net>
> ---
>   package/pkg-generic.mk | 18 ++++++++++++++++++
>   1 file changed, 18 insertions(+)
>
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 544ae5c..82fbeb0 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -305,6 +305,24 @@ endif
>   endef
>
>   ################################################################################
> +# hardlink-copy -- hardlink source and destination if possible, otherwise
> +# do a simple copy
> +#
> +# argument 1 is the source
> +# argument 2 is the destination *directory*
> +#
> +# example:
> +#   $(call hard-link-copy,source,destination)
> +#
> +# Note: we make that a single command, so se can:
> +#  - use '$(Q)' in front of it and properly silence the whole macro,
> +#  - use '|| exit 1' after it, so we can exit on error in compound commands.
> +################################################################################
> +define hardlink-copy
> +	{ mkdir -p $(2) && { cp -l $(1) $(2) 2>/dev/null || cp $(1) $(2); } }
> +endef
> +

Good idea! But wouldn't it fit better in pkg-utils.mk? Indeed it's very
generic.

-- 
Luca

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2015-11-18 15:40 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-16 22:47 [Buildroot] [PATCH 0/21 RFC] core/legal-info: fixes, completness and enhancements (branch yem/legal-patch) Yann E. MORIN
2015-11-16 22:46 ` [Buildroot] [PATCH 01/21 RFC] package/libecore: do not build anything at patch time Yann E. MORIN
2015-11-17 11:16   ` Thomas Petazzoni
2015-11-17 12:20     ` Romain Naour
2015-11-17 20:16       ` Romain Naour
2015-11-17 16:03   ` Peter Korsgaard
2015-11-16 22:46 ` [Buildroot] [PATCH 02/21 RFC] core/legal-info: fix missing double-$ Yann E. MORIN
2015-11-17 11:19   ` Thomas Petazzoni
2015-11-17 16:03   ` Peter Korsgaard
2015-11-16 22:46 ` [Buildroot] [PATCH 03/21 RFC] package/linux-headers: add licensing information Yann E. MORIN
2015-11-17 11:19   ` Thomas Petazzoni
2015-11-17 16:04   ` Peter Korsgaard
2015-11-16 22:46 ` [Buildroot] [PATCH 04/21 RFC] core/legal-info: allow ignoring packages from the legal-info Yann E. MORIN
2015-11-17 11:22   ` Thomas Petazzoni
2015-11-17 17:35     ` Luca Ceresoli
2015-11-17 19:28       ` Yann E. MORIN
2015-11-17 20:14         ` Thomas Petazzoni
2015-11-17 21:26           ` Yann E. MORIN
2015-11-17 21:43     ` Arnout Vandecappelle
2015-11-17 21:48   ` Arnout Vandecappelle
2015-11-16 22:47 ` [Buildroot] [PATCH 05/21 RFC] core/pkg-virtual: ignore from legal-info output Yann E. MORIN
2015-11-17 11:25   ` Thomas Petazzoni
2015-11-17 19:35     ` Yann E. MORIN
2015-11-16 22:47 ` [Buildroot] [PATCH 06/21 RFC] package/gcc: add licensing information Yann E. MORIN
2015-11-17 11:28   ` Thomas Petazzoni
2015-11-17 21:15     ` Yann E. MORIN
2015-11-17 21:25       ` Thomas Petazzoni
2015-11-17 21:40         ` Yann E. MORIN
2015-11-16 22:47 ` [Buildroot] [PATCH 07/21 RFC] package/gcc: handle " Yann E. MORIN
2015-11-17 11:31   ` Thomas Petazzoni
2015-11-17 21:20     ` Yann E. MORIN
2015-11-16 22:47 ` [Buildroot] [PATCH 08/21 RFC] package/gcc: add a patch for arc rather than using sed Yann E. MORIN
2015-11-16 22:47 ` [Buildroot] [PATCH 09/21 RFC] package/gcc: properly extract and patch sources Yann E. MORIN
2015-11-16 22:47 ` [Buildroot] [PATCH 10/21 RFC] package/gcc: make host-gcc a pure host package Yann E. MORIN
2015-11-16 22:47 ` [Buildroot] [PATCH 11/21 RFC] package/gcc: make -initial and -final use sources from host-gcc Yann E. MORIN
2015-11-16 22:47 ` [Buildroot] [PATCH 12/21 RFC] package/gcc: include the extensa overlay in the legal-info output Yann E. MORIN
2015-11-16 22:47 ` [Buildroot] [PATCH 13/21 RFC] package/perl: include perl-cross " Yann E. MORIN
2015-11-16 22:47 ` [Buildroot] [PATCH 14/21 RFC] core: add a global variable with already-unquoted global patch dir Yann E. MORIN
2015-11-16 22:47 ` [Buildroot] [PATCH 15/21 RFC] core/pkg-generic: add macro to hardlink-or-copy Yann E. MORIN
2015-11-18 15:40   ` Luca Ceresoli
2015-11-16 22:47 ` [Buildroot] [PATCH 16/21 RFC] core/legal-info: use the macro to install source archives Yann E. MORIN
2015-11-16 22:47 ` [Buildroot] [PATCH 17/21 RFC] core/legal-info: install source archives in their own sub-dir Yann E. MORIN
2015-11-16 22:47 ` [Buildroot] [PATCH 18/21 RFC] core/legal-info: add package version to license directory Yann E. MORIN
2015-11-16 22:47 ` [Buildroot] [PATCH 19/21 RFC] core/apply-patches: store full path of applied patches Yann E. MORIN
2015-11-16 22:47 ` [Buildroot] [PATCH 20/21 RFC] core/legal-info: also save patches Yann E. MORIN
2015-11-16 22:47 ` [Buildroot] [PATCH 21/21 RFC] core/pkg-infra: ensure legal-info works in off-line mode Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.