AW: AW: [PATCH v3 2/3] amd64: Add to build
Jan.Sommer at dlr.de
Jan.Sommer at dlr.de
Wed Feb 12 09:00:35 UTC 2020
> -----Ursprüngliche Nachricht-----
> Von: Chris Johns [mailto:chrisj at rtems.org]
> Gesendet: Mittwoch, 12. Februar 2020 00:36
> An: Sommer, Jan; sebastian.huber at embedded-brains.de; devel at rtems.org
> Betreff: Re: AW: [PATCH v3 2/3] amd64: Add to build
>
> On 12/2/20 12:21 am, Jan.Sommer at dlr.de wrote:
> >> Von: Sebastian Huber [mailto:sebastian.huber at embedded-brains.de]
> >> Gesendet: Dienstag, 11. Februar 2020 13:22
> >> An: Sommer, Jan; devel at rtems.org
> >> Betreff: Re: [PATCH v3 2/3] amd64: Add to build
> >>> + includes += ['freebsd/sys/x86/include']
> >>> + if cpu == "x86_64":
> >>> + cpu = 'amd64'
> >>> includes += ['freebsd/sys/x86/include']
> >>> for i in config['cpu-include-paths']:
> >>> includes += [i.replace('@CPU@', cpu)]
> >> I am not sure what this should do. Here cpu x86_64 seems to be renamed
> >> to amd64? Should it be named amd64 in general?
> >
> > The problem is that the RTEMS_ARCH and the compiler prefix is x86_64,
> however in FreeBSD the related files are in amd64 subdirectories.
>
> Yes, this is fixed and cannot change. As Joel points out it is from the tools
> and we a long standing policy of following the tool names.
>
> > libbsd.py uses @CPU@ to create the architecture specific include directories
> which then yields sys/x86_64/include for example, but should create
> sys/amd64/include.
>
> Yes. The i386 has a hidden case as a hack in the generator code. It should also
> be removed and cleaned up, see below.
>
> > Before my last patch set, cpu was overridden to x86 for i386, so I thought
> doing something similar saves me the trouble with the include directories here.
> > Do you maybe have a more elegant solution?
>
> I think we need some form of path matching. I doubt this will be the only place
> we encounter something like this and it is not the first case.
>
> What about adding something that maps one path to another path? eg to
> libbsd.py
> add ...
>
> #
> # Map paths based on RTEMS naming to FreeBSD naming.
> #
> 'path-mappings' : [('freebsd/sys/i386/include', 'freebsd/sys/x64/include'),
> ('freebsd/sys/x86_64/include', 'freebsd/sys/amd64/include')]
>
I like the idea, but I also need to add an additional path for amd64 and i386.
It's the include path for header files which are shared among both of them, e.g., freebsd/sys/x86/include.
Do you have a suggestion where a good place for this addition would be, if the "if cpu == 'i386'" is to be removed?
> The mapping code can be added here ...
>
> https://git.rtems.org/rtems-libbsd/tree/waf_libbsd.py#n192
>
> ... and the special case of i386 removed. I would add a path_remap call so if
> this is needed in other places it can be added easily.
>
> Chris
More information about the devel
mailing list