devos50/qemu-ios

compiling error

Closed this issue · 8 comments

usually happens with the make command

I may have to compile in a VM

I have the exact same issue. M1 Pro, 14 inch MBP, macOS 14.5.

same issue

same issue:

[1830/2822] Compiling C object libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_sha1.c.o
FAILED: libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_sha1.c.o 
cc -Ilibqemu-arm-softmmu.fa.p -I. -I.. -Itarget/arm -I../target/arm -Isubprojects/dtc/libfdt -I../subprojects/dtc/libfdt -Iqapi -Itrace -Iui -Iui/shader -I/opt/homebrew/Cellar/pixman/0.42.2/include/pixman-1 -I/opt/homebrew/opt/openssl@3/include -I/opt/homebrew/Cellar/glib/2.80.4/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.80.4/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.44/include -I/opt/homebrew/Cellar/glib/2.80.4/include -fcolor-diagnostics -Wall -Winvalid-pch -std=gnu11 -O2 -g -fstack-protector-strong -Wundef -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wmissing-format-attribute -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 -iquote . -iquote /Users/patyk/qemu-ios -iquote /Users/patyk/qemu-ios/include -iquote /Users/patyk/qemu-ios/host/include/aarch64 -iquote /Users/patyk/qemu-ios/host/include/generic -iquote /Users/patyk/qemu-ios/tcg/aarch64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -fno-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_sha1.c.o -MF libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_sha1.c.o.d -o libqemu-arm-softmmu.fa.p/hw_arm_ipod_touch_sha1.c.o -c ../hw/arm/ipod_touch_sha1.c
../hw/arm/ipod_touch_sha1.c:55:49: error: incompatible integer to pointer conversion passing 'uint64_t' (aka 'unsigned long long') to parameter of type 'void *' [-Wint-conversion]
   55 |                 uint64_t data_length = swapLong(((uint64_t *)s->buffer)[s->buffer_ind / 8 - 1]) / 8;
      |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../hw/arm/ipod_touch_sha1.c:3:32: note: passing argument to parameter 'X' here
    3 | static uint64_t swapLong(void *X) {
      |                                ^
../hw/arm/ipod_touch_sha1.c:58:17: warning: 'SHA1_Init' is deprecated [-Wdeprecated-declarations]
   58 |                 SHA1_Init(&ctx);
      |                 ^
/opt/homebrew/opt/openssl@3/include/openssl/sha.h:49:1: note: 'SHA1_Init' has been explicitly marked deprecated here
   49 | OSSL_DEPRECATEDIN_3_0 int SHA1_Init(SHA_CTX *c);
      | ^
/opt/homebrew/opt/openssl@3/include/openssl/macros.h:194:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
  194 | #   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
      |                                                 ^
/opt/homebrew/opt/openssl@3/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
   62 | #     define OSSL_DEPRECATED(since) __attribute__((deprecated))
      |                                                    ^
../hw/arm/ipod_touch_sha1.c:59:17: warning: 'SHA1_Update' is deprecated [-Wdeprecated-declarations]
   59 |                 SHA1_Update(&ctx, s->buffer, data_length);
      |                 ^
/opt/homebrew/opt/openssl@3/include/openssl/sha.h:50:1: note: 'SHA1_Update' has been explicitly marked deprecated here
   50 | OSSL_DEPRECATEDIN_3_0 int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
      | ^
/opt/homebrew/opt/openssl@3/include/openssl/macros.h:194:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
  194 | #   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
      |                                                 ^
/opt/homebrew/opt/openssl@3/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
   62 | #     define OSSL_DEPRECATED(since) __attribute__((deprecated))
      |                                                    ^
../hw/arm/ipod_touch_sha1.c:60:17: warning: 'SHA1_Final' is deprecated [-Wdeprecated-declarations]
   60 |                 SHA1_Final(s->hashout, &ctx);
      |                 ^
/opt/homebrew/opt/openssl@3/include/openssl/sha.h:51:1: note: 'SHA1_Final' has been explicitly marked deprecated here
   51 | OSSL_DEPRECATEDIN_3_0 int SHA1_Final(unsigned char *md, SHA_CTX *c);
      | ^
/opt/homebrew/opt/openssl@3/include/openssl/macros.h:194:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
  194 | #   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
      |                                                 ^
/opt/homebrew/opt/openssl@3/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
   62 | #     define OSSL_DEPRECATED(since) __attribute__((deprecated))
      |                                                    ^
3 warnings and 1 error generated.
ninja: build stopped: subcommand failed.
make: *** [run-ninja] Error 1

M2, 15inch MBA, macOS 15.1b1

Probably the type of the swapLong argument should be fixed. Could anyone try to change it to something like the following (I'm unable to try this out right now)?

static uint64_t swapLong(uint64_t x) {
    x = (x & 0x00000000FFFFFFFF) << 32 | (x & 0xFFFFFFFF00000000) >> 32;
    x = (x & 0x0000FFFF0000FFFF) << 16 | (x & 0xFFFF0000FFFF0000) >> 16;
    x = (x & 0x00FF00FF00FF00FF) << 8  | (x & 0xFF00FF00FF00FF00) >> 8;
    return x;
}
image

Spot on! I'll create a PR

Cool, thank you! 👍