diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index 44a6620fcd..85ecccd4b7 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -502,29 +502,27 @@ if $(HOST_PLATFORM_BEOS_COMPATIBLE) { # request 64 bit off_t support explicitely. HOST_DEFINES += _GNU_SOURCE _FILE_OFFSET_BITS=64 __STDC_FORMAT_MACROS __STDC_LIMIT_MACROS ; +} - # On Linux with xattr support we can use it for our attribute emulation, - # which is somewhat more robust. - if $(HAIKU_HOST_USE_XATTR) = 1 { - HOST_DEFINES += HAIKU_HOST_USE_XATTR ; - } else { - # Otherwise the generic attribute emulation is used, which uses a - # directory per file to store its attribute. We need to redefine RM so - # that the attributes are removed as well. We use a wrapper script, - # which invokes a build tool. If the build tool hasn't been built yet, - # the normal "rm" is used and the attributes are leaked (likely there - # aren't any yet). - RM = $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ";" - [ FDirName $(HAIKU_TOP) build scripts rm_attrs ] - [ FDirName $(HAIKU_OBJECT_DIR) $(HOST_PLATFORM) $(HOST_ARCH) release - tools rm_attrs ] -f ; - # assumes that rm_attrs is built with debugging disabled - HOST_RM_ATTRS_TARGET = rm_attrs ; +if $(HAIKU_HOST_USE_XATTR) = 1 { + HOST_DEFINES += HAIKU_HOST_USE_XATTR ; +} else { + # Otherwise the generic attribute emulation is used, which uses a + # directory per file to store its attribute. We need to redefine RM so + # that the attributes are removed as well. We use a wrapper script, + # which invokes a build tool. If the build tool hasn't been built yet, + # the normal "rm" is used and the attributes are leaked (likely there + # aren't any yet). + RM = $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ";" + [ FDirName $(HAIKU_TOP) build scripts rm_attrs ] + [ FDirName $(HAIKU_OBJECT_DIR) $(HOST_PLATFORM) $(HOST_ARCH) release + tools rm_attrs ] -f ; + # assumes that rm_attrs is built with debugging disabled + HOST_RM_ATTRS_TARGET = rm_attrs ; - # If specified, use xattr support to tag files with unique IDs. - if $(HAIKU_HOST_USE_XATTR_REF) = 1 { - HOST_DEFINES += HAIKU_HOST_USE_XATTR_REF ; - } + # If specified, use xattr support to tag files with unique IDs. + if $(HAIKU_HOST_USE_XATTR_REF) = 1 { + HOST_DEFINES += HAIKU_HOST_USE_XATTR_REF ; } } diff --git a/headers/build/os/kernel/fs_attr.h b/headers/build/os/kernel/fs_attr.h index 3f24985f05..d441301d08 100644 --- a/headers/build/os/kernel/fs_attr.h +++ b/headers/build/os/kernel/fs_attr.h @@ -20,6 +20,23 @@ typedef struct attr_info { extern "C" { #endif + +/* Since libroot_build is also used on Haiku and linked against the real + * libroot which also has the fs*attr functions, these must be shadowed. */ +#define fs_read_attr build_fs_read_attr +#define fs_write_attr build_fs_write_attr +#define fs_remove_attr build_fs_remove_attr +#define fs_stat_attr build_fs_stat_attr +#define fs_open_attr build_fs_open_attr +#define fs_fopen_attr build_fs_fopen_attr +#define fs_close_attr build_fs_close_attr +#define fs_open_attr_dir build_fs_open_attr_dir +#define fs_fopen_attr_dir build_fs_fopen_attr_dir +#define fs_close_attr_dir build_fs_close_attr_dir +#define fs_read_attr_dir build_fs_read_attr_dir +#define fs_rewind_attr_dir build_fs_rewind_attr_dir + + extern ssize_t fs_read_attr(int fd, const char *attribute, uint32 type, off_t pos, void *buffer, size_t readBytes); extern ssize_t fs_write_attr(int fd, const char *attribute, uint32 type, diff --git a/src/build/libroot/Jamfile b/src/build/libroot/Jamfile index 1d22d3cd33..ea648a6c7e 100644 --- a/src/build/libroot/Jamfile +++ b/src/build/libroot/Jamfile @@ -78,10 +78,15 @@ local librootSources = USES_BE_API on [ FGristFiles $(librootSources:S=$(SUFOBJ)) ] = true ; +local extraLibs ; +if $(HOST_PLATFORM) = haiku_host { + extraLibs = gnu ; +} + BuildPlatformSharedLibrary libroot_build.so : $(librootSources) : - $(HOST_LIBSUPC++) $(HOST_LIBSTDC++) + $(HOST_LIBSUPC++) $(HOST_LIBSTDC++) $(extraLibs) ; # TODO: This doesn't work with the function remapping. diff --git a/src/build/libroot/fs_attr.cpp b/src/build/libroot/fs_attr.cpp index c56a919ba6..d52e690258 100644 --- a/src/build/libroot/fs_attr.cpp +++ b/src/build/libroot/fs_attr.cpp @@ -1,9 +1,5 @@ -#ifdef HAIKU_HOST_USE_XATTR -# ifdef HAIKU_HOST_PLATFORM_HAIKU - // Do nothing; we allow libroot's fs_attr symbols to shine through. -# else -# include "fs_attr_untyped.cpp" -# endif -#else -# include "fs_attr_generic.cpp" -#endif +#ifdef HAIKU_HOST_USE_XATTR +# include "fs_attr_untyped.cpp" +#else +# include "fs_attr_generic.cpp" +#endif diff --git a/src/build/libroot/fs_attr_untyped.cpp b/src/build/libroot/fs_attr_untyped.cpp index aeffdca36e..f2359eff40 100644 --- a/src/build/libroot/fs_attr_untyped.cpp +++ b/src/build/libroot/fs_attr_untyped.cpp @@ -39,7 +39,7 @@ // Include the interface to the host platform attributes support. -#if defined(HAIKU_HOST_PLATFORM_LINUX) +#if defined(HAIKU_HOST_PLATFORM_LINUX) || defined(HAIKU_HOST_PLATFORM_HAIKU) # include "fs_attr_xattr.h" #elif defined(HAIKU_HOST_PLATFORM_FREEBSD) # include "fs_attr_extattr.h"