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

M1 shader-tools #1577

Closed
Tracked by #1299
DanAlbert opened this issue Sep 2, 2021 · 3 comments
Closed
Tracked by #1299

M1 shader-tools #1577

DanAlbert opened this issue Sep 2, 2021 · 3 comments

Comments

@DanAlbert
Copy link
Member

Subtask of #1299.

@dneto0 FYI, but I don't think any work is actually needed from your side. Pretty sure it's just a matter of getting the build servers in order and adding some flags.

@DanAlbert DanAlbert added this to Triaged in r24 via automation Sep 2, 2021
@rprichard
Copy link
Collaborator

This NDK checkbuild.py patch appears sufficient to turn the shader-tools binaries into universal arm64+x86_64 binaries:

diff --git a/ndk/cmake.py b/ndk/cmake.py
index 7290de9f..ddcbc26d 100644
--- a/ndk/cmake.py
+++ b/ndk/cmake.py
@@ -35,7 +35,7 @@ SYSTEM_NAME_MAP = {
 }
 
 HOST_TRIPLE_MAP = {
-    Host.Darwin: 'x86_64-apple-darwin',
+    Host.Darwin: 'apple-darwin',
     Host.Linux: 'x86_64-linux-gnu',
     Host.Windows64: 'x86_64-w64-mingw32',
 }
@@ -179,6 +179,8 @@ class CMakeBuilder:
         }
         if self.host.is_windows:
             defines['CMAKE_RC'] = str(self.toolchain.rescomp)
+        if self.host == Host.Darwin:
+            defines['CMAKE_OSX_ARCHITECTURES'] = 'x86_64;arm64'
         return defines
 
     def clean(self) -> None:

I wasn't sure what to do with the triple, so I tried just cutting x86_64 off of it. Maybe we should omit the CMAKE_C_COMPILER_TARGET and CMAKE_CXX_COMPILER_TARGET defines instead.

I'm running on macOS 11.5.2 with Xcode 12.5.1, though. I think the aosp-master-ndk buildbot is too old. The aosp-llvm-toolchain buildbot is new enough, though?

@DanAlbert DanAlbert moved this from Triaged to Merged in r24 Dec 15, 2021
@DanAlbert DanAlbert added this to Triaged in r23c via automation Dec 15, 2021
@DanAlbert DanAlbert moved this from Triaged to Needs cherry-pick in r23c Dec 15, 2021
@DanAlbert
Copy link
Member Author

Should be fixed in r23 build 8486889.

r23c automation moved this from Needs cherry-pick to Merged Apr 22, 2022
MaoHan001 pushed a commit to riscv-android-src/platform-ndk that referenced this issue Jun 22, 2022
Test: checkbuild.py on macOS Big Sur with Xcode 12.5.1
Bug: android/ndk#1546
Bug: android/ndk#1577
Change-Id: I09e477c50c8e3eb927dc3a713278d290c5c213e5
(cherry picked from commit f9cbfd2)
Merged-In: I09e477c50c8e3eb927dc3a713278d290c5c213e5
MaoHan001 pushed a commit to riscv-android-src/platform-ndk that referenced this issue Jun 22, 2022
Bug: android/ndk#1546
Bug: android/ndk#1577
Test: None
Change-Id: Ib42b3644966ff691f45595d9e2bbe456b4a91c22
(cherry picked from commit 0d991cbe04d8afede6649dfa1584cba40b775664)
Merged-In: Ib42b3644966ff691f45595d9e2bbe456b4a91c22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants