关于在 macos 上构建 gcc 的 asm 错误

问题描述 投票:0回答:1

我曾经在 Windows 上构建项目,现在我试图在 macOS (M1) 上构建它,我在依赖项(嵌套在依赖项中)上遇到错误:

pixman-0.34.0/pixman/pixman-x86.c:103:4: error: unknown register name '%eax' in asm
        : "%eax", "%ecx");
          ^
pixman-0.34.0/pixman/pixman-x86.c:136:4: error: invalid output constraint '=a' in asm
        : "=a" (*a), "=r" (*b), "=c" (*c), "=d" (*d)
          ^

我周围也收到警告:

pixman-0.34.0/pixman/pixman-x86.c:83:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
#if _PIXMAN_X86_64 || defined (_MSC_VER) || defined(__native_client__)
    ^
pixman-0.34.0/pixman/pixman-x86.c:78:6: note: expanded from macro '_PIXMAN_X86_64'
    (defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64))
     ^

项目使用CMake配置,参数很少,大部分配置在依赖的CMake中(Orthanc Stone)。
有一个几乎相同的源和库的 emscripten 构建工作正常所以我想我在 CMake 配置中遗漏了一些东西以使其在 macos 上工作。
我想目标架构与 pixman 库不兼容(可能还有编译尚未达到的其他架构)。但是我没有找到解决方法。

我使用自制软件安装了 gcc

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc-11
COLLECT_LTO_WRAPPER=/opt/homebrew/Cellar/gcc/11.3.0/bin/../libexec/gcc/aarch64-apple-darwin21/11/lto-wrapper
Target: aarch64-apple-darwin21
Configured with: ../configure --prefix=/opt/homebrew/opt/gcc --libdir=/opt/homebrew/opt/gcc/lib/gcc/11 --disable-nls --enable-checking=release --with-gcc-major-version-only --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-11 --with-gmp=/opt/homebrew/opt/gmp --with-mpfr=/opt/homebrew/opt/mpfr --with-mpc=/opt/homebrew/opt/libmpc --with-isl=/opt/homebrew/opt/isl --with-zstd=/opt/homebrew/opt/zstd --with-pkgversion='Homebrew GCC 11.3.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --build=aarch64-apple-darwin21 --with-system-zlib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (Homebrew GCC 11.3.0)
macos gcc cmake cairo pixman
1个回答
1
投票

项目使用CMake配置,参数很少,大部分配置在依赖项(Orthanc)的CMake中进行。

这个Orthanc吗?他们究竟是如何使用 CMake 构建 pixman 的? Pixman 在 Assembler 中实现了许多特殊情况。在构建时,autoconf 会检测到要启用的正确选项。由于您写的是您正在使用 CMake,我敢打赌有人回避了所有自动检测,只是硬编码要构建的内容。并对 x86 构建进行硬编码。

如果这个猜测是正确的,那么这就是 CMake 文件中的一个错误,除了 orthanc 开发人员之外,没有任何人可以解决这个问题。

你想准确地构建 orthanc 的哪一部分,如何构建?我找不到它对 cairo 的使用...

© www.soinside.com 2019 - 2024. All rights reserved.