Skip to contentSkip to conversation

u-boot-tools: Add dependency on libyaml for dtschema validation

PATCH In review Khem Raj 3 participants 5 messages Apr 12 – Apr 24

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/1 u-boot-tools: Add dependency on libyaml for dtschema validation

yamltree host tool, used to emit YAML from the DT, is now built as part of the normal u-boot-tools build to support the schema infrastructure

Fixes link errors like

| /usr/bin/ld: scripts/dtc/yamltree.o: in function `dt_to_yaml':
| yamltree.c:(.text+0x91b): undefined reference to `yaml_emitter_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x926): undefined reference to `yaml_emitter_set_output_file'
| /usr/bin/ld: yamltree.c:(.text+0x933): undefined reference to `yaml_stream_start_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x93e): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x957): undefined reference to `yaml_document_start_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x962): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x983): undefined reference to `yaml_sequence_start_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x98e): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x9ab): undefined reference to `yaml_sequence_end_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x9b6): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x9c8): undefined reference to `yaml_document_end_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x9d3): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x9e3): undefined reference to `yaml_stream_end_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x9ee): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x9fa): undefined reference to `yaml_emitter_delete'

---
v2: Add dep on native libyalm alone

 meta/recipes-bsp/u-boot/u-boot-tools.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-bsp/u-boot/u-boot-tools.inc +1 -1
index 4e4f7fa092..a055409c2c 100644
@@ -1,5 +1,5 @@
 SUMMARY = "U-Boot bootloader tools"
-DEPENDS += "gnutls openssl util-linux swig-native"
+DEPENDS += "gnutls openssl util-linux swig-native libyaml-native"
 
 inherit python3native
 export STAGING_INCDIR = "${STAGING_INCDIR_NATIVE}"
#1 lore raw

Is this specific to the 2026.04 upgrade or does it apply to 2026.01 too?

Ross

Quoted 52 lines · Khem Raj via lists.openembedded.org

yamltree host tool, used to emit YAML from the DT, is now built as part of the normal u-boot-tools build to support the schema infrastructure

Fixes link errors like

| /usr/bin/ld: scripts/dtc/yamltree.o: in function `dt_to_yaml':
| yamltree.c:(.text+0x91b): undefined reference to `yaml_emitter_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x926): undefined reference to `yaml_emitter_set_output_file'
| /usr/bin/ld: yamltree.c:(.text+0x933): undefined reference to `yaml_stream_start_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x93e): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x957): undefined reference to `yaml_document_start_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x962): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x983): undefined reference to `yaml_sequence_start_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x98e): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x9ab): undefined reference to `yaml_sequence_end_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x9b6): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x9c8): undefined reference to `yaml_document_end_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x9d3): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x9e3): undefined reference to `yaml_stream_end_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x9ee): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x9fa): undefined reference to `yaml_emitter_delete'

---
v2: Add dep on native libyalm alone

meta/recipes-bsp/u-boot/u-boot-tools.inc | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-bsp/u-boot/u-boot-tools.inc +0 -0
index 4e4f7fa092..a055409c2c 100644
@@ -1,5 +1,5 @@

SUMMARY = "U-Boot bootloader tools"

meta/recipes-bsp/u-boot/u-boot-tools.inc +1 -1
-DEPENDS += "gnutls openssl util-linux swig-native"
+DEPENDS += "gnutls openssl util-linux swig-native libyaml-native"

inherit python3native
export STAGING_INCDIR = "${STAGING_INCDIR_NATIVE}"

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#235052): https://lists.openembedded.org/g/openembedded-core/message/235052
Mute This Topic: https://lists.openembedded.org/mt/118784443/6875888
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

author
#2 lore raw
Quoted 2 lines · Ross Burton

Is this specific to the 2026.04 upgrade or does it apply to 2026.01 too?

I think 2026.01 does not need it.

Quoted 76 lines

Ross

Quoted 1 line

On 12 Apr 2026, at 04:57, Khem Raj via lists.openembedded.org <raj.khem=

Quoted 9 lines · [email protected]> wrote:

yamltree host tool, used to emit YAML from the DT, is now built as part of the normal u-boot-tools build to support the schema infrastructure

Fixes link errors like

| /usr/bin/ld: scripts/dtc/yamltree.o: in function `dt_to_yaml':
| yamltree.c:(.text+0x91b): undefined reference to

`yaml_emitter_initialize'

Quoted 1 line

| /usr/bin/ld: yamltree.c:(.text+0x926): undefined reference to

`yaml_emitter_set_output_file'

Quoted 1 line

| /usr/bin/ld: yamltree.c:(.text+0x933): undefined reference to

`yaml_stream_start_event_initialize'

Quoted 1 line

| /usr/bin/ld: yamltree.c:(.text+0x93e): undefined reference to

`yaml_emitter_emit'

Quoted 1 line

| /usr/bin/ld: yamltree.c:(.text+0x957): undefined reference to

`yaml_document_start_event_initialize'

Quoted 1 line

| /usr/bin/ld: yamltree.c:(.text+0x962): undefined reference to

`yaml_emitter_emit'

Quoted 1 line

| /usr/bin/ld: yamltree.c:(.text+0x983): undefined reference to

`yaml_sequence_start_event_initialize'

Quoted 1 line

| /usr/bin/ld: yamltree.c:(.text+0x98e): undefined reference to

`yaml_emitter_emit'

Quoted 1 line

| /usr/bin/ld: yamltree.c:(.text+0x9ab): undefined reference to

`yaml_sequence_end_event_initialize'

Quoted 1 line

| /usr/bin/ld: yamltree.c:(.text+0x9b6): undefined reference to

`yaml_emitter_emit'

Quoted 1 line

| /usr/bin/ld: yamltree.c:(.text+0x9c8): undefined reference to

`yaml_document_end_event_initialize'

Quoted 1 line

| /usr/bin/ld: yamltree.c:(.text+0x9d3): undefined reference to

`yaml_emitter_emit'

Quoted 1 line

| /usr/bin/ld: yamltree.c:(.text+0x9e3): undefined reference to

`yaml_stream_end_event_initialize'

Quoted 1 line

| /usr/bin/ld: yamltree.c:(.text+0x9ee): undefined reference to

`yaml_emitter_emit'

Quoted 1 line

| /usr/bin/ld: yamltree.c:(.text+0x9fa): undefined reference to

`yaml_emitter_delete'

Review

Quoted 9 lines

---
v2: Add dep on native libyalm alone

meta/recipes-bsp/u-boot/u-boot-tools.inc | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/meta/recipes-bsp/u-boot/u-boot-tools.inc

Quoted 8 lines

index 4e4f7fa092..a055409c2c 100644

meta/recipes-bsp/u-boot/u-boot-tools.inc +0 -0
@@ -1,5 +1,5 @@

SUMMARY = "U-Boot bootloader tools"

meta/recipes-bsp/u-boot/u-boot-tools.inc +1 -1
-DEPENDS += "gnutls openssl util-linux swig-native"
+DEPENDS += "gnutls openssl util-linux swig-native libyaml-native"
Quoted 6 lines

inherit python3native
export STAGING_INCDIR = "${STAGING_INCDIR_NATIVE}"

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#235052):

https://lists.openembedded.org/g/openembedded-core/message/235052

Quoted 3 lines

Mute This Topic: https://lists.openembedded.org/mt/118784443/6875888
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [

[email protected]]

Quoted 2 lines

-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw
In reply to Ross Burton

Hi Ross,

Quoted 2 lines · Ross Burton via lists.openembedded.org

Is this specific to the 2026.04 upgrade or does it apply to 2026.01 too?

The file only exists in 2026.04+.

Cheers,
Quentin

#4 lore raw
In reply to Khem Raj

Hi Khem,

Quoted 6 lines · Khem Raj via lists.openembedded.org

yamltree host tool, used to emit YAML from the DT, is now built as part of the normal u-boot-tools build to support the schema infrastructure

Fixes link errors like

Quoted 17 lines
| /usr/bin/ld: scripts/dtc/yamltree.o: in function `dt_to_yaml':
| yamltree.c:(.text+0x91b): undefined reference to `yaml_emitter_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x926): undefined reference to `yaml_emitter_set_output_file'
| /usr/bin/ld: yamltree.c:(.text+0x933): undefined reference to `yaml_stream_start_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x93e): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x957): undefined reference to `yaml_document_start_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x962): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x983): undefined reference to `yaml_sequence_start_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x98e): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x9ab): undefined reference to `yaml_sequence_end_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x9b6): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x9c8): undefined reference to `yaml_document_end_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x9d3): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x9e3): undefined reference to `yaml_stream_end_event_initialize'
| /usr/bin/ld: yamltree.c:(.text+0x9ee): undefined reference to `yaml_emitter_emit'
| /usr/bin/ld: yamltree.c:(.text+0x9fa): undefined reference to `yaml_emitter_delete'

OK so there's a test to check if libyaml is available by looking if there's a file at $(PKG_CONFIG_SYSROOT_DIR)/usr/include/yaml.h. Then it uses pkg-config --cflags and pkg-config --libs on yaml-0.1 to find where that is located. I'm assuming the first one is found, possibly on the host distro, and the pkg-config possibly returns nothing as libyaml isn't available in the sysroot? This seems to be what 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot") is supposed to handle (specifically mentioning this fixes building with Yocto SDK). This commit is part of 2026.04, so not sure what's going on there. They say the error doesn't happen within Yocto because pseudo intercepts and rewrites the path, so this seems weird.

This logic is also borrowed from the kernel, which funnily enough dropped this entirely 4 years ago, in commit ef8795f3f1ce ("dt-bindings: kbuild: Use DTB files for validation"). So maybe something to work on with U-Boot to update DTC again (Kbuild and DTC updates aren't trivial in U-Boot as far as I understood as we have "lightly" forked it).

Cheers,
Quentin