Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] How to control host gcc version?
@ 2024-09-10 19:01 Grant Edwards
  2024-09-10 19:10 ` Grant Edwards
  0 siblings, 1 reply; 5+ messages in thread
From: Grant Edwards @ 2024-09-10 19:01 UTC (permalink / raw)
  To: buildroot

I'm trying to build a root filesystem using a vendor-supplied copy of
buildroot 2020.02.07.

Unfortunately, some of the packages that buildroot wants to build for
the host (e.g. m4) are so old they won't compile with my host's
version of gcc (13.3).  [I've got m4 installed on the host, but
buildroot still wants to build its own.]

I can install older versions of gcc, but I can't figure out how to
tell buildroot what host toolchain to use. There must be an option for
that, but I've been searching through the manual and haven't found it.

How do I tell buildroot what host gcc to use (e.g. 'gcc-11' instead of
'gcc')?

--
Grant

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] How to control host gcc version?
  2024-09-10 19:01 [Buildroot] How to control host gcc version? Grant Edwards
@ 2024-09-10 19:10 ` Grant Edwards
  2024-09-10 20:46   ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 5+ messages in thread
From: Grant Edwards @ 2024-09-10 19:10 UTC (permalink / raw)
  To: buildroot; +Cc: buildroot

On 2024-09-10, Grant Edwards <grant.b.edwards@gmail.com> wrote:

> How do I tell buildroot what host gcc to use (e.g. 'gcc-11' instead of
> 'gcc')?

Ah, found it:

    8.6. Environment variables

    Buildroot also honors some environment variables, when they are
    passed to make or set in the environment:

    HOSTCXX, the host C++ compiler to use
    
    HOSTCC, the host C compiler to use

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] How to control host gcc version?
  2024-09-10 19:10 ` Grant Edwards
@ 2024-09-10 20:46   ` Thomas Petazzoni via buildroot
  2024-09-10 21:16     ` Grant Edwards
  2024-09-10 22:26     ` Grant Edwards
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-09-10 20:46 UTC (permalink / raw)
  To: Grant Edwards; +Cc: buildroot, buildroot

On Tue, 10 Sep 2024 19:10:29 -0000 (UTC)
Grant Edwards <grant.b.edwards@gmail.com> wrote:

> Ah, found it:
> 
>     8.6. Environment variables
> 
>     Buildroot also honors some environment variables, when they are
>     passed to make or set in the environment:
> 
>     HOSTCXX, the host C++ compiler to use
>     
>     HOSTCC, the host C compiler to use

Indeed. But in your case, what you probably should do is use a Docker
container. You can use the utils/docker-run script to easily run the
build in a docker container.

Basically do:

	./utils/docker-run make

and it will do the Buildroot build in our "reference" Debian bullseye
Docker container. If you're not happy with this container, you can do:

	IMAGE=<your-docker-image> ./utils/docker-run make

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] How to control host gcc version?
  2024-09-10 20:46   ` Thomas Petazzoni via buildroot
@ 2024-09-10 21:16     ` Grant Edwards
  2024-09-10 22:26     ` Grant Edwards
  1 sibling, 0 replies; 5+ messages in thread
From: Grant Edwards @ 2024-09-10 21:16 UTC (permalink / raw)
  To: buildroot; +Cc: buildroot

On 2024-09-10, Thomas Petazzoni via buildroot <buildroot@buildroot.org> wrote:
> On Tue, 10 Sep 2024 19:10:29 -0000 (UTC) Grant Edwards <grant.b.edwards@gmail.com> wrote:
>
>> Ah, found it:
>> 
>>     8.6. Environment variables
>> 
>>     Buildroot also honors some environment variables, when they are
>>     passed to make or set in the environment:
>> 
>>     HOSTCXX, the host C++ compiler to use
>>     HOSTCC, the host C compiler to use
>
> Indeed. But in your case, what you probably should do is use a Docker
> container. You can use the utils/docker-run script to easily run the
> build in a docker container.
>
> Basically do:
>
> 	./utils/docker-run make
>
> and it will do the Buildroot build in our "reference" Debian bullseye
> Docker container.

Thanks! I'll definitely take a look at that. I don't currently have my
development hosts set up with docker support, but it's looking like
we're probably headed that way for other projects too.

> If you're not happy with this container, you can do:
>
> 	IMAGE=<your-docker-image> ./utils/docker-run make


_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] How to control host gcc version?
  2024-09-10 20:46   ` Thomas Petazzoni via buildroot
  2024-09-10 21:16     ` Grant Edwards
@ 2024-09-10 22:26     ` Grant Edwards
  1 sibling, 0 replies; 5+ messages in thread
From: Grant Edwards @ 2024-09-10 22:26 UTC (permalink / raw)
  To: buildroot; +Cc: buildroot

On 2024-09-10, Thomas Petazzoni via buildroot <buildroot@buildroot.org> wrote:
> On Tue, 10 Sep 2024 19:10:29 -0000 (UTC)
> Grant Edwards <grant.b.edwards@gmail.com> wrote:
>> [...]
>> 
>>     HOSTCXX, the host C++ compiler to use
>>     HOSTCC, the host C compiler to use
>
> Indeed. But in your case, what you probably should do is use a Docker
> container. You can use the utils/docker-run script to easily run the
> build in a docker container.
>
> Basically do:
>
> 	./utils/docker-run make

It looks like 2020.02.7 doesn't have a docker-run.

It turns out it's not the gcc version that's "too new", it's the glibc
version that's "too new", and Gentoo doesn't support having multiple
versions of that installed. :)

I'm going to have to manually upgrade buildroot's m4 package from 4.18
to 4.19.

Once I get the vendor "supported" buildroot configuration built and
running, I'll look into upgrading to a newer version of buildroot --
perhaps one with a refrence docker image for building it.

--
Grant



_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2024-09-10 22:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-10 19:01 [Buildroot] How to control host gcc version? Grant Edwards
2024-09-10 19:10 ` Grant Edwards
2024-09-10 20:46   ` Thomas Petazzoni via buildroot
2024-09-10 21:16     ` Grant Edwards
2024-09-10 22:26     ` Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox