<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 14, 2020 at 12:15 AM Chris Johns <<a href="mailto:chrisj@rtems.org">chrisj@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 14/9/20 3:06 pm, Sebastian Huber wrote:<br>
> On 14/09/2020 01:46, Chris Johns wrote:<br>
>> On 13/9/20 3:46 am, Sebastian Huber wrote:<br>
>>> Hello,<br>
>>><br>
>>> I can't build the libbsd for powerpc/beatnik:<br>
>>><br>
>>> ---------------------------------------------<br>
>>> Compiler version (powerpc-rtems6-gcc)<br>
>>> 10.2.1 20200904 (RTEMS 6, RSB 47f32b8b1a597b5ed3475722bdc155249ef51115, Newlib<br>
>>> a0d7982)<br>
>>> Opening and load pkgconfig:<br>
>>> /ramdisk/git-rtems-6/build/install/lib/pkgconfig/powerpc-rtems6-beatnik.pc<br>
>>> -----------------------------------------<br>
>>> CFLAGS -><br>
>>> -qrtems -B/ramdisk/git-rtems-6/build/install/powerpc-rtems6/beatnik/lib<br>
>>> -D__ppc_generic -mcpu=7400<br>
>>> LDFLAGS -><br>
>>> pkconfig warning: Label not found: LDFLAGS<br>
>>><br>
>>> LIB -><br>
>>> pkconfig warning: Label not found: LIB<br>
>>><br>
>>> ---------------------------------------------<br>
>>> Checking for a valid RTEMS BSP installation<br>
>>> ==><br>
>>> #include <rtems.h><br>
>>> void Init(rtems_task_argument arg) { (void)arg; }<br>
>>> #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER<br>
>>> #define CONFIGURE_MAXIMUM_TASKS 1<br>
>>> #define CONFIGURE_RTEMS_INIT_TASKS_TABLE<br>
>>> #define CONFIGURE_INIT<br>
>>> #include <rtems/confdefs.h><br>
>>> <==<br>
>>> [1/2] Compiling build/.conf_check_261484d99ea5da27480d47dee9a30c04/test.c<br>
>>><br>
>>> ['/build/rtems/6/bin/powerpc-rtems6-gcc', '-qrtems',<br>
>>> '-B/ramdisk/git-rtems-6/build/install/powerpc-rtems6/beatnik/lib', '-mcpu=7400',<br>
>>> '-MMD', '../test.c', '-c',<br>
>>> '-o/ramdisk/git-rtems-libbsd/build/.conf_check_261484d99ea5da27480d47dee9a30c04/testbuild/test.c.1.o']<br>
>>><br>
>>><br>
>>> err: In file included from<br>
>>> /ramdisk/git-rtems-6/build/install/powerpc-rtems6/beatnik/lib/include/libcpu/powerpc-utility.h:46,<br>
>>><br>
>>><br>
>>> from<br>
>>> /ramdisk/git-rtems-6/build/install/powerpc-rtems6/beatnik/lib/include/bsp/vectors.h:40,<br>
>>><br>
>>><br>
>>> from<br>
>>> /ramdisk/git-rtems-6/build/install/powerpc-rtems6/beatnik/lib/include/bsp.h:45,<br>
>>> from<br>
>>> /ramdisk/git-rtems-6/build/install/powerpc-rtems6/beatnik/lib/include/rtems/confdefs/bsp.h:53,<br>
>>><br>
>>><br>
>>> from<br>
>>> /ramdisk/git-rtems-6/build/install/powerpc-rtems6/beatnik/lib/include/rtems/confdefs/extensions.h:45,<br>
>>><br>
>>><br>
>>> from<br>
>>> /ramdisk/git-rtems-6/build/install/powerpc-rtems6/beatnik/lib/include/rtems/confdefs.h:67,<br>
>>><br>
>>><br>
>>> from ../test.c:7:<br>
>>> /ramdisk/git-rtems-6/build/install/powerpc-rtems6/beatnik/lib/include/rtems/powerpc/powerpc.h:289:2:<br>
>>><br>
>>> error: #error "Unsupported CPU Model"<br>
>>> 289 | #error "Unsupported CPU Model"<br>
>>> | ^~~~~<br>
>>><br>
>>> I haven't figured out why the "-D__ppc_generic" is removed from the CFLAGS.<br>
>><br>
>> There are multiple places filtering happens. It could be rtems_waf ...<br>
>><br>
>> <a href="https://git.rtems.org/rtems_waf/tree/rtems.py#n840" rel="noreferrer" target="_blank">https://git.rtems.org/rtems_waf/tree/rtems.py#n840</a><br>
>><br>
>> of pkgconfig in the RSB ...<br>
>><br>
>> <a href="https://git.rtems.org/rtems-source-builder/tree/rtems/config/rtems-bsp.cfg#n40" rel="noreferrer" target="_blank">https://git.rtems.org/rtems-source-builder/tree/rtems/config/rtems-bsp.cfg#n40</a><br>
>> <a href="https://git.rtems.org/rtems-source-builder/tree/source-builder/sb/config.py#n512" rel="noreferrer" target="_blank">https://git.rtems.org/rtems-source-builder/tree/source-builder/sb/config.py#n512</a><br>
>><br>
>> Exporting of internal build flags by RTEMS to applications needs to be consider<br>
>> a bug. This happens in a small number of cases like this one but the effort and<br>
>> complexity involved in managing these cases outside of Makefile.inc is growing.<br>
>><br>
>> I am reluctant to support adding exceptions to the filtering of flags to manage<br>
>> things like this because it is a slippery slope and fragile. The hack at the<br>
>> moment is to take the flags and remove the warning ones. In rtems_waf the<br>
>> filtering goes further to group the flags to isolate machine flags so the ABI<br>
>> can be cleanly exported to the 3rd party libraries and applications.<br>
> <br>
> The goal should be to export the information in the new build system so that we<br>
> don't have to filter it.<br>
<br>
Yes. We should only export the machine flags in pkgconfig's CFLAGS.<br>
<br>
We can export other things from a BSP but they need to be plgconfig variables..<br>
An example would be mkimage arguments if the BSP can be booted by u-boot.<br>
<br>
> <br>
>><br>
>> I think using a command line -Dsomething to control a machine configuration<br>
>> outside of the RTEMS build arena is fragile. Can this be added to the powerpc's<br>
>> bspopts.h as a #define for this BSP?<br>
> <br>
> It is just something that came up during the testing of the new build system.<br>
<br>
Ah OK.<br></blockquote><div><br></div><div>Where is this even used? I can't imagine a lot of code using it. Wouldn't this be</div><div>a case where narrowing down where it is used and addressing that point place</div><div>be the easiest? Then we can eliminate it.</div><div><br></div><div>Hopefully eliminate all -D's defined for Makefile builds. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> I think this define can go away at some point in time.<br>
<br>
That would be great.<br>
<br>
Chris<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></blockquote></div></div>