Skip to content

Commit 874eb8b

Browse files
authoredMar 23, 2017
Fix: select generic ARM/AArch64 LibC (#4167)
Fixes the target triple used by Crystal to select the LibC bindings when the triple specifies a specific ARM architecture, e.g. `armv6`, `armv7l` or `armv8.1-a`. refs #3424 (comment)
1 parent 6697f17 commit 874eb8b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

Diff for: ‎src/compiler/crystal/crystal_path.cr

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ module Crystal
2020
triple = target_triple.split('-')
2121
triple.delete(triple[1]) if triple.size == 4 # skip vendor
2222

23-
if %w(i386 i486 i586).includes?(triple[0])
23+
case triple[0]
24+
when "i386", "i486", "i586"
2425
triple[0] = "i686"
26+
when .starts_with?("armv8")
27+
triple[0] = "aarch64"
28+
when .starts_with?("arm")
29+
triple[0] = "arm"
2530
end
2631

2732
target = if triple.any?(&.includes?("macosx")) || triple.any?(&.includes?("darwin"))

0 commit comments

Comments
 (0)