Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bunch of compilation errors #203

Open
devos50 opened this issue Dec 22, 2024 · 12 comments
Open

Bunch of compilation errors #203

devos50 opened this issue Dec 22, 2024 · 12 comments
Assignees

Comments

@devos50
Copy link
Owner

devos50 commented Dec 22, 2024

When compiling the project today (after some time of inactivity), I'm getting the following errors:

(base) martijndevos@iMacvanMartijn build % make
  GIT     ui/keycodemapdb meson tests/fp/berkeley-testfloat-3 tests/fp/berkeley-softfloat-3 dtc
[1/498] Generating qemu-version.h with a custom command (wrapped by meson to capture output)
[2/498] Compiling C object libqmp.fa.p/monitor_qmp-cmds-control.c.o
[3/498] Linking static target libqmp.fa
[4/498] Compiling Objective-C object libcommon.fa.p/ui_cocoa.m.o
[5/498] Compiling C object libcommon.fa.p/softmmu_vl.c.o
[6/498] Compiling C object libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_2g.c.o
FAILED: libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_2g.c.o 
cc -m64 -mcx16 -Ilibqemu-arm-softmmu.fa.p -I. -I.. -Itarget/arm -I../target/arm -I../dtc/libfdt -Iqapi -Itrace -Iui -Iui/shader -I/usr/local/Cellar/pixman/0.44.2/include/pixman-1 -I/usr/local/opt/openssl@3/include -I/usr/local/Cellar/glib/2.82.4/include -I/usr/local/Cellar/glib/2.82.4/include/glib-2.0 -I/usr/local/Cellar/glib/2.82.4/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre2/10.44/include -fcolor-diagnostics -Wall -Winvalid-pch -std=gnu11 -O2 -g -iquote . -iquote /Users/martijndevos/Documents/qemu-it2g -iquote /Users/martijndevos/Documents/qemu-it2g/include -iquote /Users/martijndevos/Documents/qemu-it2g/tcg/i386 -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 -Wno-gnu-variable-sized-type-not-at-end -fstack-protector-strong -DNEED_CPU_H '-DCONFIG_TARGET="arm-softmmu-config-target.h"' '-DCONFIG_DEVICES="arm-softmmu-config-devices.h"' -MD -MQ libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_2g.c.o -MF libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_2g.c.o.d -o libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_2g.c.o -c ../hw/arm/ipod_touch_2g.c
../hw/arm/ipod_touch_2g.c:62:5: error: incompatible function pointer types initializing 'CPReadFn *' (aka 'unsigned long long (*)(struct CPUArchState *, const struct ARMCPRegInfo *)') with an expression of type 'uint32_t (CPUARMState *)' (aka 'unsigned int (struct CPUArchState *)') [-Wincompatible-function-pointer-types]
   62 |     IT2G_CPREG_DEF_QEMU_CALL,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~
../hw/arm/ipod_touch_2g.c:44:19: note: expanded from macro 'IT2G_CPREG_DEF_QEMU_CALL'
   44 |         .readfn = qemu_call_status, \
      |                   ^~~~~~~~~~~~~~~~
../hw/arm/ipod_touch_2g.c:62:5: error: incompatible function pointer types initializing 'CPWriteFn *' (aka 'void (*)(struct CPUArchState *, const struct ARMCPRegInfo *, unsigned long long)') with an expression of type 'void (CPUARMState *, uint32_t)' (aka 'void (struct CPUArchState *, unsigned int)') [-Wincompatible-function-pointer-types]
   62 |     IT2G_CPREG_DEF_QEMU_CALL,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~
../hw/arm/ipod_touch_2g.c:45:20: note: expanded from macro 'IT2G_CPREG_DEF_QEMU_CALL'
   45 |         .writefn = qemu_call,     \
      |                    ^~~~~~~~~
../hw/arm/ipod_touch_2g.c:246:42: warning: passing 'const char[5]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  246 |     DeviceState *dev = pl192_manual_init("vic0", qdev_get_gpio_in(DEVICE(nms->cpu), ARM_CPU_IRQ), qdev_get_gpio_in(DEVICE(nms->cpu), ARM_CPU_FIQ), NULL);
      |                                          ^~~~~~
/Users/martijndevos/Documents/qemu-it2g/include/hw/intc/pl192.h:78:38: note: passing argument to parameter 'mem_name' here
   78 | DeviceState *pl192_manual_init(char *mem_name, ...);
      |                                      ^
../hw/arm/ipod_touch_2g.c:253:29: warning: passing 'const char[5]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  253 |     dev = pl192_manual_init("vic1", NULL);
      |                             ^~~~~~
/Users/martijndevos/Documents/qemu-it2g/include/hw/intc/pl192.h:78:38: note: passing argument to parameter 'mem_name' here
   78 | DeviceState *pl192_manual_init(char *mem_name, ...);
      |                                      ^
../hw/arm/ipod_touch_2g.c:424:16: warning: unused variable 'pmu' [-Wunused-variable]
  424 |     I2CSlave * pmu = i2c_slave_create_simple(i2c_state->bus, "pcf50633", 0x73);
      |                ^~~
../hw/arm/ipod_touch_2g.c:427:15: warning: unused variable 'accelerometer' [-Wunused-variable]
  427 |     I2CSlave *accelerometer = i2c_slave_create_simple(i2c_state->bus, "lis302dl", 0x1D);
      |               ^~~~~~~~~~~~~
../hw/arm/ipod_touch_2g.c:440:15: warning: unused variable 'cd327mikey' [-Wunused-variable]
  440 |     I2CSlave *cd327mikey = i2c_slave_create_simple(i2c_state->bus, "cd3272mikey", 0x39);
      |               ^~~~~~~~~~
5 warnings and 2 errors generated.
ninja: build stopped: subcommand failed.
make: *** [run-ninja] Error 1

I suspect this is because the compiler has become more strict on passing the expected types.

@devos50 devos50 self-assigned this Dec 22, 2024
@devos50
Copy link
Owner Author

devos50 commented Dec 22, 2024

Hmm weird, I compiled everything from scratch and now it seems to work again.

@devos50 devos50 closed this as completed Dec 22, 2024
@JerboaTheSandWing
Copy link

JerboaTheSandWing commented Dec 22, 2024

@devos50 I just tried to install this, and I encountered a very similar error:

FAILED: libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_2g.c.obj
"cc" "-m64" "-mcx16" "-Ilibqemu-arm-softmmu.fa.p" "-I." "-I.." "-Itarget/arm" "-I../target/arm" "-Isubprojects/dtc/libfdt" "-I../subprojects/dtc/libfdt" "-Iqapi" "-Itrace" "-Iui" "-Iui/shader" "-IC:/msys64/mingw64/include/pixman-1" "-I/mingw64/include/openssl" "-IC:/msys64/mingw64/include/glib-2.0" "-IC:/msys64/mingw64/lib/glib-2.0/include" "-fdiagnostics-color=auto" "-Wall" "-Winvalid-pch" "-std=gnu11" "-O2" "-g" "-Wundef" "-Wwrite-strings" "-Wmissing-prototypes" "-Wstrict-prototypes" "-Wredundant-decls" "-Wold-style-declaration" "-Wold-style-definition" "-Wtype-limits" "-Wformat-security" "-Wformat-y2k" "-Winit-self" "-Wignored-qualifiers" "-Wempty-body" "-Wnested-externs" "-Wendif-labels" "-Wexpansion-to-defined" "-Wimplicit-fallthrough=2" "-Wmissing-format-attribute" "-Wno-missing-include-dirs" "-Wno-shift-negative-value" "-Wno-psabi" "-Wshadow=local" "-iquote" "." "-iquote" "C:/Users/Jerbo/qemu-ios" "-iquote" "C:/Users/Jerbo/qemu-ios/include" "-iquote" "C:/Users/Jerbo/qemu-ios/host/include/x86_64" "-iquote" "C:/Users/Jerbo/qemu-ios/host/include/generic" "-iquote" "C:/Users/Jerbo/qemu-ios/tcg/i386" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE" "-fno-strict-aliasing" "-fno-common" "-fwrapv" "-fno-pie" "-no-pie" "-DNEED_CPU_H" "-DCONFIG_TARGET=\"arm-softmmu-config-target.h\"" "-DCONFIG_DEVICES=\"arm-softmmu-config-devices.h\"" -MD -MQ libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_2g.c.obj -MF "libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_2g.c.obj.d" -o libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_2g.c.obj "-c" ../hw/arm/ipod_touch_2g.c
../hw/arm/ipod_touch_2g.c: In function 'ipod_touch_memory_setup':
../hw/arm/ipod_touch_2g.c:100:69: error: passing argument 3 of 'g_file_get_contents' from incompatible pointer type [-Wincompatible-pointer-types]
  100 |     if (g_file_get_contents(nms->bootrom_path, (char **)&file_data, &fsize, NULL)) {
      |                                                                     ^~~~~~
      |                                                                     |
      |                                                                     long unsigned int *
In file included from C:/msys64/mingw64/include/glib-2.0/glib.h:50,
                 from C:/Users/Jerbo/qemu-ios/include/glib-compat.h:32,
                 from C:/Users/Jerbo/qemu-ios/include/qemu/osdep.h:161,
                 from ../hw/arm/ipod_touch_2g.c:1:
C:/msys64/mingw64/include/glib-2.0/glib/gfileutils.h:122:45: note: expected 'gsize *' {aka 'long long unsigned int *'} but argument is of type 'long unsigned int *'
  122 |                               gsize        *length,
      |                               ~~~~~~~~~~~~~~^~~~~~
../hw/arm/ipod_touch_2g.c: In function 'ipod_touch_key_event':
../hw/arm/ipod_touch_2g.c:186:10: warning: unused variable 'do_irq' [-Wunused-variable]
  186 |     bool do_irq = false;
      |          ^~~~~~
../hw/arm/ipod_touch_2g.c: In function 'ipod_touch_machine_init':
../hw/arm/ipod_touch_2g.c:263:42: warning: passing argument 1 of 'pl192_manual_init' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  263 |     DeviceState *dev = pl192_manual_init("vic0", qdev_get_gpio_in(DEVICE(nms->cpu), ARM_CPU_IRQ), qdev_get_gpio_in(DEVICE(nms->cpu), ARM_CPU_FIQ), NULL);
      |                                          ^~~~~~
In file included from C:/Users/Jerbo/qemu-ios/include/hw/arm/ipod_touch_2g.h:6,
                 from ../hw/arm/ipod_touch_2g.c:13:
C:/Users/Jerbo/qemu-ios/include/hw/intc/pl192.h:78:38: note: expected 'char *' but argument is of type 'const char *'
   78 | DeviceState *pl192_manual_init(char *mem_name, ...);
      |                                ~~~~~~^~~~~~~~
../hw/arm/ipod_touch_2g.c:270:29: warning: passing argument 1 of 'pl192_manual_init' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  270 |     dev = pl192_manual_init("vic1", NULL);
      |                             ^~~~~~
C:/Users/Jerbo/qemu-ios/include/hw/intc/pl192.h:78:38: note: expected 'char *' but argument is of type 'const char *'
   78 | DeviceState *pl192_manual_init(char *mem_name, ...);
      |                                ~~~~~~^~~~~~~~
../hw/arm/ipod_touch_2g.c:463:15: warning: unused variable 'cd327mikey' [-Wunused-variable]
  463 |     I2CSlave *cd327mikey = i2c_slave_create_simple(i2c_state->bus, "cd3272mikey", 0x39);
      |               ^~~~~~~~~~
../hw/arm/ipod_touch_2g.c:460:15: warning: unused variable 'isl29003dl' [-Wunused-variable]
  460 |     I2CSlave *isl29003dl = i2c_slave_create_simple(i2c_state->bus, "isl29003dl", 0x44);
      |               ^~~~~~~~~~
../hw/arm/ipod_touch_2g.c:444:15: warning: unused variable 'accelerometer' [-Wunused-variable]
  444 |     I2CSlave *accelerometer = i2c_slave_create_simple(i2c_state->bus, "lis302dl", 0x1D);
      |               ^~~~~~~~~~~~~
../hw/arm/ipod_touch_2g.c:441:16: warning: unused variable 'pmu' [-Wunused-variable]
  441 |     I2CSlave * pmu = i2c_slave_create_simple(i2c_state->bus, "pcf50633", 0x73);
      |                ^~~
ninja: build stopped: subcommand failed.
make: *** [Makefile:162: run-ninja] Error 1

@devos50 devos50 reopened this Dec 23, 2024
@devos50
Copy link
Owner Author

devos50 commented Dec 23, 2024

@JerboaTheSandWing thanks for letting me know. Looks like the compiler is being a bit strict here, but there are indeed some conversion errors that can be fixed.

In the meantime, you could try to pass -Wno-incompatible-pointer-types to the compilation process?

@JerboaTheSandWing
Copy link

I tried adding that to the ..Configure command, but I still get the same error when building.

@devos50
Copy link
Owner Author

devos50 commented Dec 24, 2024

@JerboaTheSandWing could you check if my latest commit (7022646) fixes this?

@JerboaTheSandWing
Copy link

I cloned it again and tried to compile it both with and without -Wno-incompatible-pointer-types and I got a different error this time:

../hw/arm/ipod_touch_2g.c: In function 'ipod_touch_key_event':
../hw/arm/ipod_touch_2g.c:186:10: warning: unused variable 'do_irq' [-Wunused-variable]
  186 |     bool do_irq = false;
      |          ^~~~~~
../hw/arm/ipod_touch_2g.c: In function 'ipod_touch_machine_init':
../hw/arm/ipod_touch_2g.c:263:42: warning: passing argument 1 of 'pl192_manual_init' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  263 |     DeviceState *dev = pl192_manual_init("vic0", qdev_get_gpio_in(DEVICE(nms->cpu), ARM_CPU_IRQ), qdev_get_gpio_in(DEVICE(nms->cpu), ARM_CPU_FIQ), NULL);
      |                                          ^~~~~~
In file included from C:/Users/Jerbo/qemu-ios/include/hw/arm/ipod_touch_2g.h:6,
                 from ../hw/arm/ipod_touch_2g.c:13:
C:/Users/Jerbo/qemu-ios/include/hw/intc/pl192.h:78:38: note: expected 'char *' but argument is of type 'const char *'
   78 | DeviceState *pl192_manual_init(char *mem_name, ...);
      |                                ~~~~~~^~~~~~~~
../hw/arm/ipod_touch_2g.c:270:29: warning: passing argument 1 of 'pl192_manual_init' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  270 |     dev = pl192_manual_init("vic1", NULL);
      |                             ^~~~~~
C:/Users/Jerbo/qemu-ios/include/hw/intc/pl192.h:78:38: note: expected 'char *' but argument is of type 'const char *'
   78 | DeviceState *pl192_manual_init(char *mem_name, ...);
      |                                ~~~~~~^~~~~~~~
../hw/arm/ipod_touch_2g.c:463:15: warning: unused variable 'cd327mikey' [-Wunused-variable]
  463 |     I2CSlave *cd327mikey = i2c_slave_create_simple(i2c_state->bus, "cd3272mikey", 0x39);
      |               ^~~~~~~~~~
../hw/arm/ipod_touch_2g.c:460:15: warning: unused variable 'isl29003dl' [-Wunused-variable]
  460 |     I2CSlave *isl29003dl = i2c_slave_create_simple(i2c_state->bus, "isl29003dl", 0x44);
      |               ^~~~~~~~~~
../hw/arm/ipod_touch_2g.c:444:15: warning: unused variable 'accelerometer' [-Wunused-variable]
  444 |     I2CSlave *accelerometer = i2c_slave_create_simple(i2c_state->bus, "lis302dl", 0x1D);
      |               ^~~~~~~~~~~~~
../hw/arm/ipod_touch_2g.c:441:16: warning: unused variable 'pmu' [-Wunused-variable]
  441 |     I2CSlave * pmu = i2c_slave_create_simple(i2c_state->bus, "pcf50633", 0x73);
      |                ^~~
../hw/arm/ipod_touch_2g.c:309:79: warning: iteration 5 invokes undefined behavior [-Waggressive-loop-optimizations]
  309 |         sysbus_connect_irq(busdev, grp, s5l8900_get_irq(nms, S5L8900_GPIO_IRQS[grp]));
      |                                                              ~~~~~~~~~~~~~~~~~^~~~~
../hw/arm/ipod_touch_2g.c:308:26: note: within this loop
  308 |     for(int grp = 0; grp < GPIO_NUMINTGROUPS; grp++) {
[1799/2301] Compiling C object libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_clock.c.obj
../hw/arm/ipod_touch_clock.c: In function 's5l8900_clock_write':
../hw/arm/ipod_touch_clock.c:52:68: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'hwaddr' {aka 'long long unsigned int'} [-Wformat=]
   52 |             hw_error("%s: Forbidden write to PLLLOCK register 0x%08x\n", __func__, addr);
      |                                                                 ~~~^               ~~~~
      |                                                                    |               |
      |                                                                    unsigned int    hwaddr {aka long long unsigned int}
      |                                                                 %08llx
../hw/arm/ipod_touch_clock.c:73:46: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=]
   73 |             hw_error("%s: writing value 0x%08x to unknown clock register 0x%08x\n", __func__, val, addr);
      |                                           ~~~^                                                ~~~
      |                                              |                                                |
      |                                              unsigned int                                     uint64_t {aka long long unsigned int}
      |                                           %08llx
../hw/arm/ipod_touch_clock.c:73:79: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'hwaddr' {aka 'long long unsigned int'} [-Wformat=]
   73 |             hw_error("%s: writing value 0x%08x to unknown clock register 0x%08x\n", __func__, val, addr);
      |                                                                            ~~~^                    ~~~~
      |                                                                               |                    |
      |                                                                               unsigned int         hwaddr {aka long long unsigned int}
      |                                                                            %08llx
../hw/arm/ipod_touch_clock.c: In function 's5l8900_clock_read':
../hw/arm/ipod_touch_clock.c:118:68: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'hwaddr' {aka 'long long unsigned int'} [-Wformat=]
  118 |             hw_error("%s: reading from unknown clock register 0x%08x\n", __func__, addr);
      |                                                                 ~~~^               ~~~~
      |                                                                    |               |
      |                                                                    unsigned int    hwaddr {aka long long unsigned int}
      |                                                                 %08llx
[1800/2301] Compiling C object libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_chipid.c.obj
../hw/arm/ipod_touch_chipid.c: In function 'ipod_touch_chipid_read':
../hw/arm/ipod_touch_chipid.c:17:70: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'hwaddr' {aka 'long long unsigned int'} [-Wformat=]
   17 |             hw_error("%s: reading from unknown chip ID register 0x%08x\n", __func__, addr);
      |                                                                   ~~~^               ~~~~
      |                                                                      |               |
      |                                                                      unsigned int    hwaddr {aka long long unsigned int}
      |                                                                   %08llx
[1801/2301] Compiling C object libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_gpio.c.obj
../hw/arm/ipod_touch_gpio.c: In function 's5l8900_gpio_write':
../hw/arm/ipod_touch_gpio.c:6:25: warning: unused variable 's' [-Wunused-variable]
    6 |     IPodTouchGPIOState *s = (struct IPodTouchGPIOState *) opaque;
      |                         ^
../hw/arm/ipod_touch_gpio.c: In function 's5l8900_gpio_read':
../hw/arm/ipod_touch_gpio.c:16:41: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'hwaddr' {aka 'long long unsigned int'} [-Wformat=]
   16 |     printf("%s: read from location 0x%08x\n", __func__, addr);
      |                                      ~~~^               ~~~~
      |                                         |               |
      |                                         unsigned int    hwaddr {aka long long unsigned int}
      |                                      %08llx
[1802/2301] Compiling C object libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_sysic.c.obj
[1803/2301] Compiling C object libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_timer.c.obj
[1804/2301] Compiling C object libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_usb_otg.c.obj
../hw/arm/ipod_touch_usb_otg.c: In function 'synopsys_usb_update_in_ep':
../hw/arm/ipod_touch_usb_otg.c:98:17: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
   98 |                 ;//printf("USB: IN transfer queued on %d.\n", _ep);
      |                 ^
../hw/arm/ipod_touch_usb_otg.c: In function 'synopsys_usb_update_out_ep':
../hw/arm/ipod_touch_usb_otg.c:107:17: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
  107 |                 ;//printf("USB: OUT transfer queued on %d.\n", _ep);
      |                 ^
../hw/arm/ipod_touch_usb_otg.c: In function 'synopsys_usb_read':
../hw/arm/ipod_touch_usb_otg.c:272:60: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'hwaddr' {aka 'long long unsigned int'} [-Wformat=]
  272 |                 hw_error("USB: Unhandled read address 0x%08x!\n", _addr);
      |                                                         ~~~^      ~~~~~
      |                                                            |      |
      |                                                            |      hwaddr {aka long long unsigned int}
      |                                                            unsigned int
      |                                                         %08llx
../hw/arm/ipod_touch_usb_otg.c: In function 'synopsys_usb_write':
../hw/arm/ipod_touch_usb_otg.c:499:61: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'hwaddr' {aka 'long long unsigned int'} [-Wformat=]
  499 |                 hw_error("USB: Unhandled write address 0x%08x!\n", _addr);
      |                                                          ~~~^      ~~~~~
      |                                                             |      |
      |                                                             |      hwaddr {aka long long unsigned int}
      |                                                             unsigned int
      |                                                          %08llx
../hw/arm/ipod_touch_usb_otg.c: In function 's5l8900_usb_otg_init1':
../hw/arm/ipod_touch_usb_otg.c:571:22: warning: unused variable 'dev' [-Wunused-variable]
  571 |         DeviceState *dev = DEVICE(obj);
      |                      ^~~
[1805/2301] Compiling C object libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_usb_phys.c.obj
../hw/arm/ipod_touch_usb_phys.c: In function 'ipod_touch_usb_phys_read':
../hw/arm/ipod_touch_usb_phys.c:21:48: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'hwaddr' {aka 'long long unsigned int'} [-Wformat=]
   21 |         printf("%s: read invalid location 0x%08x\n", __func__, addr);
      |                                             ~~~^               ~~~~
      |                                                |               |
      |                                                unsigned int    hwaddr {aka long long unsigned int}
      |                                             %08llx
../hw/arm/ipod_touch_usb_phys.c: In function 'ipod_touch_usb_phys_write':
../hw/arm/ipod_touch_usb_phys.c:49:49: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'hwaddr' {aka 'long long unsigned int'} [-Wformat=]
   49 |         printf("%s: write invalid location 0x%08x.\n", __func__, addr);
      |                                              ~~~^                ~~~~
      |                                                 |                |
      |                                                 unsigned int     hwaddr {aka long long unsigned int}
      |                                              %08llx
[1806/2301] Compiling C object libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_spi.c.obj
../hw/arm/ipod_touch_spi.c: In function 'ipod_touch_spi_realize':
../hw/arm/ipod_touch_spi.c:292:26: warning: declaration of 'dev' shadows a parameter [-Wshadow=compatible-local]
  292 |             DeviceState *dev = ssi_create_peripheral(s->spi, TYPE_IPOD_TOUCH_NOR_SPI);
      |                          ^~~
../hw/arm/ipod_touch_spi.c:267:49: note: shadowed declaration is here
  267 | static void ipod_touch_spi_realize(DeviceState *dev, struct Error **errp)
      |                                    ~~~~~~~~~~~~~^~~
../hw/arm/ipod_touch_spi.c:301:26: warning: declaration of 'dev' shadows a parameter [-Wshadow=compatible-local]
  301 |             DeviceState *dev = ssi_create_peripheral(s->spi, TYPE_IPOD_TOUCH_MULTITOUCH);
      |                          ^~~
../hw/arm/ipod_touch_spi.c:267:49: note: shadowed declaration is here
  267 | static void ipod_touch_spi_realize(DeviceState *dev, struct Error **errp)
      |                                    ~~~~~~~~~~~~~^~~
[1807/2301] Compiling C object libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_nor_spi.c.obj
FAILED: libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_nor_spi.c.obj
"cc" "-m64" "-mcx16" "-Ilibqemu-arm-softmmu.fa.p" "-I." "-I.." "-Itarget/arm" "-I../target/arm" "-Isubprojects/dtc/libfdt" "-I../subprojects/dtc/libfdt" "-Iqapi" "-Itrace" "-Iui" "-Iui/shader" "-IC:/msys64/mingw64/include/pixman-1" "-I/mingw64/include/openssl" "-IC:/msys64/mingw64/include/glib-2.0" "-IC:/msys64/mingw64/lib/glib-2.0/include" "-fdiagnostics-color=auto" "-Wall" "-Winvalid-pch" "-std=gnu11" "-O2" "-g" "-Wundef" "-Wwrite-strings" "-Wmissing-prototypes" "-Wstrict-prototypes" "-Wredundant-decls" "-Wold-style-declaration" "-Wold-style-definition" "-Wtype-limits" "-Wformat-security" "-Wformat-y2k" "-Winit-self" "-Wignored-qualifiers" "-Wempty-body" "-Wnested-externs" "-Wendif-labels" "-Wexpansion-to-defined" "-Wimplicit-fallthrough=2" "-Wmissing-format-attribute" "-Wno-missing-include-dirs" "-Wno-shift-negative-value" "-Wno-psabi" "-Wshadow=local" "-iquote" "." "-iquote" "C:/Users/Jerbo/qemu-ios" "-iquote" "C:/Users/Jerbo/qemu-ios/include" "-iquote" "C:/Users/Jerbo/qemu-ios/host/include/x86_64" "-iquote" "C:/Users/Jerbo/qemu-ios/host/include/generic" "-iquote" "C:/Users/Jerbo/qemu-ios/tcg/i386" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE" "-fno-strict-aliasing" "-fno-common" "-fwrapv" "-fno-pie" "-no-pie" "-DNEED_CPU_H" "-DCONFIG_TARGET=\"arm-softmmu-config-target.h\"" "-DCONFIG_DEVICES=\"arm-softmmu-config-devices.h\"" -MD -MQ libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_nor_spi.c.obj -MF "libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_nor_spi.c.obj.d" -o libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_nor_spi.c.obj "-c" ../hw/arm/ipod_touch_nor_spi.c
../hw/arm/ipod_touch_nor_spi.c: In function 'initialize_nor':
../hw/arm/ipod_touch_nor_spi.c:6:65: error: passing argument 3 of 'g_file_get_contents' from incompatible pointer type [-Wincompatible-pointer-types]
    6 |     if (g_file_get_contents(s->nor_path, (char **)&s->nor_data, &fsize, NULL)) {
      |                                                                 ^~~~~~
      |                                                                 |
      |                                                                 long unsigned int *
In file included from C:/msys64/mingw64/include/glib-2.0/glib.h:50,
                 from C:/Users/Jerbo/qemu-ios/include/glib-compat.h:32,
                 from C:/Users/Jerbo/qemu-ios/include/qemu/osdep.h:161,
                 from C:/Users/Jerbo/qemu-ios/include/hw/arm/ipod_touch_nor_spi.h:4,
                 from ../hw/arm/ipod_touch_nor_spi.c:1:
C:/msys64/mingw64/include/glib-2.0/glib/gfileutils.h:122:45: note: expected 'gsize *' {aka 'long long unsigned int *'} but argument is of type 'long unsigned int *'
  122 |                               gsize        *length,
      |                               ~~~~~~~~~~~~~~^~~~~~
../hw/arm/ipod_touch_nor_spi.c: In function 'ipod_touch_nor_spi_transfer':
../hw/arm/ipod_touch_nor_spi.c:94:21: warning: declaration of 'ret_val' shadows a previous local [-Wshadow=compatible-local]
   94 |             uint8_t ret_val = s->nor_data[s->nor_read_ind];
      |                     ^~~~~~~
../hw/arm/ipod_touch_nor_spi.c:91:17: note: shadowed declaration is here
   91 |         uint8_t ret_val;
      |                 ^~~~~~~
ninja: build stopped: subcommand failed.
make: *** [Makefile:162: run-ninja] Error 1

@devos50
Copy link
Owner Author

devos50 commented Dec 25, 2024

Ah, there seems to be another occurrence of g_file_get_contents, I fixed this in 1c586e8. Does it work now?

@JerboaTheSandWing
Copy link

JerboaTheSandWing commented Dec 25, 2024

@devos50 It compiled successfully this time, but the arm-softmmu folder is empty.
image

@devos50
Copy link
Owner Author

devos50 commented Dec 26, 2024

Hmm that's weird. They didn't end up in a different directory somehow?

@JerboaTheSandWing
Copy link

JerboaTheSandWing commented Dec 26, 2024

It looks like qemu-system-arm doesn't exist.
image

Edit: Never mind—I found it in the main build directory; that was a skill issue on my part.

@JerboaTheSandWing
Copy link

Thank you for all your help; it works now.

@devos50
Copy link
Owner Author

devos50 commented Dec 27, 2024

No problem, have fun with the emulator!

@devos50 devos50 closed this as completed Dec 27, 2024
@devos50 devos50 reopened this Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants