Skip to content

Commit

Permalink
libgcc, aarch64, Darwin: Initial libgcc boiler-plate changes.
Browse files Browse the repository at this point in the history
Initial changes to build libgcc for aarch64 Darwin (declare the port,
handle Mach-O assembler syntax and arrange for building the main extra
pieces).
  • Loading branch information
iains committed Feb 26, 2022
1 parent 47c2f5d commit 61b51cf
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libgcc/config.host
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ m32c*-*-*)
cpu_type=m32c
tmake_file=t-fdpbit
;;
aarch64*-*-*)
aarch64*-*-* | arm64*-*-*)
cpu_type=aarch64
;;
alpha*-*-*)
Expand Down Expand Up @@ -407,6 +407,14 @@ aarch64*-*-elf | aarch64*-*-rtems*)
tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
md_unwind_header=aarch64/aarch64-unwind.h
;;
aarch64*-*darwin* | arm64*-*darwin* )
extra_parts="$extra_parts crtfastmath.o"
tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
tmake_file="${tmake_file} ${cpu_type}/t-lse "
tmake_file="${tmake_file} t-crtfm"
# No soft float for now because our long double is DF not TF.
md_unwind_header=aarch64/aarch64-unwind.h
;;
aarch64*-*-freebsd*)
extra_parts="$extra_parts crtfastmath.o"
tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
Expand Down
28 changes: 28 additions & 0 deletions libgcc/config/aarch64/lse.S
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#endif

/* Declare the symbol gating the LSE implementations. */
#if __ELF__
.hidden __aarch64_have_lse_atomics
#else
.private_extern __aarch64_have_lse_atomics
#endif

/* Turn size and memory model defines into mnemonic fragments. */
#if SIZE == 1
Expand Down Expand Up @@ -139,6 +143,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define BTI_C hint 34

/* Start and end a function. */
#if __ELF__
.macro STARTFN name
.text
.balign 16
Expand All @@ -162,6 +167,29 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
cbz w(tmp0), \label
.endm

#else
.macro STARTFN name
.text
.balign 16
.private_extern _\name
.cfi_startproc
_\name:
BTI_C
.endm

.macro ENDFN name
.cfi_endproc
.endm

/* Branch to LABEL if LSE is disabled. */
.macro JUMP_IF_NOT_LSE label
adrp x(tmp0), ___aarch64_have_lse_atomics@PAGE
ldrb w(tmp0), [x(tmp0), ___aarch64_have_lse_atomics@PAGEOFF]
cbz w(tmp0), \label
.endm

#endif

#ifdef L_cas

STARTFN NAME(cas)
Expand Down
7 changes: 7 additions & 0 deletions libgcc/config/aarch64/t-darwin
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# FIXME: decide what we need here, or delete this file.

HOST_LIBGCC2_CFLAGS += -mmacosx-version-min=11.0

LIB2_SIDITI_CONV_FUNCS = yes

BUILD_LIBGCCS1 =

0 comments on commit 61b51cf

Please sign in to comment.