Skip to content

Commit bfd7024

Browse files
authored
[LibC] Refactor arm64 to aarch64 for darwin. (#141509)
Fixes [#141505](#141505) The main intention behind this PR is to update the LibCTargetArchitecture for arm64 to use the implementation of aarch64 architecture and not arm32. This is a historical issue , and is a blocker to issue #138407. The intended fix is to set the `LibCTargetArchitecture` to aarch64 when it matches arm64 , this in turn would help us run darwin/aarch64 specific code on our MacOs pipeline in the git actions. Methods used to search and find "darwin/arm" directories was 1. "find . -type d -path "*/libc/*/darwin/arm" in a linux terminal to check for arm specifically 2. "find . -type d -path "*/libc/*/darwin/*" to ensure there are no directories that are named "*arm*" where star is a wildcard for any character.
1 parent fbbae9e commit bfd7024

File tree

6 files changed

+3
-5
lines changed

6 files changed

+3
-5
lines changed

libc/cmake/modules/LLVMLibCArchitectures.cmake

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,10 @@ function(get_arch_and_system_from_triple triple arch_var sys_var)
3333
# value.
3434
if(target_arch MATCHES "^mips")
3535
set(target_arch "mips")
36+
elseif(target_arch MATCHES "^aarch64|^arm64")
37+
set(target_arch "aarch64")
3638
elseif(target_arch MATCHES "^arm")
37-
# TODO(lntue): Shall we separate `arm64`? It is currently recognized as
38-
# `arm` here.
3939
set(target_arch "arm")
40-
elseif(target_arch MATCHES "^aarch64")
41-
set(target_arch "aarch64")
4240
elseif(target_arch MATCHES "(x86_64)|(AMD64|amd64)")
4341
set(target_arch "x86_64")
4442
elseif(target_arch MATCHES "(^i.86$)")

libc/src/__support/OSUtil/darwin/syscall.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "src/__support/macros/properties/architectures.h"
1616

1717
#ifdef LIBC_TARGET_ARCH_IS_ANY_ARM
18-
#include "arm/syscall.h"
18+
#include "aarch64/syscall.h"
1919
#else
2020
#error "Unsupported architecture"
2121
#endif

0 commit comments

Comments
 (0)