Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Oct 2017 22:26:59 +0300
From:      =?UTF-8?Q?Eddy_Petri=C8=99or?= <eddy.petrisor@gmail.com>
To:        freebsd-arm@freebsd.org
Subject:   How does (src)/sys/x86/machine/endian.h get deplyoed as DESTDIR/usr/include/x86/endian.h
Message-ID:  <CAK0XTWeL5Ut6ADs0sN2zPEyz8k9MJqGjMZPoN9PteWEO0AhZaQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hello,

I am trying to add cross build support of FreeBSD from a Linux build
system and I am taking it one small step at a time.

I have a wrapper script to consistently set environment variables, to
set the correct bmake and the proper MAKEFLAGS to pass the correct
dirs for the .mk files and made some changes to map the uname -p/uname
-m's reported x86_64 to amd64 for the MACHINE* variables.

During 'make TARGET=3Damd64 toolchain' the compilation of
contrib/libc-pwcache/pwcache.c fails to find some definitions. Of
course, before implementing the changes in the build system (or my
Linux wrapper script) definitons that might make sense for a build
from Linux, I am trying to compile by hand the offending pwcache.c
file, and, although some of them I was able to resolve either by using
the files from freebsd-glue or by adding -Isys, I am a little puzzled
by the mix of build and freebsd headers/definitions and also got stuck
because in my mind the compilation at this stage needs to generate
binaries for running on a linux system, but some definitions seem to
be freebsd specfic.

In either case, I saw that on the FreeBSD system I am using as a
reference there are some files (such as endian.h) are in
/usr/include/x86, but in the source tree they were in the source tree
in sys/x86/machine.

Since at this stage it looks like I need some kind of way to do an
install-headers(?) from sys/$MACHINE/machine (+x86, in case of x86_64)
to a $NON_BSD_WRAPPERSDIR/$MACHINE/usr/include directory:

1) does it make sense to try to use the headers from src, or is the
right way (tm) to add definitions which are 100% correct for Linux?
1.1) I am thinking that since the definitions were originally in the
src tree under sys, they are related to the FreeBSD kernel, so it
makes little sense to try to define something for Linux. Am I wrong?
Does it make sense to continue on this route?
2) is there such a target/script that I can run to populate my
wrappers dir with the right headers no matter which $MACHINE we're
talking about?



--=20
Eddy Petri=C8=99or



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAK0XTWeL5Ut6ADs0sN2zPEyz8k9MJqGjMZPoN9PteWEO0AhZaQ>