Skip to content
Merged
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
1 change: 1 addition & 0 deletions config/dfp.m4
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;;
[
case $1 in
powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \
x86_64-zephyr-* | \
i?86*-*-elfiamcu | i?86*-*-gnu* | x86_64*-*-gnu* | \
i?86*-*-mingw* | x86_64*-*-mingw* | \
i?86*-*-cygwin* | x86_64*-*-cygwin*)
Expand Down
12 changes: 12 additions & 0 deletions gcc/acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,18 @@ AC_DEFUN([gcc_GAS_FLAGS],
dnl Override the default, which may be incompatible.
gcc_cv_as_flags=--64
;;
i[[34567]]86-zephyr*)
dnl Override the default, which may be incompatible.
gcc_cv_as_flags=--32
;;
x86_64-zephyr-elfx32)
dnl Override the default, which may be incompatible.
gcc_cv_as_flags=--x32
;;
x86_64-zephyr*)
dnl Override the default, which may be incompatible.
gcc_cv_as_flags=--64
;;
powerpc*-*-darwin*)
dnl Always pass -arch ppc to assembler.
gcc_cv_as_flags="-arch ppc"
Expand Down
15 changes: 15 additions & 0 deletions gcc/config.gcc
Original file line number Diff line number Diff line change
Expand Up @@ -1895,9 +1895,18 @@ x86_64-*-darwin*)
i[34567]86-*-elfiamcu)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/iamcu.h"
;;
i586-zephyr-elf)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h"
tmake_file="${tmake_file} i386/t-zephyr"
;;
i[34567]86-*-elf*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h"
;;
x86_64-zephyr-elf*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h"
tm_file="${tm_file} i386/zephyr64.h"
tmake_file="${tmake_file} i386/t-zephyr64"
;;
x86_64-*-elf*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h"
;;
Expand Down Expand Up @@ -2463,6 +2472,9 @@ riscv*-*-linux*)
riscv*-*-elf* | riscv*-*-rtems*)
tm_file="elfos.h newlib-stdint.h ${tm_file} riscv/elf.h"
case ${target} in
*-zephyr*)
tmake_file="${tmake_file} riscv/t-zephyr"
;;
*-*-rtems*)
tm_file="${tm_file} riscv/rtems.h rtems.h"
tmake_file="${tmake_file} riscv/t-rtems"
Expand Down Expand Up @@ -3363,6 +3375,9 @@ sh-wrs-vxworks)
sparc-*-elf*)
tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp-elf.h"
case ${target} in
sparc-zephyr*)
tmake_file="sparc/t-sparc sparc/t-zephyr"
;;
*-leon-*)
tmake_file="sparc/t-sparc sparc/t-leon"
;;
Expand Down
23 changes: 23 additions & 0 deletions gcc/config/i386/t-zephyr
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2016 Intel Corporation.
#
# 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.
#
# 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/>.
#

MULTILIB_OPTIONS += msoft-float
MULTILIB_DIRNAMES += soft-float
MULTILIB_MATCHES = msoft-float=mno-80387
MULTILIB_EXCEPTIONS =
38 changes: 38 additions & 0 deletions gcc/config/i386/t-zephyr64
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (C) 2002-2018 Free Software Foundation, 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.
#
# 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/>.

# On Debian, Ubuntu and other derivative distributions, the 32bit libraries
# are found in /lib32 and /usr/lib32, /lib64 and /usr/lib64 are symlinks to
# /lib and /usr/lib, while other distributions install libraries into /lib64
# and /usr/lib64. The LSB does not enforce the use of /lib64 and /usr/lib64,
# it doesn't tell anything about the 32bit libraries on those systems. Set
# MULTILIB_OSDIRNAMES according to what is found on the target.

# To support i386, x86-64 and x32 libraries, the directory structrue
# should be:
#
# /lib has i386 libraries.
# /lib64 has x86-64 libraries.
# /libx32 has x32 libraries.
#
MULTILIB_OPTIONS = m64/m32 msoft-float
MULTILIB_DIRNAMES = 64 32 soft-float
MULTILIB_REQUIRED = m64 m32 m32/msoft-float
MULTILIB_EXCEPTIONS = msoft-float
MULTILIB_OSDIRNAMES = m64=!64 m32=!32 m32/msoft-float=!32/soft-float
MULTILIB_MATCHES = msoft-float=mno-80387
39 changes: 39 additions & 0 deletions gcc/config/i386/zephyr64.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* Definitions for x86-64 for Zephyr 64-bit toolchain.
Copyright (C) 2001-2019 Free Software Foundation, Inc.
Contributed by Jan Hubicka <[email protected]>, based on linux.h.
Based on gnu-user64.h.

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 and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */

#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s"

#undef STARTFILE_SPEC
#define STARTFILE_SPEC "crtbegin.o%s"

#undef LINK_SPEC
#define LINK_SPEC \
"%{m32:-m elf_i386} \
%{m64:-m elf_x86_64} \
%{mx32:-m elf32_x86_64}"

#define MULTILIB_DEFAULTS { "m64" }
6 changes: 3 additions & 3 deletions gcc/config/nios2/t-nios2
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.

# MULTILIB_OPTIONS = mno-hw-mul/mhw-mulx mcustom-fpu-cfg=60-1/mcustom-fpu-cfg=60-2
# MULTILIB_DIRNAMES = nomul mulx fpu-60-1 fpu-60-2
# MULTILIB_EXCEPTIONS =
MULTILIB_OPTIONS = mno-hw-mul/mhw-mulx mcustom-fpu-cfg=60-1/mcustom-fpu-cfg=60-2
MULTILIB_DIRNAMES = nomul mulx fpu-60-1 fpu-60-2
MULTILIB_EXCEPTIONS =

# MULTILIB_OPTIONS += EL/EB
# MULTILIB_DIRNAMES += le be
Expand Down
62 changes: 62 additions & 0 deletions gcc/config/riscv/t-zephyr
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Multilib target configurations
MULTILIB_SRC_ARCH = rv32im_zicsr_zifencei
MULTILIB_SRC_ARCH += rv32imc_zicsr_zifencei
MULTILIB_SRC_ARCH += rv32imac_zicsr_zifencei
MULTILIB_SRC_ARCH += rv32imafc_zicsr_zifencei
MULTILIB_SRC_ARCH += rv32imafd_zicsr_zifencei
MULTILIB_SRC_ARCH += rv32imafdc_zicsr_zifencei
MULTILIB_SRC_ARCH += rv32g
MULTILIB_SRC_ARCH += rv32gc
MULTILIB_SRC_ARCH += rv32em_zicsr_zifencei
MULTILIB_SRC_ARCH += rv32ema_zicsr_zifencei
MULTILIB_SRC_ARCH += rv32emc_zicsr_zifencei
MULTILIB_SRC_ARCH += rv32emac_zicsr_zifencei
MULTILIB_SRC_ARCH += rv64imac_zicsr_zifencei
MULTILIB_SRC_ARCH += rv64imafdc_zicsr_zifencei
MULTILIB_SRC_ARCH += rv64gc
MULTILIB_SRC_ARCH += rv64imafd_zicsr_zifencei
MULTILIB_SRC_ARCH += rv64g

MULTILIB_SRC_ABI = ilp32
MULTILIB_SRC_ABI += ilp32f
MULTILIB_SRC_ABI += ilp32d
MULTILIB_SRC_ABI += ilp32e
MULTILIB_SRC_ABI += lp64
MULTILIB_SRC_ABI += lp64d

MULTILIB_SRC_MCMODEL = medany

# Multilib build configurations
MULTILIB_REQUIRED = \
march=rv32im_zicsr_zifencei/mabi=ilp32 \
march=rv32imac_zicsr_zifencei/mabi=ilp32 \
march=rv32imafc_zicsr_zifencei/mabi=ilp32f \
march=rv32imafd_zicsr_zifencei/mabi=ilp32d \
march=rv32em_zicsr_zifencei/mabi=ilp32e \
march=rv32emc_zicsr_zifencei/mabi=ilp32e \
march=rv64imac_zicsr_zifencei/mabi=lp64 \
march=rv64imafdc_zicsr_zifencei/mabi=lp64d \
march=rv64imafd_zicsr_zifencei/mabi=lp64d \
march=rv64imac_zicsr_zifencei/mabi=lp64/mcmodel=medany \
march=rv64imafdc_zicsr_zifencei/mabi=lp64d/mcmodel=medany \
march=rv64imafd_zicsr_zifencei/mabi=lp64d/mcmodel=medany

# Multilib alternate mapping
MULTILIB_REUSE = \
march.rv32im_zicsr_zifencei/mabi.ilp32=march.rv32imc_zicsr_zifencei/mabi.ilp32 \
march.rv32imafd_zicsr_zifencei/mabi.ilp32d=march.rv32imafdc_zicsr_zifencei/mabi.ilp32d \
march.rv32imafd_zicsr_zifencei/mabi.ilp32d=march.rv32g/mabi.ilp32d \
march.rv32imafd_zicsr_zifencei/mabi.ilp32d=march.rv32gc/mabi.ilp32d \
march.rv32em_zicsr_zifencei/mabi.ilp32e=march.rv32ema_zicsr_zifencei/mabi.ilp32e \
march.rv32emc_zicsr_zifencei/mabi.ilp32e=march.rv32emac_zicsr_zifencei/mabi.ilp32e \
march.rv64imafdc_zicsr_zifencei/mabi.lp64d=march.rv64gc/mabi.lp64d \
march.rv64imafd_zicsr_zifencei/mabi.lp64d=march.rv64g/mabi.lp64d

# Automatically generate multilib options and directory names from the target configurations
space := $(subst ,, )

MULTILIB_OPTIONS = $(subst $(space),/,$(patsubst %,march=%,$(MULTILIB_SRC_ARCH)))
MULTILIB_OPTIONS += $(subst $(space),/,$(patsubst %,mabi=%,$(MULTILIB_SRC_ABI)))
MULTILIB_OPTIONS += $(subst $(space),/,$(patsubst %,mcmodel=%,$(MULTILIB_SRC_MCMODEL)))

MULTILIB_DIRNAMES = $(MULTILIB_SRC_ARCH) $(MULTILIB_SRC_ABI) $(MULTILIB_SRC_MCMODEL)
55 changes: 55 additions & 0 deletions gcc/config/sparc/t-zephyr
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright (C) 2012-2014 Free Software Foundation, 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.
#
# 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/>.

# Multilibs for Zephyr
MULTILIB_OPTIONS =
MULTILIB_DIRNAMES =

MULTILIB_OPTIONS += mcpu=leon/mcpu=leon3/mcpu=leon3v7
MULTILIB_DIRNAMES += leon leon3 leon3v7

MULTILIB_OPTIONS += msoft-float
MULTILIB_DIRNAMES += soft

MULTILIB_OPTIONS += mflat
MULTILIB_DIRNAMES += flat

MULTILIB_MATCHES = msoft-float=mno-fpu


# This is the complete list of multilibs to build
MULTILIB_REQUIRED =


MULTILIB_REQUIRED += msoft-float

MULTILIB_REQUIRED += mcpu=leon
MULTILIB_REQUIRED += mcpu=leon/msoft-float
MULTILIB_REQUIRED += mcpu=leon/mflat
MULTILIB_REQUIRED += mcpu=leon/msoft-float/mflat


MULTILIB_REQUIRED += mcpu=leon3
MULTILIB_REQUIRED += mcpu=leon3/msoft-float
MULTILIB_REQUIRED += mcpu=leon3/mflat
MULTILIB_REQUIRED += mcpu=leon3/msoft-float/mflat

MULTILIB_REQUIRED += mcpu=leon3v7
MULTILIB_REQUIRED += mcpu=leon3v7/msoft-float
MULTILIB_REQUIRED += mcpu=leon3v7/mflat
MULTILIB_REQUIRED += mcpu=leon3v7/msoft-float/mflat
16 changes: 13 additions & 3 deletions gcc/configure
Original file line number Diff line number Diff line change
Expand Up @@ -7897,6 +7897,7 @@ else

case $target in
powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \
x86_64*-zephyr-* | \
i?86*-*-elfiamcu | i?86*-*-gnu* | x86_64*-*-gnu* | \
i?86*-*-mingw* | x86_64*-*-mingw* | \
i?86*-*-cygwin* | x86_64*-*-cygwin*)
Expand Down Expand Up @@ -15431,7 +15432,7 @@ ia64-*-hpux*)
rm -rf conftest*
;;

x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
x86_64-*kfreebsd*-gnu|x86_64-*linux*|x86_64-zephyr-*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
Expand All @@ -15446,7 +15447,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
x86_64-*linux*|x86_64-zephyr-*)
case `/usr/bin/file conftest.o` in
*x86-64*)
LD="${LD-ld} -m elf32_x86_64"
Expand Down Expand Up @@ -15475,7 +15476,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_x86_64_fbsd"
;;
x86_64-*linux*)
x86_64-*linux*|x86_64-zephyr-*)
LD="${LD-ld} -m elf_x86_64"
;;
powerpcle-*linux*)
Expand Down Expand Up @@ -23724,6 +23725,15 @@ else
x86_64-*-linux*)
gcc_cv_as_flags=--64
;;
i[34567]86-zephyr*)
gcc_cv_as_flags=--32
;;
x86_64-zephyr-elfx32)
gcc_cv_as_flags=--x32
;;
x86_64-zephyr*)
gcc_cv_as_flags=--64
;;
powerpc*-*-darwin*)
gcc_cv_as_flags="-arch ppc"
;;
Expand Down
6 changes: 3 additions & 3 deletions libatomic/configure
Original file line number Diff line number Diff line change
Expand Up @@ -6872,7 +6872,7 @@ ia64-*-hpux*)
rm -rf conftest*
;;

x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
x86_64-*kfreebsd*-gnu|x86_64-*linux*|x86_64-zephyr-*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
Expand All @@ -6887,7 +6887,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
x86_64-*linux*|x86_64-zephyr-*)
case `/usr/bin/file conftest.o` in
*x86-64*)
LD="${LD-ld} -m elf32_x86_64"
Expand Down Expand Up @@ -6916,7 +6916,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_x86_64_fbsd"
;;
x86_64-*linux*)
x86_64-*linux*|x86_64-zephyr-*)
LD="${LD-ld} -m elf_x86_64"
;;
powerpcle-*linux*)
Expand Down
Loading