[Solved] Issues building Haiku

I’ve been building Haiku and its components before, but now got erros relating to “stat.h” - I forget the details…

I decided to remove the “generated” folder and configure anew. Unfortunately, this fails. I’ve checked out the latest buildtools source.

This is my configure line and the error output:

$> /HaikuSrc/haiku/configure -j8 --distro-compatibility official --target-arch x86_64 --cross-tools-source /HaikuSrc/buildtools --build-cross-tools x86_64
checking build system type... x86_64-unknown-haiku_buildhost
checking host system type... x86_64-unknown-haiku_buildhost
checking target system type... x86_64-unknown-haiku
checking for a BSD-compatible install... /bin/install -c
checking whether ln works... no, using cp
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for x86_64-unknown-haiku_buildhost-gcc... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/HaikuBuild/generated/cross-tools-x86_64-build/binutils':
configure: error: C compiler cannot create executables
See `config.log' for more details

This is the `config.log’ :

config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ /HaikuSrc/buildtools/binutils/configure --prefix=/HaikuBuild/generated/cross-tools-x86_64 --build=x86_64-unknown-haiku_buildhost --host=x86_64-unknown-haiku_buildhost --target=x86_64-unknown-haiku --enable-targets=x86_64-unknown-haiku,i386-efi-pe,x86_64-efi-pe --disable-nls --disable-shared --disable-werror --with-sysroot=/HaikuBuild/generated/cross-tools-x86_64/sysroot --disable-maintainer-mode --enable-multilib

## --------- ##
## Platform. ##
## --------- ##

hostname = shredder
uname -m = x86_64
uname -r = R1~beta6+development
uname -s = Haiku
uname -v = hrev59901 Jul 27 2026 06:30:45

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: .
PATH: /boot/home/config/non-packaged/bin
PATH: /boot/home/config/bin
PATH: /boot/home/config/apps
PATH: /boot/system/non-packaged/bin
PATH: /bin
PATH: /boot/system/apps
PATH: /boot/system/preferences


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2392: checking build system type
configure:2406: result: x86_64-unknown-haiku_buildhost
configure:2453: checking host system type
configure:2466: result: x86_64-unknown-haiku_buildhost
configure:2486: checking target system type
configure:2499: result: x86_64-unknown-haiku
configure:2553: checking for a BSD-compatible install
configure:2621: result: /bin/install -c
configure:2632: checking whether ln works
configure:2650: result: no, using cp
configure:2658: checking whether ln -s works
configure:2662: result: yes
configure:2669: checking for a sed that does not truncate output
configure:2733: result: /bin/sed
configure:2742: checking for gawk
configure:2758: found /bin/gawk
configure:2769: result: gawk
configure:4210: checking for x86_64-unknown-haiku_buildhost-gcc
configure:4240: result: no
configure:4250: checking for gcc
configure:4266: found /bin/gcc
configure:4277: result: gcc
configure:4506: checking for C compiler version
configure:4515: gcc --version >&5
gcc (2023_08_10) 13.3.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:4526: $? = 0
configure:4515: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.3.0/lto-wrapper
Target: x86_64-unknown-haiku
Configured with: /sources/gcc-13.3.0/configure --build=x86_64-unknown-haiku --prefix=/packages/gcc-13.3.0_2023_08_10-6/.self/develop/tools --libexecdir=/packages/gcc-13.3.0_2023_08_10-6/.self/develop/tools/lib --mandir=/packages/gcc-13.3.0_2023_08_10-6/.self/documentation/man --docdir=/packages/gcc-13.3.0_2023_08_10-6/.self/documentation/packages/gcc --enable-threads=posix --disable-nls --enable-shared --with-gnu-ld --with-gnu-as --enable-version-specific-runtime-libs --enable-languages=c,c++,fortran,jit,objc --enable-lto --enable-frame-pointer --with-pkgversion=2023_08_10 --enable-__cxa-atexit --with-system-zlib --enable-checking=release --with-bug-url=http://dev.haiku-os.org/ --with-default-libstdcxx-abi=gcc4-compatible --enable-libssp --enable-libsanitizer --enable-host-shared --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.3.0 (2023_08_10) 
configure:4526: $? = 0
configure:4515: gcc -V >&5
gcc: error: unrecognized command-line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:4526: $? = 1
configure:4515: gcc -qversion >&5
gcc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:4526: $? = 1
configure:4546: checking whether the C compiler works
configure:4568: gcc -O2   conftest.c  >&5
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.3.0/../../../../x86_64-unknown-haiku/bin/ld: cannot find crti.o: No such file or directory
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.3.0/../../../../x86_64-unknown-haiku/bin/ld: cannot find start_dyn.o: No such file or directory
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.3.0/../../../../x86_64-unknown-haiku/bin/ld: cannot find init_term_dyn.o: No such file or directory
collect2: error: ld returned 1 exit status
configure:4572: $? = 1
configure:4610: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:4615: error: in `/HaikuBuild/generated/cross-tools-x86_64-build/binutils':
configure:4617: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-unknown-haiku_buildhost
ac_cv_env_AR_FOR_TARGET_set=
ac_cv_env_AR_FOR_TARGET_value=
ac_cv_env_AR_set=
ac_cv_env_AR_value=
ac_cv_env_AS_FOR_TARGET_set=
ac_cv_env_AS_FOR_TARGET_value=
ac_cv_env_AS_set=
ac_cv_env_AS_value=
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_FOR_TARGET_set=
ac_cv_env_CC_FOR_TARGET_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value=-O2
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CXXFLAGS_set=set
ac_cv_env_CXXFLAGS_value='-O2 -std=c++14'
ac_cv_env_CXX_FOR_TARGET_set=
ac_cv_env_CXX_FOR_TARGET_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_DLLTOOL_FOR_TARGET_set=
ac_cv_env_DLLTOOL_FOR_TARGET_value=
ac_cv_env_DLLTOOL_set=
ac_cv_env_DLLTOOL_value=
ac_cv_env_DSYMUTIL_FOR_TARGET_set=
ac_cv_env_DSYMUTIL_FOR_TARGET_value=
ac_cv_env_DSYMUTIL_set=
ac_cv_env_DSYMUTIL_value=
ac_cv_env_GCC_FOR_TARGET_set=
ac_cv_env_GCC_FOR_TARGET_value=
ac_cv_env_GDC_FOR_TARGET_set=
ac_cv_env_GDC_FOR_TARGET_value=
ac_cv_env_GFORTRAN_FOR_TARGET_set=
ac_cv_env_GFORTRAN_FOR_TARGET_value=
ac_cv_env_GOC_FOR_TARGET_set=
ac_cv_env_GOC_FOR_TARGET_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LD_FOR_TARGET_set=
ac_cv_env_LD_FOR_TARGET_value=
ac_cv_env_LD_set=
ac_cv_env_LD_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LIPO_FOR_TARGET_set=
ac_cv_env_LIPO_FOR_TARGET_value=
ac_cv_env_LIPO_set=
ac_cv_env_LIPO_value=
ac_cv_env_NM_FOR_TARGET_set=
ac_cv_env_NM_FOR_TARGET_value=
ac_cv_env_NM_set=
ac_cv_env_NM_value=
ac_cv_env_OBJCOPY_FOR_TARGET_set=
ac_cv_env_OBJCOPY_FOR_TARGET_value=
ac_cv_env_OBJCOPY_set=
ac_cv_env_OBJCOPY_value=
ac_cv_env_OBJDUMP_FOR_TARGET_set=
ac_cv_env_OBJDUMP_FOR_TARGET_value=
ac_cv_env_OBJDUMP_set=
ac_cv_env_OBJDUMP_value=
ac_cv_env_OTOOL_FOR_TARGET_set=
ac_cv_env_OTOOL_FOR_TARGET_value=
ac_cv_env_OTOOL_set=
ac_cv_env_OTOOL_value=
ac_cv_env_RANLIB_FOR_TARGET_set=
ac_cv_env_RANLIB_FOR_TARGET_value=
ac_cv_env_RANLIB_set=
ac_cv_env_RANLIB_value=
ac_cv_env_READELF_FOR_TARGET_set=
ac_cv_env_READELF_FOR_TARGET_value=
ac_cv_env_READELF_set=
ac_cv_env_READELF_value=
ac_cv_env_STRIP_FOR_TARGET_set=
ac_cv_env_STRIP_FOR_TARGET_value=
ac_cv_env_STRIP_set=
ac_cv_env_STRIP_value=
ac_cv_env_WINDMC_FOR_TARGET_set=
ac_cv_env_WINDMC_FOR_TARGET_value=
ac_cv_env_WINDMC_set=
ac_cv_env_WINDMC_value=
ac_cv_env_WINDRES_FOR_TARGET_set=
ac_cv_env_WINDRES_FOR_TARGET_value=
ac_cv_env_WINDRES_set=
ac_cv_env_WINDRES_value=
ac_cv_env_build_alias_set=set
ac_cv_env_build_alias_value=x86_64-unknown-haiku_buildhost
ac_cv_env_build_configargs_set=
ac_cv_env_build_configargs_value=
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=x86_64-unknown-haiku_buildhost
ac_cv_env_host_configargs_set=
ac_cv_env_host_configargs_value=
ac_cv_env_target_alias_set=set
ac_cv_env_target_alias_value=x86_64-unknown-haiku
ac_cv_env_target_configargs_set=
ac_cv_env_target_configargs_value=
ac_cv_host=x86_64-unknown-haiku_buildhost
ac_cv_path_SED=/bin/sed
ac_cv_path_install='/bin/install -c'
ac_cv_prog_AWK=gawk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_target=x86_64-unknown-haiku
acx_cv_prog_LN=no

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR=''
AR_FOR_BUILD='$(AR)'
AR_FOR_TARGET=''
AR_PLUGIN_OPTION=''
AS=''
AS_FOR_BUILD='$(AS)'
AS_FOR_TARGET=''
AWK='gawk'
BISON=''
BUILD_CONFIG=''
CC='gcc'
CC_FOR_BUILD='$(CC)'
CC_FOR_TARGET=''
CFLAGS='-O2'
CFLAGS_FOR_BUILD=''
CFLAGS_FOR_TARGET=''
COMPILER_AS_FOR_TARGET=''
COMPILER_LD_FOR_TARGET=''
COMPILER_NM_FOR_TARGET=''
CONFIGURE_GDB_TK=''
CPPFLAGS=''
CPPFLAGS_FOR_BUILD=''
CPP_FOR_BUILD=''
CXX=''
CXXFLAGS='-O2 -std=c++14'
CXXFLAGS_FOR_BUILD=''
CXXFLAGS_FOR_TARGET=''
CXX_FOR_BUILD='$(CXX)'
CXX_FOR_TARGET=''
DEBUG_PREFIX_CFLAGS_FOR_TARGET=''
DEFS=''
DLLTOOL=''
DLLTOOL_FOR_BUILD='$(DLLTOOL)'
DLLTOOL_FOR_TARGET=''
DSYMUTIL=''
DSYMUTIL_FOR_BUILD='$(DSYMUTIL)'
DSYMUTIL_FOR_TARGET=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
EXPECT=''
FLAGS_FOR_TARGET=''
FLEX=''
GCC_FOR_TARGET=''
GCC_SHLIB_SUBDIR=''
GDB_TK=''
GDC=''
GDCFLAGS=''
GDC_FOR_BUILD='$(GDC)'
GDC_FOR_TARGET=''
GFORTRAN_FOR_BUILD='$(GFORTRAN)'
GFORTRAN_FOR_TARGET=''
GNATBIND=''
GNATMAKE=''
GOC_FOR_BUILD='$(GOC)'
GOC_FOR_TARGET=''
HAVE_CXX11=''
HAVE_CXX11_FOR_BUILD=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_GDB_TK=''
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LD=''
LDFLAGS=''
LDFLAGS_FOR_BUILD=''
LDFLAGS_FOR_TARGET=''
LD_FOR_BUILD='$(LD)'
LD_FOR_TARGET=''
LEX=''
LIBOBJS=''
LIBS=''
LIPO=''
LIPO_FOR_TARGET=''
LN='cp'
LN_S='ln -s'
LTLIBOBJS=''
M4=''
MAINT=''
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE=''
MAKEINFO=''
NM=''
NM_FOR_BUILD='$(NM)'
NM_FOR_TARGET=''
OBJCOPY=''
OBJCOPY_FOR_TARGET=''
OBJDUMP=''
OBJDUMP_FOR_TARGET=''
OBJEXT=''
OTOOL=''
OTOOL_FOR_TARGET=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PGO_BUILD_GEN_CFLAGS=''
PGO_BUILD_LTO_CFLAGS=''
PGO_BUILD_USE_CFLAGS=''
PKG_CONFIG_PATH=''
RANLIB=''
RANLIB_FOR_BUILD='$(RANLIB)'
RANLIB_FOR_TARGET=''
RANLIB_PLUGIN_OPTION=''
RAW_CXX_FOR_TARGET=''
READELF=''
READELF_FOR_TARGET=''
RPATH_ENVVAR=''
RUNTEST=''
SED='/bin/sed'
SHELL='/bin/sh'
STRIP=''
STRIP_FOR_TARGET=''
SYSROOT_CFLAGS_FOR_TARGET=''
TOPLEVEL_CONFIGURE_ARGUMENTS='/HaikuSrc/buildtools/binutils/configure --prefix=/HaikuBuild/generated/cross-tools-x86_64 --build=x86_64-unknown-haiku_buildhost --host=x86_64-unknown-haiku_buildhost --target=x86_64-unknown-haiku --enable-targets=x86_64-unknown-haiku,i386-efi-pe,x86_64-efi-pe --disable-nls --disable-shared --disable-werror --with-sysroot=/HaikuBuild/generated/cross-tools-x86_64/sysroot --disable-maintainer-mode --enable-multilib'
WINDMC=''
WINDMC_FOR_BUILD='$(WINDMC)'
WINDMC_FOR_TARGET=''
WINDRES=''
WINDRES_FOR_BUILD='$(WINDRES)'
WINDRES_FOR_TARGET=''
YACC=''
ac_ct_CC='gcc'
ac_ct_CXX=''
bindir='${exec_prefix}/bin'
build='x86_64-unknown-haiku_buildhost'
build_alias='x86_64-unknown-haiku_buildhost'
build_configargs=''
build_configdirs='build-libiberty build-libcpp build-texinfo build-flex build-bison build-m4 build-fixincludes'
build_cpu='x86_64'
build_libsubdir='build-x86_64-unknown-haiku_buildhost'
build_noncanonical='x86_64-unknown-haiku_buildhost'
build_os='haiku_buildhost'
build_subdir='build-x86_64-unknown-haiku_buildhost'
build_tooldir=''
build_vendor='unknown'
compare_exclusions=''
configdirs='intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libcody libdecnumber gmp mpfr mpc isl libiconv libctf libsframe texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gdbserver gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools c++tools'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
do_compare=''
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
extra_host_libiberty_configure_flags=''
extra_host_zlib_configure_flags=''
extra_isl_gmp_configure_flags=''
extra_liboffloadmic_configure_flags=''
extra_linker_plugin_configure_flags=''
extra_linker_plugin_flags=''
extra_mpc_gmp_configure_flags=''
extra_mpc_mpfr_configure_flags=''
extra_mpfr_configure_flags=''
get_gcc_base_ver=''
gmpinc=''
gmplibs=''
host='x86_64-unknown-haiku_buildhost'
host_alias='x86_64-unknown-haiku_buildhost'
host_configargs=''
host_cpu='x86_64'
host_noncanonical='x86_64-unknown-haiku_buildhost'
host_os='haiku_buildhost'
host_shared=''
host_subdir='.'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
islinc=''
isllibs=''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
poststage1_ldflags=''
poststage1_libs=''
prefix='/HaikuBuild/generated/cross-tools-x86_64'
program_transform_name='s&^&x86_64-unknown-haiku-&'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
stage1_cflags=''
stage1_checking=''
stage1_languages=''
stage1_ldflags=''
stage1_libs=''
stage2_werror_flag=''
sysconfdir='${prefix}/etc'
target='x86_64-unknown-haiku'
target_alias='x86_64-unknown-haiku'
target_configargs=''
target_configdirs='target-libgcc target-libbacktrace target-libgloss target-newlib target-libgomp target-liboffloadmic target-libatomic target-libitm target-libstdc++-v3 target-libsanitizer target-libvtv target-libssp target-libquadmath target-libgfortran target-libffi target-libobjc target-libada target-libgo target-libphobos target-zlib target-rda'
target_cpu='x86_64'
target_noncanonical='x86_64-unknown-haiku'
target_os='haiku'
target_subdir='x86_64-unknown-haiku'
target_vendor='unknown'
tooldir=''

## ------------------- ##
## File substitutions. ##
## ------------------- ##

alphaieee_frag=''
host_makefile_frag='/dev/null'
ospace_frag=''
serialization_dependencies=''
target_makefile_frag=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""

configure: exit 77

Any ideas?

Do you have haiku_devel installed?

Well. Damn. Indeed, I had not. The recent kerfuffle around un- and reinstalling and full-syncing to solve the haikuports issue around libxml etc. must’ve uninstalled the devel package.
Now it works, thank you very much!

2 Likes