Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Make Compiler-RT build for AArch64. #5

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/builtins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,13 @@ set(arm_SOURCES
arm/unordsf2vfp.S
${GENERIC_SOURCES})

set(aarch64_SOURCES
${GENERIC_SOURCES})

add_custom_target(builtins)

if (NOT WIN32)
foreach(arch x86_64 i386 arm)
foreach(arch x86_64 i386 arm aarch64)
if(CAN_TARGET_${arch})
add_compiler_rt_runtime(clang_rt.${arch} ${arch} STATIC
SOURCES ${${arch}_SOURCES}
Expand Down
2 changes: 1 addition & 1 deletion lib/builtins/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ModuleName := builtins
SubDirs :=

# Add arch specific optimized implementations.
SubDirs += i386 ppc x86_64 arm
SubDirs += i386 ppc x86_64 arm aarch64

# Define the variables for this specific directory.
Sources := $(foreach file,$(wildcard $(Dir)/*.c),$(notdir $(file)))
Expand Down
22 changes: 22 additions & 0 deletions lib/builtins/aarch64/Makefile.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#===- lib/builtins/aarch64/Makefile.mk ---------------------*- Makefile -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===------------------------------------------------------------------------===#

ModuleName := builtins
SubDirs :=
OnlyArchs := aarch64

AsmSources := $(foreach file,$(wildcard $(Dir)/*.S),$(notdir $(file)))
Sources := $(foreach file,$(wildcard $(Dir)/*.c),$(notdir $(file)))
ObjNames := $(Sources:%.c=%.o) $(AsmSources:%.S=%.o)
Implementation := Optimized

# FIXME: use automatic dependencies?
Dependencies := $(wildcard lib/*.h $(Dir)/*.h)

CFLAGS.builtins := $(CFLAGS) -std=c99
4 changes: 4 additions & 0 deletions lib/builtins/clear_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#include <asm/unistd.h>
#endif

#if defined(__aarch64__) && !defined(__APPLE__)
#include <stddef.h>
#endif

/*
* The compiler generates calls to __clear_cache() when creating
* trampoline functions on the stack for use with nested functions.
Expand Down