[haiku-commits] Re: BRANCH mmadia-github.separate-build-environment - headers/build/os/support headers/build/config_build src/build/libroot

  • From: "Ingo Weinhold" <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 01 Aug 2012 22:57:37 +0200

Matt Madia wrote:
> On 8/1/12, Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:
> > Matt Madia wrote:
> >> In file included from headers/build/os/support/Errors.h:9,
> >> from headers/build/os/support/SupportDefs.h:15,
> >> from src/build/libroot/atomic.cpp:6:
> >
> > Note that it still includes the wrong headers. "headers/build/os/..."
> > shouldn't be in the search path. It might not be relevant for atomic.cpp,
> > but it definitely will be for other files, since they won't be able to
> > include the build platform headers.
> 
> Ahh. would headers/build/os_target be the one to include then?
> e.g.,
> {{{
> diff --git a/src/build/libroot/Jamfile b/src/build/libroot/Jamfile
> index f8cb92d..dc05049 100644
> --- a/src/build/libroot/Jamfile
> +++ b/src/build/libroot/Jamfile
> @@ -1,13 +1,13 @@
>  SubDir HAIKU_TOP src build libroot ;
> 
>  UseHeaders [ FDirName $(HAIKU_TOP) headers build ] : true ;
> -UseHeaders [ FDirName $(HAIKU_TOP) headers build os ] : true ;
> -UseHeaders [ FDirName $(HAIKU_TOP) headers build os app ] : true ;
> -UseHeaders [ FDirName $(HAIKU_TOP) headers build os drivers ] : true ;
> -UseHeaders [ FDirName $(HAIKU_TOP) headers build os kernel ] : true ;
> -UseHeaders [ FDirName $(HAIKU_TOP) headers build os interface ] : true ;
> -UseHeaders [ FDirName $(HAIKU_TOP) headers build os storage ] : true ;
> -UseHeaders [ FDirName $(HAIKU_TOP) headers build os support ] : true ;
> +UseHeaders [ FDirName $(HAIKU_TOP) headers build os_target ] : true ;
> +UseHeaders [ FDirName $(HAIKU_TOP) headers build os_target app ] : true ;
> +UseHeaders [ FDirName $(HAIKU_TOP) headers build os_target drivers ] : true ;
> +UseHeaders [ FDirName $(HAIKU_TOP) headers build os_target kernel ] : true ;
> +UseHeaders [ FDirName $(HAIKU_TOP) headers build os_target interface ] : 
> true ;
> +UseHeaders [ FDirName $(HAIKU_TOP) headers build os_target storage ] : true ;
> +UseHeaders [ FDirName $(HAIKU_TOP) headers build os_target support ] : true ;
> 
>  UsePrivateBuildHeaders kernel system ;
> 
> }}}

Yes. Moreover the source files need to include the target_*.h headers 
accordingly. Otherwise they'd pull in the build platform's headers (which will 
be necessary in some cases as well).

> >> headers/build/os_target/support/target_Errors.h:668: error: two or
> >> more data types in declaration of '_haiku_build_to_positive_error'
> >> headers/build/os_target/support/target_Errors.h:669: error: two or
> >> more data types in declaration of '_haiku_build_to_negative_error'
> >
> > Very "helpful" error message. As a Google search tells us, this is likely a
> > missing semicolon somewhere. The primary suspect would be
> > _HAIKU_BUILD_DECLARE_FUNCTION(), but it looks OK. Please check (or provide)
> > the preprocessed output for the file. To do that copy the compilation line,
> > replace the '-c' by '-E' and choose another name for the output file.
> 
> {{{
> [mmadia@fBSD ~/separate-build-environment/haiku]$ cc -E
> "src/build/libroot/atomic.cpp" -O -Wall -Wno-trigraphs
> -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wpointer-arith
> -Wcast-align -Wsign-compare -Wno-multichar
> -DHAIKU_BUILD_ATTRIBUTES_DIR=\"/home/mmadia/separate-build-environment/haiku/generated/attributes\"
> -D_HAIKU_BUILD_DONT_REMAP_FD_FUNCTIONS=1
> -D_ZETA_USING_DEPRECATED_API_=1 -D_ZETA_TS_FIND_DIR_=1 -nostdinc
> -nostdinc++ -fPIC -DARCH_x86 -D_NO_INLINE_ASM -D__INTEL__
> -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_FORMAT_MACROS
> -D__STDC_LIMIT_MACROS -DHAIKU_HOST_USE_XATTR
> -DHAIKU_HOST_PLATFORM_FREEBSD -iquote build/user_config_headers
> -iquote build/config_headers -iquote src/build/libroot -iquote
> generated/objects/common/build/libroot -iquote
> generated/objects/freebsd/x86/common/build/libroot -iquote
> generated/objects/haiku/x86/common/build/libroot -I headers/build -I
> headers/build/os -I headers/build/os/app -I headers/build/os/drivers
> -I headers/build/os/kernel -I headers/build/os/interface -I
> headers/build/os/storage -I headers/build/os/support -I
> headers/build/private/kernel -I headers/build/private/system -I
> headers/build/host/freebsd -I headers/build -I headers/build/posix -I
> headers/build/os -I headers/build/os/app -I headers/build/os/drivers
> -I headers/build/os/kernel -I headers/build/os/interface -I
> headers/build/os/locale -I headers/build/os/opengl -I
> headers/build/os/storage -I headers/build/os/support -I
> headers/build/private -o
> "generated/objects/freebsd/x86/release/build/libroot/atomic-2.o" ;

Not that it matters, but I usually name it *.pp (it's the preprocessed source 
file). That's the interesting output. The pre-processor errors -- the missing 
includes -- need to be fixed first, though.

> In file included from headers/build/posix/limits.h:9,
>  from headers/build/os_target/support/target_Errors.h:9,
>  from headers/build/os/support/Errors.h:9,
>  from headers/build/os/support/SupportDefs.h:15,
>  from src/build/libroot/atomic.cpp:6:
> headers/build/posix_target/target_limits.h:10:26: error:
> config/types.h: No such file or directory

Should include target_config/target_types.h instead.

> headers/build/posix_target/target_limits.h:12:52: error: float.h: No
> such file or directory

target_float.h etc. The target_*/ headers should only include other target_*/ 
headers (or the occasional compiler header (like stdarg.h)).

CU, Ingo

Other related posts: