Skip to contentSkip to conversation

dtc: also check <yaml.h> for libyaml

PATCH In review Jiping Ma 3 participants 9 messages Jun 8, 2020 – Jun 10, 2020 Device tree

lore
Share & tools
lore

Jiping Ma

author
#0 lore raw

PATCH 1/1 dtc: also check <yaml.h> for libyaml

yamltree.c includes <yaml.h>, If /usr/include/yaml.h does not exist, it fails to build.

---
 scripts/dtc/Makefile | 4 ++++
 1 file changed, 4 insertions(+)
scripts/dtc/Makefile +4 -0
index b5a5b1c..b49dfea 100644
@@ -18,9 +18,13 @@ $(error dtc needs libyaml for DT schema validation support. \
 endif
 HOST_EXTRACFLAGS += -DNO_YAML
 else
+ifeq ($(wildcard /usr/include/yaml.h),)
+HOST_EXTRACFLAGS += -DNO_YAML
+else
 dtc-objs	+= yamltree.o
 HOSTLDLIBS_dtc	:= $(shell pkg-config yaml-0.1 --libs)
 endif
+endif
 
 # Generated files need one more search path to include headers in source tree
 HOSTCFLAGS_dtc-lexer.lex.o := -I $(srctree)/$(src)
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 3 lines · Jiping Ma

yamltree.c includes <yaml.h>, If /usr/include/yaml.h does not exist, it fails to build.

Does this patch fix your issue?:

https://lore.kernel.org/linux-devicetree/[email protected]/

Quoted 26 lines
---
 scripts/dtc/Makefile | 4 ++++
 1 file changed, 4 insertions(+)
scripts/dtc/Makefile +4 -1
index b5a5b1c..b49dfea 100644
@@ -18,9 +18,13 @@ $(error dtc needs libyaml for DT schema validation support. \
 endif
 HOST_EXTRACFLAGS += -DNO_YAML
 else
+ifeq ($(wildcard /usr/include/yaml.h),)
+HOST_EXTRACFLAGS += -DNO_YAML
+else
 dtc-objs       += yamltree.o
 HOSTLDLIBS_dtc := $(shell pkg-config yaml-0.1 --libs)
 endif
+endif
 
 # Generated files need one more search path to include headers in source tree
 HOSTCFLAGS_dtc-lexer.lex.o := -I $(srctree)/$(src)
--

1.9.1

author
#2 lore raw
Quoted 6 lines · Rob Herring
Quoted 2 lines · Jiping Ma

yamltree.c includes <yaml.h>, If /usr/include/yaml.h does not exist, it fails to build.

Does this patch fix your issue?:

https://lore.kernel.org/linux-devicetree/[email protected]/

No, it did not fix the issue.

$ pkg-config --cflags yaml-0.1
$ pkg-config yaml-0.1 --libs
-L/buildarea/jma1/wr-19-0518/19.45/sysroots/aarch64-wrs-linux/usr/lib64 -lyaml
Quoted 28 lines
Quoted 28 lines
---
  scripts/dtc/Makefile | 4 ++++
  1 file changed, 4 insertions(+)
scripts/dtc/Makefile +4 -1
index b5a5b1c..b49dfea 100644
@@ -18,9 +18,13 @@ $(error dtc needs libyaml for DT schema validation support. \
  endif
  HOST_EXTRACFLAGS += -DNO_YAML
  else
+ifeq ($(wildcard /usr/include/yaml.h),)
+HOST_EXTRACFLAGS += -DNO_YAML
+else
  dtc-objs       += yamltree.o
  HOSTLDLIBS_dtc := $(shell pkg-config yaml-0.1 --libs)
  endif
+endif
 
  # Generated files need one more search path to include headers in source tree
  HOSTCFLAGS_dtc-lexer.lex.o := -I $(srctree)/$(src)
--

1.9.1

#3 lore raw
Quoted 5 lines · Jiping Ma
Quoted 1 line · Rob Herring

On Mon, Jun 8, 2020 at 2:42 AM Jiping Ma <[email protected]> wrote:

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

yamltree.c includes <yaml.h>, If /usr/include/yaml.h does not exist, it fails to build.

Does this patch fix your issue?:

https://lore.kernel.org/linux-devicetree/[email protected]/

No, it did not fix the issue.

$ pkg-config --cflags yaml-0.1

Then, this is a problem on your system.

Quoted 27 lines
$ pkg-config yaml-0.1 --libs
(quoted diff) +0 -2
-L/buildarea/jma1/wr-19-0518/19.45/sysroots/aarch64-wrs-linux/usr/lib64
-lyaml
Quoted 24 lines
Quoted 24 lines
---
  scripts/dtc/Makefile | 4 ++++
  1 file changed, 4 insertions(+)
scripts/dtc/Makefile +4 -0
index b5a5b1c..b49dfea 100644
@@ -18,9 +18,13 @@ $(error dtc needs libyaml for DT schema validation support. \
  endif
  HOST_EXTRACFLAGS += -DNO_YAML
  else
+ifeq ($(wildcard /usr/include/yaml.h),)
+HOST_EXTRACFLAGS += -DNO_YAML
+else
  dtc-objs       += yamltree.o
  HOSTLDLIBS_dtc := $(shell pkg-config yaml-0.1 --libs)
  endif
+endif
 
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
scripts/dtc/Makefile +0 -1
  # Generated files need one more search path to include headers in source tree
  HOSTCFLAGS_dtc-lexer.lex.o := -I $(srctree)/$(src)
--

1.9.1

--
Best Regards
Masahiro Yamada

#4 lore raw
In reply to Jiping Ma
Quoted 15 lines · Jiping Ma
Quoted 6 lines · Rob Herring
Quoted 2 lines · Jiping Ma

yamltree.c includes <yaml.h>, If /usr/include/yaml.h does not exist, it fails to build.

Does this patch fix your issue?:

https://lore.kernel.org/linux-devicetree/[email protected]/

No, it did not fix the issue.

$ pkg-config --cflags yaml-0.1
$ pkg-config yaml-0.1 --libs

Review

Quoted 2 lines
(quoted diff) +0 -2
-L/buildarea/jma1/wr-19-0518/19.45/sysroots/aarch64-wrs-linux/usr/lib64
-lyaml

If I install libyaml to a non-standard location (/home/masahiro/foo), my pkg-config shows as follows:

masahiro@oscar:~$ pkg-config --cflags   yaml-0.1
-I/home/masahiro/foo/include
masahiro@oscar:~$ pkg-config --libs   yaml-0.1
-L/home/masahiro/foo/lib -lyaml
Quoted 29 lines
Quoted 28 lines
Quoted 28 lines
---
  scripts/dtc/Makefile | 4 ++++
  1 file changed, 4 insertions(+)
scripts/dtc/Makefile +4 -1
index b5a5b1c..b49dfea 100644
@@ -18,9 +18,13 @@ $(error dtc needs libyaml for DT schema validation support. \
  endif
  HOST_EXTRACFLAGS += -DNO_YAML
  else
+ifeq ($(wildcard /usr/include/yaml.h),)
+HOST_EXTRACFLAGS += -DNO_YAML
+else
  dtc-objs       += yamltree.o
  HOSTLDLIBS_dtc := $(shell pkg-config yaml-0.1 --libs)
  endif
+endif
 
  # Generated files need one more search path to include headers in source tree
  HOSTCFLAGS_dtc-lexer.lex.o := -I $(srctree)/$(src)
--

1.9.1

Signature · 2 lines
Best Regards
Masahiro Yamada
author
#5 lore raw
Quoted 9 lines · Masahiro Yamada
Quoted 8 lines · Jiping Ma
Quoted 5 lines · Rob Herring
Quoted 2 lines · Jiping Ma

yamltree.c includes <yaml.h>, If /usr/include/yaml.h does not exist, it fails to build.

Does this patch fix your issue?:

Quoted 8 lines

Review

Quoted 8 lines
Quoted 1 line

https://lore.kernel.org/linux-devicetree/[email protected]/

No, it did not fix the issue.

$ pkg-config --cflags yaml-0.1
$ pkg-config yaml-0.1 --libs
(quoted diff) +0 -2
-L/buildarea/jma1/wr-19-0518/19.45/sysroots/aarch64-wrs-linux/usr/lib64
-lyaml

This issue happened in Yocto,  After completing the SDK build and installing it, use a new shell to source the environment and try to build the helper scripts. export SDKTARGETSYSROOT=/buildarea/jma1/wr-19-0518/19.45/sysroots/aarch64-wrs-linux
export PKG_CONFIG_PATH=$SDKTARGETSYSROOT/usr/lib64/pkgconfig:$SDKTARGETSYSROOT/usr/share/pkgconfig

Quoted 47 lines

If I install libyaml to a non-standard location (/home/masahiro/foo), my pkg-config shows as follows:

masahiro@oscar:~$ pkg-config --cflags   yaml-0.1
-I/home/masahiro/foo/include
masahiro@oscar:~$ pkg-config --libs   yaml-0.1
-L/home/masahiro/foo/lib -lyaml
Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
---
   scripts/dtc/Makefile | 4 ++++
   1 file changed, 4 insertions(+)
scripts/dtc/Makefile +4 -1
index b5a5b1c..b49dfea 100644
@@ -18,9 +18,13 @@ $(error dtc needs libyaml for DT schema validation support. \
   endif
   HOST_EXTRACFLAGS += -DNO_YAML
   else
+ifeq ($(wildcard /usr/include/yaml.h),)
+HOST_EXTRACFLAGS += -DNO_YAML
+else
   dtc-objs       += yamltree.o
   HOSTLDLIBS_dtc := $(shell pkg-config yaml-0.1 --libs)
   endif
+endif
 
   # Generated files need one more search path to include headers in source tree
   HOSTCFLAGS_dtc-lexer.lex.o := -I $(srctree)/$(src)
--

1.9.1

#6 lore raw
Quoted 18 lines · Jiping Ma
Quoted 14 lines · Masahiro Yamada
Quoted 13 lines · Jiping Ma
Quoted 6 lines · Rob Herring
Quoted 2 lines · Jiping Ma

yamltree.c includes <yaml.h>, If /usr/include/yaml.h does not exist, it fails to build.

Does this patch fix your issue?:

https://lore.kernel.org/linux-devicetree/[email protected]/

No, it did not fix the issue.

$ pkg-config --cflags yaml-0.1
Quoted 12 lines
Quoted 3 lines

Review

Quoted 3 lines
$ pkg-config yaml-0.1 --libs
(quoted diff) +0 -2
-L/buildarea/jma1/wr-19-0518/19.45/sysroots/aarch64-wrs-linux/usr/lib64
-lyaml

This issue happened in Yocto, After completing the SDK build and
installing it, use a new shell to source the environment and try to
build the helper scripts.
export SDKTARGETSYSROOT=/buildarea/jma1/wr-19-0518/19.45/sysroots/aarch64-wrs-linux export PKG_CONFIG_PATH=$SDKTARGETSYSROOT/usr/lib64/pkgconfig:$SDKTARGETSYSROOT/usr/share/pkgconfig

Quoted 2 lines

Probably, this commit:

https://github.com/yaml/libyaml/commit/3c80be99fb18f3ee18af37221a3b0c4760e8df06

Use newer libyaml, and that's fine.

Signature · 2 lines
Best Regards
Masahiro Yamada
author
#7 lore raw
Quoted 29 lines · Masahiro Yamada
Quoted 16 lines · Jiping Ma
Quoted 13 lines · Masahiro Yamada
Quoted 12 lines · Jiping Ma
Quoted 6 lines · Rob Herring
Quoted 2 lines · Jiping Ma

yamltree.c includes <yaml.h>, If /usr/include/yaml.h does not exist, it fails to build.

Does this patch fix your issue?:

https://lore.kernel.org/linux-devicetree/[email protected]/

No, it did not fix the issue.

$ pkg-config --cflags yaml-0.1
Quoted 11 lines
Quoted 3 lines

Review

Quoted 3 lines
$ pkg-config yaml-0.1 --libs
(quoted diff) +0 -2
-L/buildarea/jma1/wr-19-0518/19.45/sysroots/aarch64-wrs-linux/usr/lib64
-lyaml

This issue happened in Yocto, After completing the SDK build and
installing it, use a new shell to source the environment and try to
build the helper scripts.
export SDKTARGETSYSROOT=/buildarea/jma1/wr-19-0518/19.45/sysroots/aarch64-wrs-linux export PKG_CONFIG_PATH=$SDKTARGETSYSROOT/usr/lib64/pkgconfig:$SDKTARGETSYSROOT/usr/share/pkgconfig

Quoted 1 line
Quoted 6 lines

Probably, this commit:

https://github.com/yaml/libyaml/commit/3c80be99fb18f3ee18af37221a3b0c4760e8df06

Use newer libyaml, and that's fine.

This commit already was included in our code.

Quoted 2 lines
#8 lore raw
Quoted 33 lines · Jiping Ma
Quoted 29 lines · Masahiro Yamada
Quoted 27 lines · Jiping Ma
Quoted 8 lines · Masahiro Yamada
Quoted 7 lines · Jiping Ma
Quoted 5 lines · Rob Herring
Quoted 2 lines · Jiping Ma

yamltree.c includes <yaml.h>, If /usr/include/yaml.h does not exist, it fails to build.

Does this patch fix your issue?:

Quoted 8 lines

Review

Quoted 8 lines
Quoted 1 line

https://lore.kernel.org/linux-devicetree/[email protected]/

No, it did not fix the issue.

$ pkg-config --cflags yaml-0.1
$ pkg-config yaml-0.1 --libs
(quoted diff) +0 -2
-L/buildarea/jma1/wr-19-0518/19.45/sysroots/aarch64-wrs-linux/usr/lib64
-lyaml

This issue happened in Yocto, After completing the SDK build and
installing it, use a new shell to source the environment and try to
build the helper scripts.
export SDKTARGETSYSROOT=/buildarea/jma1/wr-19-0518/19.45/sysroots/aarch64-wrs-linux export PKG_CONFIG_PATH=$SDKTARGETSYSROOT/usr/lib64/pkgconfig:$SDKTARGETSYSROOT/usr/share/pkgconfig

Quoted 1 line
Quoted 7 lines
Quoted 6 lines

Probably, this commit:

https://github.com/yaml/libyaml/commit/3c80be99fb18f3ee18af37221a3b0c4760e8df06

Use newer libyaml, and that's fine.

This commit already was included in our code.

Then, I have no idea,
but this is not a problem in the kernel build.

Signature · 2 lines
Best Regards
Masahiro Yamada