From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Andrey Nechypurenko <andreynech@gmail.com>
Cc: "Köry Maincent" <kory.maincent@bootlin.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
buildroot@buildroot.org
Subject: Re: [Buildroot] Building packages for Cortex M4
Date: Mon, 13 Dec 2021 18:52:10 +0100 [thread overview]
Message-ID: <20211213175210.GE2603@scaer> (raw)
In-Reply-To: <CAOiXNkBXdhBhPRbQ9RYXwq9DkB1ccG-sjy=1j4P9wF9Gq3gtAw@mail.gmail.com>
Andrey, All,
On 2021-12-13 18:36 +0100, Andrey Nechypurenko spake thusly:
> On Sat, 11 Dec 2021 at 09:35, Arnout Vandecappelle <arnout@mind.be> wrote:
> > On 09/12/2021 18:02, Andrey Nechypurenko wrote:
[--SNIP--]
> > > comcu.mk:
> > >
> > > ################################################################################
> > > #
> > > ## comcu
> > > #
> > > #################################################################################
> > >
> > > COMCU_SITE = $(TOPDIR)/../src/comcu
> > > COMCU_SITE_METHOD = local
> > >
> > > COMCU_CONF_OPTS = \
> > > -DTOOLCHAIN_DIR=$(HOST_DIR)/share/gcc-arm-none-eabi \
> > > -DCMAKE_TOOLCHAIN_FILE=cmake/TOOLCHAIN_arm_none_eabi_cortex_m4.cmake \
> > > -DUSE_HAL_DRIVER=ON \
> > > -DUSE_LL_DRIVER=OFF \
> > > -DUSE_OPENAMP=ON \
> > > -DUSE_STM32_USB_FS_LIB=OFF \
> > > -DUSE_FREERTOS=OFF \
> > > -DUSE_SEMIHOSTING=OFF \
> > > -DUSE_STTERM=OFF \
> > > -DUSE_DBGUART=OFF \
> > > -DUSE_GDB=OFF \
> > > -DUSE_OVERCLOCKING=OFF \
> > > -DUSE_TINY_PRINTF=OFF \
> > > -DSRC=Src \
> > > -DGITHUB_DRIVERS=OFF
> > >
> > > $(eval $(cmake-package))
> >
> > I wonder if we really want to use cmake-package here... The cmake-package
> > infrastructure is geared towards building for the target, not for some other
> > CPU. The fact that you need to override the toolchain file is indicative of this
> > problem.
>
> Could you please elaborate on it a little bit? My understanding is that
> independent of what build-system (cmake or whatever else) is used, somehow
> you need to say that other toolchain should be used to compile particular
> package. CMake's way of doing it is to use the toolchain file. Somehow I can
> not see any big disadvantages with it. Similarly I can not see any big
> advantages of using other build-systems. They will need to do the same but
> with different syntax.
>
> The only reason why I used cmake here is because this is what provided by ST
> as an example. The CMake file is not trivial with all these
> CMSIS/HAL/BSP/Cube/... things. Since I do not see any big advantages from
> using other build system, I can not find enough motivation to spend time on
> converting cmake staff to something different. That is why I would
> appreciate if you can provide more details on why cmake could be a bad idea
> in this case.
What Arnout was wondering about, is not about using cmake or not; it was
about using the cmake-package infrastructure in Buildroot or not.
I.e., what he was basically suggesting between the lines, was to make
that a generic package, something along the lines of:
COMCU_DEPENDENCIES = host-cmake
define COMCU_CONFIGURE_CMDS
$(BR2_CMAKE) $(@D) \
-DTOOLCHAIN_DIR=$(HOST_DIR)/share/gcc-arm-none-eabi \
-DCMAKE_TOOLCHAIN_FILE=cmake/TOOLCHAIN_arm_none_eabi_cortex_m4.cmake \
[etc...]
endef
define COMCU_BUILD_CMDS
$(MAKE) -C $(@D)
endef
define COMCU_INSTALL_TARGET_CMDS
$(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install/fast
endef
$(eval $(generic-package))
And I do agree with him, in that our cmake infra is made only for
building stuff that runs on the architecture that is defined in
Buildroot's configuration, not to build firmwares that run in add-on
CPUs...
However, I can also see that the way you did it also makes the package
drastically simpler that repeating a good part of the cmake-package
infra, so I am a bit torn...
would still think that it would be better to do a generic-package,
because the cmake-pakcage infra can very well get additional "features"
that would render it unusable for using with another toolchain file.
And I would like to avoid introducing a precedent...
So I'm back with Arnout: make that a generic-package.
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
prev parent reply other threads:[~2021-12-13 17:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-08 16:46 [Buildroot] Building packages for Cortex M4 Andrey Nechypurenko
2021-12-09 14:10 ` Thomas Petazzoni
2021-12-09 17:02 ` Andrey Nechypurenko
2021-12-10 22:10 ` Thomas Petazzoni
2021-12-13 17:49 ` Andrey Nechypurenko
2021-12-11 8:35 ` Arnout Vandecappelle
2021-12-13 17:36 ` Andrey Nechypurenko
2021-12-13 17:52 ` Yann E. MORIN [this message]
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=20211213175210.GE2603@scaer \
--to=yann.morin.1998@free.fr \
--cc=andreynech@gmail.com \
--cc=buildroot@buildroot.org \
--cc=kory.maincent@bootlin.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