Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: "Frager, Neal" <neal.frager@amd.com>
Cc: "luca.ceresoli@bootlin.com" <luca.ceresoli@bootlin.com>,
	Neal Frager via buildroot <buildroot@buildroot.org>,
	"Simek, Michal" <michal.simek@amd.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	"Erkiaga Elorza, Ibai" <ibai.erkiaga-elorza@amd.com>
Subject: Re: [Buildroot] [PATCH v6 03/10] package/newlib-bare-metal: new package
Date: Wed, 1 Nov 2023 14:42:05 +0100	[thread overview]
Message-ID: <20231101134205.GC114892@scaer> (raw)
In-Reply-To: <CH2PR12MB50049049609F6BE2EF07D89FF0A7A@CH2PR12MB5004.namprd12.prod.outlook.com>

Neal, All,

On 2023-11-01 13:23 +0000, Frager, Neal via buildroot spake thusly:
[--SNIP--]
> Unfortunately, by making newlib a target package instead of host, the buildroot
> infrastructure does not seem to like that newlib was built for Xilinx MicroBlaze
> and not the expected AArch64 target architecture.
> 
> Below is an example of the error message:
> ERROR: architecture for "/usr/microblazeel-xilinx-elf/lib/libc.a" is "Xilinx MicroBlaze", should be "AArch64"
> 
> Is there a way around this, or do we need to keep newlib-bare-metal as a "host" package
> to avoid this issue?z

You can use _BIN_ARCH_EXCLUDE, see the manual:
    https://buildroot.org/downloads/manual/manual.html#_infrastructure_for_packages_with_specific_build_systems

However (but I haven't read all the previous reviews), why would that
file end up in target to beging with?

It is a static library, and from what I understand about this bare-metal
toolchain, the goal is to build firmwares for co-processors, and those
are alwys going to be statically linked, right?

Furthermore, newlib is always going to be a static library, never a
shared one, right?

As such, it should only need to be installed in staging/, not in
target/, and thus:
    NEWLIB_BARE_METAL_INSTALL_STAGING = YES
    NEWLIB_BARE_METAL_INSTALL_TARGET = NO

And then, the check-bin-arch would not find that file, because it would
not be in target/ anymore (and thus _BIN_ARCH_EXCLUDE would not be
needed either).

And then, thinking yet a bit more: it not not even need to be in
staging/ either, as staging/ is for stuff that actually runs on the
target's CPU, not co-procs.

So, I think the gcc-bare-metal package should be configured with a
special sysroot, and newlib-bare-metal installed in that sysroot, e.g.
somethig like:

    HOST_GCC_BARE_METAL_SYSROOT = $(HOST_DIR)/$(GCC_BARE_METAL_ARCH)-elf/sysroot

    HOST_GCC_BARE_METAL_CONF_OPTS = \
        [...]
        --with-sysroot=$(HOST_GCC_BARE_METAL_SYSROOT)

and then:

    NEWLIB_BARE_METAL_INSTALL_OPTS = DESTDIR=$(HOST_GCC_BARE_METAL_SYSROOT)

Totally untested, but this should give some hints as to where to install
stuff.

Thomas, what do you think?

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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

  reply	other threads:[~2023-11-01 13:42 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20 11:42 [Buildroot] [PATCH v6 01/10] package/binutils-bare-metal: new package Neal Frager via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 02/10] package/gcc-bare-metal: " Neal Frager via buildroot
2023-10-26 16:06   ` Luca Ceresoli via buildroot
2023-10-31 12:41   ` Thomas Petazzoni via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 03/10] package/newlib-bare-metal: " Neal Frager via buildroot
2023-10-26 16:07   ` Luca Ceresoli via buildroot
2023-10-31 12:43   ` Thomas Petazzoni via buildroot
2023-11-01 11:43     ` Frager, Neal via buildroot
2023-11-01 11:50       ` Thomas Petazzoni via buildroot
2023-11-01 13:23         ` Frager, Neal via buildroot
2023-11-01 13:42           ` Yann E. MORIN [this message]
2023-11-02  9:35             ` Frager, Neal via buildroot
2023-11-02  9:37               ` Thomas Petazzoni via buildroot
2023-11-02 10:27                 ` Frager, Neal via buildroot
2023-11-14  5:47             ` Frager, Neal via buildroot
2023-11-15 18:12               ` Yann E. MORIN
2023-11-16 10:20                 ` Frager, Neal via buildroot
2023-11-16 11:32                   ` Frager, Neal via buildroot
2023-10-31 12:52   ` Thomas Petazzoni via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 04/10] toolchain/toolchain-bare-metal-buildroot: new toolchain Neal Frager via buildroot
2023-10-26 16:07   ` Luca Ceresoli via buildroot
2023-10-31 12:51   ` Thomas Petazzoni via buildroot
2023-11-02  9:47     ` Frager, Neal via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 05/10] boot/zynqmp-firmware: new boot firmware Neal Frager via buildroot
2023-10-26 16:07   ` Luca Ceresoli via buildroot
2023-10-31 12:54   ` Thomas Petazzoni via buildroot
2023-10-31 19:07     ` Frager, Neal via buildroot
2023-11-01  9:24       ` Thomas Petazzoni via buildroot
2023-11-01 10:18         ` Frager, Neal via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 06/10] boot/uboot.mk: new zynqmp pmufw build option Neal Frager via buildroot
2023-10-26 16:07   ` Luca Ceresoli via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 07/10] configs/zynqmp*: build pmufw source Neal Frager via buildroot
2023-10-26 16:07   ` Luca Ceresoli via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 08/10] boot/versal-firmware: new boot firmware Neal Frager via buildroot
2023-10-26 16:08   ` Luca Ceresoli via buildroot
2023-10-31 12:57   ` Thomas Petazzoni via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 09/10] configs/versal_vck190_defconfig: build plm and psmfw source Neal Frager via buildroot
2023-10-26 16:08   ` Luca Ceresoli via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 10/10] package/versal-firmware: remove package Neal Frager via buildroot
2023-10-26 16:08   ` Luca Ceresoli via buildroot
2023-10-26 11:59 ` [Buildroot] [PATCH v6 01/10] package/binutils-bare-metal: new package Frager, Neal via buildroot
2023-10-26 16:06 ` Luca Ceresoli via buildroot
2023-10-31  7:32   ` Frager, Neal via buildroot
2023-10-31 12:37 ` Thomas Petazzoni via buildroot

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=20231101134205.GC114892@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=ibai.erkiaga-elorza@amd.com \
    --cc=luca.ceresoli@bootlin.com \
    --cc=michal.simek@amd.com \
    --cc=neal.frager@amd.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