qemu-ios icon indicating copy to clipboard operation
qemu-ios copied to clipboard

Failed on building at [717/2533] Compiling C object libblockdev.fa.p/block_export_fuse.c.o FAILED: libblockdev.fa.p/block_export_fuse.c.o

Open pullobi opened this issue 7 months ago • 4 comments

Running on an Apple Silicon M3 Mac running Sequoia 15.4.1

[717/2533] Compiling C object libblockdev.fa.p/block_export_fuse.c.o
FAILED: libblockdev.fa.p/block_export_fuse.c.o 
cc -Ilibblockdev.fa.p -I. -I.. -Iqapi -Itrace -Iui -Iui/shader -I/usr/local/include/fuse3 -I/opt/homebrew/Cellar/gnutls/3.8.9/include -I/opt/homebrew/Cellar/nettle/3.10.1/include -I/opt/homebrew/Cellar/libtasn1/4.20.0/include -I/opt/homebrew/Cellar/libidn2/2.3.8/include -I/opt/homebrew/Cellar/p11-kit/0.25.5/include/p11-kit-1 -I/opt/homebrew/Cellar/glib/2.84.1/include -I/opt/homebrew/Cellar/glib/2.84.1/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.84.1/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.45/include -fcolor-diagnostics -Wall -Winvalid-pch -std=gnu11 -O2 -g -iquote . -iquote /Users/doruk/Desktop/qemu -iquote /Users/doruk/Desktop/qemu/include -iquote /Users/doruk/Desktop/qemu/disas/libvixl -iquote /Users/doruk/Desktop/qemu/tcg/aarch64 -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -fstack-protector-strong -MD -MQ libblockdev.fa.p/block_export_fuse.c.o -MF libblockdev.fa.p/block_export_fuse.c.o.d -o libblockdev.fa.p/block_export_fuse.c.o -c ../block/export/fuse.c
../block/export/fuse.c:387:26: warning: incompatible pointer types passing 'struct stat *' to parameter of type 'const struct fuse_darwin_attr *' [-Wincompatible-pointer-types]
  387 |     fuse_reply_attr(req, &statbuf, 1.);
      |                          ^~~~~~~~
/usr/local/include/fuse3/fuse_lowlevel.h:1521:2: note: passing argument to parameter here
 1521 |         fuse_reply_attr,
      |         ^
../block/export/fuse.c:628:16: error: use of undeclared identifier 'FALLOC_FL_KEEP_SIZE'
  628 |     if (mode & FALLOC_FL_KEEP_SIZE) {
      |                ^
../block/export/fuse.c:632:16: error: use of undeclared identifier 'FALLOC_FL_PUNCH_HOLE'
  632 |     if (mode & FALLOC_FL_PUNCH_HOLE) {
      |                ^
../block/export/fuse.c:633:22: error: use of undeclared identifier 'FALLOC_FL_KEEP_SIZE'
  633 |         if (!(mode & FALLOC_FL_KEEP_SIZE)) {
      |                      ^
../block/export/fuse.c:794:19: error: incompatible function pointer types initializing 'typeof(void (*)(fuse_req_t, fuse_ino_t, struct fuse_darwin_attr *, int, struct fuse_file_info *))' (aka 'void (*)(struct fuse_req *, unsigned long long, struct fuse_darwin_attr *, int, struct fuse_file_info *)') with an expression of type 'void (fuse_req_t, fuse_ino_t, struct stat *, int, struct fuse_file_info *)' (aka 'void (struct fuse_req *, unsigned long long, struct stat *, int, struct fuse_file_info *)') [-Wincompatible-function-pointer-types]
  794 |     .setattr    = fuse_setattr,
      |                   ^~~~~~~~~~~~
1 warning and 4 errors generated.
ninja: build stopped: subcommand failed.
make: *** [run-ninja] Error 1
╭─doruk@192 ~/Desktop/qemu/build  ‹ipod_touch_1g› 
╰─➤                                                                                          2 ↵

I don't know what else to add here

trying to manually compile

╰─➤  cc -Ilibblockdev.fa.p -I. -I.. -Iqapi -Itrace -Iui -Iui/shader -I/usr/local/include/fuse3 -I/opt/homebrew/Cellar/gnutls/3.8.9/include -I/opt/homebrew/Cellar/nettle/3.10.1/include -I/opt/homebrew/Cellar/libtasn1/4.20.0/include -I/opt/homebrew/Cellar/libidn2/2.3.8/include -I/opt/homebrew/Cellar/p11-kit/0.25.5/include/p11-kit-1 -I/opt/homebrew/Cellar/glib/2.84.1/include -I/opt/homebrew/Cellar/glib/2.84.1/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.84.1/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.45/include -fcolor-diagnostics -Wall -Winvalid-pch -std=gnu11 -O2 -g -iquote . -iquote /Users/doruk/Desktop/qemu -iquote /Users/doruk/Desktop/qemu/include -iquote /Users/doruk/Desktop/qemu/disas/libvixl -iquote /Users/doruk/Desktop/qemu/tcg/aarch64 -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -fstack-protector-strong -MD -MQ libblockdev.fa.p/block_export_fuse.c.o -MF libblockdev.fa.p/block_export_fuse.c.o.d -o libblockdev.fa.p/block_export_fuse.c.o -c ../block/export/fuse.c
../block/export/fuse.c:387:26: warning: incompatible pointer types passing 'struct stat *' to parameter of type 'const struct fuse_darwin_attr *' [-Wincompatible-pointer-types]
  387 |     fuse_reply_attr(req, &statbuf, 1.);
      |                          ^~~~~~~~
/usr/local/include/fuse3/fuse_lowlevel.h:1521:2: note: passing argument to parameter here
 1521 |         fuse_reply_attr,
      |         ^
../block/export/fuse.c:628:16: error: use of undeclared identifier 'FALLOC_FL_KEEP_SIZE'
  628 |     if (mode & FALLOC_FL_KEEP_SIZE) {
      |                ^
../block/export/fuse.c:632:16: error: use of undeclared identifier 'FALLOC_FL_PUNCH_HOLE'
  632 |     if (mode & FALLOC_FL_PUNCH_HOLE) {
      |                ^
../block/export/fuse.c:633:22: error: use of undeclared identifier 'FALLOC_FL_KEEP_SIZE'
  633 |         if (!(mode & FALLOC_FL_KEEP_SIZE)) {
      |                      ^
../block/export/fuse.c:794:19: error: incompatible function pointer types initializing 'typeof(void (*)(fuse_req_t, fuse_ino_t, struct fuse_darwin_attr *, int, struct fuse_file_info *))' (aka 'void (*)(struct fuse_req *, unsigned long long, struct fuse_darwin_attr *, int, struct fuse_file_info *)') with an expression of type 'void (fuse_req_t, fuse_ino_t, struct stat *, int, struct fuse_file_info *)' (aka 'void (struct fuse_req *, unsigned long long, struct stat *, int, struct fuse_file_info *)') [-Wincompatible-function-pointer-types]
  794 |     .setattr    = fuse_setattr,
      |                   ^~~~~~~~~~~~
1 warning and 4 errors generated.

note: homebrew dependencies were already installed on my mac, i reinstalled them

does anyone know how to fix this?

config.log

pullobi avatar May 04 '25 08:05 pullobi

I had this error and I was able to get it to compile but it immediately segfaults.

Ran this command:

../configure --enable-sdl --disable-cocoa --target-list=arm-softmmu --disable-capstone --disable-pie --disable-slirp --extra-cflags=-"I/opt/homebrew/opt/[email protected]/include -Wno-incompatible-pointer-types" --extra-ldflags='-L/opt/homebrew/opt/[email protected]/lib -lcrypto' --disable-fuse

Needed to disable fuse and prevent incompatible pointer types.

Applied two patches:

  • https://lists.nongnu.org/archive/html/qemu-devel/2021-12/msg04320.html
  • https://github.com/devos50/qemu-ios/pull/239

I was able to build and run qemu-system-arm-unsigned. Sadly now I just get this:

WARNING: Image format was not specified for '../system-files/nor_n45ap.bin' and probing guessed raw. Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. Reading PMU register 118 Reading PMU register 75 Reading PMU register 87 Reading PMU register 103 iis_init() spi_init() Reading PMU register 75 power supply type batt battery voltage Reading PMU register 87 error [1] 84265 segmentation fault ./qemu-system-arm-unsigned -M -serial mon:stdio -cpu max -m 1G -d unimp

aminoa avatar May 29 '25 03:05 aminoa

I had that error, too. Either it's because of the new GCC compiler or a QEMU issue.

Opuqide avatar May 29 '25 03:05 Opuqide

I tried with Clang 14 from brew (I was on Clang 16 initially) and it gives the same error so I'm not sure if it's a compiler issue.

also for both clang versions, I don't seem to need -Wno-incompatible-pointer-types anymore (maybe disable-fuse covers that?)

aminoa avatar Jun 02 '25 03:06 aminoa

Update: I'm also getting a segfault too on Ubuntu 25.04 (both are for attempting to boot up the iPod Touch 1g).

aminoa avatar Jun 07 '25 19:06 aminoa

Deleting macfuse resolved the same issue for me. Hope it will help you anon.

Samsuper12 avatar Dec 12 '25 08:12 Samsuper12