rtems-libbsd on x86_64
Joel Sherrill
joel at rtems.org
Thu Aug 18 19:22:57 UTC 2022
On Thu, Aug 18, 2022 at 12:09 PM Joel Sherrill <joel at rtems.org> wrote:
> Hi
>
> I took a shot at compiling libbsd for x86_64. First issue is that freebsd
> calls this amd64 so the reebsd/sys/@ARCH@/include is looking for the
> wrong architecture name. Somehow the waf needs to map x86_64 to amd64.
>
> I manually copied in_cksum.h into place and that left it failing to
> compile with this:
>
> [ 257/2034] Compiling freebsd/crypto/openssl/crypto/aes/aes_core.c
> ../../freebsd/sbin/sysctl/sysctl.c:67:10: fatal error: sys/efi.h: No such
> file or directory
> 67 | #include <sys/efi.h>
> | ^~~~~~~~~~~
> compilation terminated.
>
> Which points to this code:
>
> #ifdef __amd64__
> #include <sys/efi.h>
> #include <machine/metadata.h>
> #endif
>
> There are other __amd64__ ifdefs in this file. Should I just disable these
> with ifdef rtems? Or should we pull the thread? I'm prone to try to disable
> the offending code fragments.
>
I did this to proceed and the changes were relatively minor.
Another challenge is that some x86_64 machine header files include
<x86/ABC.h> to share something with x86. Looks like a place where the
include path logic somewhere in the waf needs adjusting. No idea
where.
Assuming the include path for x86_64/amd64 is fixed and my sysctl.h patch
is applied, that only leaves three compile errors which appear to be
from the use of x86_64 and x86 machine directories. For now, I hand
copied these files into place:
reebsd/sys/x86_64/include/machine/in_cksum.h
freebsd/sys/x86_64/include/machine/md_var.h
freebsd/sys/x86_64/include/machine/intr_machdep.h
freebsd/sys/x86_64/include/machine/specialreg.h
Pretty close with some help. Please. :)
Thanks.
>
> Comments and suggestions?
>
> Thanks.
>
> --joel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20220818/38830b3d/attachment.htm>
More information about the devel
mailing list