Skip to contentSkip to conversation

Add Chromium Embedded Framework library

RFC PATCH New Michael Drake 7 participants 52 messages Oct 17, 2019 – Nov 21, 2019

lore
Share & tools
lore
#0 lore raw

v2 cover Add Chromium Embedded Framework library

Hi all,

Here's a work in progress second attempt at adding libcef to Buildroot.

We're still working on:

- Testing integration with dependant packages.
- Cross compiling.

We'd appreciate any feedback!

Many thanks,

Michael

Joseph Kogut (2):
llvm: add config to build backend for host arch
lld: new package

Matt Weber (4):
package/llvm: install target binary/debug tools package/llvm/clang: note about version bumping dep package/llvm: disable libxml2 package/compiler-rt: new package

Michael Drake (20):
package/libkrb5: Add host tools package. package/libpangox: new package
package/libgtkglext: new package
package/webp: Enable host package build. package/libcef: New package
package/libcef: Add option to enable VA-API HW acceleration. package/libcef: Add proprietary codecs build option. package/widevine: Add package for the widevine CDM library. package/libcef: Widevine support depends on widevine package. package/alsa-lib/alsa-lib: Add host package. package/ffmpeg: Add host package.
package/libvpx: Add host package. package/x11r7/xcb-util: Add host package. package/x11r7/xlib_libXScrnSaver: Add host package. package/x11r7/xlib_libXcomposite: Add host package. package/x11r7/xlib_libXext: Add host package. package/x11r7/xlib_libXi: Add host package. package/x11r7/xlib_libXrandr: Add host package. package/x11r7/xlib_libXtst: Add host package. package/libcef: Add v8 Snapshot option.

Thomas Preston (4):
pkgconf: Split pkgconf command into multi-line
pkgconf: Add pkgconf system lib and include path
jpeg-turbo: Add host install
package/libcef: Add option to build cefclient and cefsimple.

 DEVELOPERS                                    |    2 +
 package/Config.in                             |    5 +
 package/Config.in.host                        |    2 +
 package/alsa-lib/alsa-lib.mk                  |    1 +
 package/clang/clang.mk                        |    1 +
 package/compiler-rt/Config.in                 |   14 +
 package/compiler-rt/compiler-rt.hash          |    2 +
 package/compiler-rt/compiler-rt.mk            |   36 +
 package/ffmpeg/ffmpeg.mk                      |   61 +
 package/jpeg-turbo/jpeg-turbo.mk              |    1 +
 .../0001-fix-one-euro-filter-build.patch      |   33 +
 .../0002-link-against-harfbuzz-subset.patch   |   50 +
 package/libcef/Config.in                      |  127 ++
 package/libcef/libcef.license-files.inc       | 1130 +++++++++++++++++
 package/libcef/libcef.mk                      |  442 +++++++
 .../libcef/scripts/gather-license-files.sh    |   53 +
 package/libcef/scripts/version.sh             |   48 +
 package/libcef/templates/cef_version.h        |   70 +
 package/libcef/toolchain/BUILD.gn             |   70 +
 package/libgtkglext/Config.in                 |   18 +
 package/libgtkglext/libgtkglext.mk            |   29 +
 package/libkrb5/libkrb5.mk                    |    1 +
 package/libpangox/Config.in                   |   14 +
 package/libpangox/libpangox.mk                |   12 +
 package/libvpx/libvpx.mk                      |   29 +
 package/lld/Config.in.host                    |   16 +
 package/lld/lld.hash                          |    2 +
 package/lld/lld.mk                            |   15 +
 package/llvm/Config.in.host                   |   18 +
 package/llvm/llvm.mk                          |   26 +-
 package/pkgconf/pkg-config.in                 |    9 +-
 package/webp/webp.mk                          |    5 +
 package/widevine/Config.in                    |    6 +
 package/widevine/widevine.mk                  |   28 +
 package/x11r7/xcb-util/xcb-util.mk            |    2 +
 .../xlib_libXScrnSaver/xlib_libXScrnSaver.mk  |    2 +
 .../xlib_libXcomposite/xlib_libXcomposite.mk  |    2 +
 package/x11r7/xlib_libXext/xlib_libXext.mk    |    2 +
 package/x11r7/xlib_libXi/xlib_libXi.mk        |    7 +
 .../x11r7/xlib_libXrandr/xlib_libXrandr.mk    |    2 +
 package/x11r7/xlib_libXtst/xlib_libXtst.mk    |    7 +
 41 files changed, 2397 insertions(+), 3 deletions(-)
 create mode 100644 package/compiler-rt/Config.in
 create mode 100644 package/compiler-rt/compiler-rt.hash
 create mode 100644 package/compiler-rt/compiler-rt.mk
 create mode 100644 package/libcef/0001-fix-one-euro-filter-build.patch
 create mode 100644 package/libcef/0002-link-against-harfbuzz-subset.patch
 create mode 100644 package/libcef/Config.in
 create mode 100644 package/libcef/libcef.license-files.inc
 create mode 100644 package/libcef/libcef.mk
 create mode 100755 package/libcef/scripts/gather-license-files.sh
 create mode 100755 package/libcef/scripts/version.sh
 create mode 100644 package/libcef/templates/cef_version.h
 create mode 100644 package/libcef/toolchain/BUILD.gn
 create mode 100644 package/libgtkglext/Config.in
 create mode 100644 package/libgtkglext/libgtkglext.mk
 create mode 100644 package/libpangox/Config.in
 create mode 100644 package/libpangox/libpangox.mk
 create mode 100644 package/lld/Config.in.host
 create mode 100644 package/lld/lld.hash
 create mode 100644 package/lld/lld.mk
 create mode 100644 package/llvm/Config.in.host
 create mode 100644 package/widevine/Config.in
 create mode 100644 package/widevine/widevine.mk
Signature · 1 line
2.20.1
#1 lore raw

RFC PATCH v2 1/30 pkgconf: Split pkgconf command into multi-line

From: Thomas Preston <[email protected]>

The pkgconf command is a long and confusing line, which is about to get longer. Split it up into logical stages so that it is easier to visualise changes.

---
 package/pkgconf/pkg-config.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
package/pkgconf/pkg-config.in +4 -1
index 99c0add8fb..8795f64b68 100644
@@ -2,4 +2,7 @@
 PKGCONFDIR=$(dirname $0)
 DEFAULT_PKG_CONFIG_LIBDIR=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/lib/pkgconfig:${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/share/pkgconfig
 DEFAULT_PKG_CONFIG_SYSROOT_DIR=${PKGCONFDIR}/../@STAGING_SUBDIR@
-PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-${DEFAULT_PKG_CONFIG_LIBDIR}} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-${DEFAULT_PKG_CONFIG_SYSROOT_DIR}} exec ${PKGCONFDIR}/pkgconf @STATIC@ "$@"
+
+PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-${DEFAULT_PKG_CONFIG_LIBDIR}} \
+	PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-${DEFAULT_PKG_CONFIG_SYSROOT_DIR}} \
+	exec ${PKGCONFDIR}/pkgconf @STATIC@ "$@"
Signature · 1 line
2.20.1
#2 lore raw

RFC PATCH v2 2/30 pkgconf: Add pkgconf system lib and include path

In reply to Michael Drake

From: Thomas Preston <[email protected]>

Buildroot does not reconfigure pkgconf system library and system include dirs to STAGING_DIR. This means that pkgconf prints the sysroot system library and system include dirs instead of letting the compiler handle the logical sysroot. This breaks the -isystem compiler flag, as it increases the priority of the system library and system include directories. For example:

	$ output/host/bin/pkg-config --cflags glib-2.0
	-Ioutput/host/bin/../x86_64-buildroot-linux-gnu/sysroot/usr/include/glib-2.0
	-Ioutput/host/bin/../x86_64-buildroot-linux-gnu/sysroot/usr/lib/glib-2.0/include
	-Ioutput/host/bin/../x86_64-buildroot-linux-gnu/sysroot/usr/include

A header in .../sysroot/usr/include will be included before a header in any directory specified with -isystem flags. Specifically, this breaks the Chromium build system, which expects a C++ math.h in a bundled LLVM C++ library, and gets a GNU C math.h instead.

Fix this by telling pkgconf about the sysroot's system library and system include directories, so that it doesn't accidentally print them.

---
 package/pkgconf/pkg-config.in | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
package/pkgconf/pkg-config.in +5 -1
index 8795f64b68..894069c492 100644
@@ -1,8 +1,12 @@
 #!/bin/sh
 PKGCONFDIR=$(dirname $0)
+DEFAULT_PKG_CONFIG_SYSTEM_LIBRARY_PATH=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/lib
+DEFAULT_PKG_CONFIG_SYSTEM_INCLUDE_PATH=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/include
 DEFAULT_PKG_CONFIG_LIBDIR=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/lib/pkgconfig:${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/share/pkgconfig
 DEFAULT_PKG_CONFIG_SYSROOT_DIR=${PKGCONFDIR}/../@STAGING_SUBDIR@
 
-PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-${DEFAULT_PKG_CONFIG_LIBDIR}} \
+PKG_CONFIG_SYSTEM_LIBRARY_PATH=${PKG_CONFIG_SYSTEM_LIBRARY_PATH:-${DEFAULT_PKG_CONFIG_SYSTEM_LIBRARY_PATH}} \
+	PKG_CONFIG_SYSTEM_INCLUDE_PATH=${PKG_CONFIG_SYSTEM_INCLUDE_PATH:-${DEFAULT_PKG_CONFIG_SYSTEM_INCLUDE_PATH}} \
+	PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-${DEFAULT_PKG_CONFIG_LIBDIR}} \
 	PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-${DEFAULT_PKG_CONFIG_SYSROOT_DIR}} \
 	exec ${PKGCONFDIR}/pkgconf @STATIC@ "$@"
Signature · 1 line
2.20.1
#3 lore raw

RFC PATCH v2 3/30 package/libkrb5: Add host tools package.

In reply to Michael Drake
---
 package/libkrb5/libkrb5.mk | 1 +
 1 file changed, 1 insertion(+)
package/libkrb5/libkrb5.mk +1 -0
index 56345416aa..43b15f0c13 100644
@@ -58,3 +58,4 @@ LIBKRB5_CONF_OPTS += --disable-thread-support
 endif
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.20.1
#4 lore raw

RFC PATCH v2 4/30 jpeg-turbo: Add host install

In reply to Michael Drake

From: Thomas Preston <[email protected]>

---
 package/jpeg-turbo/jpeg-turbo.mk | 1 +
 1 file changed, 1 insertion(+)
package/jpeg-turbo/jpeg-turbo.mk +1 -0
index 3735132b2e..aafcc6c222 100644
@@ -38,3 +38,4 @@ endef
 JPEG_TURBO_POST_INSTALL_TARGET_HOOKS += JPEG_TURBO_REMOVE_USELESS_TOOLS
 
 $(eval $(cmake-package))
+$(eval $(host-cmake-package))
Signature · 1 line
2.20.1
#5 lore raw

RFC PATCH v2 5/30 llvm: add config to build backend for host arch

In reply to Michael Drake

From: Joseph Kogut <[email protected]>

---
 package/Config.in.host      |  1 +
 package/llvm/Config.in.host | 18 ++++++++++++++++++
 package/llvm/llvm.mk        |  9 ++++++++-
 3 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 package/llvm/Config.in.host
package/Config.in.host +1 -0
index 1501889b72..3122f5abca 100644
@@ -34,6 +34,7 @@ menu "Host utilities"
 	source "package/jq/Config.in.host"
 	source "package/jsmin/Config.in.host"
 	source "package/libp11/Config.in.host"
+	source "package/llvm/Config.in.host"
 	source "package/lpc3250loader/Config.in.host"
 	source "package/lttng-babeltrace/Config.in.host"
 	source "package/mender-artifact/Config.in.host"
package/llvm/Config.in.host new file +18 -0
new file mode 100644
index 0000000000..4d73fb8c75
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_HOST_LLVM
+	bool "host llvm"
+	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
+	depends on BR2_HOST_GCC_AT_LEAST_4_8
+	help
+	  The LLVM Project is a collection of modular and reusable
+	  compiler and toolchain technologies.
+
+	  http://llvm.org
+
+config BR2_PACKAGE_HOST_LLVM_HOST_ARCH
+	string
+	default "AArch64" if BR2_HOSTARCH="aarch64"
+	default "X86" if BR2_HOSTARCH = "x86" || BR2_HOSTARCH = "x86_64"
+	default "ARM" if BR2_HOSTARCH = "arm"
+
+config BR2_PACKAGE_HOST_LLVM_ENABLE_HOST_ARCH
+	bool
package/llvm/llvm.mk +8 -1
index 3c62285188..5c413064c0 100644
@@ -41,8 +41,9 @@ HOST_LLVM_CONF_OPTS += -DCMAKE_INSTALL_RPATH="$(HOST_DIR)/lib"
 LLVM_TARGET_ARCH = $(call qstrip,$(BR2_PACKAGE_LLVM_TARGET_ARCH))
 
 # Build backend for target architecture. This include backends like AMDGPU.
+HOST_LLVM_TARGETS_TO_BUILD = $(LLVM_TARGET_ARCH)
 LLVM_TARGETS_TO_BUILD = $(LLVM_TARGET_ARCH)
-HOST_LLVM_CONF_OPTS += -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(LLVM_TARGETS_TO_BUILD))"
+HOST_LLVM_CONF_OPTS += -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(HOST_LLVM_TARGETS_TO_BUILD))"
 LLVM_CONF_OPTS += -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(LLVM_TARGETS_TO_BUILD))"
 
 # LLVM target to use for native code generation. This is required for JIT generation.
@@ -58,9 +59,15 @@ LLVM_CONF_OPTS += -DLLVM_TARGET_ARCH=$(LLVM_TARGET_ARCH)
 # output only $(LLVM_TARGET_ARCH) if not, and mesa3d won't build as
 # it thinks AMDGPU backend is not installed on the target.
 ifeq ($(BR2_PACKAGE_LLVM_AMDGPU),y)
+HOST_LLVM_TARGETS_TO_BUILD += AMDGPU
 LLVM_TARGETS_TO_BUILD += AMDGPU
 endif
 
+# Build backend for host architecture
+ifeq ($(BR2_PACKAGE_HOST_LLVM_ENABLE_HOST_ARCH),y)
+HOST_LLVM_TARGETS_TO_BUILD += $(call qstrip,$(BR2_PACKAGE_HOST_LLVM_HOST_ARCH))
+endif
+
 # Use native llvm-tblgen from host-llvm (needed for cross-compilation)
 LLVM_CONF_OPTS += -DLLVM_TABLEGEN=$(HOST_DIR)/bin/llvm-tblgen
 
Signature · 1 line
2.20.1
#6 lore raw

RFC PATCH v2 5/30 llvm: add config to build backend for host arch

Quoted 1 line · Michael Drake

From: Joseph Kogut <[email protected]>

We need a bit more explanation why this option is useful/needed.

Quoted 28 lines
---
 package/Config.in.host      |  1 +
 package/llvm/Config.in.host | 18 ++++++++++++++++++
 package/llvm/llvm.mk        |  9 ++++++++-
 3 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 package/llvm/Config.in.host
package/Config.in.host +1 -0
index 1501889b72..3122f5abca 100644
@@ -34,6 +34,7 @@ menu "Host utilities"
 	source "package/jq/Config.in.host"
 	source "package/jsmin/Config.in.host"
 	source "package/libp11/Config.in.host"
+	source "package/llvm/Config.in.host"
 	source "package/lpc3250loader/Config.in.host"
 	source "package/lttng-babeltrace/Config.in.host"
 	source "package/mender-artifact/Config.in.host"
package/llvm/Config.in.host new file +0 -0
new file mode 100644
index 0000000000..4d73fb8c75

package/llvm/Config.in.host line 3

Quoted 3 lines
package/llvm/Config.in.host new file +3 -0
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_HOST_LLVM
+	bool "host llvm"
+	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS

Why does host llvm depend on target architecture? Yes, if you want to use it to
build something for the target, obviously that is needed. But you might just as well need host-llvm for building some host tool, so I don't think this depends is appropriate here.

You do need a condition that the host arch is supported. That can be as simple as

	depends on BR2_PACKAGE_HOST_LLVM_HOST_ARCH != ""
Quoted 5 lines
package/llvm/Config.in.host new file +5 -0
+	depends on BR2_HOST_GCC_AT_LEAST_4_8
+	help
+	  The LLVM Project is a collection of modular and reusable
+	  compiler and toolchain technologies.
+

package/llvm/Config.in.host line 18

Quoted 10 lines
package/llvm/Config.in.host new file +10 -0
+	  http://llvm.org
+
+config BR2_PACKAGE_HOST_LLVM_HOST_ARCH
+	string
+	default "AArch64" if BR2_HOSTARCH="aarch64"
+	default "X86" if BR2_HOSTARCH = "x86" || BR2_HOSTARCH = "x86_64"
+	default "ARM" if BR2_HOSTARCH = "arm"
+
+config BR2_PACKAGE_HOST_LLVM_ENABLE_HOST_ARCH
+	bool

Is it worth making a symbol for this? It would make more sense to always enable
it IMO.

package/llvm/llvm.mk HOST_LLVM_CONF_OPTS += -DCMAKE_INSTALL_RPATH="$(HOST_DIR)/lib" · line 44

Quoted 9 lines
package/llvm/llvm.mk +1 -0
index 3c62285188..5c413064c0 100644
@@ -41,8 +41,9 @@ HOST_LLVM_CONF_OPTS += -DCMAKE_INSTALL_RPATH="$(HOST_DIR)/lib"
 LLVM_TARGET_ARCH = $(call qstrip,$(BR2_PACKAGE_LLVM_TARGET_ARCH))
 
 # Build backend for target architecture. This include backends like AMDGPU.
+HOST_LLVM_TARGETS_TO_BUILD = $(LLVM_TARGET_ARCH)

Okay, *this* shows that you need the arch dependency. Still, I think it's more
appropriate to add that dependency here, i.e. only add the target architecture if it is supported.

Also, this assignment should move down to where the host architecture is set.

package/llvm/llvm.mk HOST_LLVM_CONF_OPTS += -DCMAKE_INSTALL_RPATH="$(HOST_DIR)/lib" · line 46

Quoted 3 lines
package/llvm/llvm.mk +1 -1
 LLVM_TARGETS_TO_BUILD = $(LLVM_TARGET_ARCH)
-HOST_LLVM_CONF_OPTS += -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(LLVM_TARGETS_TO_BUILD))"
+HOST_LLVM_CONF_OPTS += -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(HOST_LLVM_TARGETS_TO_BUILD))"

Ah, now I see, there was already a host-llvm that would build for the target...

I think the appropriate thing to do is a whole lot simpler:

HOST_LLVM_TARGETS_TO_BUILD = \
	$(LLVM_TARGETS_TO_BUILD) \
	$(call qstrip,$(BR2_PACKAGE_HOST_LLVM_HOST_ARCH))

No Config.in option needed as far as I'm concerned... Unless it makes a
significant difference in build time, but I doubt that.

Note that the above doesn't even need to take into account a non-supported host
arch, because in that case BR2_PACKAGE_HOST_LLVM_HOST_ARCH will be empty so nothing is added.

Regards,
Arnout

Quoted 20 lines
package/llvm/llvm.mk +6 -0
 LLVM_CONF_OPTS += -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(LLVM_TARGETS_TO_BUILD))"
 
 # LLVM target to use for native code generation. This is required for JIT generation.
@@ -58,9 +59,15 @@ LLVM_CONF_OPTS += -DLLVM_TARGET_ARCH=$(LLVM_TARGET_ARCH)
 # output only $(LLVM_TARGET_ARCH) if not, and mesa3d won't build as
 # it thinks AMDGPU backend is not installed on the target.
 ifeq ($(BR2_PACKAGE_LLVM_AMDGPU),y)
+HOST_LLVM_TARGETS_TO_BUILD += AMDGPU
 LLVM_TARGETS_TO_BUILD += AMDGPU
 endif
 
+# Build backend for host architecture
+ifeq ($(BR2_PACKAGE_HOST_LLVM_ENABLE_HOST_ARCH),y)
+HOST_LLVM_TARGETS_TO_BUILD += $(call qstrip,$(BR2_PACKAGE_HOST_LLVM_HOST_ARCH))
+endif
+
 # Use native llvm-tblgen from host-llvm (needed for cross-compilation)
 LLVM_CONF_OPTS += -DLLVM_TABLEGEN=$(HOST_DIR)/bin/llvm-tblgen
 
#7 lore raw

RFC PATCH v2 5/30 llvm: add config to build backend for host arch

Quoted 9 lines · Arnout Vandecappelle
Quoted 1 line · Michael Drake

From: Joseph Kogut <[email protected]>

We need a bit more explanation why this option is useful/needed.

Quoted 3 lines

I think I should clarify my review a little...

I think this should be split into two patches, where I doubt the second one is
relevant:

1. Add the host arch as a target for the host-llvm build. I think this can be done unconditionally, which makes the patch a whole lot simpler.

2. Add a Config.in.host option for llvm. This is only useful if you want to use host-llvm outside of Buildroot, in a post-build/image script. I don't think this is the case.

If the patch is reduced to the first bit, then I think the
BR2_PACKAGE_HOST_LLVM_HOST_ARCH symbol (the only bit remaining in Config.in.host) should move to Config.in. And the change to the .mk file becomes very simple, as I indicated.

Regards,
Arnout

#8 lore raw

RFC PATCH v2 5/30 llvm: add config to build backend for host arch

+Romain Naour, as we discussed this on the #buildroot channel yesterday.

Hi all,

Quoted 17 lines · Arnout Vandecappelle
Quoted 7 lines · Arnout Vandecappelle
Quoted 1 line · Michael Drake

From: Joseph Kogut <[email protected]>

We need a bit more explanation why this option is useful/needed.

Quoted 3 lines

I think I should clarify my review a little...

I think this should be split into two patches, where I doubt the second one is
relevant:

1. Add the host arch as a target for the host-llvm build. I think this can be done unconditionally, which makes the patch a whole lot simpler.

Quoted 9 lines

2. Add a Config.in.host option for llvm. This is only useful if you want to use host-llvm outside of Buildroot, in a post-build/image script. I don't think this is the case.

If the patch is reduced to the first bit, then I think the
BR2_PACKAGE_HOST_LLVM_HOST_ARCH symbol (the only bit remaining in Config.in.host) should move to Config.in. And the change to the .mk file becomes very simple, as I indicated.

We agree that the above changes simplify this patch, and have rolled them in. Thanks!

We had an issue yesterday where this didn't actually allow LLVM to build for the host architecture, but rebuilding all of the LLVM packages fixed that:

host-llvm, host-clang, host-lld

We also have to explicitly use lld, as clang tries to use the arm-buildroot-linux-gnueabihf-ld linker. We noticed this is turned off in llvm.mk:

    HOST_LLVM_CONF_OPTS += -DLLVM_ENABLE_LLD=OFF

Is there still a reason for this now that host-lld exists?

Many thanks,
Thomas

P.s. Here is some working output:

$ codethink/docker-run.sh ./output/host/bin/llc --version

LLVM (http://llvm.org/):
LLVM version 9.0.0
Optimized build.
Default target: arm-buildroot-linux-gnueabihf
Host CPU: znver1

Registered Targets:

    arm     - ARM
    armeb   - ARM (big endian)
    thumb   - Thumb

thumbeb - Thumb (big endian)
x86 - 32-bit X86: Pentium-Pro and above
x86-64 - 64-bit X86: EM64T and AMD64

$ ./codethink/docker-run.sh output/host/bin/clang -target x86_64-linux-gnu -fuse-ld=/mnt/output/host/bin/ld.lld -o hello hello.c
$ ./hello
Hello, world
#9 lore raw

RFC PATCH v2 5/30 llvm: add config to build backend for host arch

Hi Thomas,

Le 05/11/2019 ? 13:02, Thomas Preston a ?crit?:

Quoted 39 lines

+Romain Naour, as we discussed this on the #buildroot channel yesterday.

Hi all,

Quoted 17 lines · Arnout Vandecappelle
Quoted 7 lines · Arnout Vandecappelle
Quoted 1 line · Michael Drake

From: Joseph Kogut <[email protected]>

We need a bit more explanation why this option is useful/needed.

Quoted 3 lines

I think I should clarify my review a little...

I think this should be split into two patches, where I doubt the second one is
relevant:

1. Add the host arch as a target for the host-llvm build. I think this can be done unconditionally, which makes the patch a whole lot simpler.

Quoted 9 lines

2. Add a Config.in.host option for llvm. This is only useful if you want to use host-llvm outside of Buildroot, in a post-build/image script. I don't think this is the case.

If the patch is reduced to the first bit, then I think the
BR2_PACKAGE_HOST_LLVM_HOST_ARCH symbol (the only bit remaining in Config.in.host) should move to Config.in. And the change to the .mk file becomes very simple, as I indicated.

We agree that the above changes simplify this patch, and have rolled them in. Thanks!

We had an issue yesterday where this didn't actually allow LLVM to build for the host architecture, but rebuilding all of the LLVM packages fixed that:

host-llvm, host-clang, host-lld

Quoted 7 lines

We also have to explicitly use lld, as clang tries to use the arm-buildroot-linux-gnueabihf-ld linker. We noticed this is turned off in llvm.mk:

    HOST_LLVM_CONF_OPTS += -DLLVM_ENABLE_LLD=OFF

Is there still a reason for this now that host-lld exists?

For now, lld is not yet used as C and C++ linker. Only the host-lld package was added but we need to check/modify the infrastructure to be sure to use ldd instead of the GNU ld.

Quoted 15 lines

Many thanks,
Thomas

P.s. Here is some working output:

$ codethink/docker-run.sh ./output/host/bin/llc --version

LLVM (http://llvm.org/):
LLVM version 9.0.0
Optimized build.
Default target: arm-buildroot-linux-gnueabihf
Host CPU: znver1

Registered Targets:

Quoted 8 lines
    arm     - ARM
    armeb   - ARM (big endian)
    thumb   - Thumb

thumbeb - Thumb (big endian)
x86 - 32-bit X86: Pentium-Pro and above
x86-64 - 64-bit X86: EM64T and AMD64

$ ./codethink/docker-run.sh output/host/bin/clang -target x86_64-linux-gnu -fuse-ld=/mnt/output/host/bin/ld.lld -o hello hello.c

Indeed, you need to provide the -target flag to clang in order to compile for the host machine. By default clang build for the target.

Quoted 3 lines
$ ./hello
Hello, world

Nice!

Best regards,
Romain

Quoted 7 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#10 lore raw

RFC PATCH v2 6/30 lld: new package

In reply to Michael Drake

From: Joseph Kogut <[email protected]>

---
 DEVELOPERS                 |  1 +
 package/Config.in.host     |  1 +
 package/lld/Config.in.host | 16 ++++++++++++++++
 package/lld/lld.hash       |  2 ++
 package/lld/lld.mk         | 15 +++++++++++++++
 5 files changed, 35 insertions(+)
 create mode 100644 package/lld/Config.in.host
 create mode 100644 package/lld/lld.hash
 create mode 100644 package/lld/lld.mk
DEVELOPERS +1 -0
index 4ab4e36593..bdc98edd12 100644
@@ -1221,6 +1221,7 @@ F:	package/at-spi2-core/
 F:	package/clang/
 F:	package/gconf/
 F:	package/libnss/
+F:	package/lld/
 F:	package/llvm/
 F:	package/python-cython/
 F:	package/python-raven/
package/Config.in.host +1 -0
index 3122f5abca..18074ae1a7 100644
@@ -34,6 +34,7 @@ menu "Host utilities"
 	source "package/jq/Config.in.host"
 	source "package/jsmin/Config.in.host"
 	source "package/libp11/Config.in.host"
+	source "package/lld/Config.in.host"
 	source "package/llvm/Config.in.host"
 	source "package/lpc3250loader/Config.in.host"
 	source "package/lttng-babeltrace/Config.in.host"
package/lld/Config.in.host new file +16 -0
new file mode 100644
index 0000000000..c04b7924fa
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_HOST_LLD
+	bool "host lld"
+	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # llvm
+	depends on BR2_HOST_GCC_AT_LEAST_4_8 # llvm
+	select BR2_PACKAGE_HOST_LLVM
+	help
+	  LLD is a linker from the LLVM project that is a drop-in
+	  replacement for system linkers, and runs much faster than
+	  them. It also provides features that are useful for
+	  toolchain developers.
+
+	  https://lld.llvm.org/
+
+comment "lld needs a toolchain w/ host gcc >= 4.8"
+	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
+	depends on !BR2_HOST_GCC_AT_LEAST_4_8
package/lld/lld.hash new file +2 -0
new file mode 100644
index 0000000000..ebec212041
@@ -0,0 +1,2 @@
+sha256 9caec8ec922e32ffa130f0fb08e4c5a242d7e68ce757631e425e9eba2e1a6e37  lld-8.0.0.src.tar.xz
+sha256 a6c2a7ad246b567fd1828561ee8c244e35f73f164f031c82a7f28eff9634d23d  LICENSE.TXT
package/lld/lld.mk new file +15 -0
new file mode 100644
index 0000000000..6c3b10a667
@@ -0,0 +1,15 @@
+################################################################################
+#
+# lld
+#
+################################################################################
+
+LLD_VERSION = 8.0.0
+LLD_SITE = https://llvm.org/releases/$(LLD_VERSION)
+LLD_SOURCE = lld-$(LLD_VERSION).src.tar.xz
+LLD_LICENSE = NCSA
+LLD_LICENSE_FILES = LICENSE.TXT
+LLD_SUPPORTS_IN_SOURCE_BUILD = NO
+HOST_LLD_DEPENDENCIES = host-llvm
+
+$(eval $(host-cmake-package))
Signature · 1 line
2.20.1
#11 lore raw

RFC PATCH v2 6/30 lld: new package

Quoted 2 lines · Michael Drake

From: Joseph Kogut <[email protected]>

For lld, I completely agree that a Config.in.host option is needed - not for a
post-build script, but rather to use lld in external packages.

Quoted 44 lines
---
 DEVELOPERS                 |  1 +
 package/Config.in.host     |  1 +
 package/lld/Config.in.host | 16 ++++++++++++++++
 package/lld/lld.hash       |  2 ++
 package/lld/lld.mk         | 15 +++++++++++++++
 5 files changed, 35 insertions(+)
 create mode 100644 package/lld/Config.in.host
 create mode 100644 package/lld/lld.hash
 create mode 100644 package/lld/lld.mk
DEVELOPERS +1 -0
index 4ab4e36593..bdc98edd12 100644
@@ -1221,6 +1221,7 @@ F:	package/at-spi2-core/
 F:	package/clang/
 F:	package/gconf/
 F:	package/libnss/
+F:	package/lld/
 F:	package/llvm/
 F:	package/python-cython/
 F:	package/python-raven/
package/Config.in.host +1 -0
index 3122f5abca..18074ae1a7 100644
@@ -34,6 +34,7 @@ menu "Host utilities"
 	source "package/jq/Config.in.host"
 	source "package/jsmin/Config.in.host"
 	source "package/libp11/Config.in.host"
+	source "package/lld/Config.in.host"
 	source "package/llvm/Config.in.host"
 	source "package/lpc3250loader/Config.in.host"
 	source "package/lttng-babeltrace/Config.in.host"
package/lld/Config.in.host new file +0 -0
new file mode 100644
index 0000000000..c04b7924fa

package/lld/Config.in.host line 5

Quoted 5 lines
package/lld/Config.in.host new file +5 -0
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_HOST_LLD
+	bool "host lld"
+	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # llvm
+	depends on BR2_HOST_GCC_AT_LEAST_4_8 # llvm
+	select BR2_PACKAGE_HOST_LLVM

I'm confused now... I thought the previous patch would be needed to support
lld, but you don't select BR2_PACKAGE_HOST_LLVM_ENABLE_HOST_ARCH here, so the option introduced in the previous patch is not used at all... Why is that patch needed then?

Also, in Joseph's original submission, [1] was included. Now it is no longer
there. Was it not needed after all?

Anyway, I think I'll apply Joseph's original patch now.

Regards,
Arnout

[1] http://patchwork.ozlabs.org/patch/1136469/

Quoted 41 lines
package/lld/Config.in.host new file +11 -0
+	help
+	  LLD is a linker from the LLVM project that is a drop-in
+	  replacement for system linkers, and runs much faster than
+	  them. It also provides features that are useful for
+	  toolchain developers.
+
+	  https://lld.llvm.org/
+
+comment "lld needs a toolchain w/ host gcc >= 4.8"
+	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
+	depends on !BR2_HOST_GCC_AT_LEAST_4_8
package/lld/lld.hash new file +2 -0
new file mode 100644
index 0000000000..ebec212041
@@ -0,0 +1,2 @@
+sha256 9caec8ec922e32ffa130f0fb08e4c5a242d7e68ce757631e425e9eba2e1a6e37  lld-8.0.0.src.tar.xz
+sha256 a6c2a7ad246b567fd1828561ee8c244e35f73f164f031c82a7f28eff9634d23d  LICENSE.TXT
package/lld/lld.mk new file +15 -0
new file mode 100644
index 0000000000..6c3b10a667
@@ -0,0 +1,15 @@
+################################################################################
+#
+# lld
+#
+################################################################################
+
+LLD_VERSION = 8.0.0
+LLD_SITE = https://llvm.org/releases/$(LLD_VERSION)
+LLD_SOURCE = lld-$(LLD_VERSION).src.tar.xz
+LLD_LICENSE = NCSA
+LLD_LICENSE_FILES = LICENSE.TXT
+LLD_SUPPORTS_IN_SOURCE_BUILD = NO
+HOST_LLD_DEPENDENCIES = host-llvm
+
+$(eval $(host-cmake-package))
#12 lore raw

RFC PATCH v2 6/30 lld: new package

Hi Arnout,

Le 20/10/2019 ? 00:39, Arnout Vandecappelle a ?crit?:

Quoted 14 lines

package/lld/Config.in.host line 5

Quoted 7 lines

+++ b/package/lld/Config.in.host

package/lld/Config.in.host new file +5 -0
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_HOST_LLD
+	bool "host lld"
+	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # llvm
+	depends on BR2_HOST_GCC_AT_LEAST_4_8 # llvm
+	select BR2_PACKAGE_HOST_LLVM

I'm confused now... I thought the previous patch would be needed to support
lld, but you don't select BR2_PACKAGE_HOST_LLVM_ENABLE_HOST_ARCH here, so the option introduced in the previous patch is not used at all... Why is that patch needed then?

Quoted 4 lines

Also, in Joseph's original submission, [1] was included. Now it is no longer
there. Was it not needed after all?

Anyway, I think I'll apply Joseph's original patch now.

Thanks for merging lld :)

But lld package needs to be at the same version as llvm (currently 9.0.0). lld package was sent to the mailing list at the time where llvm package was using 8.0.0.

I'm not sure how it's related but the are some build issues with host-lld package:
http://autobuild.buildroot.org/results/9a0/9a0534c4206b40963d32494ff9675543e78125d1/build-end.log

I believe we need to bump lld version and add a small comment like for llvm and clang package.

Best regards,
Romain

Quoted 7 lines

Regards,
Arnout

[1] http://patchwork.ozlabs.org/patch/1136469/

#13 lore raw

RFC PATCH v2 6/30 lld: new package

Le 24/10/2019 ? 21:35, Romain Naour a ?crit?:

Quoted 22 lines

Hi Arnout,

Le 20/10/2019 ? 00:39, Arnout Vandecappelle a ?crit?:

Quoted 14 lines

package/lld/Config.in.host line 5

Quoted 7 lines

+++ b/package/lld/Config.in.host

package/lld/Config.in.host new file +5 -0
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_HOST_LLD
+	bool "host lld"
+	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # llvm
+	depends on BR2_HOST_GCC_AT_LEAST_4_8 # llvm
+	select BR2_PACKAGE_HOST_LLVM

I'm confused now... I thought the previous patch would be needed to support
lld, but you don't select BR2_PACKAGE_HOST_LLVM_ENABLE_HOST_ARCH here, so the option introduced in the previous patch is not used at all... Why is that patch needed then?

Quoted 4 lines

Also, in Joseph's original submission, [1] was included. Now it is no longer
there. Was it not needed after all?

Anyway, I think I'll apply Joseph's original patch now.

Quoted 8 lines

Thanks for merging lld :)

But lld package needs to be at the same version as llvm (currently 9.0.0). lld package was sent to the mailing list at the time where llvm package was using 8.0.0.

I'm not sure how it's related but the are some build issues with host-lld package:
http://autobuild.buildroot.org/results/9a0/9a0534c4206b40963d32494ff9675543e78125d1/build-end.log

It's related, there is a refactoring in llvm.
See:
https://github.com/llvm-mirror/lld/commit/66fca3a6b8cc0112a4c72237ffaea5eb4b659e3f

Best regards,
Romain

Quoted 14 lines

I believe we need to bump lld version and add a small comment like for llvm and clang package.

Best regards,
Romain

Quoted 7 lines

Regards,
Arnout

[1] http://patchwork.ozlabs.org/patch/1136469/

#14 lore raw

RFC PATCH v2 6/30 lld: new package

Quoted 30 lines · Romain Naour

Le 24/10/2019 ? 21:35, Romain Naour a ?crit :

Quoted 28 lines

Hi Arnout,

Le 20/10/2019 ? 00:39, Arnout Vandecappelle a ?crit :

Quoted 14 lines

package/lld/Config.in.host line 5

Quoted 7 lines

+++ b/package/lld/Config.in.host

package/lld/Config.in.host new file +5 -0
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_HOST_LLD
+   bool "host lld"
+   depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # llvm
+   depends on BR2_HOST_GCC_AT_LEAST_4_8 # llvm
+   select BR2_PACKAGE_HOST_LLVM

I'm confused now... I thought the previous patch would be needed to support
lld, but you don't select BR2_PACKAGE_HOST_LLVM_ENABLE_HOST_ARCH here, so the option introduced in the previous patch is not used at all... Why is that patch needed then?

Quoted 4 lines

Also, in Joseph's original submission, [1] was included. Now it is no longer
there. Was it not needed after all?

Anyway, I think I'll apply Joseph's original patch now.

Thanks for merging lld :)

But lld package needs to be at the same version as llvm (currently 9.0.0). lld package was sent to the mailing list at the time where llvm package was using 8.0.0.

I've been getting emails about the build failures, and I arrived at the same conclusion yesterday. If nobody else is working on this, I can send patches in to fix these issues later today.

Quoted 25 lines
Quoted 2 lines

I'm not sure how it's related but the are some build issues with host-lld package:
http://autobuild.buildroot.org/results/9a0/9a0534c4206b40963d32494ff9675543e78125d1/build-end.log

It's related, there is a refactoring in llvm.
See:
https://github.com/llvm-mirror/lld/commit/66fca3a6b8cc0112a4c72237ffaea5eb4b659e3f

Best regards,
Romain

Quoted 14 lines

I believe we need to bump lld version and add a small comment like for llvm and clang package.

Best regards,
Romain

Quoted 7 lines

Regards,
Arnout

[1] http://patchwork.ozlabs.org/patch/1136469/

Additionally, it seems we need to apply a similar fix to 2a17fb6 to LLD, enabling LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN to fix build issues with GCC versions between 4.8 and 5.1.

#15 lore raw

RFC PATCH v2 6/30 lld: new package

Hello Joseph,

Le 24/10/2019 ? 21:56, Joseph Kogut a ?crit?:

Quoted 27 lines · Romain Naour
Quoted 26 lines

Le 24/10/2019 ? 21:35, Romain Naour a ?crit :

Quoted 24 lines

Hi Arnout,

Le 20/10/2019 ? 00:39, Arnout Vandecappelle a ?crit :

Quoted 14 lines

package/lld/Config.in.host line 5

Quoted 7 lines

+++ b/package/lld/Config.in.host

package/lld/Config.in.host new file +5 -0
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_HOST_LLD
+   bool "host lld"
+   depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # llvm
+   depends on BR2_HOST_GCC_AT_LEAST_4_8 # llvm
+   select BR2_PACKAGE_HOST_LLVM

I'm confused now... I thought the previous patch would be needed to support
lld, but you don't select BR2_PACKAGE_HOST_LLVM_ENABLE_HOST_ARCH here, so the option introduced in the previous patch is not used at all... Why is that patch needed then?

Quoted 4 lines

Also, in Joseph's original submission, [1] was included. Now it is no longer
there. Was it not needed after all?

Anyway, I think I'll apply Joseph's original patch now.

Thanks for merging lld :)

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

But lld package needs to be at the same version as llvm (currently 9.0.0). lld package was sent to the mailing list at the time where llvm package was using 8.0.0.

I've been getting emails about the build failures, and I arrived at the same conclusion yesterday. If nobody else is working on this, I can send patches in to fix these issues later today.

Bumping the package version is easy, I'm doing it right now. But I don't have time to do a runtime test, can you do it?

Best regards,
Romain

Quoted 31 lines
Quoted 4 lines
Quoted 3 lines

I'm not sure how it's related but the are some build issues with host-lld package:
http://autobuild.buildroot.org/results/9a0/9a0534c4206b40963d32494ff9675543e78125d1/build-end.log

Quoted 22 lines

It's related, there is a refactoring in llvm.
See:
https://github.com/llvm-mirror/lld/commit/66fca3a6b8cc0112a4c72237ffaea5eb4b659e3f

Best regards,
Romain

Quoted 14 lines

I believe we need to bump lld version and add a small comment like for llvm and clang package.

Best regards,
Romain

Quoted 7 lines

Regards,
Arnout

[1] http://patchwork.ozlabs.org/patch/1136469/

Additionally, it seems we need to apply a similar fix to 2a17fb6 to LLD, enabling LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN to fix build issues with GCC versions between 4.8 and 5.1.

#16 lore raw

RFC PATCH v2 6/30 lld: new package

Hello Romain,

Quoted 36 lines · Romain Naour

Hello Joseph,

Le 24/10/2019 ? 21:56, Joseph Kogut a ?crit :

Quoted 32 lines · Romain Naour
Quoted 30 lines

Le 24/10/2019 ? 21:35, Romain Naour a ?crit :

Quoted 28 lines

Hi Arnout,

Le 20/10/2019 ? 00:39, Arnout Vandecappelle a ?crit :

Quoted 14 lines

package/lld/Config.in.host line 5

Quoted 7 lines

+++ b/package/lld/Config.in.host

package/lld/Config.in.host new file +5 -0
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_HOST_LLD
+   bool "host lld"
+   depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # llvm
+   depends on BR2_HOST_GCC_AT_LEAST_4_8 # llvm
+   select BR2_PACKAGE_HOST_LLVM

I'm confused now... I thought the previous patch would be needed to support
lld, but you don't select BR2_PACKAGE_HOST_LLVM_ENABLE_HOST_ARCH here, so the option introduced in the previous patch is not used at all... Why is that patch needed then?

Quoted 4 lines

Also, in Joseph's original submission, [1] was included. Now it is no longer
there. Was it not needed after all?

Anyway, I think I'll apply Joseph's original patch now.

Thanks for merging lld :)

But lld package needs to be at the same version as llvm (currently 9.0.0). lld package was sent to the mailing list at the time where llvm package was using 8.0.0.

Quoted 7 lines
Quoted 3 lines

I've been getting emails about the build failures, and I arrived at the same conclusion yesterday. If nobody else is working on this, I can send patches in to fix these issues later today.

Bumping the package version is easy, I'm doing it right now. But I don't have time to do a runtime test, can you do it?

Yes, I can handle that.

#17 lore raw

RFC PATCH v2 6/30 lld: new package

Hello Joseph,

Le 24/10/2019 ? 22:18, Joseph Kogut a ?crit?:

Quoted 43 lines

Hello Romain,

Quoted 40 lines · Romain Naour

Hello Joseph,

Le 24/10/2019 ? 21:56, Joseph Kogut a ?crit :

Quoted 35 lines · Romain Naour
Quoted 30 lines

Le 24/10/2019 ? 21:35, Romain Naour a ?crit :

Quoted 28 lines

Hi Arnout,

Le 20/10/2019 ? 00:39, Arnout Vandecappelle a ?crit :

Quoted 14 lines

Review line 5

Quoted 7 lines

+++ b/package/lld/Config.in.host

(quoted diff) +5 -0
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_HOST_LLD
+   bool "host lld"
+   depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # llvm
+   depends on BR2_HOST_GCC_AT_LEAST_4_8 # llvm
+   select BR2_PACKAGE_HOST_LLVM

I'm confused now... I thought the previous patch would be needed to support
lld, but you don't select BR2_PACKAGE_HOST_LLVM_ENABLE_HOST_ARCH here, so the option introduced in the previous patch is not used at all... Why is that patch needed then?

Quoted 4 lines

Also, in Joseph's original submission, [1] was included. Now it is no longer
there. Was it not needed after all?

Anyway, I think I'll apply Joseph's original patch now.

Thanks for merging lld :)

But lld package needs to be at the same version as llvm (currently 9.0.0). lld package was sent to the mailing list at the time where llvm package was using 8.0.0.

I've been getting emails about the build failures, and I arrived at the same conclusion yesterday. If nobody else is working on this, I can send patches in to fix these issues later today.

Quoted 6 lines
Quoted 3 lines

Bumping the package version is easy, I'm doing it right now. But I don't have time to do a runtime test, can you do it?

Yes, I can handle that.

You're welcome :)

See: http://patchwork.ozlabs.org/project/buildroot/list/?series=138492

Best regards,
Romain

#18 lore raw

RFC PATCH v2 7/30 package/llvm: install target binary/debug tools

In reply to Michael Drake

From: Matt Weber <[email protected]>

The compiler-rt fuzzer and address sanitizer tools require additional LLVM binary tools installed to allow stack trace decoding actively during executable analysis.

https://github.com/google/sanitizers/wiki/AddressSanitizerCallStack

---
 package/llvm/llvm.mk | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
package/llvm/llvm.mk +10 -1
index 5c413064c0..e20c909175 100644
@@ -214,8 +214,17 @@ HOST_LLVM_CONF_OPTS += \
 # We need to activate LLVM_INCLUDE_TOOLS, otherwise it does not generate
 # libLLVM.so
 LLVM_CONF_OPTS += \
-	-DLLVM_INCLUDE_TOOLS=ON \
+	-DLLVM_INCLUDE_TOOLS=ON
+
+# The llvm-symbolizer binary is used by the Compiler-RT Fuzzer
+# and AddressSanitizer tools for stack traces.
+ifeq ($(BR2_PACKAGE_COMPILER_RT),y)
+LLVM_CONF_OPTS += \
+	-DLLVM_BUILD_TOOLS=ON
+else
+LLVM_CONF_OPTS += \
 	-DLLVM_BUILD_TOOLS=OFF
+endif
 
 # Compiler-rt not in the source tree.
 # llvm runtime libraries are not in the source tree.
Signature · 1 line
2.20.1
#19 lore raw

RFC PATCH v2 8/30 package/llvm/clang: note about version bumping dep

In reply to Michael Drake

From: Matt Weber <[email protected]>

---
 package/clang/clang.mk | 1 +
 package/llvm/llvm.mk   | 1 +
 2 files changed, 2 insertions(+)
package/clang/clang.mk +1 -0
index 0cab1c7f89..07e7fced2a 100644
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# LLVM and Clang should be version bumped together
 CLANG_VERSION = 8.0.0
 CLANG_SITE = http://llvm.org/releases/$(CLANG_VERSION)
 CLANG_SOURCE = cfe-$(CLANG_VERSION).src.tar.xz
package/llvm/llvm.mk +1 -0
index e20c909175..aa70a85490 100644
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# LLVM and Clang should be version bumped together
 LLVM_VERSION = 8.0.0
 LLVM_SITE = http://llvm.org/releases/$(LLVM_VERSION)
 LLVM_SOURCE = llvm-$(LLVM_VERSION).src.tar.xz
Signature · 1 line
2.20.1
#20 lore raw

RFC PATCH v2 8/30 package/llvm/clang: note about version bumping dep

Quoted 7 lines · Michael Drake

From: Matt Weber <[email protected]>

This and the following patch were already merged on August 1. Please base your
patches on master before sending them.

Regards,
Arnout

Quoted 30 lines
---
 package/clang/clang.mk | 1 +
 package/llvm/llvm.mk   | 1 +
 2 files changed, 2 insertions(+)
package/clang/clang.mk +1 -0
index 0cab1c7f89..07e7fced2a 100644
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# LLVM and Clang should be version bumped together
 CLANG_VERSION = 8.0.0
 CLANG_SITE = http://llvm.org/releases/$(CLANG_VERSION)
 CLANG_SOURCE = cfe-$(CLANG_VERSION).src.tar.xz
package/llvm/llvm.mk +1 -0
index e20c909175..aa70a85490 100644
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# LLVM and Clang should be version bumped together
 LLVM_VERSION = 8.0.0
 LLVM_SITE = http://llvm.org/releases/$(LLVM_VERSION)
 LLVM_SOURCE = llvm-$(LLVM_VERSION).src.tar.xz
#21 lore raw

RFC PATCH v2 9/30 package/llvm: disable libxml2

In reply to Michael Drake

From: Matt Weber <[email protected]>

libxml2 is needed during Windows builds to populate the COFF file manifest info. This isn't required for Linux builds.

---
 package/llvm/llvm.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/llvm/llvm.mk +5 -0
index aa70a85490..44882d39a6 100644
@@ -140,6 +140,11 @@ HOST_LLVM_CONF_OPTS += -DLLVM_ENABLE_ZLIB=ON
 HOST_LLVM_DEPENDENCIES += host-zlib
 LLVM_CONF_OPTS += -DLLVM_ENABLE_ZLIB=OFF
 
+# libxml2 can be disabled as it is used for LLVM Windows builds where COFF
+# files include manifest info
+HOST_LLVM_CONF_OPTS += -DLLVM_ENABLE_LIBXML2=OFF
+LLVM_CONF_OPTS += -DLLVM_ENABLE_LIBXML2=OFF
+
 # We don't use llvm for static only build, so enable PIC
 HOST_LLVM_CONF_OPTS += -DLLVM_ENABLE_PIC=ON
 LLVM_CONF_OPTS += -DLLVM_ENABLE_PIC=ON
Signature · 1 line
2.20.1
#22 lore raw

RFC PATCH v2 10/30 package/compiler-rt: new package

In reply to Michael Drake

From: Matt Weber <[email protected]>

This patch adds support for the compiler-rt (CLANG runtime) library. It builds a set of static libraries and installs them into the CLANG/LLVM toolchain resource folder.

Cc Romain Naour <[email protected]>
Cc Ricardo Martincoski <[email protected]>
Cc Valentin Korenblit <[email protected]>
---
 DEVELOPERS                           |  1 +
 package/Config.in                    |  1 +
 package/clang/clang.mk               |  2 +-
 package/compiler-rt/Config.in        | 14 +++++++++++
 package/compiler-rt/compiler-rt.hash |  2 ++
 package/compiler-rt/compiler-rt.mk   | 36 ++++++++++++++++++++++++++++
 package/llvm/llvm.mk                 |  2 +-
 7 files changed, 56 insertions(+), 2 deletions(-)
 create mode 100644 package/compiler-rt/Config.in
 create mode 100644 package/compiler-rt/compiler-rt.hash
 create mode 100644 package/compiler-rt/compiler-rt.mk
DEVELOPERS +1 -0
index bdc98edd12..abaa710ccb 100644
@@ -1476,6 +1476,7 @@ F:	package/bridge-utils/
 F:	package/checkpolicy/
 F:	package/checksec/
 F:	package/cgroupfs-mount/
+F:	package/compiler-rt/
 F:	package/crda/
 F:	package/cunit/
 F:	package/dacapo/
package/Config.in +1 -0
index 90dddfd346..ab9335a055 100644
@@ -1666,6 +1666,7 @@ menu "Other"
 	source "package/clapack/Config.in"
 	source "package/classpath/Config.in"
 	source "package/cmocka/Config.in"
+	source "package/compiler-rt/Config.in"
 	source "package/cppcms/Config.in"
 	source "package/cracklib/Config.in"
 	source "package/dawgdic/Config.in"
package/clang/clang.mk +1 -1
index 07e7fced2a..87a80ab258 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-# LLVM and Clang should be version bumped together
+# LLVM, Compiler-rt and Clang should be version bumped together
 CLANG_VERSION = 8.0.0
 CLANG_SITE = http://llvm.org/releases/$(CLANG_VERSION)
 CLANG_SOURCE = cfe-$(CLANG_VERSION).src.tar.xz
package/compiler-rt/Config.in new file +14 -0
new file mode 100644
index 0000000000..9afc0d9d60
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_COMPILER_RT
+	bool "compiler-rt"
+	depends on BR2_PACKAGE_LLVM
+	depends on BR2_TOOLCHAIN_USES_GLIBC # asan lib requires
+	help
+	  A collection of runtime libraries primarily used by clang and
+	  llvm to provide builtins, sanitizer runtimes, and profiling
+	  at runtime.
+
+	  https://compiler-rt.llvm.org/
+
+comment "compiler-rt requires llvm to be enabled and a glibc toolchain"
+	depends on !BR2_PACKAGE_LLVM
+	depends on !BR2_TOOLCHAIN_USES_GLIBC
package/compiler-rt/compiler-rt.hash new file +2 -0
new file mode 100644
index 0000000000..24ebdf206b
@@ -0,0 +1,2 @@
+sha256 b435c7474f459e71b2831f1a4e3f1d21203cb9c0172e94e9d9b69f50354f21b1  compiler-rt-8.0.0.src.tar.xz
+sha256 dd27f8c290bcdc8368549cd7cd98710a9dbdc34122f2e096a1edb97824ed4148  LICENSE.TXT
package/compiler-rt/compiler-rt.mk new file +36 -0
new file mode 100644
index 0000000000..7eda3bc4fe
@@ -0,0 +1,36 @@
+################################################################################
+#
+# compiler-rt
+#
+################################################################################
+
+# Compiler-RT should be bumped together with LLVM and Clang as the run-time is
+# tied to the version of those tools
+COMPILER_RT_VERSION = 8.0.0
+COMPILER_RT_SOURCE = compiler-rt-$(COMPILER_RT_VERSION).src.tar.xz
+COMPILER_RT_SITE = http://llvm.org/releases/$(COMPILER_RT_VERSION)
+COMPILER_RT_LICENSE = NCSA MIT
+COMPILER_RT_LICENSE_FILES = LICENSE.TXT
+COMPILER_RT_DEPENDENCIES = host-clang llvm
+
+COMPILER_RT_INSTALL_STAGING = YES
+COMPILER_RT_INSTALL_TARGET = NO
+
+COMPILER_RT_CONF_OPTS=-DCOMPILER_RT_STANDALONE_BUILD=OFF \
+	-DCOMPILER_RT_STANDALONE_BUILD=ON \
+	-DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=$(GNU_TARGET_NAME) \
+	-DLLVM_CONFIG_PATH=$(HOST_DIR)/usr/bin/llvm-config
+
+# The installation of the target runtime libraries defaults to DESTDIR, however
+# host-clang resources directory needs a link so Clang can find the runtime
+# libraries in the same location they would be if built as part of the Clang
+# build. The "resources" directory is loosely documented and seems to be
+# assumed, as compiler-rt is usually build at the same time as Clang and not
+# standalone.
+define COMPILER_RT_SETUP_RUNTIME_LIBS
+	mkdir -p $(HOST_DIR)/lib/clang/$(HOST_CLANG_VERSION)/lib
+	ln -sf ../../../../$(GNU_TARGET_NAME)/sysroot/usr/lib/linux $(HOST_DIR)/lib/clang/$(HOST_CLANG_VERSION)/lib/linux
+endef
+COMPILER_RT_POST_INSTALL_STAGING_HOOKS += COMPILER_RT_SETUP_RUNTIME_LIBS
+
+$(eval $(cmake-package))
package/llvm/llvm.mk +1 -1
index 44882d39a6..4fce59b95b 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-# LLVM and Clang should be version bumped together
+# LLVM, Compiler-rt and Clang should be version bumped together
 LLVM_VERSION = 8.0.0
 LLVM_SITE = http://llvm.org/releases/$(LLVM_VERSION)
 LLVM_SOURCE = llvm-$(LLVM_VERSION).src.tar.xz
Signature · 1 line
2.20.1
#23 lore raw

RFC PATCH v2 10/30 package/compiler-rt: new package

Quoted 7 lines · Michael Drake

From: Matt Weber <[email protected]>

This patch adds support for the compiler-rt (CLANG runtime) library. It builds a set of static libraries and installs them into the CLANG/LLVM toolchain resource folder.

FYI, I plan to publish (soon) a cleaned up version of my original series which add the compiler-rt feature. That refreshed patchset would have the feedback from my last series that's missing here.

Quoted 142 lines
Cc Romain Naour <[email protected]>
Cc Ricardo Martincoski <[email protected]>
Cc Valentin Korenblit <[email protected]>
---
 DEVELOPERS                           |  1 +
 package/Config.in                    |  1 +
 package/clang/clang.mk               |  2 +-
 package/compiler-rt/Config.in        | 14 +++++++++++
 package/compiler-rt/compiler-rt.hash |  2 ++
 package/compiler-rt/compiler-rt.mk   | 36 ++++++++++++++++++++++++++++
 package/llvm/llvm.mk                 |  2 +-
 7 files changed, 56 insertions(+), 2 deletions(-)
 create mode 100644 package/compiler-rt/Config.in
 create mode 100644 package/compiler-rt/compiler-rt.hash
 create mode 100644 package/compiler-rt/compiler-rt.mk
DEVELOPERS +1 -0
index bdc98edd12..abaa710ccb 100644
@@ -1476,6 +1476,7 @@ F:        package/bridge-utils/
 F:     package/checkpolicy/
 F:     package/checksec/
 F:     package/cgroupfs-mount/
+F:     package/compiler-rt/
 F:     package/crda/
 F:     package/cunit/
 F:     package/dacapo/
package/Config.in +1 -0
index 90dddfd346..ab9335a055 100644
@@ -1666,6 +1666,7 @@ menu "Other"
        source "package/clapack/Config.in"
        source "package/classpath/Config.in"
        source "package/cmocka/Config.in"
+       source "package/compiler-rt/Config.in"
        source "package/cppcms/Config.in"
        source "package/cracklib/Config.in"
        source "package/dawgdic/Config.in"
package/clang/clang.mk +1 -1
index 07e7fced2a..87a80ab258 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-# LLVM and Clang should be version bumped together
+# LLVM, Compiler-rt and Clang should be version bumped together
 CLANG_VERSION = 8.0.0
 CLANG_SITE = http://llvm.org/releases/$(CLANG_VERSION)
 CLANG_SOURCE = cfe-$(CLANG_VERSION).src.tar.xz
package/compiler-rt/Config.in new file +14 -0
new file mode 100644
index 0000000000..9afc0d9d60
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_COMPILER_RT
+       bool "compiler-rt"
+       depends on BR2_PACKAGE_LLVM
+       depends on BR2_TOOLCHAIN_USES_GLIBC # asan lib requires
+       help
+         A collection of runtime libraries primarily used by clang and
+         llvm to provide builtins, sanitizer runtimes, and profiling
+         at runtime.
+
+         https://compiler-rt.llvm.org/
+
+comment "compiler-rt requires llvm to be enabled and a glibc toolchain"
+       depends on !BR2_PACKAGE_LLVM
+       depends on !BR2_TOOLCHAIN_USES_GLIBC
package/compiler-rt/compiler-rt.hash new file +2 -0
new file mode 100644
index 0000000000..24ebdf206b
@@ -0,0 +1,2 @@
+sha256 b435c7474f459e71b2831f1a4e3f1d21203cb9c0172e94e9d9b69f50354f21b1  compiler-rt-8.0.0.src.tar.xz
+sha256 dd27f8c290bcdc8368549cd7cd98710a9dbdc34122f2e096a1edb97824ed4148  LICENSE.TXT
package/compiler-rt/compiler-rt.mk new file +36 -0
new file mode 100644
index 0000000000..7eda3bc4fe
@@ -0,0 +1,36 @@
+################################################################################
+#
+# compiler-rt
+#
+################################################################################
+
+# Compiler-RT should be bumped together with LLVM and Clang as the run-time is
+# tied to the version of those tools
+COMPILER_RT_VERSION = 8.0.0
+COMPILER_RT_SOURCE = compiler-rt-$(COMPILER_RT_VERSION).src.tar.xz
+COMPILER_RT_SITE = http://llvm.org/releases/$(COMPILER_RT_VERSION)
+COMPILER_RT_LICENSE = NCSA MIT
+COMPILER_RT_LICENSE_FILES = LICENSE.TXT
+COMPILER_RT_DEPENDENCIES = host-clang llvm
+
+COMPILER_RT_INSTALL_STAGING = YES
+COMPILER_RT_INSTALL_TARGET = NO
+
+COMPILER_RT_CONF_OPTS=-DCOMPILER_RT_STANDALONE_BUILD=OFF \
+       -DCOMPILER_RT_STANDALONE_BUILD=ON \
+       -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=$(GNU_TARGET_NAME) \
+       -DLLVM_CONFIG_PATH=$(HOST_DIR)/usr/bin/llvm-config
+
+# The installation of the target runtime libraries defaults to DESTDIR, however
+# host-clang resources directory needs a link so Clang can find the runtime
+# libraries in the same location they would be if built as part of the Clang
+# build. The "resources" directory is loosely documented and seems to be
+# assumed, as compiler-rt is usually build at the same time as Clang and not
+# standalone.
+define COMPILER_RT_SETUP_RUNTIME_LIBS
+       mkdir -p $(HOST_DIR)/lib/clang/$(HOST_CLANG_VERSION)/lib
+       ln -sf ../../../../$(GNU_TARGET_NAME)/sysroot/usr/lib/linux $(HOST_DIR)/lib/clang/$(HOST_CLANG_VERSION)/lib/linux
+endef
+COMPILER_RT_POST_INSTALL_STAGING_HOOKS += COMPILER_RT_SETUP_RUNTIME_LIBS
+
+$(eval $(cmake-package))
package/llvm/llvm.mk +1 -2
index 44882d39a6..4fce59b95b 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-# LLVM and Clang should be version bumped together
+# LLVM, Compiler-rt and Clang should be version bumped together
 LLVM_VERSION = 8.0.0
 LLVM_SITE = http://llvm.org/releases/$(LLVM_VERSION)
 LLVM_SOURCE = llvm-$(LLVM_VERSION).src.tar.xz
--

2.20.1

Signature · 23 lines
Matthew Weber | Associate Director Software Engineer | Commercial Avionics

COLLINS AEROSPACE

400 Collins Road NE, Cedar Rapids, Iowa 52498, USA

Tel: +1 319 295 7349 | FAX: +1 319 263 6099

matthew.weber at collins.com | collinsaerospace.com



CONFIDENTIALITY WARNING: This message may contain proprietary and/or
privileged information of Collins Aerospace and its affiliated
companies. If you are not the intended recipient, please 1) Do not
disclose, copy, distribute or use this message or its contents. 2)
Advise the sender by return email. 3) Delete all copies (including all
attachments) from your computer. Your cooperation is greatly
appreciated.


Any export restricted material should be shared using my
matthew.weber at corp.rockwellcollins.com address.
#24 lore raw

RFC PATCH v2 10/30 package/compiler-rt: new package

Hi Matt,

Quoted 5 lines · Matthew Weber
Quoted 3 lines · Michael Drake

From: Matt Weber <[email protected]>

Quoted 8 lines
Quoted 4 lines

This patch adds support for the compiler-rt (CLANG runtime) library. It builds a set of static libraries and installs them into the CLANG/LLVM toolchain resource folder.

FYI, I plan to publish (soon) a cleaned up version of my original series which add the compiler-rt feature. That refreshed patchset would have the feedback from my last series that's missing here.

Ooh, that's really interesting. At this very moment I am actually working on adding a host-compiler-rt. Currently I'm disabling CFI[1] in the CEF/Chromium build with is_cfi=false.

When I enable that feature, I get clang errors like:

clang++: error: no such file or directory:

'/home/tlsa/buildroot/output/host/lib/clang/8.0.0/share/cfi_blacklist.txt'

And I believe the missing cfi_blacklist.txt should come with compiler-rt.

I'll have a look for the feedback from the last series.

Thanks very much for the pointer for and the original patch!

[1] http://clang.llvm.org/docs/ControlFlowIntegrity.html

Best regards,

Michael

#25 lore raw

RFC PATCH v2 10/30 package/compiler-rt: new package

Hi Matthew,

Quoted 6 lines · Michael Drake
Quoted 3 lines · Matthew Weber

FYI, I plan to publish (soon) a cleaned up version of my original series which add the compiler-rt feature. That refreshed patchset would have the feedback from my last series that's missing here.

Quoted 8 lines

Ooh, that's really interesting. At this very moment I am actually working on adding a host-compiler-rt. Currently I'm disabling CFI[1] in the CEF/Chromium build with is_cfi=false.

When I enable that feature, I get clang errors like:

clang++: error: no such file or directory:
'/home/tlsa/buildroot/output/host/lib/clang/8.0.0/share/cfi_blacklist.txt'

I tracked this down, btw. The attached patch fixes it.

Basically, we create links for all the libclang_rt.* stuff for host-clang, but they use some data files in the share directory too, that weren't getting copied.

Cheers,

Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cfi-fix.diff
Type: text/x-patch
Size: 1928 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20191018/fa4cb02c/attachment.bin>

#26 lore raw

RFC PATCH v2 10/30 package/compiler-rt: new package

Michael / Romain / Arnout,

Quoted 16 lines · Michael Drake

Hi Matthew,

Quoted 12 lines · Michael Drake
Quoted 3 lines · Matthew Weber

FYI, I plan to publish (soon) a cleaned up version of my original series which add the compiler-rt feature. That refreshed patchset would have the feedback from my last series that's missing here.

Ooh, that's really interesting. At this very moment I am actually working on adding a host-compiler-rt. Currently I'm disabling CFI[1] in the CEF/Chromium build with is_cfi=false.

When I enable that feature, I get clang errors like:

Quoted 8 lines
Quoted 2 lines

clang++: error: no such file or directory:
'/home/tlsa/buildroot/output/host/lib/clang/8.0.0/share/cfi_blacklist.txt'

I tracked this down, btw. The attached patch fixes it.

Basically, we create links for all the libclang_rt.* stuff for host-clang, but they use some data files in the share directory too, that weren't getting copied.

I incorporated that symlink fix into the clang v8 series [1]. The new series is now just two patches as it leverages a new clang cross-compiler framework. The new framework is provided in Romain's clang cross-compiler series [2] and needs to be applied first (or the core parts of it).

Regards,
Matt

[1] http://patchwork.ozlabs.org/project/buildroot/list/?series=138196
[2] http://patchwork.ozlabs.org/project/buildroot/list/?series=129565

#27 lore raw

RFC PATCH v2 10/30 package/compiler-rt: new package

In reply to Matthew Weber

Hi Matt,

Quoted 11 lines · Matthew Weber
Quoted 6 lines · Michael Drake

From: Matt Weber <[email protected]>

This patch adds support for the compiler-rt (CLANG runtime) library. It builds a set of static libraries and installs them into the CLANG/LLVM toolchain resource folder.

FYI, I plan to publish (soon) a cleaned up version of my original series which add the compiler-rt feature. That refreshed patchset would have the feedback from my last series that's missing here.

There are probably interactions with Romain's clang series and Joseph's LLD
series, so it would be nice if all of that could be combined in one series or at least ordered somewhat...

Regards,
Arnout

#28 lore raw

RFC PATCH v2 10/30 package/compiler-rt: new package

Arnout,

Quoted 12 lines · Arnout Vandecappelle

Hi Matt,

Quoted 8 lines · Matthew Weber
Quoted 6 lines · Michael Drake

From: Matt Weber <[email protected]>

This patch adds support for the compiler-rt (CLANG runtime) library. It builds a set of static libraries and installs them into the CLANG/LLVM toolchain resource folder.

Quoted 8 lines
Quoted 3 lines

FYI, I plan to publish (soon) a cleaned up version of my original series which add the compiler-rt feature. That refreshed patchset would have the feedback from my last series that's missing here.

There are probably interactions with Romain's clang series and Joseph's LLD
series, so it would be nice if all of that could be combined in one series or at least ordered somewhat...

Agree, I'll get something together today ahead of the working meeting this week.

Right now, I've got a working copy pulling in Romain's series, however its out of date with respect to current master. Plus I need to review Michael's reuse of compiler-rt and any changes.

Regards,
Matt

#29 lore raw

RFC PATCH v2 11/30 package/libpangox: new package

In reply to Michael Drake
---
 package/Config.in              |  1 +
 package/libpangox/Config.in    | 14 ++++++++++++++
 package/libpangox/libpangox.mk | 12 ++++++++++++
 3 files changed, 27 insertions(+)
 create mode 100644 package/libpangox/Config.in
 create mode 100644 package/libpangox/libpangox.mk
package/Config.in +1 -0
index ab9335a055..56b01b3b31 100644
@@ -1325,6 +1325,7 @@ menu "Graphics"
 	source "package/libgtk3/Config.in"
 	source "package/libmediaart/Config.in"
 	source "package/libmng/Config.in"
+	source "package/libpangox/Config.in"
 	source "package/libpng/Config.in"
 	source "package/libqrencode/Config.in"
 	source "package/libraw/Config.in"
package/libpangox/Config.in new file +14 -0
new file mode 100644
index 0000000000..5575081a4e
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_LIBPANGOX
+	bool "libpangox"
+	depends on BR2_USE_WCHAR # gettext
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	select BR2_PACKAGE_LIBGTK2
+	select BR2_PACKAGE_PANGO
+	select BR2_PACKAGE_XLIB_LIBICE
+	select BR2_PACKAGE_XLIB_LIBSM
+	select BR2_PACKAGE_XLIB_LIBXMU
+	select BR2_PACKAGE_XLIB_LIBXMU
+	select BR2_PACKAGE_XLIB_LIBXT
+	help
+	  This is a compatibility library providing the obsolete pangox
+	  library that is not shipped by Pango itself anymore.
package/libpangox/libpangox.mk new file +12 -0
new file mode 100644
index 0000000000..35d7720302
@@ -0,0 +1,12 @@
+################################################################################
+#
+# libpangox
+#
+################################################################################
+LIBPANGOX_VERSION = 0.0.2
+LIBPANGOX_SOURCE = pangox-compat-$(LIBPANGOX_VERSION).tar.xz
+LIBPANGOX_SITE = http://ftp.gnome.org/pub/GNOME/sources/pangox-compat/0.0
+LIBPANGOX_INSTALL_STAGING = YES
+LIBPANGOX_DEPENDENCIES = libglib2 host-pkgconf pango
+
+$(eval $(autotools-package))
Signature · 1 line
2.20.1
#30 lore raw

RFC PATCH v2 12/30 package/libgtkglext: new package

In reply to Michael Drake
---
 package/Config.in                  |  1 +
 package/libgtkglext/Config.in      | 18 ++++++++++++++++++
 package/libgtkglext/libgtkglext.mk | 29 +++++++++++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 package/libgtkglext/Config.in
 create mode 100644 package/libgtkglext/libgtkglext.mk
package/Config.in +1 -0
index 56b01b3b31..79933bfa8c 100644
@@ -1323,6 +1323,7 @@ menu "Graphics"
 	source "package/libgta/Config.in"
 	source "package/libgtk2/Config.in"
 	source "package/libgtk3/Config.in"
+	source "package/libgtkglext/Config.in"
 	source "package/libmediaart/Config.in"
 	source "package/libmng/Config.in"
 	source "package/libpangox/Config.in"
package/libgtkglext/Config.in new file +18 -0
new file mode 100644
index 0000000000..9502335eab
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_LIBGTKGLEXT
+	bool "libgtkglext"
+	depends on BR2_PACKAGE_HAS_LIBGL
+	depends on BR2_USE_WCHAR # gettext
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	select BR2_PACKAGE_LIBGLU
+	select BR2_PACKAGE_LIBGTK2
+	select BR2_PACKAGE_PANGO
+	select BR2_PACKAGE_LIBPANGOX
+	select BR2_PACKAGE_XLIB_LIBX11
+	select BR2_PACKAGE_XLIB_LIBICE
+	select BR2_PACKAGE_XLIB_LIBSM
+	select BR2_PACKAGE_XLIB_LIBXMU
+	select BR2_PACKAGE_XLIB_LIBXT
+	help
+	  GtkGLExt is an OpenGL extension to GTK+.
+
+	  https://projects-old.gnome.org/gtkglext/index.html
package/libgtkglext/libgtkglext.mk new file +29 -0
new file mode 100644
index 0000000000..93a5d6382d
@@ -0,0 +1,29 @@
+################################################################################
+#
+# libgtkglext
+#
+################################################################################
+LIBGTKGLEXT_VERSION = 1.2.0
+LIBGTKGLEXT_SOURCE = gtkglext-$(LIBGTKGLEXT_VERSION).tar.gz
+LIBGTKGLEXT_SITE = http://downloads.sourceforge.net/gtkglext
+LIBGTKGLEXT_INSTALL_STAGING = YES
+LIBGTKGLEXT_DEPENDENCIES = \
+	host-pkgconf \
+	libglib2 \
+	libpangox \
+	pango \
+	xlib_libICE \
+	xlib_libSM \
+	xlib_libX11 \
+	xlib_libXmu \
+	xlib_libXt \
+	libglu \
+	libgtk2
+
+LIBGTKGLEXT_PATCH = \
+	https://sources.debian.org/data/main/g/gtkglext/1.2.0-9/debian/patches/01_fix_fontcache_nullderef.diff \
+	https://sources.debian.org/data/main/g/gtkglext/1.2.0-9/debian/patches/02_fix_gtk-2.20_deprecated_symbols.diff \
+	https://sources.debian.org/data/main/g/gtkglext/1.2.0-9/debian/patches/04_glibc2.27-ftbfs.diff \
+	https://sources.debian.org/data/main/g/gtkglext/1.2.0-9/debian/patches/libGL.so.1.diff
+
+$(eval $(autotools-package))
Signature · 1 line
2.20.1
#31 lore raw

RFC PATCH v2 13/30 package/webp: Enable host package build.

In reply to Michael Drake
---
 package/webp/webp.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/webp/webp.mk +5 -0
index e7235f48f4..2fb42613ec 100644
@@ -11,6 +11,10 @@ WEBP_LICENSE = BSD-3-Clause
 WEBP_LICENSE_FILES = COPYING
 WEBP_INSTALL_STAGING = YES
 
+HOST_WEBP_CONF_OPTS += \
+	--enable-libwebpmux \
+	--enable-libwebpdemux
+
 WEBP_CONF_OPTS += \
 	--with-jpegincludedir=$(STAGING_DIR)/usr/include \
 	--with-jpeglibdir=$(STAGING_DIR)/usr/lib \
@@ -54,3 +58,4 @@ WEBP_DEPENDENCIES += $(if $(BR2_PACKAGE_JPEG),jpeg)
 WEBP_DEPENDENCIES += $(if $(BR2_PACKAGE_TIFF),tiff)
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.20.1
#32 lore raw

RFC PATCH v2 14/30 package/libcef: New package

In reply to Michael Drake
---
 package/Config.in                             |    1 +
 .../0001-fix-one-euro-filter-build.patch      |   33 +
 .../0002-link-against-harfbuzz-subset.patch   |   50 +
 package/libcef/Config.in                      |   75 ++
 package/libcef/libcef.license-files.inc       | 1130 +++++++++++++++++
 package/libcef/libcef.mk                      |  372 ++++++
 .../libcef/scripts/gather-license-files.sh    |   53 +
 package/libcef/scripts/version.sh             |   48 +
 package/libcef/templates/cef_version.h        |   70 +
 package/libcef/toolchain/BUILD.gn             |   70 +
 10 files changed, 1902 insertions(+)
 create mode 100644 package/libcef/0001-fix-one-euro-filter-build.patch
 create mode 100644 package/libcef/0002-link-against-harfbuzz-subset.patch
 create mode 100644 package/libcef/Config.in
 create mode 100644 package/libcef/libcef.license-files.inc
 create mode 100644 package/libcef/libcef.mk
 create mode 100755 package/libcef/scripts/gather-license-files.sh
 create mode 100755 package/libcef/scripts/version.sh
 create mode 100644 package/libcef/templates/cef_version.h
 create mode 100644 package/libcef/toolchain/BUILD.gn
package/Config.in +1 -0
index 79933bfa8c..5fc2b8a635 100644
@@ -1562,6 +1562,7 @@ menu "Networking"
 	source "package/gupnp-dlna/Config.in"
 	source "package/ibrcommon/Config.in"
 	source "package/ibrdtn/Config.in"
+	source "package/libcef/Config.in"
 	source "package/libcgi/Config.in"
 	source "package/libcgicc/Config.in"
 	source "package/libcoap/Config.in"
package/libcef/0001-fix-one-euro-filter-build.patch new file +33 -0
new file mode 100644
index 0000000000..7789a66a11
@@ -0,0 +1,33 @@
+From 8c747a9c14ed4905f60f6680e2e09e33ea34163e Mon Sep 17 00:00:00 2001
+From: Jose Dapena Paz <[email protected]>
+Date: Fri, 26 Jul 2019 16:18:17 +0000
+Subject: [PATCH] IWYU: include <memory> in one_euro_filter.h as it uses
+ std::unique_ptr
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Bug: 819294
+Change-Id: Ie1530f7046b0c8eb76e26adca530fa57c67ed876
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1720637
+Reviewed-by: Ella Ge <[email protected]>
+Commit-Queue: Jos? Dapena Paz <[email protected]>
+Cr-Commit-Position: refs/heads/master@{#681321}
+---
+ third_party/one_euro_filter/src/one_euro_filter.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/third_party/one_euro_filter/src/one_euro_filter.h b/third_party/one_euro_filter/src/one_euro_filter.h
+index 7f8d15b62afa2..a8cd0ab9a2560 100644
+--- a/third_party/one_euro_filter/src/one_euro_filter.h
++++ b/third_party/one_euro_filter/src/one_euro_filter.h
+@@ -1,6 +1,8 @@
+ #ifndef ONE_EURO_ONE_EURO_FILTER_H_
+ #define ONE_EURO_ONE_EURO_FILTER_H_
+ 
++#include <memory>
++
+ #include "low_pass_filter.h"
+ 
+ namespace one_euro_filter {
+
package/libcef/0002-link-against-harfbuzz-subset.patch new file +50 -0

50 lines not on this page · raw message

package/libcef/Config.in new file +75 -0

75 lines not on this page · raw message

package/libcef/libcef.license-files.inc new file +1130 -0

1,130 lines not on this page · raw message

package/libcef/libcef.mk new file +372 -0

372 lines not on this page · raw message

package/libcef/scripts/gather-license-files.sh new file +53 -0

53 lines not on this page · raw message

package/libcef/scripts/version.sh new file +48 -0

48 lines not on this page · raw message

package/libcef/templates/cef_version.h new file +70 -0

70 lines not on this page · raw message

package/libcef/toolchain/BUILD.gn new file +70 -0

70 lines not on this page · raw message

Signature · 1 line
2.20.1
#33 lore raw

RFC PATCH v2 14/30 package/libcef: New package

Quoted 6 lines · Michael Drake
Quoted 11 lines
---
 package/Config.in                             |    1 +
 .../0001-fix-one-euro-filter-build.patch      |   33 +
 .../0002-link-against-harfbuzz-subset.patch   |   50 +
 package/libcef/Config.in                      |   75 ++
 package/libcef/libcef.license-files.inc       | 1130 +++++++++++++++++
 package/libcef/libcef.mk                      |  372 ++++++
 .../libcef/scripts/gather-license-files.sh    |   53 +
 package/libcef/scripts/version.sh             |   48 +
 package/libcef/templates/cef_version.h        |   70 +
 package/libcef/toolchain/BUILD.gn             |   70 +

I think a patch with this kind of diffstat deserves a commit message with some
text...

[snip]

package/libcef/Config.in line 7

Quoted 7 lines
package/libcef/Config.in new file +7 -0
+config BR2_PACKAGE_LIBCEF
+	bool "libcef"
+	depends on BR2_HOST_GCC_AT_LEAST_4_9 # gn requires -std=c++14
+	depends on BR2_INSTALL_LIBSTDCPP # icu
+	depends on BR2_USE_WCHAR # icu
+	depends on BR2_PACKAGE_HAS_LIBGL
+	depends on BR2_PACKAGE_XORG7

Please put package dependencies after the toolchain dependencies.

package/libcef/Config.in line 11

Quoted 4 lines
package/libcef/Config.in new file +4 -0
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # icu
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	depends on BR2_TOOLCHAIN_HAS_THREADS # icu
+	depends on !BR2_BINFMT_FLAT # icu

I'm a bit surprised that with such a long list of selects, icu is the only one
with any dependencies...

Quoted 11 lines
package/libcef/Config.in new file +11 -0
+	select BR2_PACKAGE_AT_SPI2_ATK
+	select BR2_PACKAGE_ALSA_LIB
+	select BR2_PACKAGE_COMPILER_RT
+	select BR2_PACKAGE_DBUS
+	select BR2_PACKAGE_FFMPEG
+	select BR2_PACKAGE_FLAC
+	select BR2_PACKAGE_FREETYPE
+	select BR2_PACKAGE_HARFBUZZ
+	select BR2_PACKAGE_LLVM_ENABLE_HOST_ARCH
+	select BR2_PACKAGE_HOST_CLANG
+	select BR2_PACKAGE_HOST_JPEG_TURBO

package/libcef/Config.in line 32

Quoted 10 lines
package/libcef/Config.in new file +10 -0
+	select BR2_PACKAGE_HOST_ICU
+	select BR2_PACKAGE_HOST_LLD
+	select BR2_PACKAGE_HOST_LLVM
+	select BR2_PACKAGE_HOST_NINJA
+	select BR2_PACKAGE_HOST_LIBKRB5
+	select BR2_PACKAGE_HOST_LIBNSS
+	select BR2_PACKAGE_HOST_NODEJS
+	select BR2_PACKAGE_HOST_PKGCONF
+	select BR2_PACKAGE_HOST_PYTHON
+	select BR2_PACKAGE_HOST_WEBP

It is normally not needed to select host packages. Some of these symbols don't
even exist, e.g. ninja.

Quoted 15 lines
package/libcef/Config.in new file +15 -0
+	select BR2_PACKAGE_ICU
+	select BR2_PACKAGE_JPEG_TURBO
+	select BR2_PACKAGE_LIBDRM
+	select BR2_PACKAGE_LIBERATION # runtime
+	select BR2_PACKAGE_LIBGLIB2
+	select BR2_PACKAGE_LIBGTK3_X11
+	select BR2_PACKAGE_LIBGTKGLEXT
+	select BR2_PACKAGE_LIBKRB5
+	select BR2_PACKAGE_LIBNSS
+	select BR2_PACKAGE_LIBPNG
+	select BR2_PACKAGE_PCIUTILS
+	select BR2_PACKAGE_PANGO
+	select BR2_PACKAGE_WEBP
+	select BR2_PACKAGE_WEBP_MUX
+	select BR2_PACKAGE_WEBP_DEMUX

package/libcef/Config.in line 57

Quoted 10 lines
package/libcef/Config.in new file +10 -0
+	select BR2_PACKAGE_LIBXML2
+	select BR2_PACKAGE_LIBXSLT
+	select BR2_PACKAGE_XLIB_LIBXCOMPOSITE
+	select BR2_PACKAGE_XLIB_LIBXCURSOR
+	select BR2_PACKAGE_XLIB_LIBXRANDR
+	select BR2_PACKAGE_XLIB_LIBXSCRNSAVER
+	select BR2_PACKAGE_XLIB_LIBXV
+	select BR2_PACKAGE_ZLIB
+	help
+	  Chromium Embedded Framework

A bit more help text could be useful. Just take a sentence from the website.

Also, a link to the website is mandatory.

package/libcef/Config.in line 67

Quoted 10 lines
package/libcef/Config.in new file +10 -0
+
+if BR2_PACKAGE_LIBCEF
+
+config BR2_PACKAGE_LIBCEF_TARGET_ARCH
+	string
+	default "arm" if BR2_arm
+	default "arm64" if BR2_aarch64
+	default "mips" if BR2_mips
+	default "x86" if BR2_i386
+	default "x64" if BR2_x86_64

This implies that you'll need BR2_PACKAGE_LIBCEF_ARCH_DEPENDS.

You can move this symbol out of the condition to the beginning of the file, and
then just do:

config BR2_PACKAGE_LIBCEF_ARCH_DEPENDS

	bool
	default y
	depends on BR2_PACKAGE_LIBCEF_TARGET_ARCH != ""

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+comment "CEF needs toolchain w/ Glibc"

Same name as the package, so libcef, and lowercase glibc.

package/libcef/Config.in line 70

Quoted 1 line
package/libcef/Config.in new file +1 -0
+	depends on !BR2_TOOLCHAIN_USES_GLIBC

If you put this inside the condition, it will never be visible.

Also, you're missing all the other dependencies.

Don't forget that the comment should depend on the negated toolchain
dependencies (libc, wchar, gcc version, ..) but should also depend on the arch dependencies (binfmt_flat).

package/libcef/Config.in line 73

Quoted 3 lines
package/libcef/Config.in new file +3 -0
+
+comment "CEF depends on X.org and needs an OpenGL backend"
+	depends on !BR2_PACKAGE_XORG7 || !BR2_PACKAGE_HAS_LIBGL

Here also the arch dependencies should be repeated.

package/libcef/libcef.license-files.inc line 3

Quoted 11 lines
(quoted diff) +2 -0
+
+endif
package/libcef/libcef.license-files.inc new file +3 -0
new file mode 100644
index 0000000000..03fd700f24
@@ -0,0 +1,1130 @@
+LIBCEF_LICENSE_FILES = \
+	base/third_party/cityhash/COPYING \
+	base/third_party/dmg_fp/LICENSE \

Are all of these really used? Well, I guess trying to weed out the really
required ones manually is a bit too much work...

Could you add a comment in front that it is automatically generated?

[snip]

Quoted 19 lines
package/libcef/libcef.mk new file +13 -0
new file mode 100644
index 0000000000..fe69cabb2c
@@ -0,0 +1,372 @@
+################################################################################
+#
+# libcef
+#
+################################################################################
+
+# Run $(LIBCEF_PKGDIR)/scripts/version.sh to generate these values.
+# Don't bother trying to update these by hand, LIBCEF_CEF_VERSION is too
+# dependant on git to assemble ourselves.
+LIBCEF_VERSION = f3890bec3b21b01c2b5b026c50f96a9f2f070e7c
+LIBCEF_CEF_COMMIT_NUMBER = 2044
+LIBCEF_CEF_VERSION = 77.1.4+gf3890be+chromium-77.0.3865.90
+LIBCEF_CEF_VERSION_MAJOR = 3

package/libcef/libcef.mk line 23

Quoted 10 lines
package/libcef/libcef.mk new file +10 -0
+LIBCEF_CEF_VERSION_MINOR = 1
+LIBCEF_CEF_VERSION_PATCH = 4
+LIBCEF_CHROMIUM_VERSION_MAJOR = 77
+LIBCEF_CHROMIUM_VERSION_MINOR = 0
+LIBCEF_CHROMIUM_VERSION_BUILD = 3865
+LIBCEF_CHROMIUM_VERSION_PATCH = 90
+# End version.sh generated values
+
+LIBCEF_SITE = https://bitbucket.org/chromiumembedded/cef.git
+LIBCEF_SITE_METHOD = git

Bitbucket has an auto-archive feature just like github, so we could use that:

https://bitbucket.org/chromiumembedded/cef/get/f3890bec3b21b01c2b5b026c50f96a9f2f070e7c.tar.bz2

I don't know how stable the tarballs are though, so maybe git is better after all.

Something to mention in the commit message :-)

package/libcef/libcef.mk line 28

Quoted 5 lines
package/libcef/libcef.mk new file +5 -0
+LIBCEF_STRIP_COMPONENTS = 0
+
+LIBCEF_INSTALL_STAGING = YES
+LIBCEF_INSTALL_STAGING_INCLUDE_PATH=$(STAGING_DIR)/usr/include/cef
+LIBCEF_INSTALL_STAGING_LIBRARY_PATH=$(STAGING_DIR)/usr/lib/cef

In general, I'm no fan of defining variables for things where there is little
variance, like for these values.

More importantly, though: define the variables closer to where they're used.
And definitely after all the generic stuff.

package/libcef/libcef.mk line 30

Quoted 2 lines
package/libcef/libcef.mk new file +2 -0
+
+LIBCEF_LICENSE = GPL-2.0 or LGPL-3.0 or GPL-3.0 or GPL-3.0 with exception

I haven't checked, but I'd be surprised if a packages with such a *load of
bundled dependencies only has those four licenses...

package/libcef/libcef.mk line 34

Quoted 4 lines
package/libcef/libcef.mk new file +4 -0
+include package/libcef/libcef.license-files.inc
+
+# The Chromium source is fetched from a release tarball.
+LIBCEF_CHROMIUM_VERSION = $(LIBCEF_CHROMIUM_VERSION_MAJOR).$(LIBCEF_CHROMIUM_VERSION_MINOR).$(LIBCEF_CHROMIUM_VERSION_BUILD).$(LIBCEF_CHROMIUM_VERSION_PATCH)

The commit message should *definitely* explain that chromium itself is bundled,
and why.

Quoted 56 lines
package/libcef/libcef.mk new file +56 -0
+LIBCEF_EXTRA_DOWNLOADS = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$(LIBCEF_CHROMIUM_VERSION).tar.xz
+
+LIBCEF_DEPENDENCIES = \
+	alsa-lib \
+	at-spi2-atk \
+	at-spi2-core \
+	atk \
+	cairo \
+	compiler-rt \
+	dbus \
+	ffmpeg \
+	flac \
+	fontconfig \
+	freetype \
+	harfbuzz \
+	host-clang \
+	host-jpeg-turbo \
+	host-libkrb5 \
+	host-libnss \
+	host-libxml2 \
+	host-ninja \
+	host-nodejs \
+	host-pkgconf \
+	host-python \
+	host-webp \
+	jpeg-turbo \
+	libdrm \
+	libglib2 \
+	libgtk3 \
+	libgtkglext \
+	libkrb5 \
+	libnss \
+	libxml2 \
+	libxslt \
+	pango \
+	webp \
+	xlib_libXcomposite \
+	xlib_libXcursor \
+	xlib_libXrandr \
+	xlib_libXScrnSaver
+
+LIBCEF_HOST_PKG_CONFIG_WRAPPER = $(@D)/br-host-pkg-config.sh
+
+LIBCEF_GN_DEFINES = \
+	audio_processing_in_audio_service_supported=false \
+	clang_use_chrome_plugins=false \
+	closure_compile=false \
+	custom_toolchain=\"//build/toolchain/linux/unbundle:default\" \
+	enable_basic_print_dialog=false \
+	enable_nacl=false \
+	enable_service_discovery=false \
+	enable_vr=false \
+	forbid_non_component_debug_builds=false \
+	host_pkg_config=\"$(LIBCEF_HOST_PKG_CONFIG_WRAPPER)\" \
+	host_toolchain=\"//build/toolchain/linux/unbundle:host\" \
+	is_cfi=false \

package/libcef/libcef.mk line 100

Quoted 10 lines
package/libcef/libcef.mk new file +10 -0
+	is_unsafe_developer_build=false \
+	link_pulseaudio=false \
+	linux_use_bundled_binutils=false \
+	target_cpu=\"$(BR2_PACKAGE_LIBCEF_TARGET_ARCH)\" \
+	treat_warnings_as_errors=false \
+	use_bundled_fontconfig=false \
+	use_gnome_keyring=false \
+	use_gtk=false \
+	use_jumbo_build=true \
+	use_sysroot=false \

That's a bit surprising... We do use a sysroot.

Quoted 17 lines
package/libcef/libcef.mk new file +17 -0
+	use_system_freetype=true \
+	use_system_harfbuzz=true \
+	use_system_libjpeg=true \
+	use_viz_devtools=false
+
+# Use Buildroot system libraries instead of Chromium third_party libraries
+LIBCEF_SYSTEM_LIBS = \
+	ffmpeg \
+	flac \
+	fontconfig \
+	freetype \
+	harfbuzz-ng \
+	libjpeg \
+	libvpx \
+	libwebp \
+	libxml \
+	libxslt \

package/libcef/libcef.mk line 127

Quoted 10 lines
package/libcef/libcef.mk new file +10 -0
+	openh264 \
+	yasm
+
+LIBCEF_BUILD_TARGETS = cef chrome_sandbox
+
+# Use the HOSTLD rather than target linker, which warns about host include dirs
+LIBCEF_HOST_LDFLAGS = $(HOST_LDFLAGS) -fuse-ld=$(HOSTLD)
+
+# Use the target sysroot when building for the target
+LIBCEF_TARGET_CFLAGS = $(TARGET_CFLAGS) --sysroot=$(STAGING_DIR)

The need for this --sysroot is surprising, since the toolchain wrapper already
forces --sysroot.

Oooh, I see, it's using clang... Could you take a look at [1] and check if that
maybe simplifies things?

(Again, a commit message would help to avoid that I have to find out these
things for myself.)

package/libcef/libcef.mk line 133

Quoted 6 lines
package/libcef/libcef.mk new file +6 -0
+LIBCEF_TARGET_CXXFLAGS = $(TARGET_CXXFLAGS) --sysroot=$(STAGING_DIR)
+LIBCEF_TARGET_LDFLAGS = $(TARGET_LDFLAGS) --sysroot=$(STAGING_DIR)
+
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
+# Tell clang where the external toolchain is and to use it
+LIBCEF_TARGET_CFLAGS += --gcc-toolchain=$(TOOLCHAIN_EXTERNAL_INSTALL_DIR) \

Can you explain why this --gcc-toolchain is needed? It can find it in $PATH, no?

package/libcef/libcef.mk line 134

Quoted 1 line
package/libcef/libcef.mk new file +1 -0
+		       --target=$(BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX)

This is only valid for custom external toolchains. You want
TOOLCHAIN_EXTERNAL_PREFIX.

package/libcef/libcef.mk line 143

Quoted 9 lines
package/libcef/libcef.mk new file +9 -0
+LIBCEF_TARGET_CXXFLAGS += --gcc-toolchain=$(TOOLCHAIN_EXTERNAL_INSTALL_DIR) \
+		       --target=$(BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX)
+LIBCEF_TARGET_LDFLAGS += --gcc-toolchain=$(TOOLCHAIN_EXTERNAL_INSTALL_DIR) \
+		       --target=$(BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX)
+else
+# Tell clang to use the Buildroot toolchain
+LIBCEF_TARGET_CFLAGS += --target=$(GNU_TARGET_NAME)
+LIBCEF_TARGET_CXXFLAGS += --target=$(GNU_TARGET_NAME)
+LIBCEF_TARGET_LDFLAGS += --target=$(GNU_TARGET_NAME)

So --target needs as argument $(TARGET_CROSS), but without the path and without
the trailing -. Maybe it would be better to define a variable for that in Makefile.in and use it here?

Quoted 7 lines
package/libcef/libcef.mk new file +7 -0
+endif
+
+ifeq ($(BR2_i386)$(BR2_x86_64),y)
+LIBCEF_SYSTEM_LIBS += yasm
+LIBCEF_DEPENDENCIES += host-yasm
+endif
+

package/libcef/libcef.mk line 160

Quoted 10 lines
package/libcef/libcef.mk new file +10 -0
+ifeq ($(BR2_ENABLE_DEBUG),y)
+LIBCEF_BUILD_OUTPUT_DIR = out/Debug
+LIBCEF_GN_DEFINES += \
+	is_debug=true \
+	is_official_build=false
+else
+LIBCEF_BUILD_OUTPUT_DIR = out/Release
+LIBCEF_GN_DEFINES += \
+	is_debug=false \
+	is_official_build=true

I don't know if we ever can call it an offical build, but OK.

package/libcef/libcef.mk line 173

Quoted 13 lines
package/libcef/libcef.mk new file +13 -0
+endif
+
+# We have two build directories.  One uses the bundled LLVM libcxx, and the
+# other uses the system C++ standard library.  One is used for libcef.so, and
+# the other is for libcef_dll_wrapper.a, that dependant projects statically
+# link against.
+LIBCEF_BUILD_OUTPUT_DIR_SYSTEM_LIBCXX = $(LIBCEF_BUILD_OUTPUT_DIR)_system_libcxx
+
+# tcmalloc has portability issues
+LIBCEF_GN_DEFINES += use_allocator=\"none\"
+
+ifeq ($(BR2_CCACHE),y)
+LIBCEF_GN_DEFINES += cc_wrapper=\"ccache\"

I would expect $(CCACHE) here.

package/libcef/libcef.mk line 183

Quoted 10 lines
package/libcef/libcef.mk new file +10 -0
+endif
+
+# LLD is unsupported on i386, and fails during linking
+ifeq ($(BR2_i386)$(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y)
+LIBCEF_GN_DEFINES += use_lld=false
+# Disable gold as well, to force usage of our toolchain's ld.bfd
+LIBCEF_GN_DEFINES += use_gold=false
+else
+LIBCEF_GN_DEFINES += use_lld=false
+LIBCEF_GN_DEFINES += use_gold=false

Both branches have the same content...

Quoted 24 lines
package/libcef/libcef.mk new file +24 -0
+endif
+
+ifeq ($(BR2_PACKAGE_CUPS),y)
+LIBCEF_DEPENDENCIES += cups
+LIBCEF_GN_DEFINES += use_cups=true
+else
+LIBCEF_GN_DEFINES += use_cups=false
+endif
+
+ifeq ($(BR2_PACKAGE_PCIUTILS),y)
+LIBCEF_DEPENDENCIES += pciutils
+LIBCEF_GN_DEFINES += use_libpci=true
+else
+LIBCEF_GN_DEFINES += use_libpci=false
+endif
+
+ifeq ($(BR2_PACKAGE_PULSEAUDIO),y)
+LIBCEF_DEPENDENCIES += pulseaudio
+LIBCEF_GN_DEFINES += use_pulseaudio=true
+else
+LIBCEF_GN_DEFINES += use_pulseaudio=false
+endif
+
+define LIBCEF_EXTRACT_CMDS

package/libcef/libcef.mk line 217

Quoted 10 lines
package/libcef/libcef.mk new file +10 -0
+	# Extract Chromium source code
+	tar -C $(@D) \
+		--strip-components=1 \
+		-xf $(LIBCEF_DL_DIR)/chromium-$(LIBCEF_CHROMIUM_VERSION).tar.xz
+
+	# Extract CEF to cef dir inside Chromium source code
+	mkdir $(@D)/cef
+	tar -C $(@D)/cef \
+		--strip-components=1 \
+		-xf $(LIBCEF_DL_DIR)/libcef-$(LIBCEF_VERSION).tar.gz

So Buildroot first extracts (with --strip-components=0) in the top directory,
then chromium gets extracted next to it, and then we extract libcef again in a subdirectory... That sounds a bit like a roundabout approach, no?

I guess you intended to just do a move here, like

	mv $(@D)/libcef-$(LIBCEF_VERSION) $(@D)/cef

Or maybe even better, a symlink.

	ln -sf $(@D)/libcef-$(LIBCEF_VERSION) $(@D)/cef

package/libcef/libcef.mk line 222

Quoted 5 lines
package/libcef/libcef.mk new file +5 -0
+
+	# Patch the Chromium source with the CEF patches
+	( cd $(@D); \
+		for cef_patch in cef/patch/patches/*.patch; do \
+			patch -p0 -u -i "$$cef_patch"; \

Patching would be better to do in a pre- or post-patch hook.

Also, you could use APPLY_PATCHES:

	$(APPLY_PATCHES) $(@D) $(@D)/cef/patch/patches *.patch
Quoted 20 lines
package/libcef/libcef.mk new file +20 -0
+		done; \
+	)
+
+	# Copy the toolchain folder into the build directory
+	cp -r $(LIBCEF_PKGDIR)/toolchain $(@D)/
+endef
+
+LIBCEF_TARGET_CONFIGURE_ENV = \
+	$(TARGET_MAKE_ENV) \
+	BUILD_CC="clang" \
+	BUILD_CXX="clang++" \
+	BUILD_AR="$(HOSTAR)" \
+	BUILD_NM="$(HOSTNM)" \
+	BUILD_CFLAGS="$(HOST_CFLAGS)" \
+	BUILD_CXXFLAGS="$(HOST_CXXFLAGS)" \
+	BUILD_LDFLAGS="$(LIBCEF_HOST_LDFLAGS)" \
+	CC="clang" \
+	CXX="clang++" \
+	AR="ar" \
+	NM="nm" \

package/libcef/libcef.mk line 252

Quoted 10 lines
package/libcef/libcef.mk new file +10 -0
+	CFLAGS="$(LIBCEF_TARGET_CFLAGS)" \
+	CXXFLAGS="$(LIBCEF_TARGET_CXXFLAGS)" \
+	LDFLAGS="$(LIBCEF_TARGET_LDFLAGS)"
+
+define LIBCEF_CONFIGURE_CMDS
+	# Make the host pkg-config wrapper
+	echo "#!/bin/bash" > $(LIBCEF_HOST_PKG_CONFIG_WRAPPER)
+	echo $(HOST_MAKE_ENV) $(HOST_DIR)/bin/pkg-config '"$${@}"' >> \
+		$(LIBCEF_HOST_PKG_CONFIG_WRAPPER)
+	chmod +x $(LIBCEF_HOST_PKG_CONFIG_WRAPPER)

I think this host pkg-config wrapper could be useful in other places as well,
so I'd move it to the pkgconf package and to $(HOST_DIR)/bin. Yes, we can bikeshed on its name, but for now it can be called anything.

Quoted 23 lines
package/libcef/libcef.mk new file +23 -0
+
+	# Create include/cef_version.h
+	sed -e "s/{{ cef_version }}/$(LIBCEF_CEF_VERSION)/; \
+		s/{{ cef_version_major }}/$(LIBCEF_CEF_VERSION_MAJOR)/; \
+		s/{{ cef_version_minor }}/$(LIBCEF_CEF_VERSION_MINOR)/; \
+		s/{{ cef_version_patch }}/$(LIBCEF_CEF_VERSION_PATCH)/; \
+		s/{{ cef_commit_number }}/$(LIBCEF_CEF_COMMIT_NUMBER)/; \
+		s/{{ cef_commit_hash }}/$(LIBCEF_VERSION)/; \
+		s/{{ year }}/$$(date +%Y)/; \
+		s/{{ chrome_version_major }}/$(LIBCEF_CHROMIUM_VERSION_MAJOR)/; \
+		s/{{ chrome_version_minor }}/$(LIBCEF_CHROMIUM_VERSION_MINOR)/; \
+		s/{{ chrome_version_build }}/$(LIBCEF_CHROMIUM_VERSION_BUILD)/; \
+		s/{{ chrome_version_patch }}/$(LIBCEF_CHROMIUM_VERSION_PATCH)/;" \
+		$(LIBCEF_PKGDIR)/templates/cef_version.h > \
+			$(@D)/cef/include/cef_version.h
+
+	# Update the CEF API in case someone has patched it
+	( cd $(@D)/cef/tools; $(TARGET_MAKE_ENV) ./translator.sh )
+
+	# Shim headers allow us to link to unbundled system libraries.  Normally
+	# this isn't allowed in "official"/release builds.
+	# Disable the build time error for official builds with system libs.
+	( cd $(@D); \

package/libcef/libcef.mk line 285

Quoted 10 lines
package/libcef/libcef.mk new file +10 -0
+		sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
+			tools/generate_shim_headers/generate_shim_headers.py \
+	)
+
+	mkdir -p $(@D)/third_party/node/linux/node-linux-x64/bin
+	ln -sf $(HOST_DIR)/bin/node $(@D)/third_party/node/linux/node-linux-x64/bin/
+
+	# Use python2 by default
+	mkdir -p $(@D)/bin
+	ln -sf $(HOST_DIR)/usr/bin/python2 $(@D)/bin/python

Why is this needed? If host-python is built, $(HOST_DIR)/bin/python will point
to it (even if host-python3 is built as well).

BTW, $(HOST_DIR)/usr no longer exists (since a bit more than a year...)

[snip]

This is as far as I got with my preliminary review. I can tell you, it's not
going to be trivial to merge this...

Regards,
Arnout

[1] http://patchwork.ozlabs.org/project/buildroot/list/?series=129565

#34 lore raw

RFC PATCH v2 14/30 package/libcef: New package

Hi Arnout,

Thank you for all the feedback!

We've addressed most of your comments in v3 of the RFC.

For the rest, I'll respond inline below.

Quoted 7 lines · Arnout Vandecappelle

Review

Quoted 2 lines · Michael Drake
(quoted diff) +2 -0
+
+LIBCEF_LICENSE = GPL-2.0 or LGPL-3.0 or GPL-3.0 or GPL-3.0 with exception

I haven't checked, but I'd be surprised if a packages with such a *load of
bundled dependencies only has those four licenses...

True, we took our inspiration from the qt5webengine package, which is also based on the Chromium source tree, and already in Buildroot:

https://github.com/buildroot/buildroot/blob/master/package/qt5/qt5webengine/qt5webengine.mk#L20

Perhaps we need to generate a full list from the files listed in the package/libcef/libcef.license-files.inc file?

Quoted 5 lines

package/libcef/libcef.mk line 133

Quoted 3 lines
package/libcef/libcef.mk new file +3 -0
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
+# Tell clang where the external toolchain is and to use it
+LIBCEF_TARGET_CFLAGS += --gcc-toolchain=$(TOOLCHAIN_EXTERNAL_INSTALL_DIR) \

Can you explain why this --gcc-toolchain is needed? It can find it in $PATH, no?

Without it, when building using an external toolchain, we see linking errors:

[2852/24834] LINK ./chrome_sandbox
FAILED: chrome_sandbox
clang++ -Wl,--fatal-warnings -Wl,--build-id=sha1 -fPIC
-Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,-z,defs -Wl,--as-needed -fuse-ld=lld -Wl,--icf=all -Wl,--color-diagnostics -flto=thin -Wl,--thinlto-jobs=8 -Wl,--thinlto-cache-dir=thinlto-cache -Wl,--thinlto-cache-policy,cache_size=10\%:cache_size_bytes=10g:cache_size_files=100000 -Wl,--lto-O0 -fwhole-program-vtables -m64 -Wl,-O2 -Wl,--gc-sections -Wl,--gdb-index -rdynamic -nostdlib++ --sysroot=../../../../host/x86_64-buildroot-linux-gnu/sysroot -fsanitize=cfi-vcall -fsanitize=cfi-icall -pie -Wl,--disable-new-dtags -Wno-unknown-warning-option --target=x86_64-tesla-linux-gnu -o "./chrome_sandbox" -Wl,--start-group @"./chrome_sandbox.rsp" -Wl,--end-group -ldl -lpthread -lrt
ld.lld: error: cannot open crtbeginS.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc
ld.lld: error: cannot open crtendS.o: No such file or directory
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

Quoted 7 lines
Quoted 7 lines
package/libcef/libcef.mk new file +7 -0
+define LIBCEF_EXTRACT_CMDS
+	# Extract Chromium source code
+	tar -C $(@D) \
+		--strip-components=1 \
+		-xf $(LIBCEF_DL_DIR)/chromium-$(LIBCEF_CHROMIUM_VERSION).tar.xz
+
+	# Extract CEF to cef dir inside Chromium source code
Quoted 8 lines

package/libcef/libcef.mk line 217

Quoted 4 lines
package/libcef/libcef.mk new file +4 -0
+	mkdir $(@D)/cef
+	tar -C $(@D)/cef \
+		--strip-components=1 \
+		-xf $(LIBCEF_DL_DIR)/libcef-$(LIBCEF_VERSION).tar.gz

So Buildroot first extracts (with --strip-components=0) in the top directory,
then chromium gets extracted next to it, and then we extract libcef again in a subdirectory... That sounds a bit like a roundabout approach, no?

Actually, I think defining LIBCEF_EXTRACT_CMDS replaces the default Buildroot extraction commands. We simply extract the Chromium source into the top level libcef output directory, and then extract the CEF source into a cef/ directory within that. This is the source tree layout that the CEF project requires.

Cheers,

Michael

#35 lore raw

RFC PATCH v2 15/30 package/libcef: Add option to build cefclient and cefsimple.

In reply to Michael Drake

From: Thomas Preston <[email protected]>

Cc Patrick Glaser <[email protected]>
Cc Jon duSaint <[email protected]>
Cc Enis Lavery <[email protected]>
---
 package/libcef/Config.in | 10 ++++++++++
 package/libcef/libcef.mk | 18 ++++++++++++++++++
 2 files changed, 28 insertions(+)
package/libcef/Config.in +10 -0
index 85a993bb93..7bdaf17ffd 100644
@@ -58,6 +58,16 @@ config BR2_PACKAGE_LIBCEF
 
 if BR2_PACKAGE_LIBCEF
 
+config BR2_PACKAGE_LIBCEF_CEFSIMPLE
+	bool "Enable libcef example application cefsimple."
+	help
+	  Enables libcef example application cefsimple.
+
+config BR2_PACKAGE_LIBCEF_CEFCLIENT
+	bool "Enable libcef example application cefclient."
+	help
+	  Enables libcef example application cefclient.
+
 config BR2_PACKAGE_LIBCEF_TARGET_ARCH
 	string
 	default "arm" if BR2_arm
package/libcef/libcef.mk +18 -0
index fe69cabb2c..b20c003a90 100644
@@ -204,6 +204,24 @@ else
 LIBCEF_GN_DEFINES += use_pulseaudio=false
 endif
 
+ifeq ($(BR2_PACKAGE_LIBCEF_CEFSIMPLE),y)
+LIBCEF_BUILD_TARGETS += cefsimple
+define LIBCEF_INSTALL_CEFSIMPLE
+	$(INSTALL) -m 0755 -D -t $(TARGET_DIR)/usr/bin \
+		$(@D)/$(LIBCEF_BUILD_OUTPUT_DIR)/cefsimple
+endef
+LIBCEF_POST_INSTALL_TARGET_HOOKS += LIBCEF_INSTALL_CEFSIMPLE
+endif
+
+ifeq ($(BR2_PACKAGE_LIBCEF_CEFCLIENT),y)
+LIBCEF_BUILD_TARGETS += cefclient
+define LIBCEF_INSTALL_CEFCLIENT
+	$(INSTALL) -m 0755 -D -t $(TARGET_DIR)/usr/bin \
+		$(@D)/$(LIBCEF_BUILD_OUTPUT_DIR)/cefclient
+endef
+LIBCEF_POST_INSTALL_TARGET_HOOKS += LIBCEF_INSTALL_CEFCLIENT
+endif
+
 define LIBCEF_EXTRACT_CMDS
 	# Extract Chromium source code
 	tar -C $(@D) \
Signature · 1 line
2.20.1
#36 lore raw

RFC PATCH v2 16/30 package/libcef: Add option to enable VA-API HW acceleration.

In reply to Michael Drake
Cc Patrick Glaser <[email protected]>
Cc Jon duSaint <[email protected]>
Cc Enis Lavery <[email protected]>
---
 package/libcef/Config.in | 6 ++++++
 package/libcef/libcef.mk | 7 +++++++
 2 files changed, 13 insertions(+)
package/libcef/Config.in +6 -0
index 7bdaf17ffd..05d577ecb6 100644
@@ -68,6 +68,12 @@ config BR2_PACKAGE_LIBCEF_CEFCLIENT
 	help
 	  Enables libcef example application cefclient.
 
+config BR2_PACKAGE_LIBCEF_VAAPI
+	bool "Enable va-api support in libcef."
+	select BR2_PACKAGE_LIBVA
+	help
+	  Enables VA-API-based hardware acceleration.
+
 config BR2_PACKAGE_LIBCEF_TARGET_ARCH
 	string
 	default "arm" if BR2_arm
package/libcef/libcef.mk +7 -0
index b20c003a90..9fa87cbb89 100644
@@ -204,6 +204,13 @@ else
 LIBCEF_GN_DEFINES += use_pulseaudio=false
 endif
 
+ifeq ($(BR2_PACKAGE_LIBCEF_VAAPI),y)
+LIBCEF_GN_DEFINES += use_vaapi=true
+LIBCEF_DEPENDENCIES += libva
+else
+LIBCEF_GN_DEFINES += use_vaapi=false
+endif
+
 ifeq ($(BR2_PACKAGE_LIBCEF_CEFSIMPLE),y)
 LIBCEF_BUILD_TARGETS += cefsimple
 define LIBCEF_INSTALL_CEFSIMPLE
Signature · 1 line
2.20.1
#37 lore raw

RFC PATCH v2 17/30 package/libcef: Add proprietary codecs build option.

In reply to Michael Drake

This uses the Chromium bundled ffmpeg.

Cc Patrick Glaser <[email protected]>
Cc Jon duSaint <[email protected]>
Cc Enis Lavery <[email protected]>
---
 package/libcef/Config.in | 10 +++++++++-
 package/libcef/libcef.mk | 12 +++++++++---
 2 files changed, 18 insertions(+), 4 deletions(-)
package/libcef/Config.in +9 -1
index 05d577ecb6..46d412f228 100644
@@ -13,7 +13,7 @@ config BR2_PACKAGE_LIBCEF
 	select BR2_PACKAGE_ALSA_LIB
 	select BR2_PACKAGE_COMPILER_RT
 	select BR2_PACKAGE_DBUS
-	select BR2_PACKAGE_FFMPEG
+	select BR2_PACKAGE_FFMPEG if !BR2_PACKAGE_LIBCEF_PROPRIETARY_CODECS
 	select BR2_PACKAGE_FLAC
 	select BR2_PACKAGE_FREETYPE
 	select BR2_PACKAGE_HARFBUZZ
@@ -39,6 +39,7 @@ config BR2_PACKAGE_LIBCEF
 	select BR2_PACKAGE_LIBGTKGLEXT
 	select BR2_PACKAGE_LIBKRB5
 	select BR2_PACKAGE_LIBNSS
+	select BR2_PACKAGE_LIBOPENH264 if BR2_PACKAGE_LIBCEF_PROPRIETARY_CODECS
 	select BR2_PACKAGE_LIBPNG
 	select BR2_PACKAGE_PCIUTILS
 	select BR2_PACKAGE_PANGO
@@ -74,6 +75,13 @@ config BR2_PACKAGE_LIBCEF_VAAPI
 	help
 	  Enables VA-API-based hardware acceleration.
 
+config BR2_PACKAGE_LIBCEF_PROPRIETARY_CODECS
+	bool "Enable proprietary codecs in libcef"
+	help
+	  Enable proprietary codecs in libcef. This uses
+	  the ffmpeg bundled in Chromium, rather than the
+	  ffmpeg buildroot package.
+
 config BR2_PACKAGE_LIBCEF_TARGET_ARCH
 	string
 	default "arm" if BR2_arm
package/libcef/libcef.mk +9 -3
index 9fa87cbb89..e7a4c2b1a3 100644
@@ -42,7 +42,6 @@ LIBCEF_DEPENDENCIES = \
 	cairo \
 	compiler-rt \
 	dbus \
-	ffmpeg \
 	flac \
 	fontconfig \
 	freetype \
@@ -105,7 +104,6 @@ LIBCEF_GN_DEFINES = \
 
 # Use Buildroot system libraries instead of Chromium third_party libraries
 LIBCEF_SYSTEM_LIBS = \
-	ffmpeg \
 	flac \
 	fontconfig \
 	freetype \
@@ -115,11 +113,19 @@ LIBCEF_SYSTEM_LIBS = \
 	libwebp \
 	libxml \
 	libxslt \
-	openh264 \
 	yasm
 
 LIBCEF_BUILD_TARGETS = cef chrome_sandbox
 
+ifeq ($(BR2_PACKAGE_LIBCEF_PROPRIETARY_CODECS),y)
+LIBCEF_GN_DEFINES += \
+	ffmpeg_branding=\"Chrome\" \
+	proprietary_codecs=true
+else
+LIBCEF_DEPENDENCIES += ffmpeg
+LIBCEF_SYSTEM_LIBS += ffmpeg
+endif
+
 # Use the HOSTLD rather than target linker, which warns about host include dirs
 LIBCEF_HOST_LDFLAGS = $(HOST_LDFLAGS) -fuse-ld=$(HOSTLD)
 
Signature · 1 line
2.20.1
#38 lore raw

RFC PATCH v2 18/30 package/widevine: Add package for the widevine CDM library.

In reply to Michael Drake
---
 package/Config.in            |  1 +
 package/widevine/Config.in   |  6 ++++++
 package/widevine/widevine.mk | 28 ++++++++++++++++++++++++++++
 3 files changed, 35 insertions(+)
 create mode 100644 package/widevine/Config.in
 create mode 100644 package/widevine/widevine.mk
package/Config.in +1 -0
index 5fc2b8a635..d290f88067 100644
@@ -1650,6 +1650,7 @@ menu "Networking"
 	source "package/usbredir/Config.in"
 	source "package/wampcc/Config.in"
 	source "package/websocketpp/Config.in"
+	source "package/widevine/Config.in"
 	source "package/zeromq/Config.in"
 	source "package/zmqpp/Config.in"
 	source "package/zyre/Config.in"
package/widevine/Config.in new file +6 -0
new file mode 100644
index 0000000000..d730e6f9bd
@@ -0,0 +1,6 @@
+menuconfig BR2_PACKAGE_WIDEVINE
+	bool "widevine"
+	depends on BR2_i386 || BR2_x86_64
+	help
+	  Proprietary content decryption module (CDM) for the digital
+	  rights management (DRM) of internet content.
package/widevine/widevine.mk new file +28 -0
new file mode 100644
index 0000000000..7a7546c5a0
@@ -0,0 +1,28 @@
+# Get latest version number from: https://dl.google.com/widevine-cdm/current.txt
+WIDEVINE_VERSION = 1.4.9.1088
+
+ifeq ($(BR2_i386),y)
+WIDEVINE_ARCH = ia32
+else ifeq ($(BR2_x86_64),y)
+WIDEVINE_ARCH = x64
+endif
+
+WIDEVINE_SOURCE = $(WIDEVINE_VERSION)-linux-$(WIDEVINE_ARCH).zip
+WIDEVINE_SITE = https://dl.google.com/widevine-cdm
+WIDEVINE_LICENSE = Proprietary
+WIDEVINE_LICENSE_FILES = LICENSE.txt
+WIDEVINE_INSTALL_STAGING = YES
+
+define WIDEVINE_EXTRACT_CMDS
+	$(UNZIP) $(WIDEVINE_DL_DIR)/$(WIDEVINE_SOURCE) -d $(@D)
+endef
+
+define WIDEVINE_INSTALL_STAGING_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/libwidevinecdm.so $(STAGING_DIR)/usr/lib
+endef
+
+define WIDEVINE_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/libwidevinecdm.so $(TARGET_DIR)/usr/lib
+endef
+
+$(eval $(generic-package))
Signature · 1 line
2.20.1
#39 lore raw

RFC PATCH v2 19/30 package/libcef: Widevine support depends on widevine package.

In reply to Michael Drake
Cc Patrick Glaser <[email protected]>
Cc Jon duSaint <[email protected]>
Cc Enis Lavery <[email protected]>
---
 package/libcef/Config.in | 6 ++++++
 package/libcef/libcef.mk | 7 +++++++
 2 files changed, 13 insertions(+)
package/libcef/Config.in +6 -0
index 46d412f228..c06fc094d3 100644
@@ -69,6 +69,12 @@ config BR2_PACKAGE_LIBCEF_CEFCLIENT
 	help
 	  Enables libcef example application cefclient.
 
+config BR2_PACKAGE_LIBCEF_WIDEVINE
+	bool "Enable Widevine support in libcef."
+	select BR2_PACKAGE_WIDEVINE
+	help
+	  Enables Widevine key system support.
+
 config BR2_PACKAGE_LIBCEF_VAAPI
 	bool "Enable va-api support in libcef."
 	select BR2_PACKAGE_LIBVA
package/libcef/libcef.mk +7 -0
index e7a4c2b1a3..0fa9c61315 100644
@@ -210,6 +210,13 @@ else
 LIBCEF_GN_DEFINES += use_pulseaudio=false
 endif
 
+ifeq ($(BR2_PACKAGE_LIBCEF_WIDEVINE),y)
+LIBCEF_GN_DEFINES += enable_widevine=true
+LIBCEF_DEPENDENCIES += widevine
+else
+LIBCEF_GN_DEFINES += enable_widevine=false
+endif
+
 ifeq ($(BR2_PACKAGE_LIBCEF_VAAPI),y)
 LIBCEF_GN_DEFINES += use_vaapi=true
 LIBCEF_DEPENDENCIES += libva
Signature · 1 line
2.20.1
#40 lore raw

RFC PATCH v2 20/30 package/alsa-lib/alsa-lib: Add host package.

In reply to Michael Drake
---
 package/alsa-lib/alsa-lib.mk | 1 +
 1 file changed, 1 insertion(+)
package/alsa-lib/alsa-lib.mk +1 -0
index fecf7d7cfa..7502a91259 100644
@@ -67,3 +67,4 @@ ALSA_LIB_CONF_ENV = \
 	LDFLAGS="$(TARGET_LDFLAGS) -lm"
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.20.1
#41 lore raw

RFC PATCH v2 21/30 package/ffmpeg: Add host package.

In reply to Michael Drake
---
 package/ffmpeg/ffmpeg.mk | 61 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
package/ffmpeg/ffmpeg.mk +61 -0
index 21fb24e597..cefeb0d5f5 100644
@@ -56,6 +56,46 @@ FFMPEG_CONF_OPTS = \
 	--disable-symver \
 	--disable-doc
 
+HOST_FFMPEG_CONF_OPTS = \
+	--enable-avfilter \
+	--disable-version3 \
+	--enable-logging \
+	--enable-optimizations \
+	--disable-extra-warnings \
+	--enable-avdevice \
+	--enable-avcodec \
+	--enable-avformat \
+	--enable-network \
+	--disable-gray \
+	--enable-swscale-alpha \
+	--disable-small \
+	--enable-dct \
+	--enable-fft \
+	--enable-mdct \
+	--enable-rdft \
+	--disable-crystalhd \
+	--disable-dxva2 \
+	--enable-runtime-cpudetect \
+	--disable-hardcoded-tables \
+	--disable-mipsdsp \
+	--disable-mipsdspr2 \
+	--disable-msa \
+	--enable-hwaccels \
+	--disable-cuda \
+	--disable-cuvid \
+	--disable-nvenc \
+	--disable-avisynth \
+	--disable-frei0r \
+	--disable-libopencore-amrnb \
+	--disable-libopencore-amrwb \
+	--disable-libdc1394 \
+	--disable-libgsm \
+	--disable-libilbc \
+	--disable-libvo-amrwbenc \
+	--disable-libxcb \
+	--disable-symver \
+	--disable-doc
+
 FFMPEG_DEPENDENCIES += host-pkgconf
 
 ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
@@ -406,9 +446,12 @@ endif
 ifeq ($(BR2_X86_CPU_HAS_MMX),y)
 FFMPEG_CONF_OPTS += --enable-x86asm
 FFMPEG_DEPENDENCIES += host-nasm
+HOST_FFMPEG_DEPENDENCIES += host-nasm
 else
 FFMPEG_CONF_OPTS += --disable-x86asm
 FFMPEG_CONF_OPTS += --disable-mmx
+HOST_FFMPEG_CONF_OPTS += --disable-x86asm
+HOST_FFMPEG_CONF_OPTS += --disable-mmx
 endif
 
 ifeq ($(BR2_X86_CPU_HAS_SSE),y)
@@ -553,9 +596,27 @@ define FFMPEG_CONFIGURE_CMDS
 	)
 endef
 
+HOST_FFMPEG_CONF_ENV += CFLAGS="$(HOST_FFMPEG_CFLAGS)"
+
+# Override HOST_FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others
+define HOST_FFMPEG_CONFIGURE_CMDS
+	(cd $(HOST_FFMPEG_SRCDIR) && rm -rf config.cache && \
+	$(HOST_CONFIGURE_OPTS) \
+	$(HOST_CONFIGURE_ARGS) \
+	$(HOST_FFMPEG_CONF_ENV) \
+	./configure \
+		--prefix="$(HOST_DIR)" \
+		--enable-shared --disable-static \
+		--disable-doc \
+		--disable-debug \
+		$(HOST_FFMPEG_CONF_OPTS) \
+	)
+endef
+
 define FFMPEG_REMOVE_EXAMPLE_SRC_FILES
 	rm -rf $(TARGET_DIR)/usr/share/ffmpeg/examples
 endef
 FFMPEG_POST_INSTALL_TARGET_HOOKS += FFMPEG_REMOVE_EXAMPLE_SRC_FILES
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.20.1
#42 lore raw

RFC PATCH v2 22/30 package/libvpx: Add host package.

In reply to Michael Drake
---
 package/libvpx/libvpx.mk | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
package/libvpx/libvpx.mk +29 -0
index 73fe2057de..f4ea019c0e 100644
@@ -15,11 +15,16 @@ LIBVPX_CONF_ENV = \
 	LD="$(TARGET_CC)" \
 	CROSS=$(GNU_TARGET_NAME)
 
+HOST_LIBVPX_CONF_ENV = \
+	LD="$(HOST_CC)"
+
 LIBVPX_CONF_OPTS = \
 	--disable-examples \
 	--disable-docs \
 	--disable-unit-tests
 
+HOST_LIBVPX_CONF_OPTS = $(LIBVPX_CONF_OPTS)
+
 # This is not a true autotools package.  It is based on the ffmpeg build system
 define LIBVPX_CONFIGURE_CMDS
 	(cd $(LIBVPX_SRCDIR) && rm -rf config.cache && \
@@ -35,10 +40,29 @@ define LIBVPX_CONFIGURE_CMDS
 	)
 endef
 
+define HOST_LIBVPX_CONFIGURE_CMDS
+	(cd $(HOST_LIBVPX_SRCDIR) && rm -rf config.cache && \
+	$(HOST_CONFIGURE_OPTS) \
+	$(HOST_CONFIGURE_ARGS) \
+	$(HOST_LIBVPX_CONF_ENV) \
+	./configure \
+		--target=generic-gnu \
+		--enable-pic \
+		--prefix="$(HOST_DIR)" \
+		--enable-shared --disable-static \
+		--disable-debug \
+		$(HOST_LIBVPX_CONF_OPTS) \
+	)
+endef
+
 define LIBVPX_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(LIBVPX_MAKE_ENV) $(MAKE) -C $(@D) all
 endef
 
+define HOST_LIBVPX_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(HOST_LIBVPX_MAKE_ENV) $(MAKE) -C $(@D) all
+endef
+
 define LIBVPX_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(LIBVPX_MAKE_ENV) $(MAKE) DESTDIR="$(STAGING_DIR)" -C $(@D) install
 endef
@@ -47,4 +71,9 @@ define LIBVPX_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(LIBVPX_MAKE_ENV) $(MAKE) DESTDIR="$(TARGET_DIR)" -C $(@D) install
 endef
 
+define HOST_LIBVPX_INSTALL_CMDS
+	$(HOST_MAKE_ENV) $(HOST_LIBVPX_MAKE_ENV) $(MAKE) -C $(@D) install
+endef
+
 $(eval $(generic-package))
+$(eval $(host-generic-package))
Signature · 1 line
2.20.1
#43 lore raw

RFC PATCH v2 23/30 package/x11r7/xcb-util: Add host package.

In reply to Michael Drake
---
 package/x11r7/xcb-util/xcb-util.mk | 2 ++
 1 file changed, 2 insertions(+)
package/x11r7/xcb-util/xcb-util.mk +2 -0
index bb73530f94..9a4f927364 100644
@@ -11,5 +11,7 @@ XCB_UTIL_LICENSE = MIT
 XCB_UTIL_LICENSE_FILES = COPYING
 XCB_UTIL_INSTALL_STAGING = YES
 XCB_UTIL_DEPENDENCIES = libxcb
+HOST_XCB_UTIL_DEPENDENCIES = host-libxcb
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.20.1
#44 lore raw

RFC PATCH v2 24/30 package/x11r7/xlib_libXScrnSaver: Add host package.

In reply to Michael Drake
---
 package/x11r7/xlib_libXScrnSaver/xlib_libXScrnSaver.mk | 2 ++
 1 file changed, 2 insertions(+)
package/x11r7/xlib_libXScrnSaver/xlib_libXScrnSaver.mk +2 -0
index 92abb902eb..1292aff5a7 100644
@@ -11,6 +11,8 @@ XLIB_LIBXSCRNSAVER_LICENSE = MIT
 XLIB_LIBXSCRNSAVER_LICENSE_FILES = COPYING
 XLIB_LIBXSCRNSAVER_INSTALL_STAGING = YES
 XLIB_LIBXSCRNSAVER_DEPENDENCIES = xlib_libX11 xlib_libXext xorgproto
+HOST_XLIB_LIBXSCRNSAVER_DEPENDENCIES = host-xlib_libX11 host-xlib_libXext host-xorgproto
 XLIB_LIBXSCRNSAVER_CONF_OPTS = --disable-malloc0returnsnull
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.20.1
#45 lore raw

RFC PATCH v2 25/30 package/x11r7/xlib_libXcomposite: Add host package.

In reply to Michael Drake
---
 package/x11r7/xlib_libXcomposite/xlib_libXcomposite.mk | 2 ++
 1 file changed, 2 insertions(+)
package/x11r7/xlib_libXcomposite/xlib_libXcomposite.mk +2 -0
index 80e94fe37c..ac32113f48 100644
@@ -11,5 +11,7 @@ XLIB_LIBXCOMPOSITE_LICENSE = MIT
 XLIB_LIBXCOMPOSITE_LICENSE_FILES = COPYING
 XLIB_LIBXCOMPOSITE_INSTALL_STAGING = YES
 XLIB_LIBXCOMPOSITE_DEPENDENCIES = xlib_libX11 xlib_libXext xlib_libXfixes xorgproto
+HOST_XLIB_LIBXCOMPOSITE_DEPENDENCIES = host-xlib_libX11 host-xlib_libXext host-xlib_libXfixes host-xorgproto
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.20.1
#46 lore raw

RFC PATCH v2 26/30 package/x11r7/xlib_libXext: Add host package.

In reply to Michael Drake
---
 package/x11r7/xlib_libXext/xlib_libXext.mk | 2 ++
 1 file changed, 2 insertions(+)
package/x11r7/xlib_libXext/xlib_libXext.mk +2 -0
index c63a3b23cc..90f6357e80 100644
@@ -11,6 +11,8 @@ XLIB_LIBXEXT_LICENSE = MIT
 XLIB_LIBXEXT_LICENSE_FILES = COPYING
 XLIB_LIBXEXT_INSTALL_STAGING = YES
 XLIB_LIBXEXT_DEPENDENCIES = xlib_libX11 xorgproto
+HOST_XLIB_LIBXEXT_DEPENDENCIES = host-xlib_libX11 host-xorgproto
 XLIB_LIBXEXT_CONF_OPTS = --disable-malloc0returnsnull
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.20.1
#47 lore raw

RFC PATCH v2 27/30 package/x11r7/xlib_libXi: Add host package.

In reply to Michael Drake
---
 package/x11r7/xlib_libXi/xlib_libXi.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/x11r7/xlib_libXi/xlib_libXi.mk +7 -0
index de7f3a7d3c..96c4487a7f 100644
@@ -16,7 +16,14 @@ XLIB_LIBXI_DEPENDENCIES = \
 	xlib_libXext \
 	xlib_libXfixes \
 	xorgproto
+HOST_XLIB_LIBXI_DEPENDENCIES = \
+	host-pkgconf \
+	host-xlib_libX11 \
+	host-xlib_libXext \
+	host-xlib_libXfixes \
+	host-xorgproto
 
 XLIB_LIBXI_CONF_OPTS = --disable-malloc0returnsnull
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.20.1
#48 lore raw

RFC PATCH v2 28/30 package/x11r7/xlib_libXrandr: Add host package.

In reply to Michael Drake
---
 package/x11r7/xlib_libXrandr/xlib_libXrandr.mk | 2 ++
 1 file changed, 2 insertions(+)
package/x11r7/xlib_libXrandr/xlib_libXrandr.mk +2 -0
index 23a0d974d0..a8080904af 100644
@@ -11,6 +11,8 @@ XLIB_LIBXRANDR_LICENSE = MIT
 XLIB_LIBXRANDR_LICENSE_FILES = COPYING
 XLIB_LIBXRANDR_INSTALL_STAGING = YES
 XLIB_LIBXRANDR_DEPENDENCIES = xlib_libX11 xlib_libXext xlib_libXrender xorgproto
+HOST_XLIB_LIBXRANDR_DEPENDENCIES = host-xlib_libX11 host-xlib_libXext host-xlib_libXrender host-xorgproto
 XLIB_LIBXRANDR_CONF_OPTS = --disable-malloc0returnsnull
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.20.1
#49 lore raw

RFC PATCH v2 29/30 package/x11r7/xlib_libXtst: Add host package.

In reply to Michael Drake
---
 package/x11r7/xlib_libXtst/xlib_libXtst.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/x11r7/xlib_libXtst/xlib_libXtst.mk +7 -0
index e0d7e8217c..38878b0e0e 100644
@@ -17,4 +17,11 @@ XLIB_LIBXTST_DEPENDENCIES = \
 	xlib_libXi \
 	xorgproto
 
+HOST_XLIB_LIBXTST_DEPENDENCIES = \
+	host-xlib_libX11 \
+	host-xlib_libXext \
+	host-xlib_libXi \
+	host-xorgproto
+
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.20.1
#50 lore raw

RFC PATCH v2 30/30 package/libcef: Add v8 Snapshot option.

In reply to Michael Drake
---
 package/libcef/Config.in | 22 ++++++++++++++++++++++
 package/libcef/libcef.mk | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+)
package/libcef/Config.in +22 -0
index c06fc094d3..9e0fa22ad5 100644
@@ -69,6 +69,28 @@ config BR2_PACKAGE_LIBCEF_CEFCLIENT
 	help
 	  Enables libcef example application cefclient.
 
+config BR2_PACKAGE_LIBCEF_V8_SNAPSHOTS
+	bool "Enable v8 snapshots in libcef"
+	select BR2_PACKAGE_HOST_DBUS
+	select BR2_PACKAGE_HOST_FFMPEG
+	select BR2_PACKAGE_HOST_LIBVPX
+	select BR2_PACKAGE_HOST_LIBXCB
+	select BR2_PACKAGE_HOST_XCB_UTIL
+	select BR2_PACKAGE_HOST_XLIB_LIBXTST
+	help
+	  Enables V8 snapshots.  This is an optimisation for
+	  JavaScript context creation (e.g. opening new tabs).
+	  It avoids needing to execute a whole load of JavaScript
+	  code that gets run on context initialisation.
+	  It works by building a browser for the host, creating
+	  a JavaScript context, and saving the JavaScript heap
+	  to file.  The target browser can then load the recorded
+	  JavaScript heap from file, instead of executing the
+	  JavaScript code.
+	  Note that since this requires building a browser for
+	  the host, it requires a lot of extra host packages
+	  to be built.
+
 config BR2_PACKAGE_LIBCEF_WIDEVINE
 	bool "Enable Widevine support in libcef."
 	select BR2_PACKAGE_WIDEVINE
package/libcef/libcef.mk +32 -0
index 0fa9c61315..63e2e3a767 100644
@@ -210,6 +210,27 @@ else
 LIBCEF_GN_DEFINES += use_pulseaudio=false
 endif
 
+ifeq ($(BR2_PACKAGE_LIBCEF_V8_SNAPSHOTS),y)
+LIBCEF_GN_DEFINES += \
+	v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:host\" \
+	v8_use_snapshot=true
+LIBCEF_DEPENDENCIES += \
+	host-alsa-lib \
+	host-dbus \
+	host-ffmpeg \
+	host-libvpx \
+	host-libxcb \
+	host-xcb-util \
+	host-xlib_libXcomposite \
+	host-xlib_libXcursor \
+	host-xlib_libXrandr \
+	host-xlib_libXScrnSaver \
+	host-xlib_libXtst
+else
+LIBCEF_GN_DEFINES += \
+	v8_use_snapshot=false
+endif
+
 ifeq ($(BR2_PACKAGE_LIBCEF_WIDEVINE),y)
 LIBCEF_GN_DEFINES += enable_widevine=true
 LIBCEF_DEPENDENCIES += widevine
@@ -242,6 +263,17 @@ endef
 LIBCEF_POST_INSTALL_TARGET_HOOKS += LIBCEF_INSTALL_CEFCLIENT
 endif
 
+ifeq ($(BR2_PACKAGE_LIBCEF_V8_SNAPSHOTS),y)
+define LIBCEF_INSTALL_V8_SNAPSHOT_BINARIES
+	# v8 snapshot binaries
+	$(INSTALL) -m 0644 -D -t $(TARGET_DIR)/usr/lib \
+		$(@D)/$(LIBCEF_BUILD_OUTPUT_DIR)/natives_blob.bin \
+		$(@D)/$(LIBCEF_BUILD_OUTPUT_DIR)/snapshot_blob.bin \
+		$(@D)/$(LIBCEF_BUILD_OUTPUT_DIR)/v8_context_snapshot.bin
+endef
+LIBCEF_POST_INSTALL_TARGET_HOOKS += LIBCEF_INSTALL_V8_SNAPSHOT_BINARIES
+endif
+
 define LIBCEF_EXTRACT_CMDS
 	# Extract Chromium source code
 	tar -C $(@D) \
Signature · 1 line
2.20.1
#51 lore raw

v2 cover Add Chromium Embedded Framework library

In reply to Michael Drake
Quoted 10 lines · Michael Drake

Hi all,

Here's a work in progress second attempt at adding libcef to Buildroot.

We're still working on:

- Testing integration with dependant packages.
- Cross compiling.

We'd appreciate any feedback!

Since there has been some feedback now, I've marked the entire series as
Changes Requested in patchwork.

Thanks!

Regards,
Arnout