在MACOS上建立ASM的ASM错误
我曾经在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 )。
有一个几乎相同的来源和LIB的Emscripten构建正常,所以我想我缺少CMAKE配置中的某些内容,以使其在MacOS上工作。
我想目标体系结构与Pixman Lib不兼容(以及汇编尚未达到的其他lib)。但是我找不到解决方法。
我使用自制的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)
I used to build a project on windows and now that I am trying to build it on macos (M1) I get errors on a dependency (nested in a dependency):
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)
^
I also get warnings all around:
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))
^
The project is configured with CMake with very few parameters, most of the configuration is made in the CMake of the dependency (Orthanc Stone).
There is an emscripten build of almost the same sources and libs that is working fine so I guess I'm missing something in the CMake configuration to make it work on macos.
I suppose the target architecture is not compatible with the pixman lib (and probably others that the compilation has not reached yet). But I did not find how to fix it.
I installed gcc using homebrew
$ 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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是 this orthanc?他们如何用CMAKE构建Pixman? Pixman在汇编程序中有许多特殊案例。在构建时间,AutoConf检测到启用的正确启用。由于您正在写Cmake,因此我敢打赌某人侧向踩踏所有自动检测,只是硬编码了要构建的内容。并硬编码X86构建。
如果这个猜测是正确的,那么这是该cmake文件的错误,除了Orthanc Devs可以做到这一点,别无选择。
您要确切地构建Orthanc的哪一部分?如何?我找不到它对开罗的使用...
Is it this Orthanc? How exactly are they building pixman with CMake? Pixman has lots of special cases implemented in Assembler. At build time, autoconf detects the right one to enable. Since you are writing that you are using CMake, I bet someone side-stepped all that auto-detection and just hardcoded what to build. And hardcoded the x86 build.
If this guess is right, then that is a bug in that CMake file and there is nothing anyone but orthanc devs can do about that.
Which part of orthanc are you trying to build exactly and how? I fail to find its use of cairo...