From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Norbert Lange <nolange79@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/libxml-parser-perl: fix build when host matches target gcc
Date: Sat, 10 Dec 2022 17:18:51 +0100 [thread overview]
Message-ID: <20221210161851.GC1044805@scaer> (raw)
In-Reply-To: <20221210131713.274886-1-nolange79@gmail.com>
Norbert, All,
On 2022-12-10 14:17 +0100, Norbert Lange spake thusly:
> The host configure and build step looks for same compiler name
> (eg. x86_64-linux-gnu-gcc), and the build potentially breaks
> if the target compiler is named identically.
>
> revert PATH env variable to not include the target binaries.
We pass $(HOST_CONFIGURE_OPTS) in the environment, which contains a
definition for: CC=$(HOSTCC)
And HOSTCC is defined as:
ifndef HOSTCC
HOSTCC := gcc
HOSTCC := $(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc)
endif
In my case, however, I can indeed see that it uses it (single line
wrapped for readability):
/usr/bin/gcc -c -I/home/ymorin/dev/buildroot/O/master/host/include
-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g
-DVERSION=\"2.46\" -DXS_VERSION=\"2.46\" -fPIC
"-I/usr/lib/x86_64-linux-gnu/perl/5.30/CORE" Expat.c
So, I looked at the generated Makefile, and I can see;
# These definitions are from config.sh (via /usr/lib/x86_64-linux-gnu/perl/5.30/Config.pm).
# They may have been overridden via Makefile.PL or on the command line.
So, we are passing CC et all in the environment, so they do not override
the ones my system perl was built with.
We are also even forcing LD, but it is not accounted for either... I
guess that _may_ work when we are building our own host-perl, but not
when we are using the system perl...
So, I think the best fix would be to change how we pass CC et al,
either by passing HOST_LIBXML_PARSER_PERL_CONFIGURE_OPTS as options
instead of in the environment, or by carefully cherry-picking CC, LD and
maybe a few others, and force them to be passed as options.
Regards,
Yann E. MORIN.
> Signed-off-by: Norbert Lange <nolange79@gmail.com>
> ---
> package/libxml-parser-perl/libxml-parser-perl.mk | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/package/libxml-parser-perl/libxml-parser-perl.mk b/package/libxml-parser-perl/libxml-parser-perl.mk
> index 37cef2e418..4af4485429 100644
> --- a/package/libxml-parser-perl/libxml-parser-perl.mk
> +++ b/package/libxml-parser-perl/libxml-parser-perl.mk
> @@ -14,6 +14,7 @@ LIBXML_PARSER_PERL_RUN_PERL = `which perl`
>
> HOST_LIBXML_PARSER_PERL_CONFIGURE_OPTS = \
> $(HOST_CONFIGURE_OPTS) \
> + PATH="$(PATH)" \
> LD="$(HOSTCC)"
>
> define HOST_LIBXML_PARSER_PERL_CONFIGURE_CMDS
> --
> 2.35.1
>
> _______________________________________________
> 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-12-10 16:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-10 13:17 [Buildroot] [PATCH] package/libxml-parser-perl: fix build when host matches target gcc Norbert Lange
2022-12-10 16:18 ` Yann E. MORIN [this message]
2022-12-10 16:55 ` Norbert Lange
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=20221210161851.GC1044805@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@buildroot.org \
--cc=nolange79@gmail.com \
--cc=thomas.petazzoni@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox