From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Erico Nunes <nunes.erico@gmail.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/efivar: bump to version 38
Date: Sat, 1 Oct 2022 22:53:54 +0200 [thread overview]
Message-ID: <20221001205354.GV30794@scaer> (raw)
In-Reply-To: <20220927105829.760755-1-nunes.erico@gmail.com>
On 2022-09-27 12:58 +0200, Erico Nunes spake thusly:
> Drop backported patches and rebase the ones that are still relevant.
>
> From version 37 to 38, there is a new build system in place, which is
> still custom Makefiles.
> It is not cross-compilation friendly and includes host tools, so a
> few workarounds are required to prevent things being built or rebuilt
> wrongly for host or target.
[--SNIP--]
> diff --git a/package/efivar/efivar.mk b/package/efivar/efivar.mk
> index 8708057b18..aaea33c01d 100644
> --- a/package/efivar/efivar.mk
> +++ b/package/efivar/efivar.mk
[--SNIP--]
> @@ -21,16 +21,36 @@ define EFIVAR_BUILD_CMDS
> # $(HOST_CC), otherwise it gets cross-built.
> $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) \
> CFLAGS="$(HOST_CFLAGS) -std=gnu99" \
> - $(MAKE) -C $(@D)/src gcc_cflags= makeguids
> + TOPDIR=$(@D) CFLAGS_GCC= \
> + $(MAKE) -C $(@D)/src makeguids
>
> + # util.o needs to be rebuilt for target
> + mv -v $(@D)/src/util.o $(@D)/src/util_host.o
This dual build commands hint at the need for a host-efivar package that
builds makeguids, and patch src/Makefile to use an existing $(MAKEGUIDS)
e.g. (mock diff for the sake of ilustration):
+MAKEGUIDS ?= makeguids
-$(MAKEGUIDS_OUTPUT) : makeguids
-$(MAKEGUIDS_OUTPUT) : guids.txt
+$(MAKEGUIDS_OUTPUT) : guids.txt $(MAKEGUIDS)
-./makeguids $(LD_DASH_T) guids.txt ...
+$(MAKEGUIDS) $(LD_DASH_T) guids.txt ...
(yeah, this is very borked, but it's just to explain what I have in
mind).
> +
> + # Some workarounds for cross-compilation:
> + # MAKEGUIDS_SOURCES is undefined so it doesn't pick host flags for
> + # util.o or attempt to build makeguids again.
> + # SUBDIRS is redefined so it skips building docs.
> + # LD_DASH_T is redefined as the linker detection fails with Buildroot.
> $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
> AR=$(TARGET_AR) NM=$(TARGET_NM) RANLIB=$(TARGET_RANLIB) \
> $(EFIVAR_MAKE_OPTS) \
> + TOPDIR=$(@D) \
> + MAKEGUIDS_SOURCES= \
> + SUBDIRS=src \
> + LD_DASH_T=-T \
Those should probably go into EFIVAR_MAKE_OPTS, as EFI_VAR_MAKE_OPTS
is already used for EFIVAR_BUILD_CMDS, EFIVAR_INSTALL_TARGET_CMDS, and
EFIVAR_STAGING_INSTALL_CMDS.
> all
> +
> + # skip 'all' in install so in staging/target installs it won't try
> + # to build everything again due to the workarounds above
> + $(SED) 's/install : all/install :/g' $(@D)/src/Makefile
This sed is not conditional, and it munges an existing, static file, so
it should be done with a patch.
Regards,
Yann E. MORIN.
> endef
>
> define EFIVAR_INSTALL_STAGING_CMDS
> $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
> + TOPDIR=$(@D) \
> + MAKEGUIDS_SOURCES= \
> + SUBDIRS=src \
> $(EFIVAR_MAKE_OPTS) \
> DESTDIR="$(STAGING_DIR)" \
> install
> @@ -38,6 +58,9 @@ endef
>
> define EFIVAR_INSTALL_TARGET_CMDS
> $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
> + TOPDIR=$(@D) \
> + MAKEGUIDS_SOURCES= \
> + SUBDIRS=src \
> $(EFIVAR_MAKE_OPTS) \
> DESTDIR="$(TARGET_DIR)" \
> install
> --
> 2.37.3
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-10-01 20:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-27 10:58 [Buildroot] [PATCH] package/efivar: bump to version 38 Erico Nunes
2022-10-01 20:53 ` Yann E. MORIN [this message]
2022-10-03 8:00 ` Erico Nunes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221001205354.GV30794@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@buildroot.org \
--cc=nunes.erico@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.