depends: Cross-compiling using -m64/-m32 fails on FreeBSD / OpenBSD #32715

issue hebasto openend this issue on June 10, 2025
  1. hebasto commented at 11:18 am on June 10, 2025: member

    On FreeBSD 14.3:

     0$ gmake -C depends HOST=i686-unknown-freebsd libevent
     1gmake: Entering directory '/home/hebasto/dev/bitcoin/depends'
     2Configuring libevent...
     3CMake Deprecation Warning at CMakeLists.txt:22 (cmake_minimum_required):
     4  Compatibility with CMake < 3.10 will be removed from a future version of
     5  CMake.
     6
     7  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
     8  to tell CMake that the project requires at least <min> but has been updated
     9  to work with policies introduced by <max> or earlier.
    10
    11
    12-- The C compiler identification is Clang 19.1.7
    13-- Detecting C compiler ABI info
    14-- Detecting C compiler ABI info - failed
    15-- Check for working C compiler: /usr/bin/clang
    16-- Check for working C compiler: /usr/bin/clang - broken
    17CMake Error at /usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):
    18  The C compiler
    19
    20    "/usr/bin/clang"
    21
    22  is not able to compile a simple test program.
    23
    24  It fails with the following output:
    25
    26    Change Dir: '/home/hebasto/dev/bitcoin/depends/work/build/i686-unknown-freebsd/libevent/2.1.12-stable-baac65d95ab/build/CMakeFiles/CMakeScratch/TryCompile-LurZhX'
    27    
    28    Run Build Command(s): /usr/local/bin/cmake -E env VERBOSE=1 /usr/local/bin/gmake -f Makefile cmTC_a9d3d/fast
    29    gmake[1]: Entering directory '/home/hebasto/dev/bitcoin/depends/work/build/i686-unknown-freebsd/libevent/2.1.12-stable-baac65d95ab/build/CMakeFiles/CMakeScratch/TryCompile-LurZhX'
    30    /usr/local/bin/gmake  -f CMakeFiles/cmTC_a9d3d.dir/build.make CMakeFiles/cmTC_a9d3d.dir/build
    31    gmake[2]: Entering directory '/home/hebasto/dev/bitcoin/depends/work/build/i686-unknown-freebsd/libevent/2.1.12-stable-baac65d95ab/build/CMakeFiles/CMakeScratch/TryCompile-LurZhX'
    32    Building C object CMakeFiles/cmTC_a9d3d.dir/testCCompiler.c.o
    33    /usr/bin/clang  -m32 --target=i686-unknown-freebsd   -I/home/hebasto/dev/bitcoin/depends/i686-unknown-freebsd/include -D_GNU_SOURCE -D_FORTIFY_SOURCE=3 -pipe -std=c11 -O2 -fdebug-prefix-map=/home/hebasto/dev/bitcoin/depends/work/build/i686-unknown-freebsd/libevent/2.1.12-stable-baac65d95ab=/usr -fmacro-prefix-map=/home/hebasto/dev/bitcoin/depends/work/build/i686-unknown-freebsd/libevent/2.1.12-stable-baac65d95ab=/usr  -fPIE -MD -MT CMakeFiles/cmTC_a9d3d.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_a9d3d.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_a9d3d.dir/testCCompiler.c.o -c /home/hebasto/dev/bitcoin/depends/work/build/i686-unknown-freebsd/libevent/2.1.12-stable-baac65d95ab/build/CMakeFiles/CMakeScratch/TryCompile-LurZhX/testCCompiler.c
    34    Linking C executable cmTC_a9d3d
    35    /usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a9d3d.dir/link.txt --verbose=1
    36    ld: error: /usr/lib/crt1.o is incompatible with elf_i386_fbsd
    37    ld: error: /usr/lib/crti.o is incompatible with elf_i386_fbsd
    38    ld: error: /usr/lib/crtbegin.o is incompatible with elf_i386_fbsd
    39    ld: error: /usr/lib/libgcc.a(x86.o) is incompatible with elf_i386_fbsd
    40    ld: error: /usr/lib/libgcc.a(fp_mode.o) is incompatible with elf_i386_fbsd
    41    ld: error: /usr/lib/libgcc.a(absvdi2.o) is incompatible with elf_i386_fbsd
    42    ld: error: /usr/lib/libgcc.a(absvsi2.o) is incompatible with elf_i386_fbsd
    43    ld: error: /usr/lib/libgcc.a(absvti2.o) is incompatible with elf_i386_fbsd
    44    ld: error: /usr/lib/libgcc.a(addvdi3.o) is incompatible with elf_i386_fbsd
    45    ld: error: /usr/lib/libgcc.a(addvsi3.o) is incompatible with elf_i386_fbsd
    46    ld: error: /usr/lib/libgcc.a(addvti3.o) is incompatible with elf_i386_fbsd
    47    ld: error: /usr/lib/libgcc.a(apple_versioning.o) is incompatible with elf_i386_fbsd
    48    ld: error: /usr/lib/libgcc.a(ashldi3.o) is incompatible with elf_i386_fbsd
    49    ld: error: /usr/lib/libgcc.a(ashlti3.o) is incompatible with elf_i386_fbsd
    50    ld: error: /usr/lib/libgcc.a(ashrdi3.o) is incompatible with elf_i386_fbsd
    51    ld: error: /usr/lib/libgcc.a(ashrti3.o) is incompatible with elf_i386_fbsd
    52    ld: error: /usr/lib/libgcc.a(bswapdi2.o) is incompatible with elf_i386_fbsd
    53    ld: error: /usr/lib/libgcc.a(bswapsi2.o) is incompatible with elf_i386_fbsd
    54    ld: error: /usr/lib/libgcc.a(clear_cache.o) is incompatible with elf_i386_fbsd
    55    ld: error: /usr/lib/libgcc.a(clzdi2.o) is incompatible with elf_i386_fbsd
    56    ld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
    57    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    58    /usr/bin/clang  -m32 --target=i686-unknown-freebsd -I/home/hebasto/dev/bitcoin/depends/i686-unknown-freebsd/include -D_GNU_SOURCE -D_FORTIFY_SOURCE=3 -pipe -std=c11 -O2 -fdebug-prefix-map=/home/hebasto/dev/bitcoin/depends/work/build/i686-unknown-freebsd/libevent/2.1.12-stable-baac65d95ab=/usr -fmacro-prefix-map=/home/hebasto/dev/bitcoin/depends/work/build/i686-unknown-freebsd/libevent/2.1.12-stable-baac65d95ab=/usr  -L/home/hebasto/dev/bitcoin/depends/i686-unknown-freebsd/lib  CMakeFiles/cmTC_a9d3d.dir/testCCompiler.c.o -o cmTC_a9d3d
    59    gmake[2]: *** [CMakeFiles/cmTC_a9d3d.dir/build.make:103: cmTC_a9d3d] Error 1
    60    gmake[2]: Leaving directory '/home/hebasto/dev/bitcoin/depends/work/build/i686-unknown-freebsd/libevent/2.1.12-stable-baac65d95ab/build/CMakeFiles/CMakeScratch/TryCompile-LurZhX'
    61    gmake[1]: *** [Makefile:134: cmTC_a9d3d/fast] Error 2
    62    gmake[1]: Leaving directory '/home/hebasto/dev/bitcoin/depends/work/build/i686-unknown-freebsd/libevent/2.1.12-stable-baac65d95ab/build/CMakeFiles/CMakeScratch/TryCompile-LurZhX'
    63    
    64    
    65
    66  
    67
    68  CMake will not be able to correctly generate this project.
    69Call Stack (most recent call first):
    70  CMakeLists.txt:47 (project)
    71
    72
    73-- Configuring incomplete, errors occurred!
    74gmake: *** [funcs.mk:343: /home/hebasto/dev/bitcoin/depends/i686-unknown-freebsd/.libevent_stamp_configured] Error 1
    75gmake: Leaving directory '/home/hebasto/dev/bitcoin/depends'
    

    Additionally, for example, #23948 contains no evidence that this scenario has ever been tested.

    As the i686-unknown-freebsd target was never documented in depends/README.md, we might consider removing the broken code from depends/hosts/freebsd.mk.

    The same reasoning applies to OpenBSD as well. However, I have not tested this on NetBSD.

  2. hebasto added the label Build system on Jun 10, 2025
  3. hebasto commented at 12:04 pm on June 10, 2025: member

    However, I have not tested this on NetBSD.

    Well, this seems to be working on NetBSD 10.0:

    0$ gmake -C depends HOST=i686-unknown-netbsd NO_QT=1
    
  4. hebasto commented at 12:09 pm on June 10, 2025: member
    It seems my FreeBSD installation was broken.
  5. hebasto closed this on Jun 10, 2025


hebasto

Labels
Build system


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-06-15 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me