Skip to content

Commit

Permalink
toplevel:
Browse files Browse the repository at this point in the history
    * configure.ac: Don't add ${libgcj} for arm*-*-freebsd*.
    * configure: Regenerate.
gcc:
    * config.gcc (arm*-*-freebsd*): New configuration.
    * config/arm/freebsd.h: New file.
    * config.host: Add extra components for arm*-*-freebsd*.
    * config/arm/arm.h: Introduce MAX_SYNC_LIBFUNC_SIZE.
    * config/arm/arm.c (arm_init_libfuncs): Use MAX_SYNC_LIBFUNC_SIZE.

libgcc:

    * config.host (arm*-*-freebsd*): Add new configuration for
    arm*-*-freebsd*.
    * config/arm/freebsd-atomic.c: New file.
    * config/arm/t-freebsd: Likewise.
    * config/arm/unwind-arm.h: Add __FreeBSD__ to the list of
    'PC-relative indirect' OS's.

libatomic:

    * configure.tgt: Exclude arm*-*-freebsd* from try_ifunc.

libstdc++-v3:

    * configure.host: Add arm*-*-freebsd* port_specific_symbol_files.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219388 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
andreast committed Jan 9, 2015
1 parent 9fda427 commit 275d0a7
Show file tree
Hide file tree
Showing 20 changed files with 535 additions and 16 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2015-01-09 Andreas Tobler <[email protected]>

* configure.ac: Don't add ${libgcj} for arm*-*-freebsd*.
* configure: Regenerate.

2015-01-08 Thomas Schwinge <[email protected]>

* Makefile.def (dependencies) <all-target-liboffloadmic>: Depend on
Expand Down
3 changes: 3 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3433,6 +3433,9 @@ case "${target}" in
alpha*-*-*vms*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
arm*-*-freebsd*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
arm-wince-pe)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
Expand Down
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,9 @@ case "${target}" in
alpha*-*-*vms*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
arm*-*-freebsd*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
arm-wince-pe)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
Expand Down
8 changes: 8 additions & 0 deletions gcc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2015-01-09 Andreas Tobler <[email protected]>

* config.gcc (arm*-*-freebsd*): New configuration.
* config/arm/freebsd.h: New file.
* config.host: Add extra components for arm*-*-freebsd*.
* config/arm/arm.h: Introduce MAX_SYNC_LIBFUNC_SIZE.
* config/arm/arm.c (arm_init_libfuncs): Use MAX_SYNC_LIBFUNC_SIZE.

2015-01-09 Sebastian Huber <[email protected]>

* config/rs6000/rtems.h (CPP_OS_RTEMS_SPEC): Define __PPC_CPU_E6500__
Expand Down
22 changes: 21 additions & 1 deletion gcc/config.gcc
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ case ${target} in
arm*-wince-pe* \
| arm*-*-ecos-elf \
| arm*-*-elf \
| arm*-*-freebsd* \
| arm*-*-linux* \
| arm*-*-uclinux* \
| i[34567]86-go32-* \
Expand Down Expand Up @@ -1010,6 +1009,27 @@ arm-wrs-vxworks)
extra_options="${extra_options} arm/vxworks.opt"
tmake_file="${tmake_file} arm/t-arm arm/t-vxworks"
;;
arm*-*-freebsd*) # ARM FreeBSD EABI
tm_file="dbxelf.h elfos.h ${fbsd_tm_file} arm/elf.h"
case $target in
arm*b-*-freebsd*)
tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
;;
esac
tmake_file="${tmake_file} arm/t-arm arm/t-bpabi"
tm_file="${tm_file} arm/bpabi.h arm/freebsd.h arm/aout.h arm/arm.h"
case $target in
armv6*-*-freebsd*)
tm_defines="${tm_defines} TARGET_FREEBSD_ARMv6=1"
;;
esac
case $target in
arm*hf-*-freebsd*)
tm_defines="${tm_defines} TARGET_FREEBSD_ARM_HARD_FLOAT=1"
;;
esac
with_tls=${with_tls:-gnu}
;;
arm*-*-netbsdelf*)
tm_file="dbxelf.h elfos.h netbsd.h netbsd-elf.h arm/elf.h arm/aout.h ${tm_file} arm/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
Expand Down
2 changes: 1 addition & 1 deletion gcc/config.host
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ case ${host} in
esac

case ${host} in
arm*-*-linux*)
arm*-*-freebsd* | arm*-*-linux*)
case ${target} in
arm*-*-*)
host_extra_gcc_objs="driver-arm.o"
Expand Down
2 changes: 1 addition & 1 deletion gcc/config/arm/arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2160,7 +2160,7 @@ arm_init_libfuncs (void)
{
/* For Linux, we have access to kernel support for atomic operations. */
if (arm_abi == ARM_ABI_AAPCS_LINUX)
init_sync_libfuncs (2 * UNITS_PER_WORD);
init_sync_libfuncs (MAX_SYNC_LIBFUNC_SIZE);

/* There are no special library functions unless we are using the
ARM BPABI. */
Expand Down
5 changes: 5 additions & 0 deletions gcc/config/arm/arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,11 @@ extern int arm_arch_crc;
#define PCC_BITFIELD_TYPE_MATTERS TARGET_AAPCS_BASED
#endif

/* The maximum size of the sync library functions supported. */
#ifndef MAX_SYNC_LIBFUNC_SIZE
#define MAX_SYNC_LIBFUNC_SIZE (2 * UNITS_PER_WORD);
#endif


/* Standard register usage. */

Expand Down
180 changes: 180 additions & 0 deletions gcc/config/arm/freebsd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
/* Definitions of target machine for GNU compiler, FreeBSD/arm version.
Copyright (C) 2002-2015 Free Software Foundation, Inc.
Contributed by Wasabi Systems, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3, or (at your
option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */

#undef SUBTARGET_CPP_SPEC
#define SUBTARGET_CPP_SPEC FBSD_CPP_SPEC

#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
{ "subtarget_extra_asm_spec", SUBTARGET_EXTRA_ASM_SPEC }, \
{ "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \
{ "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }

#undef SUBTARGET_EXTRA_ASM_SPEC
#define SUBTARGET_EXTRA_ASM_SPEC \
"%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5} " TARGET_FIX_V4BX_SPEC " \
%{fpic|fpie:-k} %{fPIC|fPIE:-k}"

#undef SUBTARGET_ASM_FLOAT_SPEC
#ifdef TARGET_FREEBSD_ARM_HARD_FLOAT
/* Default to full vfp if we build for arm*hf. */
#define SUBTARGET_ASM_FLOAT_SPEC "%{!mfpu=*:-mfpu=vfp}"
#else
#define SUBTARGET_ASM_FLOAT_SPEC "%{!mfpu=*:-mfpu=softvfp}"
#endif

#undef LINK_SPEC
#define LINK_SPEC " \
%{p:%nconsider using `-pg' instead of `-p' with gprof (1) } \
%{v:-V} \
%{assert*} %{R*} %{rpath*} %{defsym*} \
%{shared:-Bshareable %{h*} %{soname*}} \
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \
%{static:-Bstatic}} \
%{!static:--hash-style=both --enable-new-dtags} \
%{symbolic:-Bsymbolic} \
-X %{mbig-endian:-EB} %{mlittle-endian:-EL}"

/* TARGET_BIG_ENDIAN_DEFAULT is set in
config.gcc for big endian configurations. */
#if TARGET_BIG_ENDIAN_DEFAULT
#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
#define TARGET_ENDIAN_OPTION "mbig-endian"
#define TARGET_LINKER_EMULATION "armelfb_fbsd"
#else
#define TARGET_ENDIAN_DEFAULT 0
#define TARGET_ENDIAN_OPTION "mlittle-endian"
#define TARGET_LINKER_EMULATION "armelf_fbsd"
#endif

#undef SUBTARGET_EXTRA_LINK_SPEC
#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"

#undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
FBSD_TARGET_OS_CPP_BUILTINS (); \
TARGET_BPABI_CPP_BUILTINS (); \
} \
while (false)

/* We default to a soft-float ABI so that binaries can run on all
target hardware. */
#undef TARGET_DEFAULT_FLOAT_ABI
#ifdef TARGET_FREEBSD_ARM_HARD_FLOAT
#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
#else
#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
#endif

#undef ARM_DEFAULT_ABI

/* AACPS_LINUX has access to kernel atomic ops while we don't.
But AACPS defaults to short_enums. */
#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX

#undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT)

/* We do not have any MULTILIB_OPTIONS specified, so there are no
MULTILIB_DEFAULTS. */
#undef MULTILIB_DEFAULTS

/* Use the AAPCS type for wchar_t, override the one from config/freebsd.h. */
#undef WCHAR_TYPE
#define WCHAR_TYPE "unsigned int"

#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE BITS_PER_WORD

#if defined (TARGET_FREEBSD_ARMv6)
#undef SUBTARGET_CPU_DEFAULT
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm1176jzs
#else
#undef SUBTARGET_CPU_DEFAULT
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9
#endif

#define SUBTARGET_OVERRIDE_OPTIONS \
do { \
if (unaligned_access) \
unaligned_access = 0; \
} while (0)

#undef MAX_SYNC_LIBFUNC_SIZE
#define MAX_SYNC_LIBFUNC_SIZE 4 /* UNITS_PER_WORD not defined yet. */

/* FreeBSD does its profiling differently to the Acorn compiler. We
don't need a word following the mcount call; and to skip it
requires either an assembly stub or use of fomit-frame-pointer when
compiling the profiling functions. Since we break Acorn CC
compatibility below a little more won't hurt. */

#undef ARM_FUNCTION_PROFILER
#define ARM_FUNCTION_PROFILER(STREAM,LABELNO) \
{ \
asm_fprintf (STREAM, "\tmov\t%Rip, %Rlr\n"); \
asm_fprintf (STREAM, "\tbl\t__mcount%s\n", \
(TARGET_ARM && NEED_PLT_RELOC) \
? "(PLT)" : ""); \
}

/* Clear the instruction cache from `BEG' to `END'. This makes a
call to the ARM_SYNC_ICACHE architecture specific syscall. */
#define CLEAR_INSN_CACHE(BEG, END) \
do \
{ \
extern int sysarch (int number, void *args); \
struct \
{ \
unsigned int addr; \
int len; \
} s; \
s.addr = (unsigned int) (BEG); \
s.len = (END) - (BEG); \
(void) sysarch (0, &s); \
} \
while (0)

/* This is how we tell the assembler that two symbols have the same value. */
#define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \
do \
{ \
assemble_name (FILE, NAME1); \
fputs (" = ", FILE); \
assemble_name (FILE, NAME2); \
fputc ('\n', FILE); \
} \
while (0)

/* Add .note.GNU-stack. */
#undef NEED_INDICATE_EXEC_STACK
#define NEED_INDICATE_EXEC_STACK 1

#define ARM_TARGET2_DWARF_FORMAT (DW_EH_PE_pcrel | DW_EH_PE_indirect)

8 changes: 8 additions & 0 deletions gcc/ginclude/unwind-arm-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ extern "C" {

struct _Unwind_Control_Block
{
#ifdef __FreeBSD__
unsigned exception_class __attribute__((__mode__(__DI__)));
#else
char exception_class[8];
#endif
void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *);
/* Unwinder cache, private fields for the unwinder's use */
struct
Expand Down Expand Up @@ -181,7 +185,11 @@ extern "C" {

/* Support functions for the PR. */
#define _Unwind_Exception _Unwind_Control_Block
#ifdef __FreeBSD__
typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__)));
#else
typedef char _Unwind_Exception_Class[8];
#endif

void * _Unwind_GetLanguageSpecificData (_Unwind_Context *);
_Unwind_Ptr _Unwind_GetRegionStart (_Unwind_Context *);
Expand Down
4 changes: 4 additions & 0 deletions libatomic/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2015-01-09 Andreas Tobler <[email protected]>

* configure.tgt: Exclude arm*-*-freebsd* from try_ifunc.

2015-01-05 Jakub Jelinek <[email protected]>

Update copyright years.
Expand Down
13 changes: 9 additions & 4 deletions libatomic/configure.tgt
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ case "${target_cpu}" in

arm*)
ARCH=arm
# ??? Detect when -march=armv7 is already enabled.
try_ifunc=yes
;;

case "${target}" in
arm*-*-freebsd*)
;;
*)
# ??? Detect when -march=armv7 is already enabled.
try_ifunc=yes
;;
esac
;;
sparc)
case " ${CC} ${CFLAGS} " in
*" -m64 "*)
Expand Down
9 changes: 9 additions & 0 deletions libgcc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2015-01-09 Andreas Tobler <[email protected]>

* config.host (arm*-*-freebsd*): Add new configuration for
arm*-*-freebsd*.
* config/arm/freebsd-atomic.c: New file.
* config/arm/t-freebsd: Likewise.
* config/arm/unwind-arm.h: Add __FreeBSD__ to the list of
'PC-relative indirect' OS's.

2015-01-06 Eric Botcazou <[email protected]>

* config.host: Add Visium support.
Expand Down
7 changes: 7 additions & 0 deletions libgcc/config.host
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,13 @@ arm-wrs-vxworks)
tmake_file="$tmake_file arm/t-arm arm/t-elf t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
extra_parts="$extra_parts crti.o crtn.o"
;;
arm*-*-freebsd*) # ARM FreeBSD EABI
tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix arm/t-elf"
tmake_file="${tmake_file} arm/t-bpabi arm/t-freebsd t-slibgcc-libgcc"
tm_file="${tm_file} arm/bpabi-lib.h"
unwind_header=config/arm/unwind-arm.h
tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
;;
arm*-*-netbsdelf*)
tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover"
;;
Expand Down
Loading

0 comments on commit 275d0a7

Please sign in to comment.