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

fix build on macOS ARM #71

Merged
merged 1 commit into from
Mar 11, 2022
Merged

fix build on macOS ARM #71

merged 1 commit into from
Mar 11, 2022

Conversation

cho-m
Copy link
Contributor

@cho-m cho-m commented Mar 11, 2022

During update of libpgm Homebrew package Homebrew/homebrew-core#95457, the following macOS M1/ARM build failures were seen during make:

cpu.c:44:7: error: invalid output constraint '=a' in asm
    : "=a"(cpu_info[0]), "=D"(cpu_info[1]), "=c"(cpu_info[2]), "=d"(cpu_info[3])
      ^
cpu.c:56:16: error: invalid output constraint '=a' in asm
    "xgetbv" : "=a"(eax), "=d"(edx) : "c"(xcr));
               ^
5 warnings and 2 errors generated.
make: *** [libpgm_noinst_la-cpu.lo] Error 1

The simple fix here is to avoid the incompatible assembly code inside __cpuidex & _xgetbv since they are only used within a i386/x86_64-conditional section from 9730e05

@cho-m cho-m mentioned this pull request Mar 11, 2022
6 tasks
@steve-o steve-o merged commit 8d507fc into steve-o:master Mar 11, 2022
@steve-o
Copy link
Owner

steve-o commented Mar 11, 2022

nice, thx

@cho-m cho-m deleted the fix-macos-arm branch March 11, 2022 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants