[PATCH] spec/pkgconfig: Allow builds to override headers
Kinsey Moore
kinsey.moore at oarcorp.com
Fri Sep 30 20:30:04 UTC 2022
On 9/29/2022 16:19, Chris Johns wrote:
> On 29/9/22 11:24 pm, Kinsey Moore wrote:
>> On 9/28/2022 19:03, Chris Johns wrote:
>>> On 29/9/2022 7:13 am, Kinsey Moore wrote:
>>>> This allows any builds targeting an installed RTEMS BSP to override
>>>> headers in the installed BSP reliably, including headers previously
>>>> installed by that or other builds. This includes applications, network
>>>> stacks, libraries, and any other builds.
>>> I am a little confused by these comments. This change effects the generated .pc
>>> file for a BSP so it is only used once it is installed.
>> Correct, this is a fix for things like rtems-libbsd and rtems-lwip that allows
>> them to build correctly even if there are existing conflicting installations of
>> that library already installed in the BSP install.
> So this is a change to aid developers of these packages who use a single prefix
> for the tools, BSP and packages? I split the install paths up and that avoids
> the problem.
I guess I'm conflating a couple of different problems here. I'll take a
closer look at how things behave when there is a separate installation path.
>
>>> An install should update
>>> the headers at the same time the .pc is installed and made available so what is
>>> old or previous? What are the "builds targeting" you refer too?
>> "builds targeting an installed RTEMS BSP" refers to any external build that uses
>> installed RTEMS headers and libraries. These external builds can install their
>> own files in the BSP install.
> Is this install or reinstall?
The issues happen on reinstall since there is an existing header that
has a higher priority in the include search paths than the local search
paths.
>
>>> I think defining the include search of RTEMS BSP and any vertical stack packages
>>> headers installed under the same prefix as system headers seems like the right
>>> thing to do. However this change will silence warnings from RTEMS (and installed
>>> packages). Is that want we want?
>> What warnings will this silence?
> https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html
>
> This changes the level of warnings we currently have for a specific but
> important group of packages that are based on rtems_waf or use .pc files. I
> think this is important to consider.
It changes the warning level when used from the installed BSP, but we
should still see these warnings when compiling RTEMS itself and packages
compiled against an installed BSP using the .pc files (via rtems_waf or
otherwise) will still display these warnings in their own headers since
they will be used locally pre-installation.
There is still the issue of using existing headers in novel ways that
could generate warnings which would be missed due to this change, but
even then the documentation linked claims that macros instanced in
non-system-header locations are only immune to a small subset of
warnings. I think it's worth the change given that installing additional
packages into the installed BSP is common practice from what I've seen.
>
>> It shouldn't affect RTEMS builds because RTEMS
>> doesn't use the pkgconfg while building. It still places installed headers
>> before actual system/tools headers in the include hierarchy, so any build errors
>> generated that way should be preserved.
> Is Makefile.inc also updated? It effects some users of RTEMS but not all. Is
> that important?
I hunted for this earlier and missed it. It's apparently in make/custom
and would need to be tweaked as well for consistency.
>
> Is this something we should document as mandated for all users of BSP installed
> headers?
It's worth putting it somewhere. Users of the .pc and Makefile.inc won't
notice or need to care for the most part, but anyone using non-standard
external build systems will need to know.
Kinsey
More information about the devel
mailing list