All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] efibootmgr: Pass correct flags to compiler from pkg-config
@ 2019-06-25  6:01 Khem Raj
  2019-06-25  8:58 ` Adrian Bunk
  0 siblings, 1 reply; 2+ messages in thread
From: Khem Raj @ 2019-06-25  6:01 UTC (permalink / raw)
  To: openembedded-core

efivar.h is in usr/include/efirvar directory so it should be
added to include search path via -I to compiler cmdline to fix

make[1]: *** No rule to make target 'efivar.h', needed by 'efibootmgr.o'.  Stop.
| make[1]: *** Waiting for unfinished jobs....

When running clang to generate dependencies -MM -MG -MF it still
parses the compile unit and complains if certain header is not found
where as gcc does not do that, hence the compile error is only seen
when compiling with clang.

FIx is use a weak default assignment for PKGS var which is used by
pkg-config to deduce compiler flags, this helps in getting right
-I flags even for dep step

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Ross Burton <ross.burton@intel.com>
---
 ...failts-Set-PKGS-to-efivar-by-default.patch | 33 +++++++++++++++++++
 meta/recipes-bsp/efibootmgr/efibootmgr_17.bb  |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta/recipes-bsp/efibootmgr/efibootmgr/0001-Make.defailts-Set-PKGS-to-efivar-by-default.patch

diff --git a/meta/recipes-bsp/efibootmgr/efibootmgr/0001-Make.defailts-Set-PKGS-to-efivar-by-default.patch b/meta/recipes-bsp/efibootmgr/efibootmgr/0001-Make.defailts-Set-PKGS-to-efivar-by-default.patch
new file mode 100644
index 0000000000..415012d64c
--- /dev/null
+++ b/meta/recipes-bsp/efibootmgr/efibootmgr/0001-Make.defailts-Set-PKGS-to-efivar-by-default.patch
@@ -0,0 +1,33 @@
+From f6c3154810938506c13e22d16935ae4d07e911dc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 24 Jun 2019 22:27:21 -0700
+Subject: [PATCH] Make.defailts: Set PKGS to efivar by default
+
+This ensures that when make dep is run then pkg-config logic can add
+efivar related variables to cflags and ldflags
+
+Fixes
+make[1]: *** No rule to make target 'efivar.h', needed by 'efibootmgr.o'.  Stop.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Make.defaults | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Make.defaults b/Make.defaults
+index c4c0592..d75c6f4 100644
+--- a/Make.defaults
++++ b/Make.defaults
+@@ -32,7 +32,7 @@ AR	:= $(CROSS_COMPILE)gcc-ar
+ NM	:= $(CROSS_COMPILE)gcc-nm
+ RANLIB	:= $(CROSS_COMPILE)gcc-ranlib
+ 
+-PKGS	=
++PKGS	?= efivar
+ 
+ SUBDIR_CFLAGS ?=
+ clang_cflags =
+-- 
+2.22.0
+
diff --git a/meta/recipes-bsp/efibootmgr/efibootmgr_17.bb b/meta/recipes-bsp/efibootmgr/efibootmgr_17.bb
index 0e5a81e316..835c7b3b81 100644
--- a/meta/recipes-bsp/efibootmgr/efibootmgr_17.bb
+++ b/meta/recipes-bsp/efibootmgr/efibootmgr_17.bb
@@ -12,6 +12,7 @@ COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
 
 SRC_URI = "git://github.com/rhinstaller/efibootmgr.git;protocol=https \
            file://0001-remove-extra-decl.patch \
+           file://0001-Make.defailts-Set-PKGS-to-efivar-by-default.patch \
           "
 SRCREV = "e067160ecef8208e1944002e5d50b275733211fb"
 
-- 
2.22.0



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

* Re: [PATCH v2] efibootmgr: Pass correct flags to compiler from pkg-config
  2019-06-25  6:01 [PATCH v2] efibootmgr: Pass correct flags to compiler from pkg-config Khem Raj
@ 2019-06-25  8:58 ` Adrian Bunk
  0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2019-06-25  8:58 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-core

On Mon, Jun 24, 2019 at 11:01:21PM -0700, Khem Raj wrote:
> efivar.h is in usr/include/efirvar directory so it should be
> added to include search path via -I to compiler cmdline to fix
> 
> make[1]: *** No rule to make target 'efivar.h', needed by 'efibootmgr.o'.  Stop.
> | make[1]: *** Waiting for unfinished jobs....
> 
> When running clang to generate dependencies -MM -MG -MF it still
> parses the compile unit and complains if certain header is not found
> where as gcc does not do that, hence the compile error is only seen
> when compiling with clang.
> 
> FIx is use a weak default assignment for PKGS var which is used by
> pkg-config to deduce compiler flags, this helps in getting right
> -I flags even for dep step
>...
> +Upstream-Status: Pending
>...

It would be better to backport the upstream fix instead:
https://github.com/rhboot/efibootmgr/commit/97668ae0bce776a36ea2001dea63d376be8274ac

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed



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

end of thread, other threads:[~2019-06-25  8:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-25  6:01 [PATCH v2] efibootmgr: Pass correct flags to compiler from pkg-config Khem Raj
2019-06-25  8:58 ` Adrian Bunk

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