Skip to contentSkip to conversation

examples: make examples customizable

PATCH New Heinrich Schuchardt 4 participants 7 messages Sep 22, 2020 – Sep 23, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples: make examples customizable

Most users don't need the standalone API examples. Distributions like Suse do not supply libgcc for cross-compiling and we cannot do without on ARMv8 for building examples/.

Make examples customizable via symbol CONFIG_EXAMPLES. It only defaults to yes to ensure that we compile it on Gitlab CI.

---
I wonder if we should not completely drop the standalone API. The UEFI API has enough to run a standalone application.

---
 Kconfig           | 8 ++++++++
 examples/Makefile | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)
Kconfig +8 -0
index 883e3f71d0..d0eae2ceba 100644
@@ -422,6 +422,14 @@ config SYS_SRAM_SIZE
 	default 0x10000 if TARGET_TRICORDER
 	default 0x0
 
+config EXAMPLES
+	bool "Compile API examples"
+	depends on !SANDBOX
+	default y
+	help
+	  U-Boot provides an API for standalone applications. Examples are
+	  provided in directory examples/.
+
 endmenu		# General setup
 
 menu "Boot images"
examples/Makefile +1 -1
index d440bc5655..bf518bd221 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 
-ifndef CONFIG_SANDBOX
+ifdef CONFIG_EXAMPLES
 
 ifdef FTRACE
 subdir-ccflags-y += -finstrument-functions -DFTRACE

--
2.28.0

#1 lore raw

PATCH 1/1 examples: make examples customizable

Most users don't need the standalone API examples. Distributions like Suse do not supply libgcc for cross-compiling and we cannot do without on ARMv8 for building examples/.

Make examples customizable via symbol CONFIG_EXAMPLES. It only defaults to yes to ensure that we compile it on Gitlab CI.

---
I wonder if we should not completely drop the standalone API. The UEFI API has enough to run a standalone application.

---
 Kconfig           | 8 ++++++++
 examples/Makefile | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)
Kconfig +8 -0
index 883e3f71d0..d0eae2ceba 100644
@@ -422,6 +422,14 @@ config SYS_SRAM_SIZE
 	default 0x10000 if TARGET_TRICORDER
 	default 0x0
 
+config EXAMPLES
+	bool "Compile API examples"
+	depends on !SANDBOX
+	default y
+	help
+	  U-Boot provides an API for standalone applications. Examples are
+	  provided in directory examples/.
+
 endmenu		# General setup
 
 menu "Boot images"
examples/Makefile +1 -1
index d440bc5655..bf518bd221 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 
-ifndef CONFIG_SANDBOX
+ifdef CONFIG_EXAMPLES
 
 ifdef FTRACE
 subdir-ccflags-y += -finstrument-functions -DFTRACE

--
2.28.0

#2 lore raw

PATCH 1/1 examples: make examples customizable

Quoted 1 line · Heinrich Schuchardt

Most users don't need the standalone API examples. Distributions like Suse

Nit: It's SUSE not Suse

Regards,
Matthias

Quoted 50 lines

do not supply libgcc for cross-compiling and we cannot do without on ARMv8 for building examples/.

Make examples customizable via symbol CONFIG_EXAMPLES. It only defaults to yes to ensure that we compile it on Gitlab CI.

---
I wonder if we should not completely drop the standalone API. The UEFI API has enough to run a standalone application.

---
  Kconfig           | 8 ++++++++
  examples/Makefile | 2 +-
  2 files changed, 9 insertions(+), 1 deletion(-)
Kconfig +8 -0
index 883e3f71d0..d0eae2ceba 100644
@@ -422,6 +422,14 @@ config SYS_SRAM_SIZE
  	default 0x10000 if TARGET_TRICORDER
  	default 0x0
 
+config EXAMPLES
+	bool "Compile API examples"
+	depends on !SANDBOX
+	default y
+	help
+	  U-Boot provides an API for standalone applications. Examples are
+	  provided in directory examples/.
+
  endmenu		# General setup
 
  menu "Boot images"
examples/Makefile +1 -2
index d440bc5655..bf518bd221 100644
@@ -1,6 +1,6 @@
  # SPDX-License-Identifier: GPL-2.0+
 
-ifndef CONFIG_SANDBOX
+ifdef CONFIG_EXAMPLES
 
  ifdef FTRACE
  subdir-ccflags-y += -finstrument-functions -DFTRACE
--

2.28.0

#3 lore raw

PATCH 1/1 examples: make examples customizable

In reply to Heinrich Schuchardt
Quoted 6 lines · Heinrich Schuchardt

Most users don't need the standalone API examples. Distributions like Suse do not supply libgcc for cross-compiling and we cannot do without on ARMv8 for building examples/.

Make examples customizable via symbol CONFIG_EXAMPLES. It only defaults to yes to ensure that we compile it on Gitlab CI.

In this case we should not make it "default y" but instead enable it in some specific cases that go through CI. Probably once per arch/ directory on the QEMU / virtual target for that arch.

Quoted 5 lines

---
I wonder if we should not completely drop the standalone API. The UEFI API has enough to run a standalone application.

I'm certainly in favor of NOT adding support there for new architectures. I don't believe however we can drop it for existing architectures without some fairly large notice, and only then when UEFI is available as a reasonable replacement (ARM? Yes. MIPS? No idea).

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200922/b88414cc/attachment.sig>
#4 lore raw

PATCH 1/1 examples: make examples customizable

Quoted 6 lines · Tom Rini
Quoted 4 lines · Heinrich Schuchardt

Most users don't need the standalone API examples. Distributions like Suse do not supply libgcc for cross-compiling and we cannot do without on ARMv8 for building examples/.

Quoted 6 lines
Quoted 2 lines

Make examples customizable via symbol CONFIG_EXAMPLES. It only defaults to yes to ensure that we compile it on Gitlab CI.

In this case we should not make it "default y" but instead enable it in some specific cases that go through CI. Probably once per arch/ directory on the QEMU / virtual target for that arch.

default y if ARCH_QEMU would compile it

Quoted 7 lines
Quoted 6 lines

---
I wonder if we should not completely drop the standalone API. The UEFI API has enough to run a standalone application.

Quoted 5 lines

I'm certainly in favor of NOT adding support there for new architectures. I don't believe however we can drop it for existing architectures without some fairly large notice, and only then when UEFI is available as a reasonable replacement (ARM? Yes. MIPS? No idea).

UEFI is low endian only.

Best regards

Heinrich

#5 lore raw

PATCH 1/1 examples: make examples customizable

Quoted 7 lines · Heinrich Schuchardt
Quoted 6 lines · Tom Rini
Quoted 4 lines · Heinrich Schuchardt

Most users don't need the standalone API examples. Distributions like Suse do not supply libgcc for cross-compiling and we cannot do without on ARMv8 for building examples/.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Make examples customizable via symbol CONFIG_EXAMPLES. It only defaults to yes to ensure that we compile it on Gitlab CI.

In this case we should not make it "default y" but instead enable it in some specific cases that go through CI. Probably once per arch/ directory on the QEMU / virtual target for that arch.

default y if ARCH_QEMU would compile it

OK, lets do that in v2 please.

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

---
I wonder if we should not completely drop the standalone API. The UEFI API has enough to run a standalone application.

Quoted 7 lines
Quoted 5 lines

I'm certainly in favor of NOT adding support there for new architectures. I don't believe however we can drop it for existing architectures without some fairly large notice, and only then when UEFI is available as a reasonable replacement (ARM? Yes. MIPS? No idea).

UEFI is low endian only.

Right, so we can't just remove the standalone API but we can encourage new architectures to see if UEFI is right for them.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200922/63b8bd2a/attachment.sig>
#6 lore raw

PATCH 1/1 examples: make examples customizable

In reply to Heinrich Schuchardt

Hi Heinrich,

Quoted 5 lines · Heinrich Schuchardt

Most users don't need the standalone API examples. Distributions like Suse do not supply libgcc for cross-compiling and we cannot do without on ARMv8 for building examples/.

Quoted 8 lines

Make examples customizable via symbol CONFIG_EXAMPLES. It only defaults to yes to ensure that we compile it on Gitlab CI.

---
I wonder if we should not completely drop the standalone API. The UEFI API has enough to run a standalone application.

I am not sure. I don't like UEFI at all and it doesn't expose U-Boot devices, etc.