OpenWrt
/branches/18.06.1/toolchain/Config.in |
---|
@@ -0,0 +1,321 @@ |
# Copyright (C) 2006-2013 OpenWrt.org |
# |
# This is free software, licensed under the GNU General Public License v2. |
# See /LICENSE for more information. |
# |
menuconfig TARGET_OPTIONS |
bool "Target Options" if DEVEL |
config TARGET_OPTIMIZATION |
string "Target Optimizations" if TARGET_OPTIONS |
default DEFAULT_TARGET_OPTIMIZATION |
help |
Optimizations to use when building for the target host. |
config SOFT_FLOAT |
bool "Use software floating point by default" if TARGET_OPTIONS |
default y if !HAS_FPU |
depends on arm || armeb || powerpc || mipsel || mips || mips64el || mips64 |
help |
If your target CPU does not have a Floating Point Unit (FPU) or a |
kernel FPU emulator, but you still wish to support floating point |
functions, then everything will need to be compiled with soft floating |
point support (-msoft-float). |
Most people will answer N. |
config USE_MIPS16 |
bool "Build packages with MIPS16 instructions" if TARGET_OPTIONS |
depends on HAS_MIPS16 |
default y |
help |
If your target CPU does support the MIPS16 instruction set |
and you want to use it for packages, enable this option. |
MIPS16 produces smaller binaries thus reducing pressure on |
caches and TLB. |
Most people will answer N. |
menuconfig EXTERNAL_TOOLCHAIN |
bool |
prompt "Use external toolchain" if DEVEL |
help |
If enabled, LEDE will compile using an existing toolchain instead of |
compiling one. |
config NATIVE_TOOLCHAIN |
bool |
prompt "Use host's toolchain" if DEVEL |
depends on EXTERNAL_TOOLCHAIN |
select NO_STRIP |
help |
If enabled, LEDE will compile using the native toolchain for your |
host instead of compiling one. |
config TARGET_NAME |
string |
prompt "Target name" if DEVEL |
depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN |
default "aarch64-unknown-linux-gnu" if aarch64 |
default "aarch64_be-unknown-linux-gnu" if aarch64_be |
default "arm-unknown-linux-gnu" if arm |
default "armeb-unknown-linux-gnu" if armeb |
default "i486-unknown-linux-gnu" if i386 |
default "mips-unknown-linux-gnu" if mips |
default "mipsel-unknown-linux-gnu" if mipsel |
default "powerpc-unknown-linux-gnu" if powerpc |
default "x86_64-unknown-linux-gnu" if x86_64 |
config TOOLCHAIN_PREFIX |
string |
prompt "Toolchain prefix" if DEVEL |
depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN |
default "aarch64-unknown-linux-gnu" if aarch64 |
default "aarch64_be-unknown-linux-gnu" if aarch64_be |
default "arm-unknown-linux-gnu-" if arm |
default "armeb-unknown-linux-gnu-" if armeb |
default "i486-unknown-linux-gnu-" if i386 |
default "mips-unknown-linux-gnu-" if mips |
default "mipsel-unknown-linux-gnu-" if mipsel |
default "powerpc-unknown-linux-gnu-" if powerpc |
default "x86_64-unknown-linux-gnu-" if x86_64 |
config TOOLCHAIN_ROOT |
string |
prompt "Toolchain root" if DEVEL |
depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN |
default "/opt/cross/aarch64-unknown-linux-gnu" if aarch64 |
default "/opt/cross/aarch64_be-unknown-linux-gnu" if aarch64_be |
default "/opt/cross/arm-unknown-linux-gnu" if arm |
default "/opt/cross/armeb-unknown-linux-gnu" if armeb |
default "/opt/cross/i486-unknown-linux-gnu" if i386 |
default "/opt/cross/mips-unknown-linux-gnu" if mips |
default "/opt/cross/mipsel-unknown-linux-gnu" if mipsel |
default "/opt/cross/powerpc-unknown-linux-gnu" if powerpc |
default "/opt/cross/x86_64-unknown-linux-gnu" if x86_64 |
choice TOOLCHAIN_LIBC_TYPE |
prompt "Toolchain libc" if DEVEL |
depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN |
default EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL |
help |
Specify the libc type used by the external toolchain. The given value |
is passed as -m flag to all gcc and g++ invocations. This is mainly |
intended for multilib toolchains which support glibc and uclibc at |
the same time. If no value is specified, no -m flag is passed. |
config EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC |
bool "glibc" |
select USE_GLIBC |
config EXTERNAL_TOOLCHAIN_LIBC_USE_UCLIBC |
bool "uClibc" |
select USE_UCLIBC |
depends on !(aarch64 || aarch64_be) |
config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL |
bool "musl" |
select USE_MUSL |
endchoice |
config TOOLCHAIN_LIBC |
string |
depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN |
default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC |
default "uclibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_UCLIBC |
default "musl" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL |
config TOOLCHAIN_BIN_PATH |
string |
prompt "Toolchain program path" if DEVEL |
depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN |
default "./usr/bin ./bin" |
help |
Specify additional directories searched for toolchain binaries |
(override PATH). Use ./DIR for directories relative to the root above. |
config TOOLCHAIN_INC_PATH |
string |
prompt "Toolchain include path" if DEVEL |
depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN |
default "./usr/include ./include" |
help |
Specify additional directories searched for header files (override |
CPPFLAGS). Use ./DIR for directories relative to the root above. |
config TOOLCHAIN_LIB_PATH |
string |
prompt "Toolchain library path" if DEVEL |
depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN |
default "./usr/lib ./lib" |
help |
Specify additional directories searched for libraries (override LDFLAGS). |
Use ./DIR for directories relative to the root above. |
config NEED_TOOLCHAIN |
bool |
depends on DEVEL |
default y if !EXTERNAL_TOOLCHAIN |
menuconfig TOOLCHAINOPTS |
bool "Toolchain Options" if DEVEL |
depends on NEED_TOOLCHAIN |
menuconfig EXTRA_TARGET_ARCH |
bool |
prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS |
depends on !sparc |
default n |
help |
Some builds may require a 'biarch' toolchain. This option |
allows you to specify an additional target arch. |
Most people will answer N here. |
config EXTRA_TARGET_ARCH_NAME |
string |
prompt "Extra architecture name" if EXTRA_TARGET_ARCH |
help |
Specify the cpu name (eg powerpc64 or x86_64) of the |
additional target architecture. |
config EXTRA_TARGET_ARCH_OPTS |
string |
prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH |
help |
If you're specifying an addition target architecture, |
you'll probably need to also provide options to make |
the compiler use this alternate arch. |
For example, if you're building a compiler that can build |
both powerpc and powerpc64 binaries, you'll need to |
specify -m64 here. |
choice |
prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el) |
default MIPS64_ABI_N64 |
help |
MIPS64 supports 3 different user-land ABIs: o32 (legacy), |
n32 and n64. |
config MIPS64_ABI_N64 |
bool "n64" |
config MIPS64_ABI_N32 |
depends on !LIBC_USE_MUSL |
bool "n32" |
config MIPS64_ABI_O32 |
bool "o32" |
endchoice |
comment "Binary tools" |
depends on TOOLCHAINOPTS |
source "toolchain/binutils/Config.in" |
comment "Compiler" |
depends on TOOLCHAINOPTS |
source "toolchain/gcc/Config.in" |
config NASM |
bool |
depends on ( i386 || x86_64 ) |
prompt "Build nasm" if TOOLCHAINOPTS |
default y |
help |
Enable if you want to build nasm |
comment "C Library" |
depends on TOOLCHAINOPTS |
choice |
prompt "C Library implementation" if TOOLCHAINOPTS |
default LIBC_USE_UCLIBC if arc |
default LIBC_USE_GLIBC if powerpc64 |
default LIBC_USE_MUSL |
help |
Select the C library implementation. |
config LIBC_USE_GLIBC |
bool "Use glibc" |
select USE_GLIBC |
depends on !arc |
config LIBC_USE_UCLIBC |
select USE_UCLIBC |
bool "Use uClibc" |
depends on !(aarch64 || aarch64_be || powerpc64) |
depends on BROKEN || !(arm || armeb || i386 || x86_64 || mips || mipsel || mips64 || mips64el || powerpc) |
config LIBC_USE_MUSL |
select USE_MUSL |
bool "Use musl" |
depends on !(arc || powerpc64) |
endchoice |
source "toolchain/uClibc/Config.in" |
source "toolchain/musl/Config.in" |
comment "Debuggers" |
depends on TOOLCHAINOPTS |
config GDB |
bool |
prompt "Build gdb" if TOOLCHAINOPTS |
default y if !EXTERNAL_TOOLCHAIN |
help |
Enable if you want to build the gdb. |
config USE_GLIBC |
default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (powerpc64) |
bool |
config USE_UCLIBC |
default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc) |
bool |
config USE_MUSL |
default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc || powerpc64) |
bool |
config SSP_SUPPORT |
default y if USE_MUSL || GCC_LIBSSP |
bool |
config USE_EXTERNAL_LIBC |
bool |
default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN |
source "toolchain/binutils/Config.version" |
source "toolchain/gcc/Config.version" |
config LIBC |
string |
default "glibc" if USE_GLIBC |
default "uClibc" if USE_UCLIBC |
default "musl" if USE_MUSL |
config TARGET_SUFFIX |
string |
default "gnueabi" if USE_GLIBC && (arm || armeb) |
default "gnu" if USE_GLIBC && !(arm || armeb) |
default "uclibcgnueabi" if USE_UCLIBC && (arm || armeb) |
default "uclibc" if USE_UCLIBC && !(arm || armeb) |
default "muslgnueabi" if USE_MUSL && (arm || armeb) |
default "musl" if USE_MUSL && !(arm || armeb) |
config MIPS64_ABI |
depends on mips64 || mips64el |
string |
default "64" if MIPS64_ABI_N64 |
default "n32" if MIPS64_ABI_N32 |
default "32" if MIPS64_ABI_O32 |
default "64" |
/branches/18.06.1/toolchain/Makefile |
---|
@@ -0,0 +1,99 @@ |
# |
# Copyright (C) 2007-2009 OpenWrt.org |
# |
# This is free software, licensed under the GNU General Public License v2. |
# See /LICENSE for more information. |
# |
# Main makefile for the toolchain |
# |
# Steps: |
# 1) toolchain/binutils/compile |
# build & install binutils |
# 2) toolchain/gcc/minimal/compile |
# build & install a minimal gcc, needed for steps 3 & 4 |
# 3) toolchain/kernel-headers/compile |
# install kernel headers, needed for step 4 |
# 4) toolchain/libc/headers/compile |
# build & install libc headers & support files, needed for step 5 |
# 5) toolchain/gcc/initial/compile |
# build & install an initial gcc, needed for step 6 |
# 6) toolchain/libc/compile |
# build & install the final libc |
# 7) toolchain/gcc/final/compile |
# build & install the final gcc |
# 8) toolchain/libc/utils/compile |
# build & install libc utilities |
# |
# For musl, steps 2 and 4 are skipped, and step 3 is done after 5 |
curdir:=toolchain |
# subdirectories to descend into |
$(curdir)/builddirs := $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_EXTERNAL_TOOLCHAIN),wrapper,kernel-headers binutils gcc/initial gcc/final $(LIBC) fortify-headers) $(if $(CONFIG_NASM),nasm) |
ifdef CONFIG_USE_UCLIBC |
$(curdir)/builddirs += $(LIBC)/utils |
endif |
# builddir dependencies |
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) |
ifdef CONFIG_USE_MUSL |
$(curdir)/kernel-headers/compile:=$(curdir)/gcc/initial/compile |
$(curdir)/$(LIBC)/compile:=$(curdir)/kernel-headers/compile |
else |
$(curdir)/builddirs += $(LIBC)/headers gcc/minimal |
$(curdir)/gcc/minimal/compile:=$(curdir)/binutils/compile |
$(curdir)/kernel-headers/compile:=$(curdir)/gcc/minimal/compile |
$(curdir)/$(LIBC)/headers/compile:=$(curdir)/kernel-headers/compile |
$(curdir)/gcc/initial/compile:=$(curdir)/$(LIBC)/headers/compile |
endif |
$(curdir)/gcc/initial/compile+=$(curdir)/binutils/compile |
$(curdir)/$(LIBC)/compile:=$(curdir)/gcc/initial/compile |
$(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/compile |
$(curdir)/$(LIBC)/utils/compile:=$(curdir)/gcc/final/compile |
endif |
ifndef DUMP_TARGET_DB |
ifneq ($(ARCH),) |
$(TOOLCHAIN_DIR)/info.mk: .config |
@for dir in $(TOOLCHAIN_DIR); do ( \ |
$(if $(QUIET),,set -x;) \ |
mkdir -p "$$dir"; \ |
cd "$$dir"; \ |
ln -nsf lib lib64; \ |
ln -nsf lib lib32; \ |
mkdir -p stamp lib usr/include usr/lib ; \ |
); done |
@grep GCC_VERSION $@ >/dev/null 2>&1 || $(INSTALL_DATA) $(TOPDIR)/toolchain/info.mk $@ |
@touch $@ |
endif |
endif |
ifdef CONFIG_BUILDBOT |
ifneq ($(wildcard $(TOPDIR)/.git),) |
$(TOOLCHAIN_DIR)/stamp/.ver_check: $(TMP_DIR)/.build |
cd "$(TOPDIR)"; git log --format=%h -1 toolchain > $(TMP_DIR)/.ver_check |
cmp -s $(TMP_DIR)/.ver_check $@ || { \ |
rm -rf $(BUILD_DIR) $(STAGING_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR_TOOLCHAIN); \ |
mkdir -p $(TOOLCHAIN_DIR)/stamp; \ |
mv $(TMP_DIR)/.ver_check $@; \ |
} |
$(TOOLCHAIN_DIR)/info.mk $(STAGING_DIR)/.prepared: $(TOOLCHAIN_DIR)/stamp/.ver_check |
endif |
endif |
# prerequisites for the individual targets |
$(curdir)/ := .config prereq |
$(curdir)//compile = $(STAGING_DIR)/.prepared $(TOOLCHAIN_DIR)/info.mk $(tools/stamp-compile) |
ifndef DUMP_TARGET_DB |
$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed: |
endif |
$(curdir)/install: $(curdir)/compile |
$(eval $(call stampfile,$(curdir),toolchain,compile,$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed,,$(TOOLCHAIN_DIR))) |
$(eval $(call stampfile,$(curdir),toolchain,check,$(TMP_DIR)/.build)) |
$(eval $(call subdir,$(curdir))) |
/branches/18.06.1/toolchain/binutils/Config.in |
---|
@@ -0,0 +1,37 @@ |
# Choose binutils version. |
choice |
prompt "Binutils Version" if TOOLCHAINOPTS |
default BINUTILS_USE_VERSION_2_31_1 if !arc |
default BINUTILS_USE_VERSION_2_29_ARC if arc |
help |
Select the version of binutils you wish to use. |
config BINUTILS_USE_VERSION_2_29_ARC |
depends on arc |
bool "ARC binutils 2.29" |
select BINUTILS_VERSION_2_29_ARC |
config BINUTILS_USE_VERSION_2_29_1 |
depends on !arc |
bool "Binutils 2.29.1" |
select BINUTILS_VERSION_2_29_1 |
config BINUTILS_USE_VERSION_2_31_1 |
depends on !arc |
bool "Binutils 2.31.1" |
select BINUTILS_VERSION_2_31_1 |
config BINUTILS_USE_VERSION_2_32 |
depends on !arc |
bool "Binutils 2.32" |
select BINUTILS_VERSION_2_32 |
endchoice |
config EXTRA_BINUTILS_CONFIG_OPTIONS |
string |
prompt "Additional binutils configure options" if TOOLCHAINOPTS |
default "" |
help |
Any additional binutils options you may want to include.... |
/branches/18.06.1/toolchain/binutils/Config.version |
---|
@@ -0,0 +1,20 @@ |
config BINUTILS_VERSION_2_29_ARC |
default y if (!TOOLCHAINOPTS && arc) |
bool |
config BINUTILS_VERSION_2_29_1 |
bool |
config BINUTILS_VERSION_2_31_1 |
default y if (!TOOLCHAINOPTS && !arc) |
bool |
config BINUTILS_VERSION_2_32 |
bool |
config BINUTILS_VERSION |
string |
default "2.29.1" if BINUTILS_VERSION_2_29_1 |
default "2.31.1" if BINUTILS_VERSION_2_31_1 |
default "2.32" if BINUTILS_VERSION_2_32 |
default "arc-2017.09" if BINUTILS_VERSION_2_29_ARC |
/branches/18.06.1/toolchain/binutils/Makefile |
---|
@@ -0,0 +1,118 @@ |
# |
# Copyright (C) 2006-2013 OpenWrt.org |
# |
# This is free software, licensed under the GNU General Public License v2. |
# See /LICENSE for more information. |
# |
include $(TOPDIR)/rules.mk |
PKG_NAME:=binutils |
PKG_VERSION:=$(call qstrip,$(CONFIG_BINUTILS_VERSION)) |
BIN_VERSION:=$(PKG_VERSION) |
PKG_SOURCE_URL:=@GNU/binutils/ |
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz |
TAR_OPTIONS += --exclude='*.rej' |
ifeq ($(PKG_VERSION),2.29.1) |
PKG_HASH:=e7010a46969f9d3e53b650a518663f98a5dde3c3ae21b7d71e5e6803bc36b577 |
endif |
ifeq ($(PKG_VERSION),2.31.1) |
PKG_HASH:=5d20086ecf5752cc7d9134246e9588fa201740d540f7eb84d795b1f7a93bca86 |
endif |
ifeq ($(PKG_VERSION),2.32) |
PKG_HASH:=0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04 |
endif |
ifneq ($(CONFIG_BINUTILS_VERSION_2_29_ARC),) |
PKG_REV:=arc-2017.09-release |
PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_REV)/ |
PKG_SOURCE:=$(PKG_NAME)-$(PKG_REV).tar.gz |
PKG_HASH:=2ea086fd5521e942926dd6ff6922ce31c29ee7ffc754fca3d06385e0f27600f8 |
BINUTILS_DIR:=$(PKG_NAME)-gdb-$(PKG_REV) |
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(BINUTILS_DIR) |
endif |
HOST_BUILD_PARALLEL:=1 |
PATCH_DIR:=./patches/$(PKG_VERSION) |
include $(INCLUDE_DIR)/toolchain-build.mk |
BINUTILS_CONFIGURE:= \ |
./configure \ |
--prefix=$(TOOLCHAIN_DIR) \ |
--build=$(GNU_HOST_NAME) \ |
--host=$(GNU_HOST_NAME) \ |
--target=$(REAL_GNU_TARGET_NAME) \ |
--with-sysroot=$(TOOLCHAIN_DIR) \ |
--enable-deterministic-archives \ |
--enable-plugins \ |
--disable-multilib \ |
--disable-werror \ |
--disable-nls \ |
--disable-sim \ |
--disable-gdb \ |
$(GRAPHITE_CONFIGURE) \ |
$(SOFT_FLOAT_CONFIG_OPTION) \ |
$(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS)) |
ifneq ($(CONFIG_SSP_SUPPORT),) |
BINUTILS_CONFIGURE+= \ |
--enable-libssp |
else |
BINUTILS_CONFIGURE+= \ |
--disable-libssp |
endif |
ifneq ($(CONFIG_EXTRA_TARGET_ARCH),) |
BINUTILS_CONFIGURE+= \ |
--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX) |
endif |
define Host/Prepare |
$(call Host/Prepare/Default) |
ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) |
$(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/ |
$(SED) 's, " Linaro.*,,' $(HOST_BUILD_DIR)/bfd/version.h |
endef |
define Host/Configure |
(cd $(HOST_BUILD_DIR); \ |
$(BINUTILS_CONFIGURE) \ |
); |
endef |
define Host/Compile |
+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all |
endef |
define Host/Install |
mkdir -p $(TOOLCHAIN_DIR)/initial |
$(MAKE) -C $(HOST_BUILD_DIR) \ |
prefix=$(TOOLCHAIN_DIR)/initial \ |
install |
$(MAKE) -C $(HOST_BUILD_DIR) \ |
prefix=$(TOOLCHAIN_DIR) \ |
install |
$(call FixupLibdir,$(TOOLCHAIN_DIR)/initial) |
$(RM) $(TOOLCHAIN_DIR)/initial/lib/libiberty.a |
$(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(HOST_BUILD_PREFIX)/bin/readelf |
# ARC gcc requires extlib. |
# If extlib is not available in "initial" folder |
# initial gcc will fail to build libc. |
if [ -d $(TOOLCHAIN_DIR)/extlib ]; then \ |
$(CP) -r $(TOOLCHAIN_DIR)/extlib $(TOOLCHAIN_DIR)/initial/; \ |
fi |
endef |
define Host/Clean |
rm -rf \ |
$(HOST_BUILD_DIR) \ |
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) |
endef |
$(eval $(call HostBuild)) |
/branches/18.06.1/toolchain/binutils/patches/2.29.1/300-001_ld_makefile_patch.patch |
---|
@@ -0,0 +1,22 @@ |
--- a/ld/Makefile.am |
+++ b/ld/Makefile.am |
@@ -57,7 +57,7 @@ endif |
# We put the scripts in the directory $(scriptdir)/ldscripts. |
# We can't put the scripts in $(datadir) because the SEARCH_DIR |
# directives need to be different for native and cross linkers. |
-scriptdir = $(tooldir)/lib |
+scriptdir = $(libdir) |
EMUL = @EMUL@ |
EMULATION_OFILES = @EMULATION_OFILES@ |
--- a/ld/Makefile.in |
+++ b/ld/Makefile.in |
@@ -446,7 +446,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) |
# We put the scripts in the directory $(scriptdir)/ldscripts. |
# We can't put the scripts in $(datadir) because the SEARCH_DIR |
# directives need to be different for native and cross linkers. |
-scriptdir = $(tooldir)/lib |
+scriptdir = $(libdir) |
BASEDIR = $(srcdir)/.. |
BFDDIR = $(BASEDIR)/bfd |
INCDIR = $(BASEDIR)/include |
/branches/18.06.1/toolchain/binutils/patches/2.29.1/300-012_check_ldrunpath_length.patch |
---|
@@ -0,0 +1,20 @@ |
--- a/ld/emultempl/elf32.em |
+++ b/ld/emultempl/elf32.em |
@@ -1463,6 +1463,8 @@ fragment <<EOF |
&& command_line.rpath == NULL) |
{ |
path = (const char *) getenv ("LD_RUN_PATH"); |
+ if ((path) && (strlen (path) == 0)) |
+ path = NULL; |
if (path |
&& gld${EMULATION_NAME}_search_needed (path, &n, force)) |
break; |
@@ -1740,6 +1742,8 @@ gld${EMULATION_NAME}_before_allocation ( |
rpath = command_line.rpath; |
if (rpath == NULL) |
rpath = (const char *) getenv ("LD_RUN_PATH"); |
+ if ((rpath) && (strlen (rpath) == 0)) |
+ rpath = NULL; |
for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) |
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) |
/branches/18.06.1/toolchain/binutils/patches/2.29.1/400-mips_no_dynamic_linking_sym.patch |
---|
@@ -0,0 +1,18 @@ |
--- a/bfd/elfxx-mips.c |
+++ b/bfd/elfxx-mips.c |
@@ -7871,6 +7871,7 @@ _bfd_mips_elf_create_dynamic_sections (b |
name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING"; |
bh = NULL; |
+ if (0) { |
if (!(_bfd_generic_link_add_one_symbol |
(info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, 0, |
NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh))) |
@@ -7883,6 +7884,7 @@ _bfd_mips_elf_create_dynamic_sections (b |
if (! bfd_elf_link_record_dynamic_symbol (info, h)) |
return FALSE; |
+ } |
if (! mips_elf_hash_table (info)->use_rld_obj_head) |
{ |
/branches/18.06.1/toolchain/binutils/patches/2.29.1/500-Change-default-emulation-for-mips64-linux.patch |
---|
@@ -0,0 +1,37 @@ |
--- a/bfd/config.bfd |
+++ b/bfd/config.bfd |
@@ -1186,12 +1186,12 @@ case "${targ}" in |
targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec" |
;; |
mips64*el-*-linux*) |
- targ_defvec=mips_elf32_ntrad_le_vec |
- targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec" |
+ targ_defvec=mips_elf64_trad_le_vec |
+ targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec" |
;; |
mips64*-*-linux*) |
- targ_defvec=mips_elf32_ntrad_be_vec |
- targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec" |
+ targ_defvec=mips_elf64_trad_be_vec |
+ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec" |
;; |
mips*el-*-linux*) |
targ_defvec=mips_elf32_trad_le_vec |
--- a/ld/configure.tgt |
+++ b/ld/configure.tgt |
@@ -530,11 +530,11 @@ mips*el-*-vxworks*) targ_emul=elf32elmip |
mips*-*-vxworks*) targ_emul=elf32ebmipvxworks |
targ_extra_emuls="elf32elmipvxworks" ;; |
mips*-*-windiss) targ_emul=elf32mipswindiss ;; |
-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 |
- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" |
+mips64*el-*-linux-*) targ_emul=elf64ltsmip |
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip" |
targ_extra_libpath=$targ_extra_emuls ;; |
-mips64*-*-linux-*) targ_emul=elf32btsmipn32 |
- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" |
+mips64*-*-linux-*) targ_emul=elf64btsmip |
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip" |
targ_extra_libpath=$targ_extra_emuls ;; |
mips*el-*-linux-*) targ_emul=elf32ltsmip |
targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" |
/branches/18.06.1/toolchain/binutils/patches/2.31.1/100-delay_evaluation_of_alignment_expressions_in_output_sections.patch |
---|
@@ -0,0 +1,276 @@ |
From 3d9c8f6b3f033a6092425b7344647fb51dbed5c6 Mon Sep 17 00:00:00 2001 |
From: Alan Modra <amodra@gmail.com> |
Date: Sun, 26 Aug 2018 14:23:38 +0930 |
Subject: [PATCH] Delay evaluation of alignment expressions in output sections |
git commit 702d16713 broke expressions using CONSTANT(COMMONPAGESIZE) |
in ALIGN or SUBALIGN of output section statements, because these |
optional fields were evaluated at script parse time and the patch in |
question delayed setting of config.commonpagesize. The right thing to |
do is keep the tree representation of those fields for later |
evaluation. |
PR 23571 |
* ldlang.h (section_alignment): Make it an expression tree. |
(subsection_alignment): Likewise. |
* ldlang.c (topower): Delete. |
(output_section_statement_newfunc): Adjust initialization. |
(init_os): Evaluate section_alignment. |
(lang_size_sections_1): Likewise. |
(size_input_section): Evaluate subsection_alignment. |
(lang_enter_output_section_statement): Don't evaluate here. |
(lang_new_phdr): Use exp_get_vma rather than exp_get_value_int. |
* ldexp.h (exp_get_value_int): Delete. |
(exp_get_power): Declare. |
* ldexp.c (exp_get_value_int): Delete. |
(exp_get_power): New function. |
* emultempl/pe.em (place_orphan): Build expression for section |
alignment. |
* emultempl/pep.em (place_orphan): Likewise. |
* testsuite/ld-scripts/pr23571.d, |
* testsuite/ld-scripts/pr23571.t: New test. |
* testsuite/ld-scripts/align.exp: Run it. |
--- |
ld/ChangeLog | 23 +++++++++++++++++++ |
ld/emultempl/pe.em | 2 +- |
ld/emultempl/pep.em | 2 +- |
ld/ldexp.c | 20 ++++++++++++++-- |
ld/ldexp.h | 4 ++-- |
ld/ldlang.c | 48 +++++++++++++-------------------------- |
ld/ldlang.h | 4 ++-- |
ld/testsuite/ld-scripts/align.exp | 4 ++++ |
ld/testsuite/ld-scripts/pr23571.d | 10 ++++++++ |
ld/testsuite/ld-scripts/pr23571.t | 11 +++++++++ |
10 files changed, 88 insertions(+), 40 deletions(-) |
create mode 100644 ld/testsuite/ld-scripts/pr23571.d |
create mode 100644 ld/testsuite/ld-scripts/pr23571.t |
--- a/ld/emultempl/pe.em |
+++ b/ld/emultempl/pe.em |
@@ -2165,7 +2165,7 @@ gld_${EMULATION_NAME}_place_orphan (asec |
&add_child); |
if (bfd_link_relocatable (&link_info)) |
{ |
- os->section_alignment = s->alignment_power; |
+ os->section_alignment = exp_intop (1U << s->alignment_power); |
os->bfd_section->alignment_power = s->alignment_power; |
} |
} |
--- a/ld/emultempl/pep.em |
+++ b/ld/emultempl/pep.em |
@@ -1962,7 +1962,7 @@ gld_${EMULATION_NAME}_place_orphan (asec |
&add_child); |
if (bfd_link_relocatable (&link_info)) |
{ |
- os->section_alignment = s->alignment_power; |
+ os->section_alignment = exp_intop (1U << s->alignment_power); |
os->bfd_section->alignment_power = s->alignment_power; |
} |
} |
--- a/ld/ldexp.c |
+++ b/ld/ldexp.c |
@@ -1522,10 +1522,26 @@ exp_get_vma (etree_type *tree, bfd_vma d |
return def; |
} |
+/* Return the smallest non-negative integer such that two raised to |
+ that power is at least as large as the vma evaluated at TREE, if |
+ TREE is a non-NULL expression that can be resolved. If TREE is |
+ NULL or cannot be resolved, return -1. */ |
+ |
int |
-exp_get_value_int (etree_type *tree, int def, char *name) |
+exp_get_power (etree_type *tree, char *name) |
{ |
- return exp_get_vma (tree, def, name); |
+ bfd_vma x = exp_get_vma (tree, -1, name); |
+ bfd_vma p2; |
+ int n; |
+ |
+ if (x == (bfd_vma) -1) |
+ return -1; |
+ |
+ for (n = 0, p2 = 1; p2 < x; ++n, p2 <<= 1) |
+ if (p2 == 0) |
+ break; |
+ |
+ return n; |
} |
fill_type * |
--- a/ld/ldexp.h |
+++ b/ld/ldexp.h |
@@ -229,8 +229,8 @@ void exp_print_tree |
(etree_type *); |
bfd_vma exp_get_vma |
(etree_type *, bfd_vma, char *); |
-int exp_get_value_int |
- (etree_type *, int, char *); |
+int exp_get_power |
+ (etree_type *, char *); |
fill_type *exp_get_fill |
(etree_type *, fill_type *, char *); |
bfd_vma exp_get_abs_int |
--- a/ld/ldlang.c |
+++ b/ld/ldlang.c |
@@ -1199,8 +1199,8 @@ output_section_statement_newfunc (struct |
ret = (struct out_section_hash_entry *) entry; |
memset (&ret->s, 0, sizeof (ret->s)); |
ret->s.header.type = lang_output_section_statement_enum; |
- ret->s.output_section_statement.subsection_alignment = -1; |
- ret->s.output_section_statement.section_alignment = -1; |
+ ret->s.output_section_statement.subsection_alignment = NULL; |
+ ret->s.output_section_statement.section_alignment = NULL; |
ret->s.output_section_statement.block_value = 1; |
lang_list_init (&ret->s.output_section_statement.children); |
lang_statement_append (stat_ptr, &ret->s, &ret->s.header.next); |
@@ -2193,8 +2193,9 @@ init_os (lang_output_section_statement_t |
exp_init_os (s->load_base); |
/* If supplied an alignment, set it. */ |
- if (s->section_alignment != -1) |
- s->bfd_section->alignment_power = s->section_alignment; |
+ if (s->section_alignment != NULL) |
+ s->bfd_section->alignment_power = exp_get_power (s->section_alignment, |
+ "section alignment"); |
} |
/* Make sure that all output sections mentioned in an expression are |
@@ -4706,8 +4707,10 @@ size_input_section |
is greater than any seen before, then record it too. Perform |
the alignment by inserting a magic 'padding' statement. */ |
- if (output_section_statement->subsection_alignment != -1) |
- i->alignment_power = output_section_statement->subsection_alignment; |
+ if (output_section_statement->subsection_alignment != NULL) |
+ i->alignment_power |
+ = exp_get_power (output_section_statement->subsection_alignment, |
+ "subsection alignment"); |
if (o->alignment_power < i->alignment_power) |
o->alignment_power = i->alignment_power; |
@@ -5147,7 +5150,8 @@ lang_size_sections_1 |
section_alignment = os->bfd_section->alignment_power; |
} |
else |
- section_alignment = os->section_alignment; |
+ section_alignment = exp_get_power (os->section_alignment, |
+ "section alignment"); |
/* Align to what the section needs. */ |
if (section_alignment > 0) |
@@ -5225,7 +5229,8 @@ lang_size_sections_1 |
only align according to the value in the output |
statement. */ |
if (os->lma_region != os->region) |
- section_alignment = os->section_alignment; |
+ section_alignment = exp_get_power (os->section_alignment, |
+ "section alignment"); |
if (section_alignment > 0) |
lma = align_power (lma, section_alignment); |
} |
@@ -6673,25 +6678,6 @@ lang_add_output (const char *name, int f |
} |
} |
-static int |
-topower (int x) |
-{ |
- unsigned int i = 1; |
- int l; |
- |
- if (x < 0) |
- return -1; |
- |
- for (l = 0; l < 32; l++) |
- { |
- if (i >= (unsigned int) x) |
- return l; |
- i <<= 1; |
- } |
- |
- return 0; |
-} |
- |
lang_output_section_statement_type * |
lang_enter_output_section_statement (const char *output_section_statement_name, |
etree_type *address_exp, |
@@ -6727,10 +6713,8 @@ lang_enter_output_section_statement (con |
einfo (_("%F%P:%pS: error: align with input and explicit align specified\n"), |
NULL); |
- os->subsection_alignment = |
- topower (exp_get_value_int (subalign, -1, "subsection alignment")); |
- os->section_alignment = |
- topower (exp_get_value_int (align, -1, "section alignment")); |
+ os->subsection_alignment = subalign; |
+ os->section_alignment = align; |
os->load_base = ebase; |
return os; |
@@ -7748,7 +7732,7 @@ lang_new_phdr (const char *name, |
n = (struct lang_phdr *) stat_alloc (sizeof (struct lang_phdr)); |
n->next = NULL; |
n->name = name; |
- n->type = exp_get_value_int (type, 0, "program header type"); |
+ n->type = exp_get_vma (type, 0, "program header type"); |
n->filehdr = filehdr; |
n->phdrs = phdrs; |
n->at = at; |
--- a/ld/ldlang.h |
+++ b/ld/ldlang.h |
@@ -143,6 +143,8 @@ typedef struct lang_output_section_state |
fill_type *fill; |
union etree_union *addr_tree; |
union etree_union *load_base; |
+ union etree_union *section_alignment; |
+ union etree_union *subsection_alignment; |
/* If non-null, an expression to evaluate after setting the section's |
size. The expression is evaluated inside REGION (above) with '.' |
@@ -153,8 +155,6 @@ typedef struct lang_output_section_state |
lang_output_section_phdr_list *phdrs; |
unsigned int block_value; |
- int subsection_alignment; /* Alignment of components. */ |
- int section_alignment; /* Alignment of start of section. */ |
int constraint; |
flagword flags; |
enum section_type sectype; |
--- a/ld/testsuite/ld-scripts/align.exp |
+++ b/ld/testsuite/ld-scripts/align.exp |
@@ -53,3 +53,7 @@ if ![is_aout_format] { |
} |
run_dump_test align2c |
set LDFLAGS "$saved_LDFLAGS" |
+ |
+if { [is_elf_format] && ![is_generic_elf] } { |
+ run_dump_test pr23571 |
+} |
--- /dev/null |
+++ b/ld/testsuite/ld-scripts/pr23571.d |
@@ -0,0 +1,10 @@ |
+#source: align2a.s |
+#ld: -T pr23571.t -z common-page-size=0x1000 |
+#objdump: -h -w |
+ |
+.*: +file format .* |
+ |
+Sections: |
+Idx Name +Size +VMA +LMA +File off +Algn +Flags |
+ +0 \.text +[0-9a-f]* +0+1000 +0+1000 .* |
+ +1 \.data +[0-9a-f]* +0+2000 +0+2000 +[0-9a-f]* +2\*\*12 .* |
--- /dev/null |
+++ b/ld/testsuite/ld-scripts/pr23571.t |
@@ -0,0 +1,11 @@ |
+SECTIONS |
+{ |
+ .text CONSTANT(COMMONPAGESIZE) : { |
+ *(.text) |
+ } |
+ |
+ .data : ALIGN(CONSTANT(COMMONPAGESIZE)) { |
+ *(.data) |
+ } |
+ /DISCARD/ : {*(*)} |
+} |
/branches/18.06.1/toolchain/binutils/patches/2.31.1/300-001_ld_makefile_patch.patch |
---|
@@ -0,0 +1,22 @@ |
--- a/ld/Makefile.am |
+++ b/ld/Makefile.am |
@@ -57,7 +57,7 @@ endif |
# We put the scripts in the directory $(scriptdir)/ldscripts. |
# We can't put the scripts in $(datadir) because the SEARCH_DIR |
# directives need to be different for native and cross linkers. |
-scriptdir = $(tooldir)/lib |
+scriptdir = $(libdir) |
EMUL = @EMUL@ |
EMULATION_OFILES = @EMULATION_OFILES@ |
--- a/ld/Makefile.in |
+++ b/ld/Makefile.in |
@@ -563,7 +563,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) |
# We put the scripts in the directory $(scriptdir)/ldscripts. |
# We can't put the scripts in $(datadir) because the SEARCH_DIR |
# directives need to be different for native and cross linkers. |
-scriptdir = $(tooldir)/lib |
+scriptdir = $(libdir) |
BASEDIR = $(srcdir)/.. |
BFDDIR = $(BASEDIR)/bfd |
INCDIR = $(BASEDIR)/include |
/branches/18.06.1/toolchain/binutils/patches/2.31.1/300-012_check_ldrunpath_length.patch |
---|
@@ -0,0 +1,20 @@ |
--- a/ld/emultempl/elf32.em |
+++ b/ld/emultempl/elf32.em |
@@ -1471,6 +1471,8 @@ fragment <<EOF |
&& command_line.rpath == NULL) |
{ |
path = (const char *) getenv ("LD_RUN_PATH"); |
+ if ((path) && (strlen (path) == 0)) |
+ path = NULL; |
if (path |
&& gld${EMULATION_NAME}_search_needed (path, &n, force)) |
break; |
@@ -1751,6 +1753,8 @@ gld${EMULATION_NAME}_before_allocation ( |
rpath = command_line.rpath; |
if (rpath == NULL) |
rpath = (const char *) getenv ("LD_RUN_PATH"); |
+ if ((rpath) && (strlen (rpath) == 0)) |
+ rpath = NULL; |
for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) |
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) |
/branches/18.06.1/toolchain/binutils/patches/2.31.1/400-mips_no_dynamic_linking_sym.patch |
---|
@@ -0,0 +1,18 @@ |
--- a/bfd/elfxx-mips.c |
+++ b/bfd/elfxx-mips.c |
@@ -7888,6 +7888,7 @@ _bfd_mips_elf_create_dynamic_sections (b |
name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING"; |
bh = NULL; |
+ if (0) { |
if (!(_bfd_generic_link_add_one_symbol |
(info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, 0, |
NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh))) |
@@ -7900,6 +7901,7 @@ _bfd_mips_elf_create_dynamic_sections (b |
if (! bfd_elf_link_record_dynamic_symbol (info, h)) |
return FALSE; |
+ } |
if (! mips_elf_hash_table (info)->use_rld_obj_head) |
{ |
/branches/18.06.1/toolchain/binutils/patches/2.31.1/500-Change-default-emulation-for-mips64-linux.patch |
---|
@@ -0,0 +1,37 @@ |
--- a/bfd/config.bfd |
+++ b/bfd/config.bfd |
@@ -913,12 +913,12 @@ case "${targ}" in |
targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec" |
;; |
mips64*el-*-linux*) |
- targ_defvec=mips_elf32_ntrad_le_vec |
- targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec" |
+ targ_defvec=mips_elf64_trad_le_vec |
+ targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec" |
;; |
mips64*-*-linux*) |
- targ_defvec=mips_elf32_ntrad_be_vec |
- targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec" |
+ targ_defvec=mips_elf64_trad_be_vec |
+ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec" |
;; |
mips*el-*-linux*) |
targ_defvec=mips_elf32_trad_le_vec |
--- a/ld/configure.tgt |
+++ b/ld/configure.tgt |
@@ -464,11 +464,11 @@ mips*el-*-vxworks*) targ_emul=elf32elmip |
mips*-*-vxworks*) targ_emul=elf32ebmipvxworks |
targ_extra_emuls="elf32elmipvxworks" ;; |
mips*-*-windiss) targ_emul=elf32mipswindiss ;; |
-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 |
- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" |
+mips64*el-*-linux-*) targ_emul=elf64ltsmip |
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip" |
targ_extra_libpath=$targ_extra_emuls ;; |
-mips64*-*-linux-*) targ_emul=elf32btsmipn32 |
- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" |
+mips64*-*-linux-*) targ_emul=elf64btsmip |
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip" |
targ_extra_libpath=$targ_extra_emuls ;; |
mips*el-*-linux-*) targ_emul=elf32ltsmip |
targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" |
/branches/18.06.1/toolchain/binutils/patches/2.32/300-001_ld_makefile_patch.patch |
---|
@@ -0,0 +1,22 @@ |
--- a/ld/Makefile.am |
+++ b/ld/Makefile.am |
@@ -57,7 +57,7 @@ endif |
# We put the scripts in the directory $(scriptdir)/ldscripts. |
# We can't put the scripts in $(datadir) because the SEARCH_DIR |
# directives need to be different for native and cross linkers. |
-scriptdir = $(tooldir)/lib |
+scriptdir = $(libdir) |
EMUL = @EMUL@ |
EMULATION_OFILES = @EMULATION_OFILES@ |
--- a/ld/Makefile.in |
+++ b/ld/Makefile.in |
@@ -563,7 +563,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) |
# We put the scripts in the directory $(scriptdir)/ldscripts. |
# We can't put the scripts in $(datadir) because the SEARCH_DIR |
# directives need to be different for native and cross linkers. |
-scriptdir = $(tooldir)/lib |
+scriptdir = $(libdir) |
BASEDIR = $(srcdir)/.. |
BFDDIR = $(BASEDIR)/bfd |
INCDIR = $(BASEDIR)/include |
/branches/18.06.1/toolchain/binutils/patches/2.32/300-012_check_ldrunpath_length.patch |
---|
@@ -0,0 +1,20 @@ |
--- a/ld/emultempl/elf32.em |
+++ b/ld/emultempl/elf32.em |
@@ -1471,6 +1471,8 @@ fragment <<EOF |
&& command_line.rpath == NULL) |
{ |
path = (const char *) getenv ("LD_RUN_PATH"); |
+ if ((path) && (strlen (path) == 0)) |
+ path = NULL; |
if (path |
&& gld${EMULATION_NAME}_search_needed (path, &n, force)) |
break; |
@@ -1751,6 +1753,8 @@ gld${EMULATION_NAME}_before_allocation ( |
rpath = command_line.rpath; |
if (rpath == NULL) |
rpath = (const char *) getenv ("LD_RUN_PATH"); |
+ if ((rpath) && (strlen (rpath) == 0)) |
+ rpath = NULL; |
for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) |
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) |
/branches/18.06.1/toolchain/binutils/patches/2.32/400-mips_no_dynamic_linking_sym.patch |
---|
@@ -0,0 +1,18 @@ |
--- a/bfd/elfxx-mips.c |
+++ b/bfd/elfxx-mips.c |
@@ -7888,6 +7888,7 @@ _bfd_mips_elf_create_dynamic_sections (b |
name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING"; |
bh = NULL; |
+ if (0) { |
if (!(_bfd_generic_link_add_one_symbol |
(info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, 0, |
NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh))) |
@@ -7900,6 +7901,7 @@ _bfd_mips_elf_create_dynamic_sections (b |
if (! bfd_elf_link_record_dynamic_symbol (info, h)) |
return FALSE; |
+ } |
if (! mips_elf_hash_table (info)->use_rld_obj_head) |
{ |
/branches/18.06.1/toolchain/binutils/patches/2.32/500-Change-default-emulation-for-mips64-linux.patch |
---|
@@ -0,0 +1,37 @@ |
--- a/bfd/config.bfd |
+++ b/bfd/config.bfd |
@@ -913,12 +913,12 @@ case "${targ}" in |
targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec" |
;; |
mips64*el-*-linux*) |
- targ_defvec=mips_elf32_ntrad_le_vec |
- targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec" |
+ targ_defvec=mips_elf64_trad_le_vec |
+ targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec" |
;; |
mips64*-*-linux*) |
- targ_defvec=mips_elf32_ntrad_be_vec |
- targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec" |
+ targ_defvec=mips_elf64_trad_be_vec |
+ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec" |
;; |
mips*el-*-linux*) |
targ_defvec=mips_elf32_trad_le_vec |
--- a/ld/configure.tgt |
+++ b/ld/configure.tgt |
@@ -464,11 +464,11 @@ mips*el-*-vxworks*) targ_emul=elf32elmip |
mips*-*-vxworks*) targ_emul=elf32ebmipvxworks |
targ_extra_emuls="elf32elmipvxworks" ;; |
mips*-*-windiss) targ_emul=elf32mipswindiss ;; |
-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 |
- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" |
+mips64*el-*-linux-*) targ_emul=elf64ltsmip |
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip" |
targ_extra_libpath=$targ_extra_emuls ;; |
-mips64*-*-linux-*) targ_emul=elf32btsmipn32 |
- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" |
+mips64*-*-linux-*) targ_emul=elf64btsmip |
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip" |
targ_extra_libpath=$targ_extra_emuls ;; |
mips*el-*-linux-*) targ_emul=elf32ltsmip |
targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" |
/branches/18.06.1/toolchain/fortify-headers/Makefile |
---|
@@ -0,0 +1,28 @@ |
# |
# Copyright (C) 2015 OpenWrt.org |
# |
# This is free software, licensed under the GNU General Public License v2. |
# See /LICENSE for more information. |
# |
include $(TOPDIR)/rules.mk |
include $(INCLUDE_DIR)/target.mk |
PKG_NAME:=fortify-headers |
PKG_VERSION:=1.0 |
PKG_RELEASE=1 |
PKG_SOURCE_URL:=http://dl.2f30.org/releases |
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
PKG_HASH:=026e4cc0f2aa69b7922b1bc8838491048b497faf1c8b20450741114f9ea3775b |
include $(INCLUDE_DIR)/toolchain-build.mk |
define Host/Compile |
true |
endef |
define Host/Install |
$(MAKE) -C $(HOST_BUILD_DIR) PREFIX="" DESTDIR="$(TOOLCHAIN_DIR)" install |
endef |
$(eval $(call HostBuild)) |
/branches/18.06.1/toolchain/gcc/Config.in |
---|
@@ -0,0 +1,83 @@ |
# Choose gcc version. |
choice |
prompt "GCC compiler Version" if TOOLCHAINOPTS |
default GCC_USE_VERSION_7_1_ARC if arc |
default GCC_USE_VERSION_7 |
help |
Select the version of gcc you wish to use. |
config GCC_USE_VERSION_7_1_ARC |
select GCC_VERSION_7_1_ARC |
bool "gcc 7.1.x with support of ARC cores" |
depends on arc |
config GCC_USE_VERSION_5 |
bool "gcc 5.x" |
depends on !arc |
config GCC_USE_VERSION_7 |
bool "gcc 7.x" |
depends on !arc |
config GCC_USE_VERSION_8 |
bool "gcc 8.x" |
endchoice |
config GCC_USE_GRAPHITE |
bool |
prompt "Compile in support for the new Graphite framework in GCC 4.4+" if TOOLCHAINOPTS |
config EXTRA_GCC_CONFIG_OPTIONS |
string |
prompt "Additional gcc configure options" if TOOLCHAINOPTS |
default "" |
help |
Any additional gcc options you may want to include.... |
config GCC_DEFAULT_PIE |
bool |
prompt "Build executable with PIE enabled by default" if TOOLCHAINOPTS |
depends on !GCC_USE_VERSION_5 |
default n |
help |
Use gcc configure option --enable-default-pie to turn on -fPIE and -pie by default. |
config GCC_DEFAULT_SSP |
bool |
prompt "Build executable with Stack-Smashing Protection enabled by default" if TOOLCHAINOPTS |
default n |
help |
Use gcc configure option --enable-default-ssp to turn on -fstack-protector-strong by default. |
config GCC_LIBSSP |
bool |
prompt "Build gcc libssp" if TOOLCHAINOPTS |
depends on !USE_MUSL |
default y if !USE_MUSL |
help |
Enable Stack-Smashing Protection support |
config SJLJ_EXCEPTIONS |
bool |
prompt "Use setjump()/longjump() exceptions" if TOOLCHAINOPTS |
default n |
help |
Use old setjump()/longjump() exceptions instead of the newer |
frame unwinding exceptions handling routines. Warning: increases |
code size and runtime memory usage. |
config INSTALL_GFORTRAN |
bool |
prompt "Build/install fortran compiler?" if TOOLCHAINOPTS |
default n |
help |
Build/install GNU fortran compiler ? |
config INSTALL_GCCGO |
bool |
prompt "Build/install Go compiler?" if TOOLCHAINOPTS |
depends on USE_GLIBC || BROKEN |
default n |
help |
Build/install GNU gccgo compiler ? |
/branches/18.06.1/toolchain/gcc/Config.version |
---|
@@ -0,0 +1,23 @@ |
config GCC_VERSION_7_1_ARC |
default y if (!TOOLCHAINOPTS && arc) |
bool |
config GCC_VERSION_5 |
default y if GCC_USE_VERSION_5 |
bool |
config GCC_VERSION_8 |
default y if GCC_USE_VERSION_8 |
bool |
config GCC_USE_EMBEDDED_PATH_REMAP |
default y if GCC_VERSION_8 |
default n |
bool |
config GCC_VERSION |
string |
default "5.5.0" if GCC_VERSION_5 |
default "arc-2017.09-release" if GCC_VERSION_7_1_ARC |
default "8.3.0" if GCC_VERSION_8 |
default "7.4.0" |
/branches/18.06.1/toolchain/gcc/common.mk |
---|
@@ -0,0 +1,232 @@ |
# |
# Copyright (C) 2002-2003 Erik Andersen <andersen@uclibc.org> |
# Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org> |
# Copyright (C) 2005-2006 Felix Fietkau <nbd@nbd.name> |
# Copyright (C) 2006-2014 OpenWrt.org |
# |
# This program 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 2 of the License, or |
# (at your option) any later version. |
# |
# This program 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 this program; if not, write to the Free Software |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
include $(TOPDIR)/rules.mk |
PKG_NAME:=gcc |
GCC_VERSION:=$(call qstrip,$(CONFIG_GCC_VERSION)) |
PKG_VERSION:=$(firstword $(subst +, ,$(GCC_VERSION))) |
GCC_DIR:=$(PKG_NAME)-$(PKG_VERSION) |
PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION) |
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz |
ifeq ($(PKG_VERSION),5.5.0) |
PKG_HASH:=530cea139d82fe542b358961130c69cfde8b3d14556370b65823d2f91f0ced87 |
endif |
ifeq ($(PKG_VERSION),7.4.0) |
PKG_HASH:=eddde28d04f334aec1604456e536416549e9b1aa137fc69204e65eb0c009fe51 |
endif |
ifeq ($(PKG_VERSION),8.3.0) |
PKG_HASH:=64baadfe6cc0f4947a84cb12d7f0dfaf45bb58b7e92461639596c21e02d97d2c |
endif |
ifneq ($(CONFIG_GCC_VERSION_7_1_ARC),) |
PKG_VERSION:=7.1.1 |
PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/gcc/archive/$(GCC_VERSION) |
PKG_SOURCE:=$(PKG_NAME)-$(GCC_VERSION).tar.gz |
PKG_HASH:=90596af8b9c26a434cec0a3b3d37d0c7c755ab6a65496af6ca32529fab5a6cfe |
PKG_REV:=2017.09-release |
GCC_DIR:=gcc-arc-$(PKG_REV) |
HOST_BUILD_DIR = $(BUILD_DIR_HOST)/$(PKG_NAME)-$(GCC_VERSION) |
endif |
PATCH_DIR=../patches/$(GCC_VERSION) |
BUGURL=http://www.lede-project.org/bugs/ |
PKGVERSION=OpenWrt GCC $(PKG_VERSION) $(REVISION) |
HOST_BUILD_PARALLEL:=1 |
include $(INCLUDE_DIR)/toolchain-build.mk |
HOST_SOURCE_DIR:=$(HOST_BUILD_DIR) |
ifeq ($(GCC_VARIANT),minimal) |
GCC_BUILD_DIR:=$(HOST_BUILD_DIR)-$(GCC_VARIANT) |
else |
HOST_BUILD_DIR:=$(HOST_BUILD_DIR)-$(GCC_VARIANT) |
GCC_BUILD_DIR:=$(HOST_BUILD_DIR) |
endif |
HOST_STAMP_PREPARED:=$(HOST_BUILD_DIR)/.prepared |
HOST_STAMP_BUILT:=$(GCC_BUILD_DIR)/.built |
HOST_STAMP_CONFIGURED:=$(GCC_BUILD_DIR)/.configured |
HOST_STAMP_INSTALLED:=$(HOST_BUILD_PREFIX)/stamp/.gcc_$(GCC_VARIANT)_installed |
SEP:=, |
TARGET_LANGUAGES:="c,c++$(if $(CONFIG_INSTALL_GFORTRAN),$(SEP)fortran)$(if $(CONFIG_INSTALL_GCCGO),$(SEP)go)" |
TAR_OPTIONS += \ |
--exclude-from='$(CURDIR)/../exclude-testsuite' --exclude=gcc/ada/*.ad* \ |
--exclude=libjava |
export libgcc_cv_fixed_point=no |
ifdef CONFIG_USE_UCLIBC |
export glibcxx_cv_c99_math_tr1=no |
endif |
ifdef CONFIG_INSTALL_GCCGO |
export libgo_cv_c_split_stack_supported=no |
endif |
ifdef CONFIG_GCC_USE_GRAPHITE |
GRAPHITE_CONFIGURE:= --with-isl=$(TOPDIR)/staging_dir/host |
else |
GRAPHITE_CONFIGURE:= --without-isl --without-cloog |
endif |
GCC_CONFIGURE:= \ |
SHELL="$(BASH)" \ |
$(if $(shell gcc --version 2>&1 | grep LLVM), \ |
CFLAGS="-O2 -fbracket-depth=512 -pipe" \ |
CXXFLAGS="-O2 -fbracket-depth=512 -pipe" \ |
) \ |
$(HOST_SOURCE_DIR)/configure \ |
--with-bugurl=$(BUGURL) \ |
--with-pkgversion="$(PKGVERSION)" \ |
--prefix=$(TOOLCHAIN_DIR) \ |
--build=$(GNU_HOST_NAME) \ |
--host=$(GNU_HOST_NAME) \ |
--target=$(REAL_GNU_TARGET_NAME) \ |
--with-gnu-ld \ |
--enable-target-optspace \ |
--disable-libgomp \ |
--disable-libmudflap \ |
--disable-multilib \ |
--disable-libmpx \ |
--disable-nls \ |
$(GRAPHITE_CONFIGURE) \ |
--with-host-libstdcxx=-lstdc++ \ |
$(SOFT_FLOAT_CONFIG_OPTION) \ |
$(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \ |
$(if $(CONFIG_mips64)$(CONFIG_mips64el),--with-arch=mips64 \ |
--with-abi=$(call qstrip,$(CONFIG_MIPS64_ABI))) \ |
$(if $(CONFIG_arc),--with-cpu=$(CONFIG_CPU_TYPE)) \ |
--with-gmp=$(TOPDIR)/staging_dir/host \ |
--with-mpfr=$(TOPDIR)/staging_dir/host \ |
--with-mpc=$(TOPDIR)/staging_dir/host \ |
--disable-decimal-float \ |
--with-diagnostics-color=auto-if-env |
ifneq ($(CONFIG_mips)$(CONFIG_mipsel),) |
GCC_CONFIGURE += --with-mips-plt |
endif |
ifneq ($(CONFIG_GCC_DEFAULT_PIE),) |
GCC_CONFIGURE+= \ |
--enable-default-pie |
endif |
ifneq ($(CONFIG_GCC_DEFAULT_SSP),) |
GCC_CONFIGURE+= \ |
--enable-default-ssp |
endif |
ifneq ($(CONFIG_GCC_LIBSSP),) |
GCC_CONFIGURE+= \ |
--enable-libssp |
else |
GCC_CONFIGURE+= \ |
--disable-libssp |
endif |
ifneq ($(CONFIG_EXTRA_TARGET_ARCH),) |
GCC_CONFIGURE+= \ |
--enable-biarch \ |
--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX) |
endif |
ifdef CONFIG_sparc |
GCC_CONFIGURE+= \ |
--enable-targets=all \ |
--with-long-double-128 |
endif |
ifeq ($(LIBC),uClibc) |
GCC_CONFIGURE+= \ |
--disable-__cxa_atexit |
else |
GCC_CONFIGURE+= \ |
--enable-__cxa_atexit |
endif |
ifneq ($(GCC_ARCH),) |
GCC_CONFIGURE+= --with-arch=$(GCC_ARCH) |
endif |
ifneq ($(CONFIG_SOFT_FLOAT),y) |
ifeq ($(CONFIG_arm),y) |
GCC_CONFIGURE+= \ |
--with-float=hard |
endif |
endif |
ifeq ($(CONFIG_TARGET_x86)$(CONFIG_USE_GLIBC)$(CONFIG_INSTALL_GCCGO),yyy) |
TARGET_CFLAGS+=-fno-split-stack |
endif |
GCC_MAKE:= \ |
export SHELL="$(BASH)"; \ |
$(MAKE) \ |
CFLAGS="$(HOST_CFLAGS)" \ |
CFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \ |
CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \ |
GOCFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" |
define Host/SetToolchainInfo |
$(SED) 's,TARGET_CROSS=.*,TARGET_CROSS=$(REAL_GNU_TARGET_NAME)-,' $(TOOLCHAIN_DIR)/info.mk |
$(SED) 's,GCC_VERSION=.*,GCC_VERSION=$(GCC_VERSION),' $(TOOLCHAIN_DIR)/info.mk |
endef |
ifneq ($(GCC_PREPARE),) |
define Host/Prepare |
$(call Host/SetToolchainInfo) |
$(call Host/Prepare/Default) |
ln -snf $(GCC_DIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) |
$(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_SOURCE_DIR)/ |
$(SED) 's,^MULTILIB_OSDIRNAMES,# MULTILIB_OSDIRNAMES,' $(HOST_SOURCE_DIR)/gcc/config/*/t-* |
$(SED) 'd' $(HOST_SOURCE_DIR)/gcc/DEV-PHASE |
$(SED) 's, DATESTAMP,,' $(HOST_SOURCE_DIR)/gcc/version.c |
#(cd $(HOST_SOURCE_DIR)/libstdc++-v3; autoconf;); |
$(SED) 's,gcc_no_link=yes,gcc_no_link=no,' $(HOST_SOURCE_DIR)/libstdc++-v3/configure |
mkdir -p $(GCC_BUILD_DIR) |
endef |
else |
define Host/Prepare |
mkdir -p $(GCC_BUILD_DIR) |
endef |
endif |
define Host/Configure |
(cd $(GCC_BUILD_DIR) && rm -f config.cache; \ |
$(GCC_CONFIGURE) \ |
); |
endef |
define Host/Clean |
rm -rf $(if $(GCC_PREPARE),$(HOST_SOURCE_DIR)) \ |
$(HOST_BUILD_PREFIX)/stamp/.gcc_* \ |
$(HOST_BUILD_PREFIX)/stamp/.binutils_* \ |
$(GCC_BUILD_DIR) \ |
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \ |
$(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME) \ |
$(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gc* \ |
$(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-c* |
endef |
/branches/18.06.1/toolchain/gcc/exclude-testsuite |
---|
@@ -0,0 +1,9 @@ |
gcc-*/gcc/testsuite/ada |
gcc-*/gcc/testsuite/brig.dg |
gcc-*/gcc/testsuite/c-c++-common |
gcc-*/gcc/testsuite/ChangeLog* |
gcc-*/gcc/testsuite/config |
gcc-*/gcc/testsuite/g* |
gcc-*/gcc/testsuite/jit.dg |
gcc-*/gcc/testsuite/lib |
gcc-*/gcc/testsuite/o* |
/branches/18.06.1/toolchain/gcc/files/alternate-arch-cc.in |
---|
@@ -0,0 +1,3 @@ |
#!/bin/sh |
exec @CC_BASE@ @EXTRA_ARCH_OPTS@ "$@" |
/branches/18.06.1/toolchain/gcc/final/Makefile |
---|
@@ -0,0 +1,87 @@ |
GCC_VARIANT:=final |
include ../common.mk |
GCC_CONFIGURE += \ |
--with-headers=$(TOOLCHAIN_DIR)/include \ |
--disable-libsanitizer \ |
--enable-languages=$(TARGET_LANGUAGES) \ |
--enable-shared \ |
--enable-threads \ |
--with-slibdir=$(TOOLCHAIN_DIR)/lib \ |
--enable-lto \ |
--with-libelf=$(TOPDIR)/staging_dir/host |
ifdef CONFIG_USE_MUSL |
GCC_MAKE += gcc_cv_libc_provides_ssp=yes |
endif |
ifneq ($(CONFIG_SJLJ_EXCEPTIONS),) |
GCC_CONFIGURE += \ |
--enable-sjlj-exceptions |
endif |
define CleanupToolchain |
$(INSTALL_DIR) $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME) |
# Important! Required for limits.h to be fixed. |
rm -rf $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include |
ln -sf ../include $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include |
rm -rf $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/lib |
ln -sf ../lib $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/lib |
$(if $(CONFIG_ARCH_64BIT),ln -sf ../lib64 $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/lib64) |
endef |
define Host/Configure |
$(CleanupToolchain) |
mkdir -p $(GCC_BUILD_DIR) |
(cd $(GCC_BUILD_DIR) && rm -f config.cache; \ |
$(GCC_CONFIGURE) \ |
); |
endef |
ifeq ($(CONFIG_USE_GLIBC)$(CONFIG_INSTALL_GCCGO),yy) |
define FixGogccCrt |
# link crtX.o for gotools |
mkdir -p $(GCC_BUILD_DIR)/gotools |
$(foreach crt, i 1 n, ln -sf ../../glibc-dev/lib/crt$(crt).o $(GCC_BUILD_DIR)/gotools/ ; ) |
endef |
endif |
define Host/Compile |
$(FixGogccCrt) |
+$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) all |
endef |
define SetupExtraArch |
for app in $(TOOLCHAIN_DIR)/bin/$(OPTIMIZE_FOR_CPU)*-{gcc,gcc-*,g++}; do \ |
[ -e $$$$app ] || continue; \ |
old_base=$$$$(basename $$$$app); \ |
new_base=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-$$$${old_base##$(OPTIMIZE_FOR_CPU)-}; \ |
sed -e "s/@CC_BASE@/$$$$old_base/" \ |
-e 's/@EXTRA_ARCH_OPTS@/$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_OPTS))/' \ |
../files/alternate-arch-cc.in > \ |
$(TOOLCHAIN_DIR)/bin/$$$$new_base; \ |
chmod a+x $(TOOLCHAIN_DIR)/bin/$$$$new_base; \ |
done |
endef |
define Host/Install |
$(CleanupToolchain) |
+$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) install |
# Set up the symlinks to enable lying about target name. |
set -e; \ |
(cd $(TOOLCHAIN_DIR); \ |
ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \ |
cd bin; \ |
for app in $(REAL_GNU_TARGET_NAME)-* ; do \ |
ln -sf $$$${app} \ |
$(GNU_TARGET_NAME)$$$${app##$(REAL_GNU_TARGET_NAME)}; \ |
done; \ |
); |
$(if $(CONFIG_EXTRA_TARGET_ARCH),$(call SetupExtraArch)) |
$(RM) $(TOOLCHAIN_DIR)/lib/libiberty.a |
$(SCRIPT_DIR)/patch-specs.sh "$(TOOLCHAIN_DIR)" |
endef |
$(eval $(call HostBuild)) |
/branches/18.06.1/toolchain/gcc/initial/Makefile |
---|
@@ -0,0 +1,36 @@ |
GCC_VARIANT:=initial |
GCC_PREPARE=$(CONFIG_USE_MUSL) |
include ../common.mk |
GCC_CONFIGURE += \ |
--with-newlib \ |
--with-sysroot=$(TOOLCHAIN_DIR) \ |
--enable-languages=c \ |
--disable-shared \ |
--disable-threads \ |
define Host/Compile |
+$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) \ |
all-build-libiberty \ |
all-gcc \ |
all-target-libgcc |
endef |
define Host/Install |
+$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) \ |
prefix="$(TOOLCHAIN_DIR)/initial" \ |
install-gcc \ |
install-target-libgcc |
# XXX: glibc insists on linking against libgcc_eh |
( cd $(TOOLCHAIN_DIR)/initial/lib/gcc/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) ; \ |
[ -e libgcc_eh.a ] || ln -sf libgcc.a libgcc_eh.a ; \ |
cp libgcc.a libgcc_initial.a; \ |
) |
$(call FixupLibdir,$(TOOLCHAIN_DIR)/initial) |
$$(call file_copy,$(TOOLCHAIN_DIR)/initial/.,$(TOOLCHAIN_DIR)/) |
endef |
$(eval $(call HostBuild)) |
/branches/18.06.1/toolchain/gcc/minimal/Makefile |
---|
@@ -0,0 +1,29 @@ |
GCC_VARIANT:=minimal |
GCC_PREPARE=$(if $(CONFIG_USE_MUSL),,1) |
include ../common.mk |
GCC_CONFIGURE += \ |
--with-newlib \ |
--without-headers \ |
--enable-languages=c \ |
--disable-libsanitizer \ |
--disable-libssp \ |
--disable-shared \ |
--disable-threads |
define Host/Compile |
+$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) all-gcc all-target-libgcc |
endef |
define Host/Install |
$(GCC_MAKE) -C $(GCC_BUILD_DIR) install-gcc install-target-libgcc |
endef |
define Host/Clean |
rm -rf \ |
$(HOST_BUILD_DIR) \ |
$(GCC_BUILD_DIR) |
endef |
$(eval $(call HostBuild)) |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/001-revert_register_mode_search.patch |
---|
@@ -0,0 +1,65 @@ |
Revert of: |
commit 275035b56823b26d5fb7e90fad945b998648edf2 |
Author: bergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4> |
Date: Thu Sep 5 14:09:07 2013 +0000 |
PR target/58139 |
* reginfo.c (choose_hard_reg_mode): Scan through all mode classes |
looking for widest mode. |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4 |
--- a/gcc/reginfo.c |
+++ b/gcc/reginfo.c |
@@ -665,35 +665,40 @@ choose_hard_reg_mode (unsigned int regno |
mode = GET_MODE_WIDER_MODE (mode)) |
if ((unsigned) hard_regno_nregs[regno][mode] == nregs |
&& HARD_REGNO_MODE_OK (regno, mode) |
- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) |
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) |
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) |
found_mode = mode; |
+ if (found_mode != VOIDmode) |
+ return found_mode; |
+ |
for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); |
mode != VOIDmode; |
mode = GET_MODE_WIDER_MODE (mode)) |
if ((unsigned) hard_regno_nregs[regno][mode] == nregs |
&& HARD_REGNO_MODE_OK (regno, mode) |
- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) |
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) |
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) |
found_mode = mode; |
+ if (found_mode != VOIDmode) |
+ return found_mode; |
+ |
for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT); |
mode != VOIDmode; |
mode = GET_MODE_WIDER_MODE (mode)) |
if ((unsigned) hard_regno_nregs[regno][mode] == nregs |
&& HARD_REGNO_MODE_OK (regno, mode) |
- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) |
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) |
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) |
found_mode = mode; |
+ if (found_mode != VOIDmode) |
+ return found_mode; |
+ |
for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT); |
mode != VOIDmode; |
mode = GET_MODE_WIDER_MODE (mode)) |
if ((unsigned) hard_regno_nregs[regno][mode] == nregs |
&& HARD_REGNO_MODE_OK (regno, mode) |
- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) |
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) |
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) |
found_mode = mode; |
if (found_mode != VOIDmode) |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/002-case_insensitive.patch |
---|
@@ -0,0 +1,14 @@ |
--- a/include/filenames.h |
+++ b/include/filenames.h |
@@ -43,11 +43,6 @@ extern "C" { |
# define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) |
# define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) |
#else /* not DOSish */ |
-# if defined(__APPLE__) |
-# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM |
-# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 |
-# endif |
-# endif /* __APPLE__ */ |
# define HAS_DRIVE_SPEC(f) (0) |
# define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) |
# define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f) |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/010-documentation.patch |
---|
@@ -0,0 +1,23 @@ |
--- a/gcc/Makefile.in |
+++ b/gcc/Makefile.in |
@@ -2943,18 +2943,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) |
doc/gccint.info: $(TEXI_GCCINT_FILES) |
doc/cppinternals.info: $(TEXI_CPPINT_FILES) |
-doc/%.info: %.texi |
- if [ x$(BUILD_INFO) = xinfo ]; then \ |
- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ |
- -I $(gcc_docdir)/include -o $@ $<; \ |
- fi |
+doc/%.info: |
# Duplicate entry to handle renaming of gccinstall.info |
-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) |
- if [ x$(BUILD_INFO) = xinfo ]; then \ |
- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ |
- -I $(gcc_docdir)/include -o $@ $<; \ |
- fi |
+doc/gccinstall.info: |
doc/cpp.dvi: $(TEXI_CPP_FILES) |
doc/gcc.dvi: $(TEXI_GCC_FILES) |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/020-no-plt-backport.patch |
---|
@@ -0,0 +1,28 @@ |
--- a/gcc/calls.c |
+++ b/gcc/calls.c |
@@ -225,6 +225,12 @@ prepare_call_address (tree fndecl_or_typ |
&& targetm.small_register_classes_for_mode_p (FUNCTION_MODE)) |
? force_not_mem (memory_address (FUNCTION_MODE, funexp)) |
: memory_address (FUNCTION_MODE, funexp)); |
+ else if (flag_pic && !flag_plt && fndecl_or_type |
+ && TREE_CODE (fndecl_or_type) == FUNCTION_DECL |
+ && !targetm.binds_local_p (fndecl_or_type)) |
+ { |
+ funexp = force_reg (Pmode, funexp); |
+ } |
else if (! sibcallp) |
{ |
#ifndef NO_FUNCTION_CSE |
--- a/gcc/common.opt |
+++ b/gcc/common.opt |
@@ -1779,6 +1779,10 @@ fpie |
Common Report Var(flag_pie,1) Negative(fPIC) |
Generate position-independent code for executables if possible (small mode) |
+fplt |
+Common Report Var(flag_plt) Init(1) |
+Use PLT for PIC calls (-fno-plt: load the address from GOT at call site) |
+ |
fplugin= |
Common Joined RejectNegative Var(common_deferred_options) Defer |
Specify a plugin to load |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/040-fix-mips-ICE-PR-68400.patch |
---|
@@ -0,0 +1,23 @@ |
--- a/gcc/config/mips/mips.c |
+++ b/gcc/config/mips/mips.c |
@@ -8001,9 +8001,17 @@ mask_low_and_shift_p (machine_mode mode, |
bool |
and_operands_ok (machine_mode mode, rtx op1, rtx op2) |
{ |
- return (memory_operand (op1, mode) |
- ? and_load_operand (op2, mode) |
- : and_reg_operand (op2, mode)); |
+ if (!memory_operand (op1, mode)) |
+ return and_reg_operand (op2, mode); |
+ |
+ if (!and_load_operand (op2, mode)) |
+ return false; |
+ |
+ if (!TARGET_MIPS16 || si_mask_operand(op2, mode)) |
+ return true; |
+ |
+ op1 = XEXP (op1, 0); |
+ return !(REG_P (op1) && REGNO (op1) == STACK_POINTER_REGNUM); |
} |
/* The canonical form of a mask-low-and-shift-left operation is |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/050-libitm-Don-t-redefine-__always_inline-in-local_atomi.patch |
---|
@@ -0,0 +1,1092 @@ |
From 55f12fce4ccf77513644a247f9c401a5b1fa2402 Mon Sep 17 00:00:00 2001 |
From: torvald <torvald@138bc75d-0d04-0410-961f-82ee72b054a4> |
Date: Thu, 20 Aug 2015 17:55:24 +0000 |
Subject: [PATCH] libitm: Don't redefine __always_inline in local_atomic. |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227040 138bc75d-0d04-0410-961f-82ee72b054a4 |
--- |
libitm/ChangeLog | 6 + |
libitm/local_atomic | 299 ++++++++++++++++++++++---------------------- |
2 files changed, 155 insertions(+), 150 deletions(-) |
diff --git a/libitm/ChangeLog b/libitm/ChangeLog |
index 569d5bbbf14..6285c85fd44 100644 |
--- a/libitm/ChangeLog |
+++ b/libitm/ChangeLog |
@@ -1,3 +1,9 @@ |
+2015-08-20 Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org> (tiny change) |
+ |
+ PR libitm/61164 |
+ * local_atomic (__always_inline): Rename to... |
+ (__libitm_always_inline): ... this. |
+ |
2017-10-10 Release Manager |
PR target/52482 |
diff --git a/libitm/local_atomic b/libitm/local_atomic |
index 3119be40d09..e536275dc9f 100644 |
--- a/libitm/local_atomic |
+++ b/libitm/local_atomic |
@@ -41,8 +41,7 @@ |
#ifndef _GLIBCXX_ATOMIC |
#define _GLIBCXX_ATOMIC 1 |
-#undef __always_inline |
-#define __always_inline __attribute__((always_inline)) |
+#define __libitm_always_inline __attribute__((always_inline)) |
// #pragma GCC system_header |
@@ -74,7 +73,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
memory_order_seq_cst |
} memory_order; |
- inline __always_inline memory_order |
+ inline __libitm_always_inline memory_order |
__calculate_memory_order(memory_order __m) noexcept |
{ |
const bool __cond1 = __m == memory_order_release; |
@@ -84,13 +83,13 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
return __mo2; |
} |
- inline __always_inline void |
+ inline __libitm_always_inline void |
atomic_thread_fence(memory_order __m) noexcept |
{ |
__atomic_thread_fence (__m); |
} |
- inline __always_inline void |
+ inline __libitm_always_inline void |
atomic_signal_fence(memory_order __m) noexcept |
{ |
__atomic_thread_fence (__m); |
@@ -280,19 +279,19 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
// Conversion to ATOMIC_FLAG_INIT. |
atomic_flag(bool __i) noexcept : __atomic_flag_base({ __i }) { } |
- __always_inline bool |
+ __libitm_always_inline bool |
test_and_set(memory_order __m = memory_order_seq_cst) noexcept |
{ |
return __atomic_test_and_set (&_M_i, __m); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
test_and_set(memory_order __m = memory_order_seq_cst) volatile noexcept |
{ |
return __atomic_test_and_set (&_M_i, __m); |
} |
- __always_inline void |
+ __libitm_always_inline void |
clear(memory_order __m = memory_order_seq_cst) noexcept |
{ |
// __glibcxx_assert(__m != memory_order_consume); |
@@ -302,7 +301,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
__atomic_clear (&_M_i, __m); |
} |
- __always_inline void |
+ __libitm_always_inline void |
clear(memory_order __m = memory_order_seq_cst) volatile noexcept |
{ |
// __glibcxx_assert(__m != memory_order_consume); |
@@ -455,7 +454,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
is_lock_free() const volatile noexcept |
{ return __atomic_is_lock_free (sizeof (_M_i), &_M_i); } |
- __always_inline void |
+ __libitm_always_inline void |
store(__int_type __i, memory_order __m = memory_order_seq_cst) noexcept |
{ |
// __glibcxx_assert(__m != memory_order_acquire); |
@@ -465,7 +464,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
__atomic_store_n(&_M_i, __i, __m); |
} |
- __always_inline void |
+ __libitm_always_inline void |
store(__int_type __i, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ |
@@ -476,7 +475,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
__atomic_store_n(&_M_i, __i, __m); |
} |
- __always_inline __int_type |
+ __libitm_always_inline __int_type |
load(memory_order __m = memory_order_seq_cst) const noexcept |
{ |
// __glibcxx_assert(__m != memory_order_release); |
@@ -485,7 +484,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
return __atomic_load_n(&_M_i, __m); |
} |
- __always_inline __int_type |
+ __libitm_always_inline __int_type |
load(memory_order __m = memory_order_seq_cst) const volatile noexcept |
{ |
// __glibcxx_assert(__m != memory_order_release); |
@@ -494,21 +493,21 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
return __atomic_load_n(&_M_i, __m); |
} |
- __always_inline __int_type |
+ __libitm_always_inline __int_type |
exchange(__int_type __i, |
memory_order __m = memory_order_seq_cst) noexcept |
{ |
return __atomic_exchange_n(&_M_i, __i, __m); |
} |
- __always_inline __int_type |
+ __libitm_always_inline __int_type |
exchange(__int_type __i, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ |
return __atomic_exchange_n(&_M_i, __i, __m); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_weak(__int_type& __i1, __int_type __i2, |
memory_order __m1, memory_order __m2) noexcept |
{ |
@@ -519,7 +518,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 1, __m1, __m2); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_weak(__int_type& __i1, __int_type __i2, |
memory_order __m1, |
memory_order __m2) volatile noexcept |
@@ -531,7 +530,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 1, __m1, __m2); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_weak(__int_type& __i1, __int_type __i2, |
memory_order __m = memory_order_seq_cst) noexcept |
{ |
@@ -539,7 +538,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
__calculate_memory_order(__m)); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_weak(__int_type& __i1, __int_type __i2, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ |
@@ -547,7 +546,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
__calculate_memory_order(__m)); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(__int_type& __i1, __int_type __i2, |
memory_order __m1, memory_order __m2) noexcept |
{ |
@@ -558,7 +557,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(__int_type& __i1, __int_type __i2, |
memory_order __m1, |
memory_order __m2) volatile noexcept |
@@ -570,7 +569,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(__int_type& __i1, __int_type __i2, |
memory_order __m = memory_order_seq_cst) noexcept |
{ |
@@ -578,7 +577,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
__calculate_memory_order(__m)); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(__int_type& __i1, __int_type __i2, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ |
@@ -586,52 +585,52 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
__calculate_memory_order(__m)); |
} |
- __always_inline __int_type |
+ __libitm_always_inline __int_type |
fetch_add(__int_type __i, |
memory_order __m = memory_order_seq_cst) noexcept |
{ return __atomic_fetch_add(&_M_i, __i, __m); } |
- __always_inline __int_type |
+ __libitm_always_inline __int_type |
fetch_add(__int_type __i, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ return __atomic_fetch_add(&_M_i, __i, __m); } |
- __always_inline __int_type |
+ __libitm_always_inline __int_type |
fetch_sub(__int_type __i, |
memory_order __m = memory_order_seq_cst) noexcept |
{ return __atomic_fetch_sub(&_M_i, __i, __m); } |
- __always_inline __int_type |
+ __libitm_always_inline __int_type |
fetch_sub(__int_type __i, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ return __atomic_fetch_sub(&_M_i, __i, __m); } |
- __always_inline __int_type |
+ __libitm_always_inline __int_type |
fetch_and(__int_type __i, |
memory_order __m = memory_order_seq_cst) noexcept |
{ return __atomic_fetch_and(&_M_i, __i, __m); } |
- __always_inline __int_type |
+ __libitm_always_inline __int_type |
fetch_and(__int_type __i, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ return __atomic_fetch_and(&_M_i, __i, __m); } |
- __always_inline __int_type |
+ __libitm_always_inline __int_type |
fetch_or(__int_type __i, |
memory_order __m = memory_order_seq_cst) noexcept |
{ return __atomic_fetch_or(&_M_i, __i, __m); } |
- __always_inline __int_type |
+ __libitm_always_inline __int_type |
fetch_or(__int_type __i, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ return __atomic_fetch_or(&_M_i, __i, __m); } |
- __always_inline __int_type |
+ __libitm_always_inline __int_type |
fetch_xor(__int_type __i, |
memory_order __m = memory_order_seq_cst) noexcept |
{ return __atomic_fetch_xor(&_M_i, __i, __m); } |
- __always_inline __int_type |
+ __libitm_always_inline __int_type |
fetch_xor(__int_type __i, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ return __atomic_fetch_xor(&_M_i, __i, __m); } |
@@ -733,7 +732,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
is_lock_free() const volatile noexcept |
{ return __atomic_is_lock_free (sizeof (_M_p), &_M_p); } |
- __always_inline void |
+ __libitm_always_inline void |
store(__pointer_type __p, |
memory_order __m = memory_order_seq_cst) noexcept |
{ |
@@ -744,7 +743,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
__atomic_store_n(&_M_p, __p, __m); |
} |
- __always_inline void |
+ __libitm_always_inline void |
store(__pointer_type __p, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ |
@@ -755,7 +754,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
__atomic_store_n(&_M_p, __p, __m); |
} |
- __always_inline __pointer_type |
+ __libitm_always_inline __pointer_type |
load(memory_order __m = memory_order_seq_cst) const noexcept |
{ |
// __glibcxx_assert(__m != memory_order_release); |
@@ -764,7 +763,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
return __atomic_load_n(&_M_p, __m); |
} |
- __always_inline __pointer_type |
+ __libitm_always_inline __pointer_type |
load(memory_order __m = memory_order_seq_cst) const volatile noexcept |
{ |
// __glibcxx_assert(__m != memory_order_release); |
@@ -773,21 +772,21 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
return __atomic_load_n(&_M_p, __m); |
} |
- __always_inline __pointer_type |
+ __libitm_always_inline __pointer_type |
exchange(__pointer_type __p, |
memory_order __m = memory_order_seq_cst) noexcept |
{ |
return __atomic_exchange_n(&_M_p, __p, __m); |
} |
- __always_inline __pointer_type |
+ __libitm_always_inline __pointer_type |
exchange(__pointer_type __p, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ |
return __atomic_exchange_n(&_M_p, __p, __m); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2, |
memory_order __m1, |
memory_order __m2) noexcept |
@@ -799,7 +798,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
return __atomic_compare_exchange_n(&_M_p, &__p1, __p2, 0, __m1, __m2); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2, |
memory_order __m1, |
memory_order __m2) volatile noexcept |
@@ -811,22 +810,22 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
return __atomic_compare_exchange_n(&_M_p, &__p1, __p2, 0, __m1, __m2); |
} |
- __always_inline __pointer_type |
+ __libitm_always_inline __pointer_type |
fetch_add(ptrdiff_t __d, |
memory_order __m = memory_order_seq_cst) noexcept |
{ return __atomic_fetch_add(&_M_p, __d, __m); } |
- __always_inline __pointer_type |
+ __libitm_always_inline __pointer_type |
fetch_add(ptrdiff_t __d, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ return __atomic_fetch_add(&_M_p, __d, __m); } |
- __always_inline __pointer_type |
+ __libitm_always_inline __pointer_type |
fetch_sub(ptrdiff_t __d, |
memory_order __m = memory_order_seq_cst) noexcept |
{ return __atomic_fetch_sub(&_M_p, __d, __m); } |
- __always_inline __pointer_type |
+ __libitm_always_inline __pointer_type |
fetch_sub(ptrdiff_t __d, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ return __atomic_fetch_sub(&_M_p, __d, __m); } |
@@ -870,67 +869,67 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
bool |
is_lock_free() const volatile noexcept { return _M_base.is_lock_free(); } |
- __always_inline void |
+ __libitm_always_inline void |
store(bool __i, memory_order __m = memory_order_seq_cst) noexcept |
{ _M_base.store(__i, __m); } |
- __always_inline void |
+ __libitm_always_inline void |
store(bool __i, memory_order __m = memory_order_seq_cst) volatile noexcept |
{ _M_base.store(__i, __m); } |
- __always_inline bool |
+ __libitm_always_inline bool |
load(memory_order __m = memory_order_seq_cst) const noexcept |
{ return _M_base.load(__m); } |
- __always_inline bool |
+ __libitm_always_inline bool |
load(memory_order __m = memory_order_seq_cst) const volatile noexcept |
{ return _M_base.load(__m); } |
- __always_inline bool |
+ __libitm_always_inline bool |
exchange(bool __i, memory_order __m = memory_order_seq_cst) noexcept |
{ return _M_base.exchange(__i, __m); } |
- __always_inline bool |
+ __libitm_always_inline bool |
exchange(bool __i, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ return _M_base.exchange(__i, __m); } |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1, |
memory_order __m2) noexcept |
{ return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); } |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1, |
memory_order __m2) volatile noexcept |
{ return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); } |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_weak(bool& __i1, bool __i2, |
memory_order __m = memory_order_seq_cst) noexcept |
{ return _M_base.compare_exchange_weak(__i1, __i2, __m); } |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_weak(bool& __i1, bool __i2, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ return _M_base.compare_exchange_weak(__i1, __i2, __m); } |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1, |
memory_order __m2) noexcept |
{ return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); } |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1, |
memory_order __m2) volatile noexcept |
{ return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); } |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(bool& __i1, bool __i2, |
memory_order __m = memory_order_seq_cst) noexcept |
{ return _M_base.compare_exchange_strong(__i1, __i2, __m); } |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(bool& __i1, bool __i2, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ return _M_base.compare_exchange_strong(__i1, __i2, __m); } |
@@ -980,11 +979,11 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
store(_Tp __i, memory_order _m = memory_order_seq_cst) noexcept |
{ __atomic_store(&_M_i, &__i, _m); } |
- __always_inline void |
+ __libitm_always_inline void |
store(_Tp __i, memory_order _m = memory_order_seq_cst) volatile noexcept |
{ __atomic_store(&_M_i, &__i, _m); } |
- __always_inline _Tp |
+ __libitm_always_inline _Tp |
load(memory_order _m = memory_order_seq_cst) const noexcept |
{ |
_Tp tmp; |
@@ -992,7 +991,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
return tmp; |
} |
- __always_inline _Tp |
+ __libitm_always_inline _Tp |
load(memory_order _m = memory_order_seq_cst) const volatile noexcept |
{ |
_Tp tmp; |
@@ -1000,7 +999,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
return tmp; |
} |
- __always_inline _Tp |
+ __libitm_always_inline _Tp |
exchange(_Tp __i, memory_order _m = memory_order_seq_cst) noexcept |
{ |
_Tp tmp; |
@@ -1008,7 +1007,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
return tmp; |
} |
- __always_inline _Tp |
+ __libitm_always_inline _Tp |
exchange(_Tp __i, |
memory_order _m = memory_order_seq_cst) volatile noexcept |
{ |
@@ -1017,50 +1016,50 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
return tmp; |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __s, |
memory_order __f) noexcept |
{ |
return __atomic_compare_exchange(&_M_i, &__e, &__i, true, __s, __f); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __s, |
memory_order __f) volatile noexcept |
{ |
return __atomic_compare_exchange(&_M_i, &__e, &__i, true, __s, __f); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_weak(_Tp& __e, _Tp __i, |
memory_order __m = memory_order_seq_cst) noexcept |
{ return compare_exchange_weak(__e, __i, __m, __m); } |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_weak(_Tp& __e, _Tp __i, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ return compare_exchange_weak(__e, __i, __m, __m); } |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __s, |
memory_order __f) noexcept |
{ |
return __atomic_compare_exchange(&_M_i, &__e, &__i, false, __s, __f); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __s, |
memory_order __f) volatile noexcept |
{ |
return __atomic_compare_exchange(&_M_i, &__e, &__i, false, __s, __f); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(_Tp& __e, _Tp __i, |
memory_order __m = memory_order_seq_cst) noexcept |
{ return compare_exchange_strong(__e, __i, __m, __m); } |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(_Tp& __e, _Tp __i, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ return compare_exchange_strong(__e, __i, __m, __m); } |
@@ -1153,46 +1152,46 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
is_lock_free() const volatile noexcept |
{ return _M_b.is_lock_free(); } |
- __always_inline void |
+ __libitm_always_inline void |
store(__pointer_type __p, |
memory_order __m = memory_order_seq_cst) noexcept |
{ return _M_b.store(__p, __m); } |
- __always_inline void |
+ __libitm_always_inline void |
store(__pointer_type __p, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ return _M_b.store(__p, __m); } |
- __always_inline __pointer_type |
+ __libitm_always_inline __pointer_type |
load(memory_order __m = memory_order_seq_cst) const noexcept |
{ return _M_b.load(__m); } |
- __always_inline __pointer_type |
+ __libitm_always_inline __pointer_type |
load(memory_order __m = memory_order_seq_cst) const volatile noexcept |
{ return _M_b.load(__m); } |
- __always_inline __pointer_type |
+ __libitm_always_inline __pointer_type |
exchange(__pointer_type __p, |
memory_order __m = memory_order_seq_cst) noexcept |
{ return _M_b.exchange(__p, __m); } |
- __always_inline __pointer_type |
+ __libitm_always_inline __pointer_type |
exchange(__pointer_type __p, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ return _M_b.exchange(__p, __m); } |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2, |
memory_order __m1, memory_order __m2) noexcept |
{ return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); } |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2, |
memory_order __m1, |
memory_order __m2) volatile noexcept |
{ return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); } |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2, |
memory_order __m = memory_order_seq_cst) noexcept |
{ |
@@ -1200,7 +1199,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
__calculate_memory_order(__m)); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ |
@@ -1208,18 +1207,18 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
__calculate_memory_order(__m)); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2, |
memory_order __m1, memory_order __m2) noexcept |
{ return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); } |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2, |
memory_order __m1, |
memory_order __m2) volatile noexcept |
{ return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); } |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2, |
memory_order __m = memory_order_seq_cst) noexcept |
{ |
@@ -1227,7 +1226,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
__calculate_memory_order(__m)); |
} |
- __always_inline bool |
+ __libitm_always_inline bool |
compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ |
@@ -1235,22 +1234,22 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
__calculate_memory_order(__m)); |
} |
- __always_inline __pointer_type |
+ __libitm_always_inline __pointer_type |
fetch_add(ptrdiff_t __d, |
memory_order __m = memory_order_seq_cst) noexcept |
{ return _M_b.fetch_add(__d, __m); } |
- __always_inline __pointer_type |
+ __libitm_always_inline __pointer_type |
fetch_add(ptrdiff_t __d, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ return _M_b.fetch_add(__d, __m); } |
- __always_inline __pointer_type |
+ __libitm_always_inline __pointer_type |
fetch_sub(ptrdiff_t __d, |
memory_order __m = memory_order_seq_cst) noexcept |
{ return _M_b.fetch_sub(__d, __m); } |
- __always_inline __pointer_type |
+ __libitm_always_inline __pointer_type |
fetch_sub(ptrdiff_t __d, |
memory_order __m = memory_order_seq_cst) volatile noexcept |
{ return _M_b.fetch_sub(__d, __m); } |
@@ -1544,98 +1543,98 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
// Function definitions, atomic_flag operations. |
- inline __always_inline bool |
+ inline __libitm_always_inline bool |
atomic_flag_test_and_set_explicit(atomic_flag* __a, |
memory_order __m) noexcept |
{ return __a->test_and_set(__m); } |
- inline __always_inline bool |
+ inline __libitm_always_inline bool |
atomic_flag_test_and_set_explicit(volatile atomic_flag* __a, |
memory_order __m) noexcept |
{ return __a->test_and_set(__m); } |
- inline __always_inline void |
+ inline __libitm_always_inline void |
atomic_flag_clear_explicit(atomic_flag* __a, memory_order __m) noexcept |
{ __a->clear(__m); } |
- inline __always_inline void |
+ inline __libitm_always_inline void |
atomic_flag_clear_explicit(volatile atomic_flag* __a, |
memory_order __m) noexcept |
{ __a->clear(__m); } |
- inline __always_inline bool |
+ inline __libitm_always_inline bool |
atomic_flag_test_and_set(atomic_flag* __a) noexcept |
{ return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); } |
- inline __always_inline bool |
+ inline __libitm_always_inline bool |
atomic_flag_test_and_set(volatile atomic_flag* __a) noexcept |
{ return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); } |
- inline __always_inline void |
+ inline __libitm_always_inline void |
atomic_flag_clear(atomic_flag* __a) noexcept |
{ atomic_flag_clear_explicit(__a, memory_order_seq_cst); } |
- inline __always_inline void |
+ inline __libitm_always_inline void |
atomic_flag_clear(volatile atomic_flag* __a) noexcept |
{ atomic_flag_clear_explicit(__a, memory_order_seq_cst); } |
// Function templates generally applicable to atomic types. |
template<typename _ITp> |
- __always_inline bool |
+ __libitm_always_inline bool |
atomic_is_lock_free(const atomic<_ITp>* __a) noexcept |
{ return __a->is_lock_free(); } |
template<typename _ITp> |
- __always_inline bool |
+ __libitm_always_inline bool |
atomic_is_lock_free(const volatile atomic<_ITp>* __a) noexcept |
{ return __a->is_lock_free(); } |
template<typename _ITp> |
- __always_inline void |
+ __libitm_always_inline void |
atomic_init(atomic<_ITp>* __a, _ITp __i) noexcept; |
template<typename _ITp> |
- __always_inline void |
+ __libitm_always_inline void |
atomic_init(volatile atomic<_ITp>* __a, _ITp __i) noexcept; |
template<typename _ITp> |
- __always_inline void |
+ __libitm_always_inline void |
atomic_store_explicit(atomic<_ITp>* __a, _ITp __i, |
memory_order __m) noexcept |
{ __a->store(__i, __m); } |
template<typename _ITp> |
- __always_inline void |
+ __libitm_always_inline void |
atomic_store_explicit(volatile atomic<_ITp>* __a, _ITp __i, |
memory_order __m) noexcept |
{ __a->store(__i, __m); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_load_explicit(const atomic<_ITp>* __a, memory_order __m) noexcept |
{ return __a->load(__m); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_load_explicit(const volatile atomic<_ITp>* __a, |
memory_order __m) noexcept |
{ return __a->load(__m); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_exchange_explicit(atomic<_ITp>* __a, _ITp __i, |
memory_order __m) noexcept |
{ return __a->exchange(__i, __m); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_exchange_explicit(volatile atomic<_ITp>* __a, _ITp __i, |
memory_order __m) noexcept |
{ return __a->exchange(__i, __m); } |
template<typename _ITp> |
- __always_inline bool |
+ __libitm_always_inline bool |
atomic_compare_exchange_weak_explicit(atomic<_ITp>* __a, |
_ITp* __i1, _ITp __i2, |
memory_order __m1, |
@@ -1643,7 +1642,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
{ return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); } |
template<typename _ITp> |
- __always_inline bool |
+ __libitm_always_inline bool |
atomic_compare_exchange_weak_explicit(volatile atomic<_ITp>* __a, |
_ITp* __i1, _ITp __i2, |
memory_order __m1, |
@@ -1651,7 +1650,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
{ return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); } |
template<typename _ITp> |
- __always_inline bool |
+ __libitm_always_inline bool |
atomic_compare_exchange_strong_explicit(atomic<_ITp>* __a, |
_ITp* __i1, _ITp __i2, |
memory_order __m1, |
@@ -1659,7 +1658,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
{ return __a->compare_exchange_strong(*__i1, __i2, __m1, __m2); } |
template<typename _ITp> |
- __always_inline bool |
+ __libitm_always_inline bool |
atomic_compare_exchange_strong_explicit(volatile atomic<_ITp>* __a, |
_ITp* __i1, _ITp __i2, |
memory_order __m1, |
@@ -1668,37 +1667,37 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
template<typename _ITp> |
- __always_inline void |
+ __libitm_always_inline void |
atomic_store(atomic<_ITp>* __a, _ITp __i) noexcept |
{ atomic_store_explicit(__a, __i, memory_order_seq_cst); } |
template<typename _ITp> |
- __always_inline void |
+ __libitm_always_inline void |
atomic_store(volatile atomic<_ITp>* __a, _ITp __i) noexcept |
{ atomic_store_explicit(__a, __i, memory_order_seq_cst); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_load(const atomic<_ITp>* __a) noexcept |
{ return atomic_load_explicit(__a, memory_order_seq_cst); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_load(const volatile atomic<_ITp>* __a) noexcept |
{ return atomic_load_explicit(__a, memory_order_seq_cst); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_exchange(atomic<_ITp>* __a, _ITp __i) noexcept |
{ return atomic_exchange_explicit(__a, __i, memory_order_seq_cst); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_exchange(volatile atomic<_ITp>* __a, _ITp __i) noexcept |
{ return atomic_exchange_explicit(__a, __i, memory_order_seq_cst); } |
template<typename _ITp> |
- __always_inline bool |
+ __libitm_always_inline bool |
atomic_compare_exchange_weak(atomic<_ITp>* __a, |
_ITp* __i1, _ITp __i2) noexcept |
{ |
@@ -1708,7 +1707,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
} |
template<typename _ITp> |
- __always_inline bool |
+ __libitm_always_inline bool |
atomic_compare_exchange_weak(volatile atomic<_ITp>* __a, |
_ITp* __i1, _ITp __i2) noexcept |
{ |
@@ -1718,7 +1717,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
} |
template<typename _ITp> |
- __always_inline bool |
+ __libitm_always_inline bool |
atomic_compare_exchange_strong(atomic<_ITp>* __a, |
_ITp* __i1, _ITp __i2) noexcept |
{ |
@@ -1728,7 +1727,7 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
} |
template<typename _ITp> |
- __always_inline bool |
+ __libitm_always_inline bool |
atomic_compare_exchange_strong(volatile atomic<_ITp>* __a, |
_ITp* __i1, _ITp __i2) noexcept |
{ |
@@ -1742,158 +1741,158 @@ namespace std // _GLIBCXX_VISIBILITY(default) |
// intergral types as specified in the standard, excluding address |
// types. |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_add_explicit(__atomic_base<_ITp>* __a, _ITp __i, |
memory_order __m) noexcept |
{ return __a->fetch_add(__i, __m); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_add_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i, |
memory_order __m) noexcept |
{ return __a->fetch_add(__i, __m); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_sub_explicit(__atomic_base<_ITp>* __a, _ITp __i, |
memory_order __m) noexcept |
{ return __a->fetch_sub(__i, __m); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_sub_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i, |
memory_order __m) noexcept |
{ return __a->fetch_sub(__i, __m); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_and_explicit(__atomic_base<_ITp>* __a, _ITp __i, |
memory_order __m) noexcept |
{ return __a->fetch_and(__i, __m); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_and_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i, |
memory_order __m) noexcept |
{ return __a->fetch_and(__i, __m); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_or_explicit(__atomic_base<_ITp>* __a, _ITp __i, |
memory_order __m) noexcept |
{ return __a->fetch_or(__i, __m); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_or_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i, |
memory_order __m) noexcept |
{ return __a->fetch_or(__i, __m); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_xor_explicit(__atomic_base<_ITp>* __a, _ITp __i, |
memory_order __m) noexcept |
{ return __a->fetch_xor(__i, __m); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_xor_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i, |
memory_order __m) noexcept |
{ return __a->fetch_xor(__i, __m); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_add(__atomic_base<_ITp>* __a, _ITp __i) noexcept |
{ return atomic_fetch_add_explicit(__a, __i, memory_order_seq_cst); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_add(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept |
{ return atomic_fetch_add_explicit(__a, __i, memory_order_seq_cst); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_sub(__atomic_base<_ITp>* __a, _ITp __i) noexcept |
{ return atomic_fetch_sub_explicit(__a, __i, memory_order_seq_cst); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_sub(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept |
{ return atomic_fetch_sub_explicit(__a, __i, memory_order_seq_cst); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_and(__atomic_base<_ITp>* __a, _ITp __i) noexcept |
{ return atomic_fetch_and_explicit(__a, __i, memory_order_seq_cst); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_and(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept |
{ return atomic_fetch_and_explicit(__a, __i, memory_order_seq_cst); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_or(__atomic_base<_ITp>* __a, _ITp __i) noexcept |
{ return atomic_fetch_or_explicit(__a, __i, memory_order_seq_cst); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_or(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept |
{ return atomic_fetch_or_explicit(__a, __i, memory_order_seq_cst); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_xor(__atomic_base<_ITp>* __a, _ITp __i) noexcept |
{ return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); } |
template<typename _ITp> |
- __always_inline _ITp |
+ __libitm_always_inline _ITp |
atomic_fetch_xor(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept |
{ return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); } |
// Partial specializations for pointers. |
template<typename _ITp> |
- __always_inline _ITp* |
+ __libitm_always_inline _ITp* |
atomic_fetch_add_explicit(atomic<_ITp*>* __a, ptrdiff_t __d, |
memory_order __m) noexcept |
{ return __a->fetch_add(__d, __m); } |
template<typename _ITp> |
- __always_inline _ITp* |
+ __libitm_always_inline _ITp* |
atomic_fetch_add_explicit(volatile atomic<_ITp*>* __a, ptrdiff_t __d, |
memory_order __m) noexcept |
{ return __a->fetch_add(__d, __m); } |
template<typename _ITp> |
- __always_inline _ITp* |
+ __libitm_always_inline _ITp* |
atomic_fetch_add(volatile atomic<_ITp*>* __a, ptrdiff_t __d) noexcept |
{ return __a->fetch_add(__d); } |
template<typename _ITp> |
- __always_inline _ITp* |
+ __libitm_always_inline _ITp* |
atomic_fetch_add(atomic<_ITp*>* __a, ptrdiff_t __d) noexcept |
{ return __a->fetch_add(__d); } |
template<typename _ITp> |
- __always_inline _ITp* |
+ __libitm_always_inline _ITp* |
atomic_fetch_sub_explicit(volatile atomic<_ITp*>* __a, |
ptrdiff_t __d, memory_order __m) noexcept |
{ return __a->fetch_sub(__d, __m); } |
template<typename _ITp> |
- __always_inline _ITp* |
+ __libitm_always_inline _ITp* |
atomic_fetch_sub_explicit(atomic<_ITp*>* __a, ptrdiff_t __d, |
memory_order __m) noexcept |
{ return __a->fetch_sub(__d, __m); } |
template<typename _ITp> |
- __always_inline _ITp* |
+ __libitm_always_inline _ITp* |
atomic_fetch_sub(volatile atomic<_ITp*>* __a, ptrdiff_t __d) noexcept |
{ return __a->fetch_sub(__d); } |
template<typename _ITp> |
- __always_inline _ITp* |
+ __libitm_always_inline _ITp* |
atomic_fetch_sub(atomic<_ITp*>* __a, ptrdiff_t __d) noexcept |
{ return __a->fetch_sub(__d); } |
// @} group atomics |
-- |
2.19.2 |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/200-musl_config.patch |
---|
@@ -0,0 +1,309 @@ |
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> |
Date: Fri, 8 May 2015 08:25:47 +0000 (+0000) |
Subject: [PATCH 2/13] musl libc config |
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=a9173ceabaf29c16f8ef226fbf98af373a4b2ceb |
[PATCH 2/13] musl libc config |
2015-05-08 Gregor Richards <gregor.richards@uwaterloo.ca> |
Szabolcs Nagy <szabolcs.nagy@arm.com> |
* config.gcc (LIBC_MUSL): New tm_defines macro. |
* config/linux.h (OPTION_MUSL): Define. |
(MUSL_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER32,) |
(MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERX32,) |
(INCLUDE_DEFAULTS_MUSL_GPP, INCLUDE_DEFAULTS_MUSL_LOCAL,) |
(INCLUDE_DEFAULTS_MUSL_PREFIX, INCLUDE_DEFAULTS_MUSL_CROSS,) |
(INCLUDE_DEFAULTS_MUSL_TOOL, INCLUDE_DEFAULTS_MUSL_NATIVE): Define. |
* config/linux.opt (mmusl): New option. |
* doc/invoke.texi (GNU/Linux Options): Document -mmusl. |
* configure.ac (gcc_cv_libc_provides_ssp): Add *-*-musl*. |
(gcc_cv_target_dl_iterate_phdr): Add *-linux-musl*. |
* configure: Regenerate. |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222904 138bc75d-0d04-0410-961f-82ee72b054a4 |
--- |
--- a/gcc/config.gcc |
+++ b/gcc/config.gcc |
@@ -575,7 +575,7 @@ case ${target} in |
esac |
# Common C libraries. |
-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3" |
+tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" |
# 32-bit x86 processors supported by --with-arch=. Each processor |
# MUST be separated by exactly one space. |
@@ -720,6 +720,9 @@ case ${target} in |
*-*-*uclibc*) |
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" |
;; |
+ *-*-*musl*) |
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL" |
+ ;; |
*) |
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" |
;; |
--- a/gcc/config/linux.h |
+++ b/gcc/config/linux.h |
@@ -32,10 +32,12 @@ see the files COPYING3 and COPYING.RUNTI |
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) |
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) |
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) |
+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) |
#else |
#define OPTION_GLIBC (linux_libc == LIBC_GLIBC) |
#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) |
#define OPTION_BIONIC (linux_libc == LIBC_BIONIC) |
+#define OPTION_MUSL (linux_libc == LIBC_MUSL) |
#endif |
#define GNU_USER_TARGET_OS_CPP_BUILTINS() \ |
@@ -50,21 +52,25 @@ see the files COPYING3 and COPYING.RUNTI |
} while (0) |
/* Determine which dynamic linker to use depending on whether GLIBC or |
- uClibc or Bionic is the default C library and whether |
- -muclibc or -mglibc or -mbionic has been passed to change the default. */ |
+ uClibc or Bionic or musl is the default C library and whether |
+ -muclibc or -mglibc or -mbionic or -mmusl has been passed to change |
+ the default. */ |
-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \ |
- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}" |
+#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \ |
+ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}" |
#if DEFAULT_LIBC == LIBC_GLIBC |
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ |
- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B) |
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ |
+ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M) |
#elif DEFAULT_LIBC == LIBC_UCLIBC |
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ |
- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B) |
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ |
+ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M) |
#elif DEFAULT_LIBC == LIBC_BIONIC |
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ |
- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U) |
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ |
+ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M) |
+#elif DEFAULT_LIBC == LIBC_MUSL |
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ |
+ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B) |
#else |
#error "Unsupported DEFAULT_LIBC" |
#endif /* DEFAULT_LIBC */ |
@@ -81,24 +87,100 @@ see the files COPYING3 and COPYING.RUNTI |
#define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker" |
#define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64" |
#define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32" |
+/* Should be redefined for each target that supports musl. */ |
+#define MUSL_DYNAMIC_LINKER "/dev/null" |
+#define MUSL_DYNAMIC_LINKER32 "/dev/null" |
+#define MUSL_DYNAMIC_LINKER64 "/dev/null" |
+#define MUSL_DYNAMIC_LINKERX32 "/dev/null" |
#define GNU_USER_DYNAMIC_LINKER \ |
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \ |
- BIONIC_DYNAMIC_LINKER) |
+ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) |
#define GNU_USER_DYNAMIC_LINKER32 \ |
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \ |
- BIONIC_DYNAMIC_LINKER32) |
+ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) |
#define GNU_USER_DYNAMIC_LINKER64 \ |
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \ |
- BIONIC_DYNAMIC_LINKER64) |
+ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) |
#define GNU_USER_DYNAMIC_LINKERX32 \ |
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \ |
- BIONIC_DYNAMIC_LINKERX32) |
+ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32) |
/* Whether we have Bionic libc runtime */ |
#undef TARGET_HAS_BIONIC |
#define TARGET_HAS_BIONIC (OPTION_BIONIC) |
+/* musl avoids problematic includes by rearranging the include directories. |
+ * Unfortunately, this is mostly duplicated from cppdefault.c */ |
+#if DEFAULT_LIBC == LIBC_MUSL |
+#define INCLUDE_DEFAULTS_MUSL_GPP \ |
+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \ |
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \ |
+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \ |
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \ |
+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \ |
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, |
+ |
+#ifdef LOCAL_INCLUDE_DIR |
+#define INCLUDE_DEFAULTS_MUSL_LOCAL \ |
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \ |
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, |
+#else |
+#define INCLUDE_DEFAULTS_MUSL_LOCAL |
+#endif |
+ |
+#ifdef PREFIX_INCLUDE_DIR |
+#define INCLUDE_DEFAULTS_MUSL_PREFIX \ |
+ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0}, |
+#else |
+#define INCLUDE_DEFAULTS_MUSL_PREFIX |
+#endif |
+ |
+#ifdef CROSS_INCLUDE_DIR |
+#define INCLUDE_DEFAULTS_MUSL_CROSS \ |
+ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0}, |
+#else |
+#define INCLUDE_DEFAULTS_MUSL_CROSS |
+#endif |
+ |
+#ifdef TOOL_INCLUDE_DIR |
+#define INCLUDE_DEFAULTS_MUSL_TOOL \ |
+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0}, |
+#else |
+#define INCLUDE_DEFAULTS_MUSL_TOOL |
+#endif |
+ |
+#ifdef NATIVE_SYSTEM_HEADER_DIR |
+#define INCLUDE_DEFAULTS_MUSL_NATIVE \ |
+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ |
+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, |
+#else |
+#define INCLUDE_DEFAULTS_MUSL_NATIVE |
+#endif |
+ |
+#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT) |
+# undef INCLUDE_DEFAULTS_MUSL_LOCAL |
+# define INCLUDE_DEFAULTS_MUSL_LOCAL |
+# undef INCLUDE_DEFAULTS_MUSL_NATIVE |
+# define INCLUDE_DEFAULTS_MUSL_NATIVE |
+#else |
+# undef INCLUDE_DEFAULTS_MUSL_CROSS |
+# define INCLUDE_DEFAULTS_MUSL_CROSS |
+#endif |
+ |
+#undef INCLUDE_DEFAULTS |
+#define INCLUDE_DEFAULTS \ |
+ { \ |
+ INCLUDE_DEFAULTS_MUSL_GPP \ |
+ INCLUDE_DEFAULTS_MUSL_PREFIX \ |
+ INCLUDE_DEFAULTS_MUSL_CROSS \ |
+ INCLUDE_DEFAULTS_MUSL_TOOL \ |
+ INCLUDE_DEFAULTS_MUSL_NATIVE \ |
+ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ |
+ { 0, 0, 0, 0, 0, 0 } \ |
+ } |
+#endif |
+ |
#if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */ |
/* This is a *uclinux* target. We don't define below macros to normal linux |
versions, because doing so would require *uclinux* targets to include |
--- a/gcc/config/linux.opt |
+++ b/gcc/config/linux.opt |
@@ -28,5 +28,9 @@ Target Report RejectNegative Var(linux_l |
Use GNU C library |
muclibc |
-Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic) |
+Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mmusl) |
Use uClibc C library |
+ |
+mmusl |
+Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mbionic) |
+Use musl C library |
--- a/gcc/configure |
+++ b/gcc/configure |
@@ -27833,6 +27833,9 @@ if test "${gcc_cv_libc_provides_ssp+set} |
else |
gcc_cv_libc_provides_ssp=no |
case "$target" in |
+ *-*-musl*) |
+ # All versions of musl provide stack protector |
+ gcc_cv_libc_provides_ssp=yes;; |
*-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) |
# glibc 2.4 and later provides __stack_chk_fail and |
# either __stack_chk_guard, or TLS access to stack guard canary. |
@@ -27865,6 +27868,7 @@ fi |
# <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now |
# simply assert that glibc does provide this, which is true for all |
# realistically usable GNU/Hurd configurations. |
+ # All supported versions of musl provide it as well |
gcc_cv_libc_provides_ssp=yes;; |
*-*-darwin* | *-*-freebsd*) |
ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail" |
@@ -27961,6 +27965,9 @@ case "$target" in |
gcc_cv_target_dl_iterate_phdr=no |
fi |
;; |
+ *-linux-musl*) |
+ gcc_cv_target_dl_iterate_phdr=yes |
+ ;; |
esac |
if test x$gcc_cv_target_dl_iterate_phdr = xyes; then |
--- a/gcc/configure.ac |
+++ b/gcc/configure.ac |
@@ -5287,6 +5287,9 @@ AC_CACHE_CHECK(__stack_chk_fail in targe |
gcc_cv_libc_provides_ssp, |
[gcc_cv_libc_provides_ssp=no |
case "$target" in |
+ *-*-musl*) |
+ # All versions of musl provide stack protector |
+ gcc_cv_libc_provides_ssp=yes;; |
*-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) |
# glibc 2.4 and later provides __stack_chk_fail and |
# either __stack_chk_guard, or TLS access to stack guard canary. |
@@ -5313,6 +5316,7 @@ AC_CACHE_CHECK(__stack_chk_fail in targe |
# <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now |
# simply assert that glibc does provide this, which is true for all |
# realistically usable GNU/Hurd configurations. |
+ # All supported versions of musl provide it as well |
gcc_cv_libc_provides_ssp=yes;; |
*-*-darwin* | *-*-freebsd*) |
AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes], |
@@ -5386,6 +5390,9 @@ case "$target" in |
gcc_cv_target_dl_iterate_phdr=no |
fi |
;; |
+ *-linux-musl*) |
+ gcc_cv_target_dl_iterate_phdr=yes |
+ ;; |
esac |
GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR]) |
if test x$gcc_cv_target_dl_iterate_phdr = xyes; then |
--- a/gcc/doc/invoke.texi |
+++ b/gcc/doc/invoke.texi |
@@ -668,7 +668,7 @@ Objective-C and Objective-C++ Dialects}. |
-mcpu=@var{cpu}} |
@emph{GNU/Linux Options} |
-@gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol |
+@gccoptlist{-mglibc -muclibc -mmusl -mbionic -mandroid @gol |
-tno-android-cc -tno-android-ld} |
@emph{H8/300 Options} |
@@ -15351,13 +15351,19 @@ These @samp{-m} options are defined for |
@item -mglibc |
@opindex mglibc |
Use the GNU C library. This is the default except |
-on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets. |
+on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and |
+@samp{*-*-linux-*android*} targets. |
@item -muclibc |
@opindex muclibc |
Use uClibc C library. This is the default on |
@samp{*-*-linux-*uclibc*} targets. |
+@item -mmusl |
+@opindex mmusl |
+Use the musl C library. This is the default on |
+@samp{*-*-linux-*musl*} targets. |
+ |
@item -mbionic |
@opindex mbionic |
Use Bionic C library. This is the default on |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/201-musl_arm.patch |
---|
@@ -0,0 +1,43 @@ |
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> |
Date: Wed, 27 May 2015 13:17:11 +0000 (+0000) |
Subject: [PATCH 4/13] arm musl support |
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=de799bd087ab9a179768fea75bd195a31d3432a4 |
[PATCH 4/13] arm musl support |
On behalf of szabolcs.nagy@arm.com |
2015-05-27 Gregor Richards <gregor.richards@uwaterloo.ca> |
* config/arm/linux-eabi.h (MUSL_DYNAMIC_LINKER): Define. |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223749 138bc75d-0d04-0410-961f-82ee72b054a4 |
--- |
--- a/gcc/config/arm/linux-eabi.h |
+++ b/gcc/config/arm/linux-eabi.h |
@@ -77,6 +77,23 @@ |
%{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ |
%{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" |
+/* For ARM musl currently supports four dynamic linkers: |
+ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI |
+ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI |
+ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB |
+ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB |
+ musl does not support the legacy OABI mode. |
+ All the dynamic linkers live in /lib. |
+ We default to soft-float, EL. */ |
+#undef MUSL_DYNAMIC_LINKER |
+#if TARGET_BIG_ENDIAN_DEFAULT |
+#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}" |
+#else |
+#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}" |
+#endif |
+#define MUSL_DYNAMIC_LINKER \ |
+ "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" |
+ |
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to |
use the GNU/Linux version, not the generic BPABI version. */ |
#undef LINK_SPEC |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/202-musl_mips.patch |
---|
@@ -0,0 +1,35 @@ |
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> |
Date: Fri, 8 May 2015 15:16:50 +0000 (+0000) |
Subject: [PATCH 6/13] mips musl support |
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=2550b6a866c887472b587bef87d433c51cf1ebc8 |
[PATCH 6/13] mips musl support |
2015-05-08 Gregor Richards <gregor.richards@uwaterloo.ca> |
Szabolcs Nagy <szabolcs.nagy@arm.com> |
* config/mips/linux.h (MUSL_DYNAMIC_LINKER32): Define. |
(MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERN32): Define. |
(GNU_USER_DYNAMIC_LINKERN32): Update. |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222915 138bc75d-0d04-0410-961f-82ee72b054a4 |
--- |
--- a/gcc/config/mips/linux.h |
+++ b/gcc/config/mips/linux.h |
@@ -37,7 +37,13 @@ along with GCC; see the file COPYING3. |
#define UCLIBC_DYNAMIC_LINKERN32 \ |
"%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}" |
+#undef MUSL_DYNAMIC_LINKER32 |
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips%{EL:el}%{msoft-float:-sf}.so.1" |
+#undef MUSL_DYNAMIC_LINKER64 |
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips64%{EL:el}%{msoft-float:-sf}.so.1" |
+#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mipsn32%{EL:el}%{msoft-float:-sf}.so.1" |
+ |
#define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" |
#define GNU_USER_DYNAMIC_LINKERN32 \ |
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \ |
- BIONIC_DYNAMIC_LINKERN32) |
+ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32) |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/203-musl_powerpc.patch |
---|
@@ -0,0 +1,209 @@ |
gcc/Changelog: |
2015-04-24 Gregor Richards <gregor.richards@uwaterloo.ca> |
Szabolcs Nagy <szabolcs.nagy@arm.com> |
* config.gcc (secure_plt): Add *-linux*-musl*. |
* config/rs6000/linux64.h (MUSL_DYNAMIC_LINKER32): Define. |
(MUSL_DYNAMIC_LINKER64): Define. |
(GNU_USER_DYNAMIC_LINKER32): Update. |
(GNU_USER_DYNAMIC_LINKER64): Update. |
(CHOOSE_DYNAMIC_LINKER): Update. |
* config/rs6000/secureplt.h (LINK_SECURE_PLT_DEFAULT_SPEC): Define. |
* config/rs6000/sysv4.h (GNU_USER_DYNAMIC_LINKER): Update. |
(MUSL_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER_E,) |
(INCLUDE_DEFAULTS_MUSL_GPP, INCLUDE_DEFAULTS_MUSL_LOCAL,) |
(INCLUDE_DEFAULTS_MUSL_PREFIX, INCLUDE_DEFAULTS_MUSL_CROSS,) |
(INCLUDE_DEFAULTS_MUSL_TOOL, INCLUDE_DEFAULTS_MUSL_NATIVE): Define. |
(LINK_SECURE_PLT_DEFAULT_SPEC): Define. |
(CHOOSE_DYNAMIC_LINKER, LINK_TARGET_SPEC, LINK_OS_LINUX_SPEC): Update. |
* config/rs6000/sysv4le.h (MUSL_DYNAMIC_LINKER_E): Define. |
--- a/gcc/config/rs6000/linux64.h |
+++ b/gcc/config/rs6000/linux64.h |
@@ -365,17 +365,21 @@ extern int dot_symbols; |
#endif |
#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" |
#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" |
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E ".so.1" |
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E ".so.1" |
#if DEFAULT_LIBC == LIBC_UCLIBC |
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" |
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" |
#elif DEFAULT_LIBC == LIBC_GLIBC |
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" |
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" |
+#elif DEFAULT_LIBC == LIBC_MUSL |
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" |
#else |
#error "Unsupported DEFAULT_LIBC" |
#endif |
#define GNU_USER_DYNAMIC_LINKER32 \ |
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) |
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) |
#define GNU_USER_DYNAMIC_LINKER64 \ |
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64) |
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) |
#undef DEFAULT_ASM_ENDIAN |
#if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN) |
--- a/gcc/config/rs6000/secureplt.h |
+++ b/gcc/config/rs6000/secureplt.h |
@@ -18,3 +18,4 @@ along with GCC; see the file COPYING3. |
<http://www.gnu.org/licenses/>. */ |
#define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt" |
+#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt" |
--- a/gcc/config/rs6000/sysv4.h |
+++ b/gcc/config/rs6000/sysv4.h |
@@ -537,6 +537,9 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF |
#ifndef CC1_SECURE_PLT_DEFAULT_SPEC |
#define CC1_SECURE_PLT_DEFAULT_SPEC "" |
#endif |
+#ifndef LINK_SECURE_PLT_DEFAULT_SPEC |
+#define LINK_SECURE_PLT_DEFAULT_SPEC "" |
+#endif |
/* Pass -G xxx to the compiler. */ |
#undef CC1_SPEC |
@@ -574,7 +577,8 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF |
%{R*} \ |
%(link_shlib) \ |
%{!T*: %(link_start) } \ |
-%(link_os)" |
+%(link_os)" \ |
+"%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}" |
/* Shared libraries are not default. */ |
#define LINK_SHLIB_SPEC "\ |
@@ -757,17 +761,22 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF |
#define LINK_START_LINUX_SPEC "" |
+#define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","") |
+ |
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" |
#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" |
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E ".so.1" |
#if DEFAULT_LIBC == LIBC_UCLIBC |
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" |
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" |
+#elif DEFAULT_LIBC == LIBC_MUSL |
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" |
#elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC |
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" |
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" |
#else |
#error "Unsupported DEFAULT_LIBC" |
#endif |
#define GNU_USER_DYNAMIC_LINKER \ |
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) |
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) |
#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ |
%{rdynamic:-export-dynamic} \ |
@@ -889,6 +898,7 @@ ncrtn.o%s" |
{ "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \ |
{ "link_os_default", LINK_OS_DEFAULT_SPEC }, \ |
{ "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \ |
+ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \ |
{ "cpp_os_ads", CPP_OS_ADS_SPEC }, \ |
{ "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \ |
{ "cpp_os_mvme", CPP_OS_MVME_SPEC }, \ |
@@ -943,3 +953,72 @@ ncrtn.o%s" |
/* This target uses the sysv4.opt file. */ |
#define TARGET_USES_SYSV4_OPT 1 |
+/* Include order changes for musl, same as in generic linux.h. */ |
+#if DEFAULT_LIBC == LIBC_MUSL |
+#define INCLUDE_DEFAULTS_MUSL_GPP \ |
+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \ |
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \ |
+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \ |
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \ |
+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \ |
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, |
+ |
+#ifdef LOCAL_INCLUDE_DIR |
+#define INCLUDE_DEFAULTS_MUSL_LOCAL \ |
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \ |
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, |
+#else |
+#define INCLUDE_DEFAULTS_MUSL_LOCAL |
+#endif |
+ |
+#ifdef PREFIX_INCLUDE_DIR |
+#define INCLUDE_DEFAULTS_MUSL_PREFIX \ |
+ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0}, |
+#else |
+#define INCLUDE_DEFAULTS_MUSL_PREFIX |
+#endif |
+ |
+#ifdef CROSS_INCLUDE_DIR |
+#define INCLUDE_DEFAULTS_MUSL_CROSS \ |
+ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0}, |
+#else |
+#define INCLUDE_DEFAULTS_MUSL_CROSS |
+#endif |
+ |
+#ifdef TOOL_INCLUDE_DIR |
+#define INCLUDE_DEFAULTS_MUSL_TOOL \ |
+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0}, |
+#else |
+#define INCLUDE_DEFAULTS_MUSL_TOOL |
+#endif |
+ |
+#ifdef NATIVE_SYSTEM_HEADER_DIR |
+#define INCLUDE_DEFAULTS_MUSL_NATIVE \ |
+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ |
+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, |
+#else |
+#define INCLUDE_DEFAULTS_MUSL_NATIVE |
+#endif |
+ |
+#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT) |
+# undef INCLUDE_DEFAULTS_MUSL_LOCAL |
+# define INCLUDE_DEFAULTS_MUSL_LOCAL |
+# undef INCLUDE_DEFAULTS_MUSL_NATIVE |
+# define INCLUDE_DEFAULTS_MUSL_NATIVE |
+#else |
+# undef INCLUDE_DEFAULTS_MUSL_CROSS |
+# define INCLUDE_DEFAULTS_MUSL_CROSS |
+#endif |
+ |
+#undef INCLUDE_DEFAULTS |
+#define INCLUDE_DEFAULTS \ |
+ { \ |
+ INCLUDE_DEFAULTS_MUSL_GPP \ |
+ INCLUDE_DEFAULTS_MUSL_PREFIX \ |
+ INCLUDE_DEFAULTS_MUSL_CROSS \ |
+ INCLUDE_DEFAULTS_MUSL_TOOL \ |
+ INCLUDE_DEFAULTS_MUSL_NATIVE \ |
+ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ |
+ { 0, 0, 0, 0, 0, 0 } \ |
+ } |
+#endif |
--- a/gcc/config/rs6000/sysv4le.h |
+++ b/gcc/config/rs6000/sysv4le.h |
@@ -31,3 +31,5 @@ |
/* Little-endian PowerPC64 Linux uses the ELF v2 ABI by default. */ |
#define LINUX64_DEFAULT_ABI_ELFv2 |
+#undef MUSL_DYNAMIC_LINKER_E |
+#define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","le") |
--- a/gcc/config.gcc |
+++ b/gcc/config.gcc |
@@ -2430,6 +2430,10 @@ powerpc*-*-linux*) |
powerpc*-*-linux*paired*) |
tm_file="${tm_file} rs6000/750cl.h" ;; |
esac |
+ case ${target} in |
+ *-linux*-musl*) |
+ enable_secureplt=yes ;; |
+ esac |
if test x${enable_secureplt} = xyes; then |
tm_file="rs6000/secureplt.h ${tm_file}" |
fi |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/204-musl_sh.patch |
---|
@@ -0,0 +1,39 @@ |
gcc/Changelog: |
2015-04-27 Gregor Richards <gregor.richards@uwaterloo.ca> |
Szabolcs Nagy <szabolcs.nagy@arm.com> |
* config/sh/linux.h (MUSL_DYNAMIC_LINKER): Define. |
(MUSL_DYNAMIC_LINKER_E, MUSL_DYNAMIC_LINKER_FP): Define. |
--- a/gcc/config/sh/linux.h |
+++ b/gcc/config/sh/linux.h |
@@ -43,6 +43,28 @@ along with GCC; see the file COPYING3. |
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack |
+#if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN |
+#define MUSL_DYNAMIC_LINKER_E "%{mb:eb}" |
+#else |
+#define MUSL_DYNAMIC_LINKER_E "%{!ml:eb}" |
+#endif |
+ |
+#if TARGET_CPU_DEFAULT & ( MASK_HARD_SH2A_DOUBLE | MASK_SH4 ) |
+/* "-nofpu" if any nofpu option is specified */ |
+#define MUSL_DYNAMIC_LINKER_FP \ |
+ "%{m1|m2|m2a-nofpu|m3|m4-nofpu|m4-100-nofpu|m4-200-nofpu|m4-300-nofpu|" \ |
+ "m4-340|m4-400|m4-500|m4al|m5-32media-nofpu|m5-64media-nofpu|" \ |
+ "m5-compact-nofpu:-nofpu}" |
+#else |
+/* "-nofpu" if none of the hard fpu options are specified */ |
+#define MUSL_DYNAMIC_LINKER_FP \ |
+ "%{m2a|m4|m4-100|m4-200|m4-300|m4a|m5-32media|m5-64media|m5-compact:;:-nofpu}" |
+#endif |
+ |
+#undef MUSL_DYNAMIC_LINKER |
+#define MUSL_DYNAMIC_LINKER \ |
+ "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E MUSL_DYNAMIC_LINKER_FP ".so.1" |
+ |
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" |
#undef SUBTARGET_LINK_EMUL_SUFFIX |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/205-musl_x86.patch |
---|
@@ -0,0 +1,41 @@ |
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> |
Date: Fri, 15 May 2015 13:20:01 +0000 (+0000) |
Subject: [PATCH 9/13] x86 musl support |
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=5551c8d927c17f60837f15f8dfe46f945ba3fa9c |
[PATCH 9/13] x86 musl support |
On behalf of Szabolcs Nagy. |
2015-05-15 Gregor Richards <gregor.richards@uwaterloo.ca> |
* config/i386/linux.h (MUSL_DYNAMIC_LINKER): Define. |
* config/i386/linux64.h (MUSL_DYNAMIC_LINKER32): Define. |
(MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERX32): Define. |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223218 138bc75d-0d04-0410-961f-82ee72b054a4 |
--- |
--- a/gcc/config/i386/linux.h |
+++ b/gcc/config/i386/linux.h |
@@ -21,3 +21,6 @@ along with GCC; see the file COPYING3. |
#define GNU_USER_LINK_EMULATION "elf_i386" |
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" |
+ |
+#undef MUSL_DYNAMIC_LINKER |
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1" |
--- a/gcc/config/i386/linux64.h |
+++ b/gcc/config/i386/linux64.h |
@@ -30,3 +30,10 @@ see the files COPYING3 and COPYING.RUNTI |
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" |
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" |
#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" |
+ |
+#undef MUSL_DYNAMIC_LINKER32 |
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1" |
+#undef MUSL_DYNAMIC_LINKER64 |
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1" |
+#undef MUSL_DYNAMIC_LINKERX32 |
+#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1" |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/206-musl_aarch64.patch |
---|
@@ -0,0 +1,31 @@ |
From: jgreenhalgh <jgreenhalgh@138bc75d-0d04-0410-961f-82ee72b054a4> |
Date: Wed, 27 May 2015 16:46:39 +0000 (+0000) |
Subject: [PATCH 3/13] aarch64 musl support |
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=b3ff21cf0531be91bc3fb8200296a7633090ec78 |
[PATCH 3/13] aarch64 musl support |
gcc/Changelog: |
2015-05-27 Gregor Richards <gregor.richards@uwaterloo.ca> |
Szabolcs Nagy <szabolcs.nagy@arm.com> |
* config/aarch64/aarch64-linux.h (MUSL_DYNAMIC_LINKER): Define. |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223766 138bc75d-0d04-0410-961f-82ee72b054a4 |
--- |
--- a/gcc/config/aarch64/aarch64-linux.h |
+++ b/gcc/config/aarch64/aarch64-linux.h |
@@ -23,6 +23,9 @@ |
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" |
+#undef MUSL_DYNAMIC_LINKER |
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" |
+ |
#undef ASAN_CC1_SPEC |
#define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}" |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/207-musl_fixincludes.patch |
---|
@@ -0,0 +1,30 @@ |
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> |
Date: Wed, 22 Apr 2015 14:18:16 +0000 (+0000) |
Subject: fixincludes update for musl support |
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=2dc727de2e87c2756a514cbb43cea23c99deaa3d |
fixincludes update for musl support |
On behalf of Szabolcs.Nagy@arm.com |
2015-04-22 Gregor Richards <gregor.richards@uwaterloo.ca> |
* mkfixinc.sh: Add *-musl* with no fixes. |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222327 138bc75d-0d04-0410-961f-82ee72b054a4 |
--- |
--- a/fixincludes/mkfixinc.sh |
+++ b/fixincludes/mkfixinc.sh |
@@ -19,7 +19,8 @@ case $machine in |
powerpc-*-eabi* | \ |
powerpc-*-rtems* | \ |
powerpcle-*-eabisim* | \ |
- powerpcle-*-eabi* ) |
+ powerpcle-*-eabi* | \ |
+ *-musl* ) |
# IF there is no include fixing, |
# THEN create a no-op fixer and exit |
(echo "#! /bin/sh" ; echo "exit 0" ) > ${target} |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/209-musl_libstdc++.patch |
---|
@@ -0,0 +1,72 @@ |
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> |
Date: Wed, 22 Apr 2015 14:24:11 +0000 (+0000) |
Subject: libstdc++, libgfortran gthr workaround for musl |
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=1e5f711c11cb80ce609db9e9c1d8b2da0f7b5b61 |
libstdc++, libgfortran gthr workaround for musl |
On behalf of szabolcs.nagy@arm.com |
[libstdc++-v3/] |
2015-04-22 Szabolcs Nagy <szabolcs.nagy@arm.com> |
* config/os/generic/os_defines.h (_GLIBCXX_GTHREAD_USE_WEAK): Define. |
* configure.host (os_include_dir): Set to "os/generic" for linux-musl*. |
[libgfortran/] |
2015-04-22 Szabolcs Nagy <szabolcs.nagy@arm.com> |
* acinclude.m4 (GTHREAD_USE_WEAK): Define as 0 for *-*-musl*. |
* configure: Regenerate. |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222329 138bc75d-0d04-0410-961f-82ee72b054a4 |
--- |
--- a/libgfortran/acinclude.m4 |
+++ b/libgfortran/acinclude.m4 |
@@ -100,7 +100,7 @@ void foo (void); |
[Define to 1 if the target supports #pragma weak]) |
fi |
case "$host" in |
- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* ) |
+ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* ) |
AC_DEFINE(GTHREAD_USE_WEAK, 0, |
[Define to 0 if the target shouldn't use #pragma weak]) |
;; |
--- a/libgfortran/configure |
+++ b/libgfortran/configure |
@@ -26456,7 +26456,7 @@ $as_echo "#define SUPPORTS_WEAK 1" >>con |
fi |
case "$host" in |
- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* ) |
+ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* ) |
$as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h |
--- a/libstdc++-v3/config/os/generic/os_defines.h |
+++ b/libstdc++-v3/config/os/generic/os_defines.h |
@@ -33,4 +33,9 @@ |
// System-specific #define, typedefs, corrections, etc, go here. This |
// file will come before all others. |
+// Disable the weak reference logic in gthr.h for os/generic because it |
+// is broken on every platform unless there is implementation specific |
+// workaround in gthr-posix.h and at link-time for static linking. |
+#define _GLIBCXX_GTHREAD_USE_WEAK 0 |
+ |
#endif |
--- a/libstdc++-v3/configure.host |
+++ b/libstdc++-v3/configure.host |
@@ -273,6 +273,9 @@ case "${host_os}" in |
freebsd*) |
os_include_dir="os/bsd/freebsd" |
;; |
+ linux-musl*) |
+ os_include_dir="os/generic" |
+ ;; |
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) |
if [ "$uclibc" = "yes" ]; then |
os_include_dir="os/uclibc" |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/230-musl_libssp.patch |
---|
@@ -0,0 +1,13 @@ |
--- a/gcc/gcc.c |
+++ b/gcc/gcc.c |
@@ -727,7 +727,9 @@ proper position among the other output f |
#endif |
#ifndef LINK_SSP_SPEC |
-#ifdef TARGET_LIBC_PROVIDES_SSP |
+#if DEFAULT_LIBC == LIBC_MUSL |
+#define LINK_SSP_SPEC "-lssp_nonshared" |
+#elif defined(TARGET_LIBC_PROVIDES_SSP) |
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ |
"|fstack-protector-strong|fstack-protector-explicit:}" |
#else |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/240-musl-libitm-fixes.patch |
---|
@@ -0,0 +1,61 @@ |
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> |
Date: Wed, 22 Apr 2015 14:11:25 +0000 (+0000) |
Subject: libitm fixes for musl support |
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=e53a4d49c3d03ab8eaddb073cf972c1c46d75338 |
libitm fixes for musl support |
On behalf of Szabolcs.Nagy@arm.com |
2015-04-22 Gregor Richards <gregor.richards@uwaterloo.ca> |
* config/arm/hwcap.cc: Use fcntl.h instead of sys/fcntl.h. |
* config/linux/x86/tls.h: Only use __GLIBC_PREREQ if defined. |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222325 138bc75d-0d04-0410-961f-82ee72b054a4 |
--- |
--- a/libitm/config/arm/hwcap.cc |
+++ b/libitm/config/arm/hwcap.cc |
@@ -40,7 +40,7 @@ int GTM_hwcap HIDDEN = 0 |
#ifdef __linux__ |
#include <unistd.h> |
-#include <sys/fcntl.h> |
+#include <fcntl.h> |
#include <elf.h> |
static void __attribute__((constructor)) |
--- a/libitm/config/linux/x86/tls.h |
+++ b/libitm/config/linux/x86/tls.h |
@@ -25,16 +25,19 @@ |
#ifndef LIBITM_X86_TLS_H |
#define LIBITM_X86_TLS_H 1 |
-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) |
+#if defined(__GLIBC_PREREQ) |
+#if __GLIBC_PREREQ(2, 10) |
/* Use slots in the TCB head rather than __thread lookups. |
GLIBC has reserved words 10 through 13 for TM. */ |
#define HAVE_ARCH_GTM_THREAD 1 |
#define HAVE_ARCH_GTM_THREAD_DISP 1 |
#endif |
+#endif |
#include "config/generic/tls.h" |
-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) |
+#if defined(__GLIBC_PREREQ) |
+#if __GLIBC_PREREQ(2, 10) |
namespace GTM HIDDEN { |
#ifdef __x86_64__ |
@@ -101,5 +104,6 @@ static inline void set_abi_disp(struct a |
} // namespace GTM |
#endif /* >= GLIBC 2.10 */ |
+#endif |
#endif // LIBITM_X86_TLS_H |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/250-add-musl.patch |
---|
@@ -0,0 +1,120 @@ |
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> |
Date: Fri, 8 May 2015 08:30:40 +0000 (+0000) |
Subject: [PATCH 0/13] Add musl support to GCC |
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=f2d678afa5b8385d763b93772d73d6bf80a9739e |
[PATCH 0/13] Add musl support to GCC |
2015-05-08 Szabolcs Nagy <szabolcs.nagy@arm.com> |
* config/glibc-stdint.h (OPTION_MUSL): Define. |
(INT_FAST16_TYPE, INT_FAST32_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE): |
Change the definition based on OPTION_MUSL for 64 bit targets. |
* config/linux.h (OPTION_MUSL): Redefine. |
* config/alpha/linux.h (OPTION_MUSL): Redefine. |
* config/rs6000/linux.h (OPTION_MUSL): Redefine. |
* config/rs6000/linux64.h (OPTION_MUSL): Redefine. |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222905 138bc75d-0d04-0410-961f-82ee72b054a4 |
--- |
--- a/gcc/config/alpha/linux.h |
+++ b/gcc/config/alpha/linux.h |
@@ -61,10 +61,14 @@ along with GCC; see the file COPYING3. |
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) |
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) |
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) |
+#undef OPTION_MUSL |
+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) |
#else |
#define OPTION_GLIBC (linux_libc == LIBC_GLIBC) |
#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) |
#define OPTION_BIONIC (linux_libc == LIBC_BIONIC) |
+#undef OPTION_MUSL |
+#define OPTION_MUSL (linux_libc == LIBC_MUSL) |
#endif |
/* Determine what functions are present at the runtime; |
--- a/gcc/config/glibc-stdint.h |
+++ b/gcc/config/glibc-stdint.h |
@@ -22,6 +22,12 @@ a copy of the GCC Runtime Library Except |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
<http://www.gnu.org/licenses/>. */ |
+/* Systems using musl libc should use this header and make sure |
+ OPTION_MUSL is defined correctly before using the TYPE macros. */ |
+#ifndef OPTION_MUSL |
+#define OPTION_MUSL 0 |
+#endif |
+ |
#define SIG_ATOMIC_TYPE "int" |
#define INT8_TYPE "signed char" |
@@ -43,12 +49,12 @@ see the files COPYING3 and COPYING.RUNTI |
#define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") |
#define INT_FAST8_TYPE "signed char" |
-#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") |
-#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") |
+#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int") |
+#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int") |
#define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") |
#define UINT_FAST8_TYPE "unsigned char" |
-#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int") |
-#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int") |
+#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int") |
+#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int") |
#define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") |
#define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") |
--- a/gcc/config/linux.h |
+++ b/gcc/config/linux.h |
@@ -32,11 +32,13 @@ see the files COPYING3 and COPYING.RUNTI |
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) |
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) |
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) |
+#undef OPTION_MUSL |
#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) |
#else |
#define OPTION_GLIBC (linux_libc == LIBC_GLIBC) |
#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) |
#define OPTION_BIONIC (linux_libc == LIBC_BIONIC) |
+#undef OPTION_MUSL |
#define OPTION_MUSL (linux_libc == LIBC_MUSL) |
#endif |
--- a/gcc/config/rs6000/linux.h |
+++ b/gcc/config/rs6000/linux.h |
@@ -30,10 +30,14 @@ |
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) |
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) |
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) |
+#undef OPTION_MUSL |
+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) |
#else |
#define OPTION_GLIBC (linux_libc == LIBC_GLIBC) |
#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) |
#define OPTION_BIONIC (linux_libc == LIBC_BIONIC) |
+#undef OPTION_MUSL |
+#define OPTION_MUSL (linux_libc == LIBC_MUSL) |
#endif |
/* Determine what functions are present at the runtime; |
--- a/gcc/config/rs6000/linux64.h |
+++ b/gcc/config/rs6000/linux64.h |
@@ -299,10 +299,14 @@ extern int dot_symbols; |
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) |
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) |
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) |
+#undef OPTION_MUSL |
+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) |
#else |
#define OPTION_GLIBC (linux_libc == LIBC_GLIBC) |
#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) |
#define OPTION_BIONIC (linux_libc == LIBC_BIONIC) |
+#undef OPTION_MUSL |
+#define OPTION_MUSL (linux_libc == LIBC_MUSL) |
#endif |
/* Determine what functions are present at the runtime; |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/260-musl-add-unwind-fix.patch |
---|
@@ -0,0 +1,34 @@ |
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> |
Date: Wed, 22 Apr 2015 14:20:01 +0000 (+0000) |
Subject: unwind fix for musl |
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=a2e31d0681d8a47389b8a3552622fbd9827bcef4 |
unwind fix for musl |
On behalf of szabolcs.nagy@arm.com |
2015-04-22 Gregor Richards <gregor.richards@uwaterloo.ca> |
Szabolcs Nagy <szabolcs.nagy@arm.com> |
* unwind-dw2-fde-dip.c (USE_PT_GNU_EH_FRAME): Define it on |
Linux if target provides dl_iterate_phdr. |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222328 138bc75d-0d04-0410-961f-82ee72b054a4 |
--- |
--- a/libgcc/unwind-dw2-fde-dip.c |
+++ b/libgcc/unwind-dw2-fde-dip.c |
@@ -59,6 +59,12 @@ |
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ |
&& defined(TARGET_DL_ITERATE_PHDR) \ |
+ && defined(__linux__) |
+# define USE_PT_GNU_EH_FRAME |
+#endif |
+ |
+#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ |
+ && defined(TARGET_DL_ITERATE_PHDR) \ |
&& (defined(__DragonFly__) || defined(__FreeBSD__)) |
# define ElfW __ElfN |
# define USE_PT_GNU_EH_FRAME |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/270-musl-add-powerpc-softfloat-fix.patch |
---|
@@ -0,0 +1,24 @@ |
--- a/gcc/config/rs6000/linux64.h |
+++ b/gcc/config/rs6000/linux64.h |
@@ -369,8 +369,8 @@ extern int dot_symbols; |
#endif |
#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" |
#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" |
-#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E ".so.1" |
-#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E ".so.1" |
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" |
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" |
#if DEFAULT_LIBC == LIBC_UCLIBC |
#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" |
#elif DEFAULT_LIBC == LIBC_GLIBC |
--- a/gcc/config/rs6000/sysv4.h |
+++ b/gcc/config/rs6000/sysv4.h |
@@ -765,7 +765,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF |
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" |
#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" |
-#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E ".so.1" |
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" |
#if DEFAULT_LIBC == LIBC_UCLIBC |
#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" |
#elif DEFAULT_LIBC == LIBC_MUSL |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/280-musl-disable-ifunc-by-default.patch |
---|
@@ -0,0 +1,36 @@ |
From 450fb05e2a7510d37744f044009f8237d902f65c Mon Sep 17 00:00:00 2001 |
From: nsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4> |
Date: Tue, 30 Aug 2016 10:26:22 +0000 |
Subject: [PATCH] disable ifunc on *-musl by default |
gcc/ |
* config.gcc (*-*-*musl*): Disable gnu-indirect-function. |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239859 138bc75d-0d04-0410-961f-82ee72b054a4 |
--- |
gcc/ChangeLog | 4 ++++ |
gcc/config.gcc | 4 ++-- |
2 files changed, 6 insertions(+), 2 deletions(-) |
--- a/gcc/config.gcc |
+++ b/gcc/config.gcc |
@@ -1455,7 +1455,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfree |
extra_options="${extra_options} linux-android.opt" |
# Assume modern glibc if not targeting Android nor uclibc. |
case ${target} in |
- *-*-*android*|*-*-*uclibc*) |
+ *-*-*android*|*-*-*uclibc*|*-*-*musl*) |
;; |
*) |
default_gnu_indirect_function=yes |
@@ -1524,7 +1524,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu |
extra_options="${extra_options} linux-android.opt" |
# Assume modern glibc if not targeting Android nor uclibc. |
case ${target} in |
- *-*-*android*|*-*-*uclibc*) |
+ *-*-*android*|*-*-*uclibc*|*-*-*musl*) |
;; |
*) |
default_gnu_indirect_function=yes |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/300-mips_Os_cpu_rtx_cost_model.patch |
---|
@@ -0,0 +1,14 @@ |
Use the proper rtx cost model for the selected CPU, even when optimizing |
for size. This generates better code. |
--- a/gcc/config/mips/mips.c |
+++ b/gcc/config/mips/mips.c |
@@ -17483,7 +17483,7 @@ mips_option_override (void) |
flag_pcc_struct_return = 0; |
/* Decide which rtx_costs structure to use. */ |
- if (optimize_size) |
+ if (0 && optimize_size) |
mips_cost = &mips_rtx_cost_optimize_size; |
else |
mips_cost = &mips_rtx_cost_data[mips_tune]; |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/800-arm_v5te_no_ldrd_strd.patch |
---|
@@ -0,0 +1,11 @@ |
--- a/gcc/config/arm/arm.h |
+++ b/gcc/config/arm/arm.h |
@@ -285,7 +285,7 @@ extern void (*arm_lang_output_object_att |
/* Thumb-1 only. */ |
#define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm) |
-#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \ |
+#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \ |
&& !TARGET_THUMB1) |
#define TARGET_CRC32 (arm_arch_crc) |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/810-arm-softfloat-libgcc.patch |
---|
@@ -0,0 +1,25 @@ |
--- a/libgcc/config/arm/t-linux |
+++ b/libgcc/config/arm/t-linux |
@@ -1,6 +1,10 @@ |
LIB1ASMSRC = arm/lib1funcs.S |
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ |
- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 |
+ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ |
+ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ |
+ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ |
+ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ |
+ _arm_fixsfsi _arm_fixunssfsi |
# Just for these, we omit the frame pointer since it makes such a big |
# difference. |
--- a/gcc/config/arm/linux-elf.h |
+++ b/gcc/config/arm/linux-elf.h |
@@ -60,8 +60,6 @@ |
%{shared:-lc} \ |
%{!shared:%{profile:-lc_p}%{!profile:-lc}}" |
-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" |
- |
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" |
#define LINUX_TARGET_LINK_SPEC "%{h*} \ |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/820-libgcc_pic.patch |
---|
@@ -0,0 +1,36 @@ |
--- a/libgcc/Makefile.in |
+++ b/libgcc/Makefile.in |
@@ -887,11 +887,12 @@ $(libgcov-driver-objects): %$(objext): $ |
# Static libraries. |
libgcc.a: $(libgcc-objects) |
+libgcc_pic.a: $(libgcc-s-objects) |
libgcov.a: $(libgcov-objects) |
libunwind.a: $(libunwind-objects) |
libgcc_eh.a: $(libgcc-eh-objects) |
-libgcc.a libgcov.a libunwind.a libgcc_eh.a: |
+libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a: |
-rm -f $@ |
objects="$(objects)"; \ |
@@ -913,7 +914,7 @@ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_E |
endif |
ifeq ($(enable_shared),yes) |
-all: libgcc_eh.a libgcc_s$(SHLIB_EXT) |
+all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT) |
ifneq ($(LIBUNWIND),) |
all: libunwind$(SHLIB_EXT) |
endif |
@@ -1108,6 +1109,10 @@ install-shared: |
chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a |
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a |
+ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/ |
+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a |
+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a |
+ |
$(subst @multilib_dir@,$(MULTIDIR),$(subst \ |
@shlib_base_name@,libgcc_s,$(subst \ |
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/830-arm_unbreak_armv4t.patch |
---|
@@ -0,0 +1,13 @@ |
http://sourceware.org/ml/crossgcc/2008-05/msg00009.html |
--- a/gcc/config/arm/linux-eabi.h |
+++ b/gcc/config/arm/linux-eabi.h |
@@ -45,7 +45,7 @@ |
The ARM10TDMI core is the default for armv5t, so set |
SUBTARGET_CPU_DEFAULT to achieve this. */ |
#undef SUBTARGET_CPU_DEFAULT |
-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi |
+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi |
/* TARGET_BIG_ENDIAN_DEFAULT is set in |
config.gcc for big endian configurations. */ |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/840-armv4_pass_fix-v4bx_to_ld.patch |
---|
@@ -0,0 +1,19 @@ |
--- a/gcc/config/arm/linux-eabi.h |
+++ b/gcc/config/arm/linux-eabi.h |
@@ -94,10 +94,15 @@ |
#define MUSL_DYNAMIC_LINKER \ |
"/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" |
+/* For armv4 we pass --fix-v4bx to linker to support EABI */ |
+#undef TARGET_FIX_V4BX_SPEC |
+#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ |
+ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" |
+ |
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to |
use the GNU/Linux version, not the generic BPABI version. */ |
#undef LINK_SPEC |
-#define LINK_SPEC EABI_LINK_SPEC \ |
+#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \ |
LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ |
LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/850-use_shared_libgcc.patch |
---|
@@ -0,0 +1,47 @@ |
--- a/gcc/config/arm/linux-eabi.h |
+++ b/gcc/config/arm/linux-eabi.h |
@@ -131,10 +131,6 @@ |
#define ENDFILE_SPEC \ |
LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) |
-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we |
- do not use -lfloat. */ |
-#undef LIBGCC_SPEC |
- |
/* Clear the instruction cache from `beg' to `end'. This is |
implemented in lib1funcs.S, so ensure an error if this definition |
is used. */ |
--- a/gcc/config/linux.h |
+++ b/gcc/config/linux.h |
@@ -53,6 +53,10 @@ see the files COPYING3 and COPYING.RUNTI |
builtin_assert ("system=posix"); \ |
} while (0) |
+#ifndef LIBGCC_SPEC |
+#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}" |
+#endif |
+ |
/* Determine which dynamic linker to use depending on whether GLIBC or |
uClibc or Bionic or musl is the default C library and whether |
-muclibc or -mglibc or -mbionic or -mmusl has been passed to change |
--- a/libgcc/mkmap-symver.awk |
+++ b/libgcc/mkmap-symver.awk |
@@ -132,5 +132,5 @@ function output(lib) { |
else if (inherit[lib]) |
printf("} %s;\n", inherit[lib]); |
else |
- printf ("\n local:\n\t*;\n};\n"); |
+ printf ("\n\t*;\n};\n"); |
} |
--- a/gcc/config/rs6000/linux.h |
+++ b/gcc/config/rs6000/linux.h |
@@ -60,6 +60,9 @@ |
#undef CPP_OS_DEFAULT_SPEC |
#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" |
+#undef LIBGCC_SPEC |
+#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" |
+ |
#undef LINK_SHLIB_SPEC |
#define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/851-libgcc_no_compat.patch |
---|
@@ -0,0 +1,12 @@ |
--- a/libgcc/config/t-libunwind |
+++ b/libgcc/config/t-libunwind |
@@ -2,8 +2,7 @@ |
HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER |
-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ |
- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c |
+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c |
LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c |
# Override the default value from t-slibgcc-elf-ver and mention -lunwind |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/870-ppc_no_crtsavres.patch |
---|
@@ -0,0 +1,11 @@ |
--- a/gcc/config/rs6000/rs6000.c |
+++ b/gcc/config/rs6000/rs6000.c |
@@ -21528,7 +21528,7 @@ rs6000_savres_strategy (rs6000_stack_t * |
/* Define cutoff for using out-of-line functions to save registers. */ |
if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) |
{ |
- if (!optimize_size) |
+ if (1) |
{ |
strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; |
strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/880-no_java_section.patch |
---|
@@ -0,0 +1,11 @@ |
--- a/gcc/defaults.h |
+++ b/gcc/defaults.h |
@@ -380,7 +380,7 @@ see the files COPYING3 and COPYING.RUNTI |
/* If we have named section and we support weak symbols, then use the |
.jcr section for recording java classes which need to be registered |
at program start-up time. */ |
-#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK |
+#if 0 && defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK |
#ifndef JCR_SECTION_NAME |
#define JCR_SECTION_NAME ".jcr" |
#endif |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/881-no_tm_section.patch |
---|
@@ -0,0 +1,11 @@ |
--- a/libgcc/crtstuff.c |
+++ b/libgcc/crtstuff.c |
@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ |
#endif |
#if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) |
-# define USE_TM_CLONE_REGISTRY 1 |
+# define USE_TM_CLONE_REGISTRY 0 |
#endif |
/* We do not want to add the weak attribute to the declarations of these |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/900-bad-mips16-crt.patch |
---|
@@ -0,0 +1,9 @@ |
--- a/libgcc/config/mips/t-mips16 |
+++ b/libgcc/config/mips/t-mips16 |
@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 |
# Version these symbols if building libgcc.so. |
SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver |
+ |
+CRTSTUFF_T_CFLAGS += -mno-mips16 |
+CRTSTUFF_T_CFLAGS_S += -mno-mips16 |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/910-mbsd_multi.patch |
---|
@@ -0,0 +1,222 @@ |
This patch brings over a few features from MirBSD: |
* -fhonour-copts |
If this option is not given, it's warned (depending |
on environment variables). This is to catch errors |
of misbuilt packages which override CFLAGS themselves. |
* -Werror-maybe-reset |
Has the effect of -Wno-error if GCC_NO_WERROR is |
set and not '0', a no-operation otherwise. This is |
to be able to use -Werror in "make" but prevent |
GNU autoconf generated configure scripts from |
freaking out. |
This patch was authored by Thorsten Glaser <tg at mirbsd.de> |
with copyright assignment to the FSF in effect. |
--- a/gcc/c-family/c-opts.c |
+++ b/gcc/c-family/c-opts.c |
@@ -122,6 +122,9 @@ static int class_dump_flags; |
/* Whether any standard preincluded header has been preincluded. */ |
static bool done_preinclude; |
+/* Check if a port honours COPTS. */ |
+static int honour_copts = 0; |
+ |
static void handle_OPT_d (const char *); |
static void set_std_cxx98 (int); |
static void set_std_cxx11 (int); |
@@ -449,6 +452,12 @@ c_common_handle_option (size_t scode, co |
flag_no_builtin = !value; |
break; |
+ case OPT_fhonour_copts: |
+ if (c_language == clk_c) { |
+ honour_copts++; |
+ } |
+ break; |
+ |
case OPT_fconstant_string_class_: |
constant_string_class_name = arg; |
break; |
@@ -1039,6 +1048,47 @@ c_common_init (void) |
return false; |
} |
+ if (c_language == clk_c) { |
+ char *ev = getenv ("GCC_HONOUR_COPTS"); |
+ int evv; |
+ if (ev == NULL) |
+ evv = -1; |
+ else if ((*ev == '0') || (*ev == '\0')) |
+ evv = 0; |
+ else if (*ev == '1') |
+ evv = 1; |
+ else if (*ev == '2') |
+ evv = 2; |
+ else if (*ev == 's') |
+ evv = -1; |
+ else { |
+ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); |
+ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ |
+ } |
+ if (evv == 1) { |
+ if (honour_copts == 0) { |
+ error ("someone does not honour COPTS at all in lenient mode"); |
+ return false; |
+ } else if (honour_copts != 1) { |
+ warning (0, "someone does not honour COPTS correctly, passed %d times", |
+ honour_copts); |
+ } |
+ } else if (evv == 2) { |
+ if (honour_copts == 0) { |
+ error ("someone does not honour COPTS at all in strict mode"); |
+ return false; |
+ } else if (honour_copts != 1) { |
+ error ("someone does not honour COPTS correctly, passed %d times", |
+ honour_copts); |
+ return false; |
+ } |
+ } else if (evv == 0) { |
+ if (honour_copts != 1) |
+ inform (0, "someone does not honour COPTS correctly, passed %d times", |
+ honour_copts); |
+ } |
+ } |
+ |
return true; |
} |
--- a/gcc/c-family/c.opt |
+++ b/gcc/c-family/c.opt |
@@ -431,6 +431,10 @@ Wfloat-conversion |
C ObjC C++ ObjC++ Var(warn_float_conversion) LangEnabledBy(C ObjC C++ ObjC++,Wconversion) |
Warn for implicit type conversions that cause loss of floating point precision |
+Werror-maybe-reset |
+C ObjC C++ ObjC++ |
+; Documented in common.opt |
+ |
Wfloat-equal |
C ObjC C++ ObjC++ Var(warn_float_equal) Warning |
Warn if testing floating point numbers for equality |
@@ -1161,6 +1165,9 @@ C++ ObjC++ Optimization Alias(fexception |
fhonor-std |
C++ ObjC++ Ignore Warn(switch %qs is no longer supported) |
+fhonour-copts |
+C ObjC C++ ObjC++ RejectNegative |
+ |
fhosted |
C ObjC |
Assume normal C execution environment |
--- a/gcc/common.opt |
+++ b/gcc/common.opt |
@@ -561,6 +561,10 @@ Werror= |
Common Joined |
Treat specified warning as error |
+Werror-maybe-reset |
+Common |
+If environment variable GCC_NO_WERROR is set, act as -Wno-error |
+ |
Wextra |
Common Var(extra_warnings) Warning |
Print extra (possibly unwanted) warnings |
@@ -1360,6 +1364,9 @@ fguess-branch-probability |
Common Report Var(flag_guess_branch_prob) Optimization |
Enable guessing of branch probabilities |
+fhonour-copts |
+Common RejectNegative |
+ |
; Nonzero means ignore `#ident' directives. 0 means handle them. |
; Generate position-independent code for executables if possible |
; On SVR4 targets, it also controls whether or not to emit a |
--- a/gcc/opts.c |
+++ b/gcc/opts.c |
@@ -1699,6 +1699,17 @@ common_handle_option (struct gcc_options |
opts, opts_set, loc, dc); |
break; |
+ case OPT_Werror_maybe_reset: |
+ { |
+ char *ev = getenv ("GCC_NO_WERROR"); |
+ if ((ev != NULL) && (*ev != '0')) |
+ warnings_are_errors = 0; |
+ } |
+ break; |
+ |
+ case OPT_fhonour_copts: |
+ break; |
+ |
case OPT_Wlarger_than_: |
opts->x_larger_than_size = value; |
opts->x_warn_larger_than = value != -1; |
--- a/gcc/doc/cppopts.texi |
+++ b/gcc/doc/cppopts.texi |
@@ -163,6 +163,11 @@ in older programs. This warning is on b |
Make all warnings into hard errors. Source code which triggers warnings |
will be rejected. |
+@item -Werror-maybe-reset |
+@opindex Werror-maybe-reset |
+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment |
+variable is set to anything other than 0 or empty. |
+ |
@item -Wsystem-headers |
@opindex Wsystem-headers |
Issue warnings for code in system headers. These are normally unhelpful |
--- a/gcc/doc/invoke.texi |
+++ b/gcc/doc/invoke.texi |
@@ -251,7 +251,7 @@ Objective-C and Objective-C++ Dialects}. |
-Wdisabled-optimization @gol |
-Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol |
-Wno-div-by-zero -Wdouble-promotion -Wempty-body -Wenum-compare @gol |
--Wno-endif-labels -Werror -Werror=* @gol |
+-Wno-endif-labels -Werror -Werror=* -Werror-maybe-reset @gol |
-Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol |
-Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol |
-Wformat-security -Wformat-signedness -Wformat-y2k @gol |
@@ -5388,6 +5388,22 @@ This option is only supported for C and |
@option{-Wall} and by @option{-Wpedantic}, which can be disabled with |
@option{-Wno-pointer-sign}. |
+@item -Werror-maybe-reset |
+@opindex Werror-maybe-reset |
+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment |
+variable is set to anything other than 0 or empty. |
+ |
+@item -fhonour-copts |
+@opindex fhonour-copts |
+If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not |
+given at least once, and warn if it is given more than once. |
+If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not |
+given exactly once. |
+If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option |
+is not given exactly once. |
+The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. |
+This flag and environment variable only affect the C language. |
+ |
@item -Wstack-protector |
@opindex Wstack-protector |
@opindex Wno-stack-protector |
@@ -7866,7 +7882,7 @@ so, the first branch is redirected to ei |
second branch or a point immediately following it, depending on whether |
the condition is known to be true or false. |
-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. |
+Enabled at levels @option{-O3}. |
@item -fsplit-wide-types |
@opindex fsplit-wide-types |
--- a/gcc/java/jvspec.c |
+++ b/gcc/java/jvspec.c |
@@ -629,6 +629,7 @@ lang_specific_pre_link (void) |
class name. Append dummy `.c' that can be stripped by set_input so %b |
is correct. */ |
set_input (concat (main_class_name, "main.c", NULL)); |
+ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */ |
err = do_spec (jvgenmain_spec); |
if (err == 0) |
{ |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/920-specs_nonfatal_getenv.patch |
---|
@@ -0,0 +1,15 @@ |
--- a/gcc/gcc.c |
+++ b/gcc/gcc.c |
@@ -8828,8 +8828,10 @@ getenv_spec_function (int argc, const ch |
value = getenv (argv[0]); |
if (!value) |
- fatal_error (input_location, |
- "environment variable %qs not defined", argv[0]); |
+ { |
+ warning (input_location, "environment variable %qs not defined", argv[0]); |
+ value = ""; |
+ } |
/* We have to escape every character of the environment variable so |
they are not interpreted as active spec characters. A |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/930-fix-mips-noexecstack.patch |
---|
@@ -0,0 +1,111 @@ |
From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001 |
From: Andrew McDonnell <bugs@andrewmcdonnell.net> |
Date: Fri, 3 Oct 2014 19:09:00 +0930 |
Subject: Add .note.GNU-stack section |
See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html |
Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html |
Re: [Patch, MIPS] Add .note.GNU-stack section |
From: Steve Ellcey <sellcey at mips dot com> |
On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote: |
> |
> |
> On Wed, Sep 10, 2014 at 9:27 AM, <pinskia@gmail.com> wrote: |
> This works except you did not update the assembly files in |
> libgcc or glibc. We (Cavium) have the same patch in our tree |
> for a few released versions. |
> Mind just checking yours in then Andrew? |
> Thanks! |
> -eric |
I talked to Andrew about what files he changed in GCC and created and |
tested this new patch. Andrew also mentioned changing some assembly |
files in glibc but I don't see any use of '.section .note.GNU-stack' in |
any assembly files in glibc (for any platform) so I wasn't planning on |
creating a glibc to add them to mips glibc assembly language files. |
OK to check in this patch? |
Steve Ellcey |
sellcey@mips.com |
2014-09-26 Steve Ellcey <sellcey@mips.com> |
--- |
gcc/config/mips/mips.c | 3 +++ |
libgcc/config/mips/crti.S | 4 ++++ |
libgcc/config/mips/crtn.S | 3 +++ |
libgcc/config/mips/mips16.S | 4 ++++ |
libgcc/config/mips/vr4120-div.S | 4 ++++ |
5 files changed, 18 insertions(+) |
--- a/gcc/config/mips/mips.c |
+++ b/gcc/config/mips/mips.c |
@@ -19629,6 +19629,9 @@ mips_lra_p (void) |
#undef TARGET_LRA_P |
#define TARGET_LRA_P mips_lra_p |
+#undef TARGET_ASM_FILE_END |
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack |
+ |
struct gcc_target targetm = TARGET_INITIALIZER; |
#include "gt-mips.h" |
--- a/libgcc/config/mips/crti.S |
+++ b/libgcc/config/mips/crti.S |
@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
<http://www.gnu.org/licenses/>. */ |
+ |
+/* An executable stack is *not* required for these functions. */ |
+ .section .note.GNU-stack,"",%progbits |
+ |
/* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. |
Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ |
--- a/libgcc/config/mips/crtn.S |
+++ b/libgcc/config/mips/crtn.S |
@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
<http://www.gnu.org/licenses/>. */ |
+/* An executable stack is *not* required for these functions. */ |
+ .section .note.GNU-stack,"",%progbits |
+ |
/* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. |
Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ |
--- a/libgcc/config/mips/mips16.S |
+++ b/libgcc/config/mips/mips16.S |
@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI |
values using the soft-float calling convention, but do the actual |
operation using the hard floating point instructions. */ |
+/* An executable stack is *not* required for these functions. */ |
+ .section .note.GNU-stack,"",%progbits |
+ .previous |
+ |
#if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64) |
/* This file contains 32-bit assembly code. */ |
--- a/libgcc/config/mips/vr4120-div.S |
+++ b/libgcc/config/mips/vr4120-div.S |
@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI |
-mfix-vr4120. div and ddiv do not give the correct result when one |
of the operands is negative. */ |
+/* An executable stack is *not* required for these functions. */ |
+ .section .note.GNU-stack,"",%progbits |
+ .previous |
+ |
.set nomips16 |
#define DIV \ |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/931-fix-MIPS-softfloat-build-issue.patch |
---|
@@ -0,0 +1,167 @@ |
From 2b46f9187b6f994fc450628a7cd97fc703dd23e0 Mon Sep 17 00:00:00 2001 |
From: BangLang Huang <banglang.huang@foxmail.com> |
Date: Wed, 9 Nov 2016 10:36:49 +0800 |
Subject: [PATCH] fix MIPS softfloat build issue |
This patch is backport from github/libffi #272 |
Signed-off-by: BangLang Huang <banglang.huang@foxmail.com> |
--- |
libffi/src/mips/n32.S | 17 +++++++++++++++++ |
libffi/src/mips/o32.S | 17 +++++++++++++++++ |
2 files changed, 34 insertions(+) |
--- a/libffi/src/mips/n32.S |
+++ b/libffi/src/mips/n32.S |
@@ -107,6 +107,16 @@ loadregs: |
REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6. |
+#ifdef __mips_soft_float |
+ REG_L a0, 0*FFI_SIZEOF_ARG(t9) |
+ REG_L a1, 1*FFI_SIZEOF_ARG(t9) |
+ REG_L a2, 2*FFI_SIZEOF_ARG(t9) |
+ REG_L a3, 3*FFI_SIZEOF_ARG(t9) |
+ REG_L a4, 4*FFI_SIZEOF_ARG(t9) |
+ REG_L a5, 5*FFI_SIZEOF_ARG(t9) |
+ REG_L a6, 6*FFI_SIZEOF_ARG(t9) |
+ REG_L a7, 7*FFI_SIZEOF_ARG(t9) |
+#else |
and t4, t6, ((1<<FFI_FLAG_BITS)-1) |
REG_L a0, 0*FFI_SIZEOF_ARG(t9) |
beqz t4, arg1_next |
@@ -193,6 +203,7 @@ arg7_next: |
arg8_doublep: |
l.d $f19, 7*FFI_SIZEOF_ARG(t9) |
arg8_next: |
+#endif |
callit: |
# Load the function pointer |
@@ -214,6 +225,7 @@ retint: |
b epilogue |
retfloat: |
+#ifndef __mips_soft_float |
bne t6, FFI_TYPE_FLOAT, retdouble |
jal t9 |
REG_L t4, 4*FFI_SIZEOF_ARG($fp) |
@@ -272,6 +284,7 @@ retstruct_f_d: |
s.s $f0, 0(t4) |
s.d $f2, 8(t4) |
b epilogue |
+#endif |
retstruct_d_soft: |
bne t6, FFI_TYPE_STRUCT_D_SOFT, retstruct_f_soft |
@@ -429,6 +442,7 @@ ffi_closure_N32: |
REG_S a6, A6_OFF2($sp) |
REG_S a7, A7_OFF2($sp) |
+#ifndef __mips_soft_float |
# Store all possible float/double registers. |
s.d $f12, F12_OFF2($sp) |
s.d $f13, F13_OFF2($sp) |
@@ -438,6 +452,7 @@ ffi_closure_N32: |
s.d $f17, F17_OFF2($sp) |
s.d $f18, F18_OFF2($sp) |
s.d $f19, F19_OFF2($sp) |
+#endif |
# Call ffi_closure_mips_inner_N32 to do the real work. |
LA t9, ffi_closure_mips_inner_N32 |
@@ -458,6 +473,7 @@ cls_retint: |
b cls_epilogue |
cls_retfloat: |
+#ifndef __mips_soft_float |
bne v0, FFI_TYPE_FLOAT, cls_retdouble |
l.s $f0, V0_OFF2($sp) |
b cls_epilogue |
@@ -500,6 +516,7 @@ cls_retstruct_f_d: |
l.s $f0, V0_OFF2($sp) |
l.d $f2, V1_OFF2($sp) |
b cls_epilogue |
+#endif |
cls_retstruct_small2: |
REG_L v0, V0_OFF2($sp) |
--- a/libffi/src/mips/o32.S |
+++ b/libffi/src/mips/o32.S |
@@ -82,13 +82,16 @@ sixteen: |
ADDU $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args |
+#ifndef __mips_soft_float |
bnez t0, pass_d # make it quick for int |
+#endif |
REG_L a0, 0*FFI_SIZEOF_ARG($sp) # just go ahead and load the |
REG_L a1, 1*FFI_SIZEOF_ARG($sp) # four regs. |
REG_L a2, 2*FFI_SIZEOF_ARG($sp) |
REG_L a3, 3*FFI_SIZEOF_ARG($sp) |
b call_it |
+#ifndef __mips_soft_float |
pass_d: |
bne t0, FFI_ARGS_D, pass_f |
l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args |
@@ -130,6 +133,7 @@ pass_f_d: |
# bne t0, FFI_ARGS_F_D, call_it |
l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args |
l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float |
+#endif |
call_it: |
# Load the function pointer |
@@ -158,14 +162,23 @@ retfloat: |
bne t2, FFI_TYPE_FLOAT, retdouble |
jalr t9 |
REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) |
+#ifndef __mips_soft_float |
s.s $f0, 0(t0) |
+#else |
+ REG_S v0, 0(t0) |
+#endif |
b epilogue |
retdouble: |
bne t2, FFI_TYPE_DOUBLE, noretval |
jalr t9 |
REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) |
+#ifndef __mips_soft_float |
s.d $f0, 0(t0) |
+#else |
+ REG_S v1, 4(t0) |
+ REG_S v0, 0(t0) |
+#endif |
b epilogue |
noretval: |
@@ -261,9 +274,11 @@ $LCFI7: |
li $13, 1 # FFI_O32 |
bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT |
+#ifndef __mips_soft_float |
# Store all possible float/double registers. |
s.d $f12, FA_0_0_OFF2($fp) |
s.d $f14, FA_1_0_OFF2($fp) |
+#endif |
1: |
# Call ffi_closure_mips_inner_O32 to do the work. |
la t9, ffi_closure_mips_inner_O32 |
@@ -281,6 +296,7 @@ $LCFI7: |
li $13, 1 # FFI_O32 |
bne $16, $13, 1f # Skip fp restore if FFI_O32_SOFT_FLOAT |
+#ifndef __mips_soft_float |
li $9, FFI_TYPE_FLOAT |
l.s $f0, V0_OFF2($fp) |
beq $8, $9, closure_done |
@@ -288,6 +304,7 @@ $LCFI7: |
li $9, FFI_TYPE_DOUBLE |
l.d $f0, V0_OFF2($fp) |
beq $8, $9, closure_done |
+#endif |
1: |
REG_L $3, V1_OFF2($fp) |
REG_L $2, V0_OFF2($fp) |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/940-no-clobber-stamp-bits.patch |
---|
@@ -0,0 +1,11 @@ |
--- a/libstdc++-v3/include/Makefile.in |
+++ b/libstdc++-v3/include/Makefile.in |
@@ -1422,7 +1422,7 @@ stamp-bits: ${bits_headers} |
@$(STAMP) stamp-bits |
stamp-bits-sup: stamp-bits ${bits_sup_headers} |
- @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null |
+ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null |
@$(STAMP) stamp-bits-sup |
stamp-c_base: ${c_base_headers} |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/950-cpp_file_path_translation.patch |
---|
@@ -0,0 +1,182 @@ |
Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047 |
--- a/gcc/c-family/c-opts.c |
+++ b/gcc/c-family/c-opts.c |
@@ -581,6 +581,10 @@ c_common_handle_option (size_t scode, co |
add_path (xstrdup (arg), SYSTEM, 0, true); |
break; |
+ case OPT_iremap: |
+ add_cpp_remap_path (arg); |
+ break; |
+ |
case OPT_iwithprefix: |
add_prefixed_path (arg, SYSTEM); |
break; |
--- a/gcc/c-family/c.opt |
+++ b/gcc/c-family/c.opt |
@@ -1528,6 +1528,10 @@ iquote |
C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs) |
-iquote <dir> Add <dir> to the end of the quote include path |
+iremap |
+C ObjC C++ ObjC++ Joined Separate |
+-iremap <src:dst> Convert <src> to <dst> if it occurs as prefix in __FILE__. |
+ |
iwithprefix |
C ObjC C++ ObjC++ Joined Separate |
-iwithprefix <dir> Add <dir> to the end of the system include path |
--- a/gcc/doc/cpp.texi |
+++ b/gcc/doc/cpp.texi |
@@ -4441,6 +4441,7 @@ without notice. |
@c man begin SYNOPSIS |
cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] |
[@option{-I}@var{dir}@dots{}] [@option{-iquote}@var{dir}@dots{}] |
+ [@option{-iremap}@var{src}:@var{dst}] |
[@option{-W}@var{warn}@dots{}] |
[@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}] |
[@option{-MP}] [@option{-MQ} @var{target}@dots{}] |
--- a/gcc/doc/cppopts.texi |
+++ b/gcc/doc/cppopts.texi |
@@ -532,6 +532,12 @@ Search @var{dir} only for header files r |
If @var{dir} begins with @code{=}, then the @code{=} will be replaced |
by the sysroot prefix; see @option{--sysroot} and @option{-isysroot}. |
+@item -iremap @var{src}:@var{dst} |
+@opindex iremap |
+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. |
+This option can be specified more than once. Processing stops at the first |
+match. |
+ |
@item -fdirectives-only |
@opindex fdirectives-only |
When preprocessing, handle directives, but do not expand macros. |
--- a/gcc/doc/invoke.texi |
+++ b/gcc/doc/invoke.texi |
@@ -494,8 +494,8 @@ Objective-C and Objective-C++ Dialects}. |
@item Directory Options |
@xref{Directory Options,,Options for Directory Search}. |
@gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol |
--iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol |
---sysroot=@var{dir} --no-sysroot-suffix} |
+-iquote@var{dir} -iremap@var{src}:@var{dst} -L@var{dir} -specs=@var{file} @gol |
+-I- --sysroot=@var{dir} --no-sysroot-suffix} |
@item Machine Dependent Options |
@xref{Submodel Options,,Hardware Models and Configurations}. |
@@ -11485,6 +11485,12 @@ be searched for header files only for th |
"@var{file}"}; they are not searched for @code{#include <@var{file}>}, |
otherwise just like @option{-I}. |
+@item -iremap @var{src}:@var{dst} |
+@opindex iremap |
+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. |
+This option can be specified more than once. Processing stops at the first |
+match. |
+ |
@item -L@var{dir} |
@opindex L |
Add directory @var{dir} to the list of directories to be searched |
--- a/libcpp/include/cpplib.h |
+++ b/libcpp/include/cpplib.h |
@@ -751,6 +751,9 @@ extern void cpp_set_lang (cpp_reader *, |
/* Set the include paths. */ |
extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int); |
+/* Provide src:dst pair for __FILE__ remapping. */ |
+extern void add_cpp_remap_path (const char *); |
+ |
/* Call these to get pointers to the options, callback, and deps |
structures for a given reader. These pointers are good until you |
call cpp_finish on that reader. You can either edit the callbacks |
--- a/libcpp/macro.c |
+++ b/libcpp/macro.c |
@@ -224,6 +224,64 @@ static const char * const monthnames[] = |
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" |
}; |
+static size_t remap_pairs; |
+static char **remap_src; |
+static char **remap_dst; |
+ |
+void |
+add_cpp_remap_path (const char *arg) |
+{ |
+ const char *arg_dst; |
+ size_t len; |
+ |
+ arg_dst = strchr(arg, ':'); |
+ if (arg_dst == NULL) |
+ { |
+ fprintf(stderr, "Invalid argument for -iremap\n"); |
+ exit(1); |
+ } |
+ |
+ len = arg_dst - arg; |
+ ++arg_dst; |
+ |
+ remap_src = (char **) xrealloc(remap_src, sizeof(char *) * (remap_pairs + 1)); |
+ remap_dst = (char **) xrealloc(remap_dst, sizeof(char *) * (remap_pairs + 1)); |
+ |
+ remap_src[remap_pairs] = (char *) xmalloc(len + 1); |
+ memcpy(remap_src[remap_pairs], arg, len); |
+ remap_src[remap_pairs][len] = '\0'; |
+ remap_dst[remap_pairs] = xstrdup(arg_dst); |
+ ++remap_pairs; |
+} |
+ |
+static const char * |
+cpp_remap_file (const char *arg, char **tmp_name) |
+{ |
+ char *result; |
+ size_t i, len; |
+ |
+ for (i = 0; i < remap_pairs; ++i) |
+ { |
+ len = strlen (remap_src[i]); |
+ if (strncmp (remap_src[i], arg, len)) |
+ continue; |
+ if (arg[len] == '\0') |
+ return xstrdup (remap_dst[i]); |
+ if (arg[len] != '/') |
+ continue; |
+ arg += len; |
+ len = strlen (remap_dst[i]); |
+ result = (char *) xmalloc (len + strlen (arg) + 1); |
+ memcpy(result, remap_dst[i], len); |
+ strcpy(result + len, arg); |
+ *tmp_name = result; |
+ |
+ return result; |
+ } |
+ |
+ return arg; |
+} |
+ |
/* Helper function for builtin_macro. Returns the text generated by |
a builtin macro. */ |
const uchar * |
@@ -286,6 +344,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi |
{ |
unsigned int len; |
const char *name; |
+ char *tmp_name = NULL; |
uchar *buf; |
if (node->value.builtin == BT_FILE) |
@@ -297,6 +356,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi |
if (!name) |
abort (); |
} |
+ name = cpp_remap_file (name, &tmp_name); |
len = strlen (name); |
buf = _cpp_unaligned_alloc (pfile, len * 2 + 3); |
result = buf; |
@@ -304,6 +364,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi |
buf = cpp_quote_string (buf + 1, (const unsigned char *) name, len); |
*buf++ = '"'; |
*buf = '\0'; |
+ free (tmp_name); |
} |
break; |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/960-go_libm.patch |
---|
@@ -0,0 +1,11 @@ |
--- a/gcc/go/Make-lang.in |
+++ b/gcc/go/Make-lang.in |
@@ -74,7 +74,7 @@ go_OBJS = $(GO_OBJS) go/gospec.o |
go1$(exeext): $(GO_OBJS) attribs.o $(BACKEND) $(LIBDEPS) |
+$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ |
- $(GO_OBJS) attribs.o $(BACKEND) $(LIBS) $(BACKENDLIBS) |
+ $(GO_OBJS) attribs.o $(BACKEND) $(LIBS) $(BACKENDLIBS) -lm |
# Documentation. |
/branches/18.06.1/toolchain/gcc/patches/5.5.0/970-warn_bug.patch |
---|
@@ -0,0 +1,11 @@ |
--- a/libgo/runtime/mprof.goc |
+++ b/libgo/runtime/mprof.goc |
@@ -403,7 +403,7 @@ func ThreadCreateProfile(p Slice) (n int |
func Stack(b Slice, all bool) (n int) { |
byte *pc, *sp; |
- bool enablegc; |
+ bool enablegc = false; /* workaround GCC bug #36550 */ |
sp = runtime_getcallersp(&b); |
pc = (byte*)(uintptr)runtime_getcallerpc(&b); |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/001-revert_register_mode_search.patch |
---|
@@ -0,0 +1,77 @@ |
commit 31285a20390a5e53a74a2a71d1b5c82f366ddd5a |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Tue May 6 11:49:05 2014 +0000 |
gcc: revert an upstream patch that is causing a regression on powerpc |
https://forum.openwrt.org/viewtopic.php?pid=232494#p232494 |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> |
SVN-Revision: 40709 |
Revert of: |
commit 275035b56823b26d5fb7e90fad945b998648edf2 |
Author: bergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4> |
Date: Thu Sep 5 14:09:07 2013 +0000 |
PR target/58139 |
* reginfo.c (choose_hard_reg_mode): Scan through all mode classes |
looking for widest mode. |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4 |
--- a/gcc/reginfo.c |
+++ b/gcc/reginfo.c |
@@ -637,35 +637,40 @@ choose_hard_reg_mode (unsigned int regno |
mode = GET_MODE_WIDER_MODE (mode)) |
if ((unsigned) hard_regno_nregs[regno][mode] == nregs |
&& HARD_REGNO_MODE_OK (regno, mode) |
- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) |
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) |
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) |
found_mode = mode; |
+ if (found_mode != VOIDmode) |
+ return found_mode; |
+ |
for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); |
mode != VOIDmode; |
mode = GET_MODE_WIDER_MODE (mode)) |
if ((unsigned) hard_regno_nregs[regno][mode] == nregs |
&& HARD_REGNO_MODE_OK (regno, mode) |
- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) |
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) |
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) |
found_mode = mode; |
+ if (found_mode != VOIDmode) |
+ return found_mode; |
+ |
for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT); |
mode != VOIDmode; |
mode = GET_MODE_WIDER_MODE (mode)) |
if ((unsigned) hard_regno_nregs[regno][mode] == nregs |
&& HARD_REGNO_MODE_OK (regno, mode) |
- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) |
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) |
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) |
found_mode = mode; |
+ if (found_mode != VOIDmode) |
+ return found_mode; |
+ |
for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT); |
mode != VOIDmode; |
mode = GET_MODE_WIDER_MODE (mode)) |
if ((unsigned) hard_regno_nregs[regno][mode] == nregs |
&& HARD_REGNO_MODE_OK (regno, mode) |
- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) |
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) |
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) |
found_mode = mode; |
if (found_mode != VOIDmode) |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/002-case_insensitive.patch |
---|
@@ -0,0 +1,24 @@ |
commit 81cc26c706b2bc8c8c1eb1a322e5c5157900836e |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Sun Oct 19 21:45:51 2014 +0000 |
gcc: do not assume that the Mac OS X filesystem is case insensitive |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> |
SVN-Revision: 42973 |
--- a/include/filenames.h |
+++ b/include/filenames.h |
@@ -43,11 +43,6 @@ extern "C" { |
# define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) |
# define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) |
#else /* not DOSish */ |
-# if defined(__APPLE__) |
-# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM |
-# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 |
-# endif |
-# endif /* __APPLE__ */ |
# define HAS_DRIVE_SPEC(f) (0) |
# define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) |
# define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f) |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/010-documentation.patch |
---|
@@ -0,0 +1,35 @@ |
commit 098bd91f5eae625c7d2ee621e10930fc4434e5e2 |
Author: Luka Perkov <luka@openwrt.org> |
Date: Tue Feb 26 16:16:33 2013 +0000 |
gcc: don't build documentation |
This closes #13039. |
Signed-off-by: Luka Perkov <luka@openwrt.org> |
SVN-Revision: 35807 |
--- a/gcc/Makefile.in |
+++ b/gcc/Makefile.in |
@@ -3121,18 +3121,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) |
doc/gccint.info: $(TEXI_GCCINT_FILES) |
doc/cppinternals.info: $(TEXI_CPPINT_FILES) |
-doc/%.info: %.texi |
- if [ x$(BUILD_INFO) = xinfo ]; then \ |
- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ |
- -I $(gcc_docdir)/include -o $@ $<; \ |
- fi |
+doc/%.info: |
# Duplicate entry to handle renaming of gccinstall.info |
-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) |
- if [ x$(BUILD_INFO) = xinfo ]; then \ |
- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ |
- -I $(gcc_docdir)/include -o $@ $<; \ |
- fi |
+doc/gccinstall.info: |
doc/cpp.dvi: $(TEXI_CPP_FILES) |
doc/gcc.dvi: $(TEXI_GCC_FILES) |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/110-Fix-MIPS-PR-84790.patch |
---|
@@ -0,0 +1,20 @@ |
Fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790. |
MIPS16 functions have a static assembler prologue which clobbers |
registers v0 and v1. Add these register clobbers to function call |
instructions. |
--- a/gcc/config/mips/mips.c |
+++ b/gcc/config/mips/mips.c |
@@ -3098,6 +3098,12 @@ mips_emit_call_insn (rtx pattern, rtx or |
emit_insn (gen_update_got_version ()); |
} |
+ if (TARGET_MIPS16 && TARGET_USE_GOT) |
+ { |
+ clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS16_PIC_TEMP); |
+ clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS_PROLOGUE_TEMP (word_mode)); |
+ } |
+ |
if (TARGET_MIPS16 |
&& TARGET_EXPLICIT_RELOCS |
&& TARGET_CALL_CLOBBERED_GP) |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/230-musl_libssp.patch |
---|
@@ -0,0 +1,28 @@ |
commit 1877bc9d8f2be143fbe530347a945850d0ecd234 |
Author: Steven Barth <cyrus@openwrt.org> |
Date: Mon Jun 22 10:31:07 2015 +0000 |
gcc/musl: rework SSP-support |
Make musl provide libssp_nonshared.a and make GCC link it unconditionally |
if musl is used. This should be a no-op if SSP is disabled and seems to be |
the only reliable way of dealing with SSP over all packages due to the mess |
that is linkerflags handling in packages. |
Signed-off-by: Steven Barth <steven@midlink.org> |
SVN-Revision: 46108 |
--- a/gcc/gcc.c |
+++ b/gcc/gcc.c |
@@ -861,7 +861,9 @@ proper position among the other output f |
#endif |
#ifndef LINK_SSP_SPEC |
-#ifdef TARGET_LIBC_PROVIDES_SSP |
+#if DEFAULT_LIBC == LIBC_MUSL |
+#define LINK_SSP_SPEC "-lssp_nonshared" |
+#elif defined(TARGET_LIBC_PROVIDES_SSP) |
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ |
"|fstack-protector-strong|fstack-protector-explicit:}" |
#else |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/300-mips_Os_cpu_rtx_cost_model.patch |
---|
@@ -0,0 +1,21 @@ |
commit ecf7671b769fe96f7b5134be442089f8bdba55d2 |
Author: Felix Fietkau <nbd@nbd.name> |
Date: Thu Aug 4 20:29:45 2016 +0200 |
gcc: add a patch to generate better code with Os on mips |
Also happens to reduce compressed code size a bit |
Signed-off-by: Felix Fietkau <nbd@nbd.name> |
--- a/gcc/config/mips/mips.c |
+++ b/gcc/config/mips/mips.c |
@@ -19790,7 +19790,7 @@ mips_option_override (void) |
flag_pcc_struct_return = 0; |
/* Decide which rtx_costs structure to use. */ |
- if (optimize_size) |
+ if (0 && optimize_size) |
mips_cost = &mips_rtx_cost_optimize_size; |
else |
mips_cost = &mips_rtx_cost_data[mips_tune]; |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/800-arm_v5te_no_ldrd_strd.patch |
---|
@@ -0,0 +1,32 @@ |
commit b050f87d13b5dc7ed82feb9a90f4529de58bdf25 |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Wed Feb 19 19:20:10 2014 +0000 |
gcc: prevent the use of LDRD/STRD on ARMv5TE |
These instructions are for 64-bit load/store. On ARMv5TE, the CPU |
requires addresses to be aligned to 64-bit. When misaligned, behavior is |
undefined (effectively either loads the same word twice on LDRD, or |
corrupts surrounding memory on STRD). |
On ARMv6 and newer, unaligned access is safe. |
Removing these instructions for ARMv5TE is necessary, because GCC |
ignores alignment information in pointers and does unsafe optimizations |
that have shown up as bugs in various places. |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> |
SVN-Revision: 39638 |
--- a/gcc/config/arm/arm.h |
+++ b/gcc/config/arm/arm.h |
@@ -150,7 +150,7 @@ extern tree arm_fp16_type_node; |
/* Thumb-1 only. */ |
#define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm) |
-#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \ |
+#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \ |
&& !TARGET_THUMB1) |
#define TARGET_CRC32 (arm_arch_crc) |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/810-arm-softfloat-libgcc.patch |
---|
@@ -0,0 +1,33 @@ |
commit 8570c4be394cff7282f332f97da2ff569a927ddb |
Author: Imre Kaloz <kaloz@openwrt.org> |
Date: Wed Feb 2 20:06:12 2011 +0000 |
fixup arm soft-float symbols |
SVN-Revision: 25325 |
--- a/libgcc/config/arm/t-linux |
+++ b/libgcc/config/arm/t-linux |
@@ -1,6 +1,10 @@ |
LIB1ASMSRC = arm/lib1funcs.S |
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ |
- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 |
+ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ |
+ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ |
+ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ |
+ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ |
+ _arm_fixsfsi _arm_fixunssfsi |
# Just for these, we omit the frame pointer since it makes such a big |
# difference. |
--- a/gcc/config/arm/linux-elf.h |
+++ b/gcc/config/arm/linux-elf.h |
@@ -58,8 +58,6 @@ |
%{shared:-lc} \ |
%{!shared:%{profile:-lc_p}%{!profile:-lc}}" |
-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" |
- |
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" |
#define LINUX_TARGET_LINK_SPEC "%{h*} \ |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/820-libgcc_pic.patch |
---|
@@ -0,0 +1,44 @@ |
commit c96312958c0621e72c9b32da5bc224ffe2161384 |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Mon Oct 19 23:26:09 2009 +0000 |
gcc: create a proper libgcc_pic.a static library for relinking (4.3.3+ for now, backport will follow) |
SVN-Revision: 18086 |
--- a/libgcc/Makefile.in |
+++ b/libgcc/Makefile.in |
@@ -920,11 +920,12 @@ $(libgcov-driver-objects): %$(objext): $ |
# Static libraries. |
libgcc.a: $(libgcc-objects) |
+libgcc_pic.a: $(libgcc-s-objects) |
libgcov.a: $(libgcov-objects) |
libunwind.a: $(libunwind-objects) |
libgcc_eh.a: $(libgcc-eh-objects) |
-libgcc.a libgcov.a libunwind.a libgcc_eh.a: |
+libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a: |
-rm -f $@ |
objects="$(objects)"; \ |
@@ -945,7 +946,7 @@ all: libunwind.a |
endif |
ifeq ($(enable_shared),yes) |
-all: libgcc_eh.a libgcc_s$(SHLIB_EXT) |
+all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT) |
ifneq ($(LIBUNWIND),) |
all: libunwind$(SHLIB_EXT) |
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) |
@@ -1151,6 +1152,10 @@ install-shared: |
chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a |
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a |
+ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/ |
+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a |
+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a |
+ |
$(subst @multilib_dir@,$(MULTIDIR),$(subst \ |
@shlib_base_name@,libgcc_s,$(subst \ |
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/840-armv4_pass_fix-v4bx_to_ld.patch |
---|
@@ -0,0 +1,28 @@ |
commit 7edc8ca5456d9743dd0075eb3cc5b04f4f24c8cc |
Author: Imre Kaloz <kaloz@openwrt.org> |
Date: Wed Feb 2 19:34:36 2011 +0000 |
add armv4 fixup patches |
SVN-Revision: 25322 |
--- a/gcc/config/arm/linux-eabi.h |
+++ b/gcc/config/arm/linux-eabi.h |
@@ -88,10 +88,15 @@ |
#define MUSL_DYNAMIC_LINKER \ |
"/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" |
+/* For armv4 we pass --fix-v4bx to linker to support EABI */ |
+#undef TARGET_FIX_V4BX_SPEC |
+#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ |
+ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" |
+ |
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to |
use the GNU/Linux version, not the generic BPABI version. */ |
#undef LINK_SPEC |
-#define LINK_SPEC EABI_LINK_SPEC \ |
+#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \ |
LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ |
LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/850-use_shared_libgcc.patch |
---|
@@ -0,0 +1,54 @@ |
commit dcfc40358b5a3cae7320c17f8d1cebd5ad5540cd |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Sun Feb 12 20:25:47 2012 +0000 |
gcc 4.6: port over the missing patch 850-use_shared_libgcc.patch to prevent libgcc crap from leaking into every single binary |
SVN-Revision: 30486 |
--- a/gcc/config/arm/linux-eabi.h |
+++ b/gcc/config/arm/linux-eabi.h |
@@ -126,10 +126,6 @@ |
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ |
LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) |
-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we |
- do not use -lfloat. */ |
-#undef LIBGCC_SPEC |
- |
/* Clear the instruction cache from `beg' to `end'. This is |
implemented in lib1funcs.S, so ensure an error if this definition |
is used. */ |
--- a/gcc/config/linux.h |
+++ b/gcc/config/linux.h |
@@ -53,6 +53,10 @@ see the files COPYING3 and COPYING.RUNTI |
builtin_assert ("system=posix"); \ |
} while (0) |
+#ifndef LIBGCC_SPEC |
+#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}" |
+#endif |
+ |
/* Determine which dynamic linker to use depending on whether GLIBC or |
uClibc or Bionic or musl is the default C library and whether |
-muclibc or -mglibc or -mbionic or -mmusl has been passed to change |
--- a/libgcc/mkmap-symver.awk |
+++ b/libgcc/mkmap-symver.awk |
@@ -136,5 +136,5 @@ function output(lib) { |
else if (inherit[lib]) |
printf("} %s;\n", inherit[lib]); |
else |
- printf ("\n local:\n\t*;\n};\n"); |
+ printf ("\n\t*;\n};\n"); |
} |
--- a/gcc/config/rs6000/linux.h |
+++ b/gcc/config/rs6000/linux.h |
@@ -60,6 +60,9 @@ |
#undef CPP_OS_DEFAULT_SPEC |
#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" |
+#undef LIBGCC_SPEC |
+#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" |
+ |
#undef LINK_SHLIB_SPEC |
#define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/851-libgcc_no_compat.patch |
---|
@@ -0,0 +1,22 @@ |
commit 64661de100da1ec1061ef3e5e400285dce115e6b |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Sun May 10 13:16:35 2015 +0000 |
gcc: add some size optimization patches |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> |
SVN-Revision: 45664 |
--- a/libgcc/config/t-libunwind |
+++ b/libgcc/config/t-libunwind |
@@ -2,8 +2,7 @@ |
HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER |
-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ |
- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c |
+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c |
LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c |
# Override the default value from t-slibgcc-elf-ver and mention -lunwind |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/870-ppc_no_crtsavres.patch |
---|
@@ -0,0 +1,18 @@ |
commit d8c570a1531035c3e26bcd94741e5f5b9c36b5d9 |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Mon Mar 5 00:51:01 2012 +0000 |
gcc: do not emit references to _savegpr_* and _restgpr_* on powerpc, as they are tricky to deal with wrt. libgcc. they cannot be linked dynamically |
SVN-Revision: 30814 |
--- a/gcc/config/rs6000/rs6000.c |
+++ b/gcc/config/rs6000/rs6000.c |
@@ -26981,7 +26981,7 @@ rs6000_savres_strategy (rs6000_stack_t * |
/* Define cutoff for using out-of-line functions to save registers. */ |
if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) |
{ |
- if (!optimize_size) |
+ if (1) |
{ |
strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; |
strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/881-no_tm_section.patch |
---|
@@ -0,0 +1,22 @@ |
commit 565988ab47bd9b96b50608564aee2104aeb4b7ae |
Author: Felix Fietkau <nbd@nbd.name> |
Date: Tue Dec 13 14:20:49 2016 +0100 |
gcc: rip out transactional memory related bloat from crtbegin |
Slightly improves compression for each executable, saving about 4k from |
the default ar71xx rootfs |
Signed-off-by: Felix Fietkau <nbd@nbd.name> |
--- a/libgcc/crtstuff.c |
+++ b/libgcc/crtstuff.c |
@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ |
#endif |
#if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) |
-# define USE_TM_CLONE_REGISTRY 1 |
+# define USE_TM_CLONE_REGISTRY 0 |
#endif |
/* We do not want to add the weak attribute to the declarations of these |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/900-bad-mips16-crt.patch |
---|
@@ -0,0 +1,30 @@ |
commit 9dc38e48f7a6f88b7ac7bfaced91f53660204e46 |
Author: Florian Fainelli <florian@openwrt.org> |
Date: Fri Apr 5 12:36:06 2013 +0000 |
toolchain/gcc: .init and .fini need to pick one ISA |
The .init and .fini sections are built by concatenating code |
fragments. Putting mips16 code in the middle of a mips32 code block |
doesn't work. Make gcc built the magic crt stuff in no-mips16 mode. |
This is specific to 4.6-linaro but is probably portable to other gcc |
flavors. Adding this to the t-libgcc-mips16 makefile fragment is a |
hack not suitable for pushing upstream, but there is no mips/t-linux |
or mips/t-uclibc and I am not going to touch gcc/configure for two |
lines. |
Signed-off-by: Jay Carlson <nop@nop.com> |
Signed-off-by: Florian Fainelli <florian@openwrt.org> |
SVN-Revision: 36200 |
--- a/libgcc/config/mips/t-mips16 |
+++ b/libgcc/config/mips/t-mips16 |
@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 |
# Version these symbols if building libgcc.so. |
SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver |
+ |
+CRTSTUFF_T_CFLAGS += -mno-mips16 |
+CRTSTUFF_T_CFLAGS_S += -mno-mips16 |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/910-mbsd_multi.patch |
---|
@@ -0,0 +1,146 @@ |
commit 99368862e44740ff4fd33760893f04e14f9dbdf1 |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Tue Jul 31 00:52:27 2007 +0000 |
Port the mbsd_multi patch from freewrt, which adds -fhonour-copts. This will emit warnings in packages that don't use our target cflags properly |
SVN-Revision: 8256 |
This patch brings over a feature from MirBSD: |
* -fhonour-copts |
If this option is not given, it's warned (depending |
on environment variables). This is to catch errors |
of misbuilt packages which override CFLAGS themselves. |
This patch was authored by Thorsten Glaser <tg at mirbsd.de> |
with copyright assignment to the FSF in effect. |
--- a/gcc/c-family/c-opts.c |
+++ b/gcc/c-family/c-opts.c |
@@ -108,6 +108,9 @@ static int class_dump_flags; |
/* Whether any standard preincluded header has been preincluded. */ |
static bool done_preinclude; |
+/* Check if a port honours COPTS. */ |
+static int honour_copts = 0; |
+ |
static void handle_OPT_d (const char *); |
static void set_std_cxx98 (int); |
static void set_std_cxx11 (int); |
@@ -456,6 +459,12 @@ c_common_handle_option (size_t scode, co |
flag_no_builtin = !value; |
break; |
+ case OPT_fhonour_copts: |
+ if (c_language == clk_c) { |
+ honour_copts++; |
+ } |
+ break; |
+ |
case OPT_fconstant_string_class_: |
constant_string_class_name = arg; |
break; |
@@ -1084,6 +1093,47 @@ c_common_init (void) |
return false; |
} |
+ if (c_language == clk_c) { |
+ char *ev = getenv ("GCC_HONOUR_COPTS"); |
+ int evv; |
+ if (ev == NULL) |
+ evv = -1; |
+ else if ((*ev == '0') || (*ev == '\0')) |
+ evv = 0; |
+ else if (*ev == '1') |
+ evv = 1; |
+ else if (*ev == '2') |
+ evv = 2; |
+ else if (*ev == 's') |
+ evv = -1; |
+ else { |
+ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); |
+ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ |
+ } |
+ if (evv == 1) { |
+ if (honour_copts == 0) { |
+ error ("someone does not honour COPTS at all in lenient mode"); |
+ return false; |
+ } else if (honour_copts != 1) { |
+ warning (0, "someone does not honour COPTS correctly, passed %d times", |
+ honour_copts); |
+ } |
+ } else if (evv == 2) { |
+ if (honour_copts == 0) { |
+ error ("someone does not honour COPTS at all in strict mode"); |
+ return false; |
+ } else if (honour_copts != 1) { |
+ error ("someone does not honour COPTS correctly, passed %d times", |
+ honour_copts); |
+ return false; |
+ } |
+ } else if (evv == 0) { |
+ if (honour_copts != 1) |
+ inform (0, "someone does not honour COPTS correctly, passed %d times", |
+ honour_copts); |
+ } |
+ } |
+ |
return true; |
} |
--- a/gcc/c-family/c.opt |
+++ b/gcc/c-family/c.opt |
@@ -1412,6 +1412,9 @@ C++ ObjC++ Optimization Alias(fexception |
fhonor-std |
C++ ObjC++ Ignore Warn(switch %qs is no longer supported) |
+fhonour-copts |
+C ObjC C++ ObjC++ RejectNegative |
+ |
fhosted |
C ObjC |
Assume normal C execution environment. |
--- a/gcc/common.opt |
+++ b/gcc/common.opt |
@@ -1510,6 +1510,9 @@ fguess-branch-probability |
Common Report Var(flag_guess_branch_prob) Optimization |
Enable guessing of branch probabilities. |
+fhonour-copts |
+Common RejectNegative |
+ |
; Nonzero means ignore `#ident' directives. 0 means handle them. |
; Generate position-independent code for executables if possible |
; On SVR4 targets, it also controls whether or not to emit a |
--- a/gcc/opts.c |
+++ b/gcc/opts.c |
@@ -1954,6 +1954,9 @@ common_handle_option (struct gcc_options |
opts, opts_set, loc, dc); |
break; |
+ case OPT_fhonour_copts: |
+ break; |
+ |
case OPT_Wlarger_than_: |
opts->x_larger_than_size = value; |
opts->x_warn_larger_than = value != -1; |
--- a/gcc/doc/invoke.texi |
+++ b/gcc/doc/invoke.texi |
@@ -6572,6 +6572,17 @@ This option is only supported for C and |
@option{-Wall} and by @option{-Wpedantic}, which can be disabled with |
@option{-Wno-pointer-sign}. |
+@item -fhonour-copts |
+@opindex fhonour-copts |
+If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not |
+given at least once, and warn if it is given more than once. |
+If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not |
+given exactly once. |
+If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option |
+is not given exactly once. |
+The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. |
+This flag and environment variable only affect the C language. |
+ |
@item -Wstack-protector |
@opindex Wstack-protector |
@opindex Wno-stack-protector |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/920-specs_nonfatal_getenv.patch |
---|
@@ -0,0 +1,22 @@ |
Author: Jo-Philipp Wich <jow@openwrt.org> |
Date: Sat Apr 21 03:02:39 2012 +0000 |
gcc: add patch to make the getenv() spec function nonfatal if requested environment variable is unset |
SVN-Revision: 31390 |
--- a/gcc/gcc.c |
+++ b/gcc/gcc.c |
@@ -9281,8 +9281,10 @@ getenv_spec_function (int argc, const ch |
value = varname; |
if (!value) |
- fatal_error (input_location, |
- "environment variable %qs not defined", varname); |
+ { |
+ warning (input_location, "environment variable %qs not defined", varname); |
+ value = ""; |
+ } |
/* We have to escape every character of the environment variable so |
they are not interpreted as active spec characters. A |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/930-fix-mips-noexecstack.patch |
---|
@@ -0,0 +1,111 @@ |
From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001 |
From: Andrew McDonnell <bugs@andrewmcdonnell.net> |
Date: Fri, 3 Oct 2014 19:09:00 +0930 |
Subject: Add .note.GNU-stack section |
See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html |
Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html |
Re: [Patch, MIPS] Add .note.GNU-stack section |
From: Steve Ellcey <sellcey at mips dot com> |
On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote: |
> |
> |
> On Wed, Sep 10, 2014 at 9:27 AM, <pinskia@gmail.com> wrote: |
> This works except you did not update the assembly files in |
> libgcc or glibc. We (Cavium) have the same patch in our tree |
> for a few released versions. |
> Mind just checking yours in then Andrew? |
> Thanks! |
> -eric |
I talked to Andrew about what files he changed in GCC and created and |
tested this new patch. Andrew also mentioned changing some assembly |
files in glibc but I don't see any use of '.section .note.GNU-stack' in |
any assembly files in glibc (for any platform) so I wasn't planning on |
creating a glibc to add them to mips glibc assembly language files. |
OK to check in this patch? |
Steve Ellcey |
sellcey@mips.com |
2014-09-26 Steve Ellcey <sellcey@mips.com> |
--- |
gcc/config/mips/mips.c | 3 +++ |
libgcc/config/mips/crti.S | 4 ++++ |
libgcc/config/mips/crtn.S | 3 +++ |
libgcc/config/mips/mips16.S | 4 ++++ |
libgcc/config/mips/vr4120-div.S | 4 ++++ |
5 files changed, 18 insertions(+) |
--- a/gcc/config/mips/mips.c |
+++ b/gcc/config/mips/mips.c |
@@ -22567,6 +22567,9 @@ mips_promote_function_mode (const_tree t |
#undef TARGET_CUSTOM_FUNCTION_DESCRIPTORS |
#define TARGET_CUSTOM_FUNCTION_DESCRIPTORS 2 |
+#undef TARGET_ASM_FILE_END |
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack |
+ |
struct gcc_target targetm = TARGET_INITIALIZER; |
#include "gt-mips.h" |
--- a/libgcc/config/mips/crti.S |
+++ b/libgcc/config/mips/crti.S |
@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
<http://www.gnu.org/licenses/>. */ |
+ |
+/* An executable stack is *not* required for these functions. */ |
+ .section .note.GNU-stack,"",%progbits |
+ |
/* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. |
Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ |
--- a/libgcc/config/mips/crtn.S |
+++ b/libgcc/config/mips/crtn.S |
@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
<http://www.gnu.org/licenses/>. */ |
+/* An executable stack is *not* required for these functions. */ |
+ .section .note.GNU-stack,"",%progbits |
+ |
/* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. |
Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ |
--- a/libgcc/config/mips/mips16.S |
+++ b/libgcc/config/mips/mips16.S |
@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI |
values using the soft-float calling convention, but do the actual |
operation using the hard floating point instructions. */ |
+/* An executable stack is *not* required for these functions. */ |
+ .section .note.GNU-stack,"",%progbits |
+ .previous |
+ |
#if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64) |
/* This file contains 32-bit assembly code. */ |
--- a/libgcc/config/mips/vr4120-div.S |
+++ b/libgcc/config/mips/vr4120-div.S |
@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI |
-mfix-vr4120. div and ddiv do not give the correct result when one |
of the operands is negative. */ |
+/* An executable stack is *not* required for these functions. */ |
+ .section .note.GNU-stack,"",%progbits |
+ .previous |
+ |
.set nomips16 |
#define DIV \ |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/931-libffi-fix-MIPS-softfloat-build-issue.patch |
---|
@@ -0,0 +1,175 @@ |
From c0c62fa4256f805389f16ebfc4a60cf789129b50 Mon Sep 17 00:00:00 2001 |
From: BangLang Huang <banglang.huang@foxmail.com> |
Date: Wed, 9 Nov 2016 10:36:49 +0800 |
Subject: [PATCH] libffi: fix MIPS softfloat build issue |
Backported from github.com/libffi/libffi#272 |
Signed-off-by: BangLang Huang <banglang.huang@foxmail.com> |
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> |
--- |
libffi/src/mips/n32.S | 17 +++++++++++++++++ |
libffi/src/mips/o32.S | 17 +++++++++++++++++ |
2 files changed, 34 insertions(+) |
diff --git a/libffi/src/mips/n32.S b/libffi/src/mips/n32.S |
index c6985d30a6f..8f25994773c 100644 |
--- a/libffi/src/mips/n32.S |
+++ b/libffi/src/mips/n32.S |
@@ -107,6 +107,16 @@ loadregs: |
REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6. |
+#ifdef __mips_soft_float |
+ REG_L a0, 0*FFI_SIZEOF_ARG(t9) |
+ REG_L a1, 1*FFI_SIZEOF_ARG(t9) |
+ REG_L a2, 2*FFI_SIZEOF_ARG(t9) |
+ REG_L a3, 3*FFI_SIZEOF_ARG(t9) |
+ REG_L a4, 4*FFI_SIZEOF_ARG(t9) |
+ REG_L a5, 5*FFI_SIZEOF_ARG(t9) |
+ REG_L a6, 6*FFI_SIZEOF_ARG(t9) |
+ REG_L a7, 7*FFI_SIZEOF_ARG(t9) |
+#else |
and t4, t6, ((1<<FFI_FLAG_BITS)-1) |
REG_L a0, 0*FFI_SIZEOF_ARG(t9) |
beqz t4, arg1_next |
@@ -193,6 +203,7 @@ arg7_next: |
arg8_doublep: |
l.d $f19, 7*FFI_SIZEOF_ARG(t9) |
arg8_next: |
+#endif |
callit: |
# Load the function pointer |
@@ -214,6 +225,7 @@ retint: |
b epilogue |
retfloat: |
+#ifndef __mips_soft_float |
bne t6, FFI_TYPE_FLOAT, retdouble |
jal t9 |
REG_L t4, 4*FFI_SIZEOF_ARG($fp) |
@@ -272,6 +284,7 @@ retstruct_f_d: |
s.s $f0, 0(t4) |
s.d $f2, 8(t4) |
b epilogue |
+#endif |
retstruct_d_soft: |
bne t6, FFI_TYPE_STRUCT_D_SOFT, retstruct_f_soft |
@@ -429,6 +442,7 @@ ffi_closure_N32: |
REG_S a6, A6_OFF2($sp) |
REG_S a7, A7_OFF2($sp) |
+#ifndef __mips_soft_float |
# Store all possible float/double registers. |
s.d $f12, F12_OFF2($sp) |
s.d $f13, F13_OFF2($sp) |
@@ -438,6 +452,7 @@ ffi_closure_N32: |
s.d $f17, F17_OFF2($sp) |
s.d $f18, F18_OFF2($sp) |
s.d $f19, F19_OFF2($sp) |
+#endif |
# Call ffi_closure_mips_inner_N32 to do the real work. |
LA t9, ffi_closure_mips_inner_N32 |
@@ -458,6 +473,7 @@ cls_retint: |
b cls_epilogue |
cls_retfloat: |
+#ifndef __mips_soft_float |
bne v0, FFI_TYPE_FLOAT, cls_retdouble |
l.s $f0, V0_OFF2($sp) |
b cls_epilogue |
@@ -500,6 +516,7 @@ cls_retstruct_f_d: |
l.s $f0, V0_OFF2($sp) |
l.d $f2, V1_OFF2($sp) |
b cls_epilogue |
+#endif |
cls_retstruct_small2: |
REG_L v0, V0_OFF2($sp) |
diff --git a/libffi/src/mips/o32.S b/libffi/src/mips/o32.S |
index eb279813a76..1aff4b14814 100644 |
--- a/libffi/src/mips/o32.S |
+++ b/libffi/src/mips/o32.S |
@@ -82,13 +82,16 @@ sixteen: |
ADDU $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args |
+#ifndef __mips_soft_float |
bnez t0, pass_d # make it quick for int |
+#endif |
REG_L a0, 0*FFI_SIZEOF_ARG($sp) # just go ahead and load the |
REG_L a1, 1*FFI_SIZEOF_ARG($sp) # four regs. |
REG_L a2, 2*FFI_SIZEOF_ARG($sp) |
REG_L a3, 3*FFI_SIZEOF_ARG($sp) |
b call_it |
+#ifndef __mips_soft_float |
pass_d: |
bne t0, FFI_ARGS_D, pass_f |
l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args |
@@ -130,6 +133,7 @@ pass_f_d: |
# bne t0, FFI_ARGS_F_D, call_it |
l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args |
l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float |
+#endif |
call_it: |
# Load the function pointer |
@@ -158,14 +162,23 @@ retfloat: |
bne t2, FFI_TYPE_FLOAT, retdouble |
jalr t9 |
REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) |
+#ifndef __mips_soft_float |
s.s $f0, 0(t0) |
+#else |
+ REG_S v0, 0(t0) |
+#endif |
b epilogue |
retdouble: |
bne t2, FFI_TYPE_DOUBLE, noretval |
jalr t9 |
REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) |
+#ifndef __mips_soft_float |
s.d $f0, 0(t0) |
+#else |
+ REG_S v1, 4(t0) |
+ REG_S v0, 0(t0) |
+#endif |
b epilogue |
noretval: |
@@ -261,9 +274,11 @@ $LCFI7: |
li $13, 1 # FFI_O32 |
bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT |
+#ifndef __mips_soft_float |
# Store all possible float/double registers. |
s.d $f12, FA_0_0_OFF2($fp) |
s.d $f14, FA_1_0_OFF2($fp) |
+#endif |
1: |
# Call ffi_closure_mips_inner_O32 to do the work. |
la t9, ffi_closure_mips_inner_O32 |
@@ -281,6 +296,7 @@ $LCFI7: |
li $13, 1 # FFI_O32 |
bne $16, $13, 1f # Skip fp restore if FFI_O32_SOFT_FLOAT |
+#ifndef __mips_soft_float |
li $9, FFI_TYPE_FLOAT |
l.s $f0, V0_OFF2($fp) |
beq $8, $9, closure_done |
@@ -288,6 +304,7 @@ $LCFI7: |
li $9, FFI_TYPE_DOUBLE |
l.d $f0, V0_OFF2($fp) |
beq $8, $9, closure_done |
+#endif |
1: |
REG_L $3, V1_OFF2($fp) |
REG_L $2, V0_OFF2($fp) |
-- |
2.16.3 |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/940-no-clobber-stamp-bits.patch |
---|
@@ -0,0 +1,33 @@ |
commit 548d9a008ff265e9eaa3c7e0e6e301c6bd5645e6 |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Fri Dec 12 17:01:57 2014 +0000 |
gcc: don't clobber stamp-bits with a symlink to itself |
Several versions of gcc have an issue in libstdc++v3 where the build may |
clobber stamp-bits with a link to itself. This doesn't manifest itself |
on all systems. On several Ubuntu systems, this doesn't appear to be a |
problem, but it is an issue on Fedora 16 systems. |
To fix the issue, we'll simply filter out stamp-bits from the symlinks |
to be generated. |
Note: gcc 4.4.7 is unaffected by this issue, so no fix is necessary |
there. |
Signed-off-by: John Szakmeister <john@szakmeister.net> |
SVN-Revision: 43669 |
--- a/libstdc++-v3/include/Makefile.in |
+++ b/libstdc++-v3/include/Makefile.in |
@@ -1474,7 +1474,7 @@ stamp-bits: ${bits_headers} |
@$(STAMP) stamp-bits |
stamp-bits-sup: stamp-bits ${bits_sup_headers} |
- @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null |
+ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null |
@$(STAMP) stamp-bits-sup |
stamp-c_base: ${c_base_headers} |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/950-cpp_file_path_translation.patch |
---|
@@ -0,0 +1,181 @@ |
commit 331735a357a73c7b8adc205241ac3cc6543d985e |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Tue Nov 17 12:38:22 2015 +0000 |
gcc: add a patch to 5.x that supports translation of __FILE__ paths |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> |
SVN-Revision: 47490 |
Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047 |
--- a/gcc/c-family/c-opts.c |
+++ b/gcc/c-family/c-opts.c |
@@ -588,6 +588,10 @@ c_common_handle_option (size_t scode, co |
add_path (xstrdup (arg), SYSTEM, 0, true); |
break; |
+ case OPT_iremap: |
+ add_cpp_remap_path (arg); |
+ break; |
+ |
case OPT_iwithprefix: |
add_prefixed_path (arg, SYSTEM); |
break; |
--- a/gcc/c-family/c.opt |
+++ b/gcc/c-family/c.opt |
@@ -1825,6 +1825,10 @@ iquote |
C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs) |
-iquote <dir> Add <dir> to the end of the quote include path. |
+iremap |
+C ObjC C++ ObjC++ Joined Separate |
+-iremap <src:dst> Convert <src> to <dst> if it occurs as prefix in __FILE__. |
+ |
iwithprefix |
C ObjC C++ ObjC++ Joined Separate |
-iwithprefix <dir> Add <dir> to the end of the system include path. |
--- a/gcc/doc/cpp.texi |
+++ b/gcc/doc/cpp.texi |
@@ -4272,6 +4272,7 @@ Refer to the GCC manual for full documen |
@c man begin SYNOPSIS |
cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] |
[@option{-I}@var{dir}@dots{}] [@option{-iquote}@var{dir}@dots{}] |
+ [@option{-iremap}@var{src}:@var{dst}] |
[@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}] |
[@option{-MP}] [@option{-MQ} @var{target}@dots{}] |
[@option{-MT} @var{target}@dots{}] |
--- a/gcc/doc/cppopts.texi |
+++ b/gcc/doc/cppopts.texi |
@@ -220,6 +220,12 @@ extensions @samp{.i}, @samp{.ii} or @sam |
extensions that GCC uses for preprocessed files created by |
@option{-save-temps}. |
+@item -iremap @var{src}:@var{dst} |
+@opindex iremap |
+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. |
+This option can be specified more than once. Processing stops at the first |
+match. |
+ |
@item -fdirectives-only |
@opindex fdirectives-only |
When preprocessing, handle directives, but do not expand macros. |
--- a/gcc/doc/invoke.texi |
+++ b/gcc/doc/invoke.texi |
@@ -11871,6 +11871,12 @@ by @option{-fplugin=@var{name}} instead |
@option{-fplugin=@var{path}/@var{name}.so}. This option is not meant |
to be used by the user, but only passed by the driver. |
+@item -iremap @var{src}:@var{dst} |
+@opindex iremap |
+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. |
+This option can be specified more than once. Processing stops at the first |
+match. |
+ |
@item -L@var{dir} |
@opindex L |
Add directory @var{dir} to the list of directories to be searched |
--- a/libcpp/include/cpplib.h |
+++ b/libcpp/include/cpplib.h |
@@ -820,6 +820,9 @@ extern void cpp_set_lang (cpp_reader *, |
/* Set the include paths. */ |
extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int); |
+/* Provide src:dst pair for __FILE__ remapping. */ |
+extern void add_cpp_remap_path (const char *); |
+ |
/* Call these to get pointers to the options, callback, and deps |
structures for a given reader. These pointers are good until you |
call cpp_finish on that reader. You can either edit the callbacks |
--- a/libcpp/macro.c |
+++ b/libcpp/macro.c |
@@ -227,6 +227,64 @@ static const char * const monthnames[] = |
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" |
}; |
+static size_t remap_pairs; |
+static char **remap_src; |
+static char **remap_dst; |
+ |
+void |
+add_cpp_remap_path (const char *arg) |
+{ |
+ const char *arg_dst; |
+ size_t len; |
+ |
+ arg_dst = strchr(arg, ':'); |
+ if (arg_dst == NULL) |
+ { |
+ fprintf(stderr, "Invalid argument for -iremap\n"); |
+ exit(1); |
+ } |
+ |
+ len = arg_dst - arg; |
+ ++arg_dst; |
+ |
+ remap_src = (char **) xrealloc(remap_src, sizeof(char *) * (remap_pairs + 1)); |
+ remap_dst = (char **) xrealloc(remap_dst, sizeof(char *) * (remap_pairs + 1)); |
+ |
+ remap_src[remap_pairs] = (char *) xmalloc(len + 1); |
+ memcpy(remap_src[remap_pairs], arg, len); |
+ remap_src[remap_pairs][len] = '\0'; |
+ remap_dst[remap_pairs] = xstrdup(arg_dst); |
+ ++remap_pairs; |
+} |
+ |
+static const char * |
+cpp_remap_file (const char *arg, char **tmp_name) |
+{ |
+ char *result; |
+ size_t i, len; |
+ |
+ for (i = 0; i < remap_pairs; ++i) |
+ { |
+ len = strlen (remap_src[i]); |
+ if (strncmp (remap_src[i], arg, len)) |
+ continue; |
+ if (arg[len] == '\0') |
+ return xstrdup (remap_dst[i]); |
+ if (arg[len] != '/') |
+ continue; |
+ arg += len; |
+ len = strlen (remap_dst[i]); |
+ result = (char *) xmalloc (len + strlen (arg) + 1); |
+ memcpy(result, remap_dst[i], len); |
+ strcpy(result + len, arg); |
+ *tmp_name = result; |
+ |
+ return result; |
+ } |
+ |
+ return arg; |
+} |
+ |
/* Helper function for builtin_macro. Returns the text generated by |
a builtin macro. */ |
const uchar * |
@@ -290,6 +348,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi |
{ |
unsigned int len; |
const char *name; |
+ char *tmp_name = NULL; |
uchar *buf; |
if (node->value.builtin == BT_FILE) |
@@ -301,6 +360,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi |
if (!name) |
abort (); |
} |
+ name = cpp_remap_file (name, &tmp_name); |
len = strlen (name); |
buf = _cpp_unaligned_alloc (pfile, len * 2 + 3); |
result = buf; |
@@ -308,6 +368,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi |
buf = cpp_quote_string (buf + 1, (const unsigned char *) name, len); |
*buf++ = '"'; |
*buf = '\0'; |
+ free (tmp_name); |
} |
break; |
/branches/18.06.1/toolchain/gcc/patches/7.4.0/960-gotools-fix-compilation-when-making-cross-compiler.patch |
---|
@@ -0,0 +1,73 @@ |
From dda6b050cd74a352670787a294596a9c56c21327 Mon Sep 17 00:00:00 2001 |
From: Yousong Zhou <yszhou4tech@gmail.com> |
Date: Fri, 4 May 2018 18:20:53 +0800 |
Subject: [PATCH] gotools: fix compilation when making cross compiler |
libgo is "the runtime support library for the Go programming language. |
This library is intended for use with the Go frontend." |
gccgo will link target files with libgo.so which depends on libgcc_s.so.1, but |
the linker will complain that it cannot find it. That's because shared libgcc |
is not present in the install directory yet. libgo.so was made without problem |
because gcc will emit -lgcc_s when compiled with -shared option. When gotools |
were being made, it was supplied with -static-libgcc thus no link option was |
provided. Check LIBGO in gcc/go/gcc-spec.c for how gccgo make a builtin spec |
for linking with libgo.so |
- GccgoCrossCompilation, https://github.com/golang/go/wiki/GccgoCrossCompilation |
- Cross-building instructions, http://www.eglibc.org/archives/patches/msg00078.html |
When 3-pass GCC compilation is used, shared libgcc runtime libraries will be |
available after gcc pass2 completed and will meet the gotools link requirement |
at gcc pass3 |
--- |
gotools/Makefile.am | 4 +++- |
gotools/Makefile.in | 4 +++- |
2 files changed, 6 insertions(+), 2 deletions(-) |
diff --git a/gotools/Makefile.am b/gotools/Makefile.am |
index 5f3940a278b..9c22f5df103 100644 |
--- a/gotools/Makefile.am |
+++ b/gotools/Makefile.am |
@@ -26,6 +26,7 @@ PWD_COMMAND = $${PWDCMD-pwd} |
STAMP = echo timestamp > |
libgodir = ../$(target_noncanonical)/libgo |
+libgccdir = ../$(target_noncanonical)/libgcc |
LIBGODEP = $(libgodir)/libgo.la |
if NATIVE |
@@ -38,7 +39,8 @@ endif |
GOCFLAGS = $(CFLAGS_FOR_TARGET) |
GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS) |
-AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs |
+AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs \ |
+ -L $(libgccdir) -L $(libgccdir)/.libs -lgcc_s |
GOLINK = $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@ |
cmdsrcdir = $(srcdir)/../libgo/go/cmd |
diff --git a/gotools/Makefile.in b/gotools/Makefile.in |
index 4386576b011..0bdd9290e01 100644 |
--- a/gotools/Makefile.in |
+++ b/gotools/Makefile.in |
@@ -252,13 +252,15 @@ mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs |
PWD_COMMAND = $${PWDCMD-pwd} |
STAMP = echo timestamp > |
libgodir = ../$(target_noncanonical)/libgo |
+libgccdir = ../$(target_noncanonical)/libgcc |
LIBGODEP = $(libgodir)/libgo.la |
@NATIVE_FALSE@GOCOMPILER = $(GOC) |
# Use the compiler we just built. |
@NATIVE_TRUE@GOCOMPILER = $(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) |
GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS) |
-AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs |
+AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs \ |
+ -L $(libgccdir) -L $(libgccdir)/.libs -lgcc_s |
GOLINK = $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@ |
cmdsrcdir = $(srcdir)/../libgo/go/cmd |
go_cmd_go_files = \ |
-- |
2.16.3 |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/002-case_insensitive.patch |
---|
@@ -0,0 +1,24 @@ |
commit 81cc26c706b2bc8c8c1eb1a322e5c5157900836e |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Sun Oct 19 21:45:51 2014 +0000 |
gcc: do not assume that the Mac OS X filesystem is case insensitive |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> |
SVN-Revision: 42973 |
--- a/include/filenames.h |
+++ b/include/filenames.h |
@@ -43,11 +43,6 @@ extern "C" { |
# define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) |
# define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) |
#else /* not DOSish */ |
-# if defined(__APPLE__) |
-# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM |
-# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 |
-# endif |
-# endif /* __APPLE__ */ |
# define HAS_DRIVE_SPEC(f) (0) |
# define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) |
# define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f) |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/010-documentation.patch |
---|
@@ -0,0 +1,35 @@ |
commit 098bd91f5eae625c7d2ee621e10930fc4434e5e2 |
Author: Luka Perkov <luka@openwrt.org> |
Date: Tue Feb 26 16:16:33 2013 +0000 |
gcc: don't build documentation |
This closes #13039. |
Signed-off-by: Luka Perkov <luka@openwrt.org> |
SVN-Revision: 35807 |
--- a/gcc/Makefile.in |
+++ b/gcc/Makefile.in |
@@ -3203,18 +3203,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) |
doc/gccint.info: $(TEXI_GCCINT_FILES) |
doc/cppinternals.info: $(TEXI_CPPINT_FILES) |
-doc/%.info: %.texi |
- if [ x$(BUILD_INFO) = xinfo ]; then \ |
- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ |
- -I $(gcc_docdir)/include -o $@ $<; \ |
- fi |
+doc/%.info: |
# Duplicate entry to handle renaming of gccinstall.info |
-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) |
- if [ x$(BUILD_INFO) = xinfo ]; then \ |
- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ |
- -I $(gcc_docdir)/include -o $@ $<; \ |
- fi |
+doc/gccinstall.info: |
doc/cpp.dvi: $(TEXI_CPP_FILES) |
doc/gcc.dvi: $(TEXI_GCC_FILES) |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/110-Fix-MIPS-PR-84790.patch |
---|
@@ -0,0 +1,20 @@ |
Fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790. |
MIPS16 functions have a static assembler prologue which clobbers |
registers v0 and v1. Add these register clobbers to function call |
instructions. |
--- a/gcc/config/mips/mips.c |
+++ b/gcc/config/mips/mips.c |
@@ -3102,6 +3102,12 @@ mips_emit_call_insn (rtx pattern, rtx or |
emit_insn (gen_update_got_version ()); |
} |
+ if (TARGET_MIPS16 && TARGET_USE_GOT) |
+ { |
+ clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS16_PIC_TEMP); |
+ clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS_PROLOGUE_TEMP (word_mode)); |
+ } |
+ |
if (TARGET_MIPS16 |
&& TARGET_EXPLICIT_RELOCS |
&& TARGET_CALL_CLOBBERED_GP) |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/230-musl_libssp.patch |
---|
@@ -0,0 +1,13 @@ |
--- a/gcc/gcc.c |
+++ b/gcc/gcc.c |
@@ -868,7 +868,9 @@ proper position among the other output f |
#endif |
#ifndef LINK_SSP_SPEC |
-#ifdef TARGET_LIBC_PROVIDES_SSP |
+#if DEFAULT_LIBC == LIBC_MUSL |
+#define LINK_SSP_SPEC "-lssp_nonshared" |
+#elif defined(TARGET_LIBC_PROVIDES_SSP) |
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ |
"|fstack-protector-strong|fstack-protector-explicit:}" |
#else |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/300-mips_Os_cpu_rtx_cost_model.patch |
---|
@@ -0,0 +1,21 @@ |
commit ecf7671b769fe96f7b5134be442089f8bdba55d2 |
Author: Felix Fietkau <nbd@nbd.name> |
Date: Thu Aug 4 20:29:45 2016 +0200 |
gcc: add a patch to generate better code with Os on mips |
Also happens to reduce compressed code size a bit |
Signed-off-by: Felix Fietkau <nbd@nbd.name> |
--- a/gcc/config/mips/mips.c |
+++ b/gcc/config/mips/mips.c |
@@ -19834,7 +19834,7 @@ mips_option_override (void) |
flag_pcc_struct_return = 0; |
/* Decide which rtx_costs structure to use. */ |
- if (optimize_size) |
+ if (0 && optimize_size) |
mips_cost = &mips_rtx_cost_optimize_size; |
else |
mips_cost = &mips_rtx_cost_data[mips_tune]; |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/800-arm_v5te_no_ldrd_strd.patch |
---|
@@ -0,0 +1,11 @@ |
--- a/gcc/config/arm/arm.h |
+++ b/gcc/config/arm/arm.h |
@@ -155,7 +155,7 @@ extern tree arm_fp16_type_node; |
/* Thumb-1 only. */ |
#define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm) |
-#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \ |
+#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \ |
&& !TARGET_THUMB1) |
#define TARGET_CRC32 (arm_arch_crc) |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/810-arm-softfloat-libgcc.patch |
---|
@@ -0,0 +1,33 @@ |
commit 8570c4be394cff7282f332f97da2ff569a927ddb |
Author: Imre Kaloz <kaloz@openwrt.org> |
Date: Wed Feb 2 20:06:12 2011 +0000 |
fixup arm soft-float symbols |
SVN-Revision: 25325 |
--- a/libgcc/config/arm/t-linux |
+++ b/libgcc/config/arm/t-linux |
@@ -1,6 +1,10 @@ |
LIB1ASMSRC = arm/lib1funcs.S |
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ |
- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 |
+ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ |
+ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ |
+ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ |
+ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ |
+ _arm_fixsfsi _arm_fixunssfsi |
# Just for these, we omit the frame pointer since it makes such a big |
# difference. |
--- a/gcc/config/arm/linux-elf.h |
+++ b/gcc/config/arm/linux-elf.h |
@@ -58,8 +58,6 @@ |
%{shared:-lc} \ |
%{!shared:%{profile:-lc_p}%{!profile:-lc}}" |
-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" |
- |
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" |
#define LINUX_TARGET_LINK_SPEC "%{h*} \ |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/820-libgcc_pic.patch |
---|
@@ -0,0 +1,44 @@ |
commit c96312958c0621e72c9b32da5bc224ffe2161384 |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Mon Oct 19 23:26:09 2009 +0000 |
gcc: create a proper libgcc_pic.a static library for relinking (4.3.3+ for now, backport will follow) |
SVN-Revision: 18086 |
--- a/libgcc/Makefile.in |
+++ b/libgcc/Makefile.in |
@@ -923,11 +923,12 @@ $(libgcov-driver-objects): %$(objext): $ |
# Static libraries. |
libgcc.a: $(libgcc-objects) |
+libgcc_pic.a: $(libgcc-s-objects) |
libgcov.a: $(libgcov-objects) |
libunwind.a: $(libunwind-objects) |
libgcc_eh.a: $(libgcc-eh-objects) |
-libgcc.a libgcov.a libunwind.a libgcc_eh.a: |
+libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a: |
-rm -f $@ |
objects="$(objects)"; \ |
@@ -948,7 +949,7 @@ all: libunwind.a |
endif |
ifeq ($(enable_shared),yes) |
-all: libgcc_eh.a libgcc_s$(SHLIB_EXT) |
+all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT) |
ifneq ($(LIBUNWIND),) |
all: libunwind$(SHLIB_EXT) |
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) |
@@ -1154,6 +1155,10 @@ install-shared: |
chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a |
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a |
+ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/ |
+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a |
+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a |
+ |
$(subst @multilib_dir@,$(MULTIDIR),$(subst \ |
@shlib_base_name@,libgcc_s,$(subst \ |
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/840-armv4_pass_fix-v4bx_to_ld.patch |
---|
@@ -0,0 +1,28 @@ |
commit 7edc8ca5456d9743dd0075eb3cc5b04f4f24c8cc |
Author: Imre Kaloz <kaloz@openwrt.org> |
Date: Wed Feb 2 19:34:36 2011 +0000 |
add armv4 fixup patches |
SVN-Revision: 25322 |
--- a/gcc/config/arm/linux-eabi.h |
+++ b/gcc/config/arm/linux-eabi.h |
@@ -88,10 +88,15 @@ |
#define MUSL_DYNAMIC_LINKER \ |
"/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" |
+/* For armv4 we pass --fix-v4bx to linker to support EABI */ |
+#undef TARGET_FIX_V4BX_SPEC |
+#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ |
+ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" |
+ |
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to |
use the GNU/Linux version, not the generic BPABI version. */ |
#undef LINK_SPEC |
-#define LINK_SPEC EABI_LINK_SPEC \ |
+#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \ |
LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ |
LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/850-use_shared_libgcc.patch |
---|
@@ -0,0 +1,54 @@ |
commit dcfc40358b5a3cae7320c17f8d1cebd5ad5540cd |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Sun Feb 12 20:25:47 2012 +0000 |
gcc 4.6: port over the missing patch 850-use_shared_libgcc.patch to prevent libgcc crap from leaking into every single binary |
SVN-Revision: 30486 |
--- a/gcc/config/arm/linux-eabi.h |
+++ b/gcc/config/arm/linux-eabi.h |
@@ -126,10 +126,6 @@ |
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ |
LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) |
-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we |
- do not use -lfloat. */ |
-#undef LIBGCC_SPEC |
- |
/* Clear the instruction cache from `beg' to `end'. This is |
implemented in lib1funcs.S, so ensure an error if this definition |
is used. */ |
--- a/gcc/config/linux.h |
+++ b/gcc/config/linux.h |
@@ -53,6 +53,10 @@ see the files COPYING3 and COPYING.RUNTI |
builtin_assert ("system=posix"); \ |
} while (0) |
+#ifndef LIBGCC_SPEC |
+#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}" |
+#endif |
+ |
/* Determine which dynamic linker to use depending on whether GLIBC or |
uClibc or Bionic or musl is the default C library and whether |
-muclibc or -mglibc or -mbionic or -mmusl has been passed to change |
--- a/libgcc/mkmap-symver.awk |
+++ b/libgcc/mkmap-symver.awk |
@@ -136,5 +136,5 @@ function output(lib) { |
else if (inherit[lib]) |
printf("} %s;\n", inherit[lib]); |
else |
- printf ("\n local:\n\t*;\n};\n"); |
+ printf ("\n\t*;\n};\n"); |
} |
--- a/gcc/config/rs6000/linux.h |
+++ b/gcc/config/rs6000/linux.h |
@@ -60,6 +60,9 @@ |
#undef CPP_OS_DEFAULT_SPEC |
#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" |
+#undef LIBGCC_SPEC |
+#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" |
+ |
#undef LINK_SHLIB_SPEC |
#define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}} \ |
%{static-pie:-static -pie --no-dynamic-linker -z text}" |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/851-libgcc_no_compat.patch |
---|
@@ -0,0 +1,22 @@ |
commit 64661de100da1ec1061ef3e5e400285dce115e6b |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Sun May 10 13:16:35 2015 +0000 |
gcc: add some size optimization patches |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> |
SVN-Revision: 45664 |
--- a/libgcc/config/t-libunwind |
+++ b/libgcc/config/t-libunwind |
@@ -2,8 +2,7 @@ |
HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER |
-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ |
- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c |
+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c |
LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c |
# Override the default value from t-slibgcc-elf-ver and mention -lunwind |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/870-ppc_no_crtsavres.patch |
---|
@@ -0,0 +1,11 @@ |
--- a/gcc/config/rs6000/rs6000.c |
+++ b/gcc/config/rs6000/rs6000.c |
@@ -24632,7 +24632,7 @@ rs6000_savres_strategy (rs6000_stack_t * |
/* Define cutoff for using out-of-line functions to save registers. */ |
if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) |
{ |
- if (!optimize_size) |
+ if (1) |
{ |
strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; |
strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/881-no_tm_section.patch |
---|
@@ -0,0 +1,11 @@ |
--- a/libgcc/crtstuff.c |
+++ b/libgcc/crtstuff.c |
@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ |
#endif |
#if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) |
-# define USE_TM_CLONE_REGISTRY 1 |
+# define USE_TM_CLONE_REGISTRY 0 |
#endif |
/* We do not want to add the weak attribute to the declarations of these |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/900-bad-mips16-crt.patch |
---|
@@ -0,0 +1,9 @@ |
--- a/libgcc/config/mips/t-mips16 |
+++ b/libgcc/config/mips/t-mips16 |
@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 |
# Version these symbols if building libgcc.so. |
SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver |
+ |
+CRTSTUFF_T_CFLAGS += -mno-mips16 |
+CRTSTUFF_T_CFLAGS_S += -mno-mips16 |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/910-mbsd_multi.patch |
---|
@@ -0,0 +1,146 @@ |
commit 99368862e44740ff4fd33760893f04e14f9dbdf1 |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Tue Jul 31 00:52:27 2007 +0000 |
Port the mbsd_multi patch from freewrt, which adds -fhonour-copts. This will emit warnings in packages that don't use our target cflags properly |
SVN-Revision: 8256 |
This patch brings over a feature from MirBSD: |
* -fhonour-copts |
If this option is not given, it's warned (depending |
on environment variables). This is to catch errors |
of misbuilt packages which override CFLAGS themselves. |
This patch was authored by Thorsten Glaser <tg at mirbsd.de> |
with copyright assignment to the FSF in effect. |
--- a/gcc/c-family/c-opts.c |
+++ b/gcc/c-family/c-opts.c |
@@ -107,6 +107,9 @@ static dump_flags_t original_dump_flags; |
/* Whether any standard preincluded header has been preincluded. */ |
static bool done_preinclude; |
+/* Check if a port honours COPTS. */ |
+static int honour_copts = 0; |
+ |
static void handle_OPT_d (const char *); |
static void set_std_cxx98 (int); |
static void set_std_cxx11 (int); |
@@ -459,6 +462,12 @@ c_common_handle_option (size_t scode, co |
flag_no_builtin = !value; |
break; |
+ case OPT_fhonour_copts: |
+ if (c_language == clk_c) { |
+ honour_copts++; |
+ } |
+ break; |
+ |
case OPT_fconstant_string_class_: |
constant_string_class_name = arg; |
break; |
@@ -1125,6 +1134,47 @@ c_common_init (void) |
return false; |
} |
+ if (c_language == clk_c) { |
+ char *ev = getenv ("GCC_HONOUR_COPTS"); |
+ int evv; |
+ if (ev == NULL) |
+ evv = -1; |
+ else if ((*ev == '0') || (*ev == '\0')) |
+ evv = 0; |
+ else if (*ev == '1') |
+ evv = 1; |
+ else if (*ev == '2') |
+ evv = 2; |
+ else if (*ev == 's') |
+ evv = -1; |
+ else { |
+ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); |
+ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ |
+ } |
+ if (evv == 1) { |
+ if (honour_copts == 0) { |
+ error ("someone does not honour COPTS at all in lenient mode"); |
+ return false; |
+ } else if (honour_copts != 1) { |
+ warning (0, "someone does not honour COPTS correctly, passed %d times", |
+ honour_copts); |
+ } |
+ } else if (evv == 2) { |
+ if (honour_copts == 0) { |
+ error ("someone does not honour COPTS at all in strict mode"); |
+ return false; |
+ } else if (honour_copts != 1) { |
+ error ("someone does not honour COPTS correctly, passed %d times", |
+ honour_copts); |
+ return false; |
+ } |
+ } else if (evv == 0) { |
+ if (honour_copts != 1) |
+ inform (UNKNOWN_LOCATION, "someone does not honour COPTS correctly, passed %d times", |
+ honour_copts); |
+ } |
+ } |
+ |
return true; |
} |
--- a/gcc/c-family/c.opt |
+++ b/gcc/c-family/c.opt |
@@ -1469,6 +1469,9 @@ C++ ObjC++ Optimization Alias(fexception |
fhonor-std |
C++ ObjC++ Ignore Warn(switch %qs is no longer supported) |
+fhonour-copts |
+C ObjC C++ ObjC++ RejectNegative |
+ |
fhosted |
C ObjC |
Assume normal C execution environment. |
--- a/gcc/common.opt |
+++ b/gcc/common.opt |
@@ -1551,6 +1551,9 @@ fguess-branch-probability |
Common Report Var(flag_guess_branch_prob) Optimization |
Enable guessing of branch probabilities. |
+fhonour-copts |
+Common RejectNegative |
+ |
; Nonzero means ignore `#ident' directives. 0 means handle them. |
; Generate position-independent code for executables if possible |
; On SVR4 targets, it also controls whether or not to emit a |
--- a/gcc/opts.c |
+++ b/gcc/opts.c |
@@ -2065,6 +2065,9 @@ common_handle_option (struct gcc_options |
opts, opts_set, loc, dc); |
break; |
+ case OPT_fhonour_copts: |
+ break; |
+ |
case OPT_Wlarger_than_: |
opts->x_larger_than_size = value; |
opts->x_warn_larger_than = value != -1; |
--- a/gcc/doc/invoke.texi |
+++ b/gcc/doc/invoke.texi |
@@ -7014,6 +7014,17 @@ This option is only supported for C and |
@option{-Wall} and by @option{-Wpedantic}, which can be disabled with |
@option{-Wno-pointer-sign}. |
+@item -fhonour-copts |
+@opindex fhonour-copts |
+If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not |
+given at least once, and warn if it is given more than once. |
+If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not |
+given exactly once. |
+If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option |
+is not given exactly once. |
+The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. |
+This flag and environment variable only affect the C language. |
+ |
@item -Wstack-protector |
@opindex Wstack-protector |
@opindex Wno-stack-protector |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/920-specs_nonfatal_getenv.patch |
---|
@@ -0,0 +1,22 @@ |
Author: Jo-Philipp Wich <jow@openwrt.org> |
Date: Sat Apr 21 03:02:39 2012 +0000 |
gcc: add patch to make the getenv() spec function nonfatal if requested environment variable is unset |
SVN-Revision: 31390 |
--- a/gcc/gcc.c |
+++ b/gcc/gcc.c |
@@ -9347,8 +9347,10 @@ getenv_spec_function (int argc, const ch |
value = varname; |
if (!value) |
- fatal_error (input_location, |
- "environment variable %qs not defined", varname); |
+ { |
+ warning (input_location, "environment variable %qs not defined", varname); |
+ value = ""; |
+ } |
/* We have to escape every character of the environment variable so |
they are not interpreted as active spec characters. A |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/930-fix-mips-noexecstack.patch |
---|
@@ -0,0 +1,111 @@ |
From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001 |
From: Andrew McDonnell <bugs@andrewmcdonnell.net> |
Date: Fri, 3 Oct 2014 19:09:00 +0930 |
Subject: Add .note.GNU-stack section |
See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html |
Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html |
Re: [Patch, MIPS] Add .note.GNU-stack section |
From: Steve Ellcey <sellcey at mips dot com> |
On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote: |
> |
> |
> On Wed, Sep 10, 2014 at 9:27 AM, <pinskia@gmail.com> wrote: |
> This works except you did not update the assembly files in |
> libgcc or glibc. We (Cavium) have the same patch in our tree |
> for a few released versions. |
> Mind just checking yours in then Andrew? |
> Thanks! |
> -eric |
I talked to Andrew about what files he changed in GCC and created and |
tested this new patch. Andrew also mentioned changing some assembly |
files in glibc but I don't see any use of '.section .note.GNU-stack' in |
any assembly files in glibc (for any platform) so I wasn't planning on |
creating a glibc to add them to mips glibc assembly language files. |
OK to check in this patch? |
Steve Ellcey |
sellcey@mips.com |
2014-09-26 Steve Ellcey <sellcey@mips.com> |
--- |
gcc/config/mips/mips.c | 3 +++ |
libgcc/config/mips/crti.S | 4 ++++ |
libgcc/config/mips/crtn.S | 3 +++ |
libgcc/config/mips/mips16.S | 4 ++++ |
libgcc/config/mips/vr4120-div.S | 4 ++++ |
5 files changed, 18 insertions(+) |
--- a/gcc/config/mips/mips.c |
+++ b/gcc/config/mips/mips.c |
@@ -22627,6 +22627,9 @@ mips_starting_frame_offset (void) |
#undef TARGET_STARTING_FRAME_OFFSET |
#define TARGET_STARTING_FRAME_OFFSET mips_starting_frame_offset |
+#undef TARGET_ASM_FILE_END |
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack |
+ |
struct gcc_target targetm = TARGET_INITIALIZER; |
#include "gt-mips.h" |
--- a/libgcc/config/mips/crti.S |
+++ b/libgcc/config/mips/crti.S |
@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
<http://www.gnu.org/licenses/>. */ |
+ |
+/* An executable stack is *not* required for these functions. */ |
+ .section .note.GNU-stack,"",%progbits |
+ |
/* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. |
Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ |
--- a/libgcc/config/mips/crtn.S |
+++ b/libgcc/config/mips/crtn.S |
@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
<http://www.gnu.org/licenses/>. */ |
+/* An executable stack is *not* required for these functions. */ |
+ .section .note.GNU-stack,"",%progbits |
+ |
/* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. |
Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ |
--- a/libgcc/config/mips/mips16.S |
+++ b/libgcc/config/mips/mips16.S |
@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI |
values using the soft-float calling convention, but do the actual |
operation using the hard floating point instructions. */ |
+/* An executable stack is *not* required for these functions. */ |
+ .section .note.GNU-stack,"",%progbits |
+ .previous |
+ |
#if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64) |
/* This file contains 32-bit assembly code. */ |
--- a/libgcc/config/mips/vr4120-div.S |
+++ b/libgcc/config/mips/vr4120-div.S |
@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI |
-mfix-vr4120. div and ddiv do not give the correct result when one |
of the operands is negative. */ |
+/* An executable stack is *not* required for these functions. */ |
+ .section .note.GNU-stack,"",%progbits |
+ .previous |
+ |
.set nomips16 |
#define DIV \ |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/931-libffi-fix-MIPS-softfloat-build-issue.patch |
---|
@@ -0,0 +1,168 @@ |
From c0c62fa4256f805389f16ebfc4a60cf789129b50 Mon Sep 17 00:00:00 2001 |
From: BangLang Huang <banglang.huang@foxmail.com> |
Date: Wed, 9 Nov 2016 10:36:49 +0800 |
Subject: [PATCH] libffi: fix MIPS softfloat build issue |
Backported from github.com/libffi/libffi#272 |
Signed-off-by: BangLang Huang <banglang.huang@foxmail.com> |
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> |
--- |
libffi/src/mips/n32.S | 17 +++++++++++++++++ |
libffi/src/mips/o32.S | 17 +++++++++++++++++ |
2 files changed, 34 insertions(+) |
--- a/libffi/src/mips/n32.S |
+++ b/libffi/src/mips/n32.S |
@@ -107,6 +107,16 @@ loadregs: |
REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6. |
+#ifdef __mips_soft_float |
+ REG_L a0, 0*FFI_SIZEOF_ARG(t9) |
+ REG_L a1, 1*FFI_SIZEOF_ARG(t9) |
+ REG_L a2, 2*FFI_SIZEOF_ARG(t9) |
+ REG_L a3, 3*FFI_SIZEOF_ARG(t9) |
+ REG_L a4, 4*FFI_SIZEOF_ARG(t9) |
+ REG_L a5, 5*FFI_SIZEOF_ARG(t9) |
+ REG_L a6, 6*FFI_SIZEOF_ARG(t9) |
+ REG_L a7, 7*FFI_SIZEOF_ARG(t9) |
+#else |
and t4, t6, ((1<<FFI_FLAG_BITS)-1) |
REG_L a0, 0*FFI_SIZEOF_ARG(t9) |
beqz t4, arg1_next |
@@ -193,6 +203,7 @@ arg7_next: |
arg8_doublep: |
l.d $f19, 7*FFI_SIZEOF_ARG(t9) |
arg8_next: |
+#endif |
callit: |
# Load the function pointer |
@@ -214,6 +225,7 @@ retint: |
b epilogue |
retfloat: |
+#ifndef __mips_soft_float |
bne t6, FFI_TYPE_FLOAT, retdouble |
jal t9 |
REG_L t4, 4*FFI_SIZEOF_ARG($fp) |
@@ -272,6 +284,7 @@ retstruct_f_d: |
s.s $f0, 0(t4) |
s.d $f2, 8(t4) |
b epilogue |
+#endif |
retstruct_d_soft: |
bne t6, FFI_TYPE_STRUCT_D_SOFT, retstruct_f_soft |
@@ -429,6 +442,7 @@ ffi_closure_N32: |
REG_S a6, A6_OFF2($sp) |
REG_S a7, A7_OFF2($sp) |
+#ifndef __mips_soft_float |
# Store all possible float/double registers. |
s.d $f12, F12_OFF2($sp) |
s.d $f13, F13_OFF2($sp) |
@@ -438,6 +452,7 @@ ffi_closure_N32: |
s.d $f17, F17_OFF2($sp) |
s.d $f18, F18_OFF2($sp) |
s.d $f19, F19_OFF2($sp) |
+#endif |
# Call ffi_closure_mips_inner_N32 to do the real work. |
LA t9, ffi_closure_mips_inner_N32 |
@@ -458,6 +473,7 @@ cls_retint: |
b cls_epilogue |
cls_retfloat: |
+#ifndef __mips_soft_float |
bne v0, FFI_TYPE_FLOAT, cls_retdouble |
l.s $f0, V0_OFF2($sp) |
b cls_epilogue |
@@ -500,6 +516,7 @@ cls_retstruct_f_d: |
l.s $f0, V0_OFF2($sp) |
l.d $f2, V1_OFF2($sp) |
b cls_epilogue |
+#endif |
cls_retstruct_small2: |
REG_L v0, V0_OFF2($sp) |
--- a/libffi/src/mips/o32.S |
+++ b/libffi/src/mips/o32.S |
@@ -82,13 +82,16 @@ sixteen: |
ADDU $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args |
+#ifndef __mips_soft_float |
bnez t0, pass_d # make it quick for int |
+#endif |
REG_L a0, 0*FFI_SIZEOF_ARG($sp) # just go ahead and load the |
REG_L a1, 1*FFI_SIZEOF_ARG($sp) # four regs. |
REG_L a2, 2*FFI_SIZEOF_ARG($sp) |
REG_L a3, 3*FFI_SIZEOF_ARG($sp) |
b call_it |
+#ifndef __mips_soft_float |
pass_d: |
bne t0, FFI_ARGS_D, pass_f |
l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args |
@@ -130,6 +133,7 @@ pass_f_d: |
# bne t0, FFI_ARGS_F_D, call_it |
l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args |
l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float |
+#endif |
call_it: |
# Load the function pointer |
@@ -158,14 +162,23 @@ retfloat: |
bne t2, FFI_TYPE_FLOAT, retdouble |
jalr t9 |
REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) |
+#ifndef __mips_soft_float |
s.s $f0, 0(t0) |
+#else |
+ REG_S v0, 0(t0) |
+#endif |
b epilogue |
retdouble: |
bne t2, FFI_TYPE_DOUBLE, noretval |
jalr t9 |
REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) |
+#ifndef __mips_soft_float |
s.d $f0, 0(t0) |
+#else |
+ REG_S v1, 4(t0) |
+ REG_S v0, 0(t0) |
+#endif |
b epilogue |
noretval: |
@@ -261,9 +274,11 @@ $LCFI7: |
li $13, 1 # FFI_O32 |
bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT |
+#ifndef __mips_soft_float |
# Store all possible float/double registers. |
s.d $f12, FA_0_0_OFF2($fp) |
s.d $f14, FA_1_0_OFF2($fp) |
+#endif |
1: |
# Call ffi_closure_mips_inner_O32 to do the work. |
la t9, ffi_closure_mips_inner_O32 |
@@ -281,6 +296,7 @@ $LCFI7: |
li $13, 1 # FFI_O32 |
bne $16, $13, 1f # Skip fp restore if FFI_O32_SOFT_FLOAT |
+#ifndef __mips_soft_float |
li $9, FFI_TYPE_FLOAT |
l.s $f0, V0_OFF2($fp) |
beq $8, $9, closure_done |
@@ -288,6 +304,7 @@ $LCFI7: |
li $9, FFI_TYPE_DOUBLE |
l.d $f0, V0_OFF2($fp) |
beq $8, $9, closure_done |
+#endif |
1: |
REG_L $3, V1_OFF2($fp) |
REG_L $2, V0_OFF2($fp) |
/branches/18.06.1/toolchain/gcc/patches/8.3.0/960-gotools-fix-compilation-when-making-cross-compiler.patch |
---|
@@ -0,0 +1,67 @@ |
From dda6b050cd74a352670787a294596a9c56c21327 Mon Sep 17 00:00:00 2001 |
From: Yousong Zhou <yszhou4tech@gmail.com> |
Date: Fri, 4 May 2018 18:20:53 +0800 |
Subject: [PATCH] gotools: fix compilation when making cross compiler |
libgo is "the runtime support library for the Go programming language. |
This library is intended for use with the Go frontend." |
gccgo will link target files with libgo.so which depends on libgcc_s.so.1, but |
the linker will complain that it cannot find it. That's because shared libgcc |
is not present in the install directory yet. libgo.so was made without problem |
because gcc will emit -lgcc_s when compiled with -shared option. When gotools |
were being made, it was supplied with -static-libgcc thus no link option was |
provided. Check LIBGO in gcc/go/gcc-spec.c for how gccgo make a builtin spec |
for linking with libgo.so |
- GccgoCrossCompilation, https://github.com/golang/go/wiki/GccgoCrossCompilation |
- Cross-building instructions, http://www.eglibc.org/archives/patches/msg00078.html |
When 3-pass GCC compilation is used, shared libgcc runtime libraries will be |
available after gcc pass2 completed and will meet the gotools link requirement |
at gcc pass3 |
--- |
gotools/Makefile.am | 4 +++- |
gotools/Makefile.in | 4 +++- |
2 files changed, 6 insertions(+), 2 deletions(-) |
--- a/gotools/Makefile.am |
+++ b/gotools/Makefile.am |
@@ -26,6 +26,7 @@ PWD_COMMAND = $${PWDCMD-pwd} |
STAMP = echo timestamp > |
libgodir = ../$(target_noncanonical)/libgo |
+libgccdir = ../$(target_noncanonical)/libgcc |
LIBGODEP = $(libgodir)/libgo.la |
LIBGOTOOL = $(libgodir)/libgotool.a |
@@ -41,7 +42,8 @@ GOCFLAGS = $(CFLAGS_FOR_TARGET) |
GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS) |
AM_GOCFLAGS = -I $(libgodir) |
-AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs |
+AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs \ |
+ -L $(libgccdir) -L $(libgccdir)/.libs -lgcc_s |
GOLINK = $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@ |
libgosrcdir = $(srcdir)/../libgo/go |
--- a/gotools/Makefile.in |
+++ b/gotools/Makefile.in |
@@ -263,6 +263,7 @@ mkinstalldirs = $(SHELL) $(toplevel_srcd |
PWD_COMMAND = $${PWDCMD-pwd} |
STAMP = echo timestamp > |
libgodir = ../$(target_noncanonical)/libgo |
+libgccdir = ../$(target_noncanonical)/libgcc |
LIBGODEP = $(libgodir)/libgo.la |
LIBGOTOOL = $(libgodir)/libgotool.a |
@NATIVE_FALSE@GOCOMPILER = $(GOC) |
@@ -271,7 +272,8 @@ LIBGOTOOL = $(libgodir)/libgotool.a |
@NATIVE_TRUE@GOCOMPILER = $(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) |
GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS) |
AM_GOCFLAGS = -I $(libgodir) |
-AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs |
+AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs \ |
+ -L $(libgccdir) -L $(libgccdir)/.libs -lgcc_s |
GOLINK = $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@ |
libgosrcdir = $(srcdir)/../libgo/go |
cmdsrcdir = $(libgosrcdir)/cmd |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/001-revert_register_mode_search.patch |
---|
@@ -0,0 +1,77 @@ |
commit 31285a20390a5e53a74a2a71d1b5c82f366ddd5a |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Tue May 6 11:49:05 2014 +0000 |
gcc: revert an upstream patch that is causing a regression on powerpc |
https://forum.openwrt.org/viewtopic.php?pid=232494#p232494 |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> |
SVN-Revision: 40709 |
Revert of: |
commit 275035b56823b26d5fb7e90fad945b998648edf2 |
Author: bergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4> |
Date: Thu Sep 5 14:09:07 2013 +0000 |
PR target/58139 |
* reginfo.c (choose_hard_reg_mode): Scan through all mode classes |
looking for widest mode. |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4 |
--- a/gcc/reginfo.c |
+++ b/gcc/reginfo.c |
@@ -637,35 +637,40 @@ choose_hard_reg_mode (unsigned int regno |
mode = GET_MODE_WIDER_MODE (mode)) |
if ((unsigned) hard_regno_nregs[regno][mode] == nregs |
&& HARD_REGNO_MODE_OK (regno, mode) |
- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) |
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) |
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) |
found_mode = mode; |
+ if (found_mode != VOIDmode) |
+ return found_mode; |
+ |
for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); |
mode != VOIDmode; |
mode = GET_MODE_WIDER_MODE (mode)) |
if ((unsigned) hard_regno_nregs[regno][mode] == nregs |
&& HARD_REGNO_MODE_OK (regno, mode) |
- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) |
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) |
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) |
found_mode = mode; |
+ if (found_mode != VOIDmode) |
+ return found_mode; |
+ |
for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT); |
mode != VOIDmode; |
mode = GET_MODE_WIDER_MODE (mode)) |
if ((unsigned) hard_regno_nregs[regno][mode] == nregs |
&& HARD_REGNO_MODE_OK (regno, mode) |
- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) |
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) |
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) |
found_mode = mode; |
+ if (found_mode != VOIDmode) |
+ return found_mode; |
+ |
for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT); |
mode != VOIDmode; |
mode = GET_MODE_WIDER_MODE (mode)) |
if ((unsigned) hard_regno_nregs[regno][mode] == nregs |
&& HARD_REGNO_MODE_OK (regno, mode) |
- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) |
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) |
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) |
found_mode = mode; |
if (found_mode != VOIDmode) |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/002-case_insensitive.patch |
---|
@@ -0,0 +1,24 @@ |
commit 81cc26c706b2bc8c8c1eb1a322e5c5157900836e |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Sun Oct 19 21:45:51 2014 +0000 |
gcc: do not assume that the Mac OS X filesystem is case insensitive |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> |
SVN-Revision: 42973 |
--- a/include/filenames.h |
+++ b/include/filenames.h |
@@ -43,11 +43,6 @@ extern "C" { |
# define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) |
# define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) |
#else /* not DOSish */ |
-# if defined(__APPLE__) |
-# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM |
-# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 |
-# endif |
-# endif /* __APPLE__ */ |
# define HAS_DRIVE_SPEC(f) (0) |
# define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) |
# define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f) |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/010-documentation.patch |
---|
@@ -0,0 +1,35 @@ |
commit 098bd91f5eae625c7d2ee621e10930fc4434e5e2 |
Author: Luka Perkov <luka@openwrt.org> |
Date: Tue Feb 26 16:16:33 2013 +0000 |
gcc: don't build documentation |
This closes #13039. |
Signed-off-by: Luka Perkov <luka@openwrt.org> |
SVN-Revision: 35807 |
--- a/gcc/Makefile.in |
+++ b/gcc/Makefile.in |
@@ -3121,18 +3121,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) |
doc/gccint.info: $(TEXI_GCCINT_FILES) |
doc/cppinternals.info: $(TEXI_CPPINT_FILES) |
-doc/%.info: %.texi |
- if [ x$(BUILD_INFO) = xinfo ]; then \ |
- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ |
- -I $(gcc_docdir)/include -o $@ $<; \ |
- fi |
+doc/%.info: |
# Duplicate entry to handle renaming of gccinstall.info |
-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) |
- if [ x$(BUILD_INFO) = xinfo ]; then \ |
- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ |
- -I $(gcc_docdir)/include -o $@ $<; \ |
- fi |
+doc/gccinstall.info: |
doc/cpp.dvi: $(TEXI_CPP_FILES) |
doc/gcc.dvi: $(TEXI_GCC_FILES) |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/230-musl_libssp.patch |
---|
@@ -0,0 +1,28 @@ |
commit 1877bc9d8f2be143fbe530347a945850d0ecd234 |
Author: Steven Barth <cyrus@openwrt.org> |
Date: Mon Jun 22 10:31:07 2015 +0000 |
gcc/musl: rework SSP-support |
Make musl provide libssp_nonshared.a and make GCC link it unconditionally |
if musl is used. This should be a no-op if SSP is disabled and seems to be |
the only reliable way of dealing with SSP over all packages due to the mess |
that is linkerflags handling in packages. |
Signed-off-by: Steven Barth <steven@midlink.org> |
SVN-Revision: 46108 |
--- a/gcc/gcc.c |
+++ b/gcc/gcc.c |
@@ -861,7 +861,9 @@ proper position among the other output f |
#endif |
#ifndef LINK_SSP_SPEC |
-#ifdef TARGET_LIBC_PROVIDES_SSP |
+#if DEFAULT_LIBC == LIBC_MUSL |
+#define LINK_SSP_SPEC "-lssp_nonshared" |
+#elif defined(TARGET_LIBC_PROVIDES_SSP) |
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ |
"|fstack-protector-strong|fstack-protector-explicit:}" |
#else |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/300-mips_Os_cpu_rtx_cost_model.patch |
---|
@@ -0,0 +1,21 @@ |
commit ecf7671b769fe96f7b5134be442089f8bdba55d2 |
Author: Felix Fietkau <nbd@nbd.name> |
Date: Thu Aug 4 20:29:45 2016 +0200 |
gcc: add a patch to generate better code with Os on mips |
Also happens to reduce compressed code size a bit |
Signed-off-by: Felix Fietkau <nbd@nbd.name> |
--- a/gcc/config/mips/mips.c |
+++ b/gcc/config/mips/mips.c |
@@ -19784,7 +19784,7 @@ mips_option_override (void) |
flag_pcc_struct_return = 0; |
/* Decide which rtx_costs structure to use. */ |
- if (optimize_size) |
+ if (0 && optimize_size) |
mips_cost = &mips_rtx_cost_optimize_size; |
else |
mips_cost = &mips_rtx_cost_data[mips_tune]; |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/800-arm_v5te_no_ldrd_strd.patch |
---|
@@ -0,0 +1,32 @@ |
commit b050f87d13b5dc7ed82feb9a90f4529de58bdf25 |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Wed Feb 19 19:20:10 2014 +0000 |
gcc: prevent the use of LDRD/STRD on ARMv5TE |
These instructions are for 64-bit load/store. On ARMv5TE, the CPU |
requires addresses to be aligned to 64-bit. When misaligned, behavior is |
undefined (effectively either loads the same word twice on LDRD, or |
corrupts surrounding memory on STRD). |
On ARMv6 and newer, unaligned access is safe. |
Removing these instructions for ARMv5TE is necessary, because GCC |
ignores alignment information in pointers and does unsafe optimizations |
that have shown up as bugs in various places. |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> |
SVN-Revision: 39638 |
--- a/gcc/config/arm/arm.h |
+++ b/gcc/config/arm/arm.h |
@@ -150,7 +150,7 @@ extern tree arm_fp16_type_node; |
/* Thumb-1 only. */ |
#define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm) |
-#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \ |
+#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \ |
&& !TARGET_THUMB1) |
#define TARGET_CRC32 (arm_arch_crc) |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/810-arm-softfloat-libgcc.patch |
---|
@@ -0,0 +1,33 @@ |
commit 8570c4be394cff7282f332f97da2ff569a927ddb |
Author: Imre Kaloz <kaloz@openwrt.org> |
Date: Wed Feb 2 20:06:12 2011 +0000 |
fixup arm soft-float symbols |
SVN-Revision: 25325 |
--- a/libgcc/config/arm/t-linux |
+++ b/libgcc/config/arm/t-linux |
@@ -1,6 +1,10 @@ |
LIB1ASMSRC = arm/lib1funcs.S |
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ |
- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 |
+ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ |
+ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ |
+ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ |
+ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ |
+ _arm_fixsfsi _arm_fixunssfsi |
# Just for these, we omit the frame pointer since it makes such a big |
# difference. |
--- a/gcc/config/arm/linux-elf.h |
+++ b/gcc/config/arm/linux-elf.h |
@@ -58,8 +58,6 @@ |
%{shared:-lc} \ |
%{!shared:%{profile:-lc_p}%{!profile:-lc}}" |
-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" |
- |
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" |
#define LINUX_TARGET_LINK_SPEC "%{h*} \ |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/820-libgcc_pic.patch |
---|
@@ -0,0 +1,44 @@ |
commit c96312958c0621e72c9b32da5bc224ffe2161384 |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Mon Oct 19 23:26:09 2009 +0000 |
gcc: create a proper libgcc_pic.a static library for relinking (4.3.3+ for now, backport will follow) |
SVN-Revision: 18086 |
--- a/libgcc/Makefile.in |
+++ b/libgcc/Makefile.in |
@@ -920,11 +920,12 @@ $(libgcov-driver-objects): %$(objext): $ |
# Static libraries. |
libgcc.a: $(libgcc-objects) |
+libgcc_pic.a: $(libgcc-s-objects) |
libgcov.a: $(libgcov-objects) |
libunwind.a: $(libunwind-objects) |
libgcc_eh.a: $(libgcc-eh-objects) |
-libgcc.a libgcov.a libunwind.a libgcc_eh.a: |
+libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a: |
-rm -f $@ |
objects="$(objects)"; \ |
@@ -945,7 +946,7 @@ all: libunwind.a |
endif |
ifeq ($(enable_shared),yes) |
-all: libgcc_eh.a libgcc_s$(SHLIB_EXT) |
+all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT) |
ifneq ($(LIBUNWIND),) |
all: libunwind$(SHLIB_EXT) |
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) |
@@ -1151,6 +1152,10 @@ install-shared: |
chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a |
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a |
+ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/ |
+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a |
+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a |
+ |
$(subst @multilib_dir@,$(MULTIDIR),$(subst \ |
@shlib_base_name@,libgcc_s,$(subst \ |
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/840-armv4_pass_fix-v4bx_to_ld.patch |
---|
@@ -0,0 +1,28 @@ |
commit 7edc8ca5456d9743dd0075eb3cc5b04f4f24c8cc |
Author: Imre Kaloz <kaloz@openwrt.org> |
Date: Wed Feb 2 19:34:36 2011 +0000 |
add armv4 fixup patches |
SVN-Revision: 25322 |
--- a/gcc/config/arm/linux-eabi.h |
+++ b/gcc/config/arm/linux-eabi.h |
@@ -88,10 +88,15 @@ |
#define MUSL_DYNAMIC_LINKER \ |
"/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" |
+/* For armv4 we pass --fix-v4bx to linker to support EABI */ |
+#undef TARGET_FIX_V4BX_SPEC |
+#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ |
+ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" |
+ |
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to |
use the GNU/Linux version, not the generic BPABI version. */ |
#undef LINK_SPEC |
-#define LINK_SPEC EABI_LINK_SPEC \ |
+#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \ |
LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ |
LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/850-use_shared_libgcc.patch |
---|
@@ -0,0 +1,54 @@ |
commit dcfc40358b5a3cae7320c17f8d1cebd5ad5540cd |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Sun Feb 12 20:25:47 2012 +0000 |
gcc 4.6: port over the missing patch 850-use_shared_libgcc.patch to prevent libgcc crap from leaking into every single binary |
SVN-Revision: 30486 |
--- a/gcc/config/arm/linux-eabi.h |
+++ b/gcc/config/arm/linux-eabi.h |
@@ -126,10 +126,6 @@ |
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ |
LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) |
-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we |
- do not use -lfloat. */ |
-#undef LIBGCC_SPEC |
- |
/* Clear the instruction cache from `beg' to `end'. This is |
implemented in lib1funcs.S, so ensure an error if this definition |
is used. */ |
--- a/gcc/config/linux.h |
+++ b/gcc/config/linux.h |
@@ -53,6 +53,10 @@ see the files COPYING3 and COPYING.RUNTI |
builtin_assert ("system=posix"); \ |
} while (0) |
+#ifndef LIBGCC_SPEC |
+#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}" |
+#endif |
+ |
/* Determine which dynamic linker to use depending on whether GLIBC or |
uClibc or Bionic or musl is the default C library and whether |
-muclibc or -mglibc or -mbionic or -mmusl has been passed to change |
--- a/libgcc/mkmap-symver.awk |
+++ b/libgcc/mkmap-symver.awk |
@@ -136,5 +136,5 @@ function output(lib) { |
else if (inherit[lib]) |
printf("} %s;\n", inherit[lib]); |
else |
- printf ("\n local:\n\t*;\n};\n"); |
+ printf ("\n\t*;\n};\n"); |
} |
--- a/gcc/config/rs6000/linux.h |
+++ b/gcc/config/rs6000/linux.h |
@@ -60,6 +60,9 @@ |
#undef CPP_OS_DEFAULT_SPEC |
#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" |
+#undef LIBGCC_SPEC |
+#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" |
+ |
#undef LINK_SHLIB_SPEC |
#define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/851-libgcc_no_compat.patch |
---|
@@ -0,0 +1,22 @@ |
commit 64661de100da1ec1061ef3e5e400285dce115e6b |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Sun May 10 13:16:35 2015 +0000 |
gcc: add some size optimization patches |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> |
SVN-Revision: 45664 |
--- a/libgcc/config/t-libunwind |
+++ b/libgcc/config/t-libunwind |
@@ -2,8 +2,7 @@ |
HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER |
-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ |
- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c |
+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c |
LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c |
# Override the default value from t-slibgcc-elf-ver and mention -lunwind |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/870-ppc_no_crtsavres.patch |
---|
@@ -0,0 +1,18 @@ |
commit d8c570a1531035c3e26bcd94741e5f5b9c36b5d9 |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Mon Mar 5 00:51:01 2012 +0000 |
gcc: do not emit references to _savegpr_* and _restgpr_* on powerpc, as they are tricky to deal with wrt. libgcc. they cannot be linked dynamically |
SVN-Revision: 30814 |
--- a/gcc/config/rs6000/rs6000.c |
+++ b/gcc/config/rs6000/rs6000.c |
@@ -26936,7 +26936,7 @@ rs6000_savres_strategy (rs6000_stack_t * |
/* Define cutoff for using out-of-line functions to save registers. */ |
if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) |
{ |
- if (!optimize_size) |
+ if (1) |
{ |
strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; |
strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/881-no_tm_section.patch |
---|
@@ -0,0 +1,22 @@ |
commit 565988ab47bd9b96b50608564aee2104aeb4b7ae |
Author: Felix Fietkau <nbd@nbd.name> |
Date: Tue Dec 13 14:20:49 2016 +0100 |
gcc: rip out transactional memory related bloat from crtbegin |
Slightly improves compression for each executable, saving about 4k from |
the default ar71xx rootfs |
Signed-off-by: Felix Fietkau <nbd@nbd.name> |
--- a/libgcc/crtstuff.c |
+++ b/libgcc/crtstuff.c |
@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ |
#endif |
#if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) |
-# define USE_TM_CLONE_REGISTRY 1 |
+# define USE_TM_CLONE_REGISTRY 0 |
#endif |
/* We do not want to add the weak attribute to the declarations of these |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/900-bad-mips16-crt.patch |
---|
@@ -0,0 +1,30 @@ |
commit 9dc38e48f7a6f88b7ac7bfaced91f53660204e46 |
Author: Florian Fainelli <florian@openwrt.org> |
Date: Fri Apr 5 12:36:06 2013 +0000 |
toolchain/gcc: .init and .fini need to pick one ISA |
The .init and .fini sections are built by concatenating code |
fragments. Putting mips16 code in the middle of a mips32 code block |
doesn't work. Make gcc built the magic crt stuff in no-mips16 mode. |
This is specific to 4.6-linaro but is probably portable to other gcc |
flavors. Adding this to the t-libgcc-mips16 makefile fragment is a |
hack not suitable for pushing upstream, but there is no mips/t-linux |
or mips/t-uclibc and I am not going to touch gcc/configure for two |
lines. |
Signed-off-by: Jay Carlson <nop@nop.com> |
Signed-off-by: Florian Fainelli <florian@openwrt.org> |
SVN-Revision: 36200 |
--- a/libgcc/config/mips/t-mips16 |
+++ b/libgcc/config/mips/t-mips16 |
@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 |
# Version these symbols if building libgcc.so. |
SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver |
+ |
+CRTSTUFF_T_CFLAGS += -mno-mips16 |
+CRTSTUFF_T_CFLAGS_S += -mno-mips16 |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/910-mbsd_multi.patch |
---|
@@ -0,0 +1,146 @@ |
commit 99368862e44740ff4fd33760893f04e14f9dbdf1 |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Tue Jul 31 00:52:27 2007 +0000 |
Port the mbsd_multi patch from freewrt, which adds -fhonour-copts. This will emit warnings in packages that don't use our target cflags properly |
SVN-Revision: 8256 |
This patch brings over a feature from MirBSD: |
* -fhonour-copts |
If this option is not given, it's warned (depending |
on environment variables). This is to catch errors |
of misbuilt packages which override CFLAGS themselves. |
This patch was authored by Thorsten Glaser <tg at mirbsd.de> |
with copyright assignment to the FSF in effect. |
--- a/gcc/c-family/c-opts.c |
+++ b/gcc/c-family/c-opts.c |
@@ -108,6 +108,9 @@ static int class_dump_flags; |
/* Whether any standard preincluded header has been preincluded. */ |
static bool done_preinclude; |
+/* Check if a port honours COPTS. */ |
+static int honour_copts = 0; |
+ |
static void handle_OPT_d (const char *); |
static void set_std_cxx98 (int); |
static void set_std_cxx11 (int); |
@@ -456,6 +459,12 @@ c_common_handle_option (size_t scode, co |
flag_no_builtin = !value; |
break; |
+ case OPT_fhonour_copts: |
+ if (c_language == clk_c) { |
+ honour_copts++; |
+ } |
+ break; |
+ |
case OPT_fconstant_string_class_: |
constant_string_class_name = arg; |
break; |
@@ -1084,6 +1093,47 @@ c_common_init (void) |
return false; |
} |
+ if (c_language == clk_c) { |
+ char *ev = getenv ("GCC_HONOUR_COPTS"); |
+ int evv; |
+ if (ev == NULL) |
+ evv = -1; |
+ else if ((*ev == '0') || (*ev == '\0')) |
+ evv = 0; |
+ else if (*ev == '1') |
+ evv = 1; |
+ else if (*ev == '2') |
+ evv = 2; |
+ else if (*ev == 's') |
+ evv = -1; |
+ else { |
+ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); |
+ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ |
+ } |
+ if (evv == 1) { |
+ if (honour_copts == 0) { |
+ error ("someone does not honour COPTS at all in lenient mode"); |
+ return false; |
+ } else if (honour_copts != 1) { |
+ warning (0, "someone does not honour COPTS correctly, passed %d times", |
+ honour_copts); |
+ } |
+ } else if (evv == 2) { |
+ if (honour_copts == 0) { |
+ error ("someone does not honour COPTS at all in strict mode"); |
+ return false; |
+ } else if (honour_copts != 1) { |
+ error ("someone does not honour COPTS correctly, passed %d times", |
+ honour_copts); |
+ return false; |
+ } |
+ } else if (evv == 0) { |
+ if (honour_copts != 1) |
+ inform (0, "someone does not honour COPTS correctly, passed %d times", |
+ honour_copts); |
+ } |
+ } |
+ |
return true; |
} |
--- a/gcc/c-family/c.opt |
+++ b/gcc/c-family/c.opt |
@@ -1412,6 +1412,9 @@ C++ ObjC++ Optimization Alias(fexception |
fhonor-std |
C++ ObjC++ Ignore Warn(switch %qs is no longer supported) |
+fhonour-copts |
+C ObjC C++ ObjC++ RejectNegative |
+ |
fhosted |
C ObjC |
Assume normal C execution environment. |
--- a/gcc/common.opt |
+++ b/gcc/common.opt |
@@ -1510,6 +1510,9 @@ fguess-branch-probability |
Common Report Var(flag_guess_branch_prob) Optimization |
Enable guessing of branch probabilities. |
+fhonour-copts |
+Common RejectNegative |
+ |
; Nonzero means ignore `#ident' directives. 0 means handle them. |
; Generate position-independent code for executables if possible |
; On SVR4 targets, it also controls whether or not to emit a |
--- a/gcc/opts.c |
+++ b/gcc/opts.c |
@@ -1928,6 +1928,9 @@ common_handle_option (struct gcc_options |
opts, opts_set, loc, dc); |
break; |
+ case OPT_fhonour_copts: |
+ break; |
+ |
case OPT_Wlarger_than_: |
opts->x_larger_than_size = value; |
opts->x_warn_larger_than = value != -1; |
--- a/gcc/doc/invoke.texi |
+++ b/gcc/doc/invoke.texi |
@@ -6567,6 +6567,17 @@ This option is only supported for C and |
@option{-Wall} and by @option{-Wpedantic}, which can be disabled with |
@option{-Wno-pointer-sign}. |
+@item -fhonour-copts |
+@opindex fhonour-copts |
+If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not |
+given at least once, and warn if it is given more than once. |
+If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not |
+given exactly once. |
+If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option |
+is not given exactly once. |
+The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. |
+This flag and environment variable only affect the C language. |
+ |
@item -Wstack-protector |
@opindex Wstack-protector |
@opindex Wno-stack-protector |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/920-specs_nonfatal_getenv.patch |
---|
@@ -0,0 +1,22 @@ |
Author: Jo-Philipp Wich <jow@openwrt.org> |
Date: Sat Apr 21 03:02:39 2012 +0000 |
gcc: add patch to make the getenv() spec function nonfatal if requested environment variable is unset |
SVN-Revision: 31390 |
--- a/gcc/gcc.c |
+++ b/gcc/gcc.c |
@@ -9280,8 +9280,10 @@ getenv_spec_function (int argc, const ch |
value = varname; |
if (!value) |
- fatal_error (input_location, |
- "environment variable %qs not defined", varname); |
+ { |
+ warning (input_location, "environment variable %qs not defined", varname); |
+ value = ""; |
+ } |
/* We have to escape every character of the environment variable so |
they are not interpreted as active spec characters. A |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/930-fix-mips-noexecstack.patch |
---|
@@ -0,0 +1,111 @@ |
From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001 |
From: Andrew McDonnell <bugs@andrewmcdonnell.net> |
Date: Fri, 3 Oct 2014 19:09:00 +0930 |
Subject: Add .note.GNU-stack section |
See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html |
Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html |
Re: [Patch, MIPS] Add .note.GNU-stack section |
From: Steve Ellcey <sellcey at mips dot com> |
On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote: |
> |
> |
> On Wed, Sep 10, 2014 at 9:27 AM, <pinskia@gmail.com> wrote: |
> This works except you did not update the assembly files in |
> libgcc or glibc. We (Cavium) have the same patch in our tree |
> for a few released versions. |
> Mind just checking yours in then Andrew? |
> Thanks! |
> -eric |
I talked to Andrew about what files he changed in GCC and created and |
tested this new patch. Andrew also mentioned changing some assembly |
files in glibc but I don't see any use of '.section .note.GNU-stack' in |
any assembly files in glibc (for any platform) so I wasn't planning on |
creating a glibc to add them to mips glibc assembly language files. |
OK to check in this patch? |
Steve Ellcey |
sellcey@mips.com |
2014-09-26 Steve Ellcey <sellcey@mips.com> |
--- |
gcc/config/mips/mips.c | 3 +++ |
libgcc/config/mips/crti.S | 4 ++++ |
libgcc/config/mips/crtn.S | 3 +++ |
libgcc/config/mips/mips16.S | 4 ++++ |
libgcc/config/mips/vr4120-div.S | 4 ++++ |
5 files changed, 18 insertions(+) |
--- a/gcc/config/mips/mips.c |
+++ b/gcc/config/mips/mips.c |
@@ -22561,6 +22561,9 @@ mips_promote_function_mode (const_tree t |
#undef TARGET_CUSTOM_FUNCTION_DESCRIPTORS |
#define TARGET_CUSTOM_FUNCTION_DESCRIPTORS 2 |
+#undef TARGET_ASM_FILE_END |
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack |
+ |
struct gcc_target targetm = TARGET_INITIALIZER; |
#include "gt-mips.h" |
--- a/libgcc/config/mips/crti.S |
+++ b/libgcc/config/mips/crti.S |
@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
<http://www.gnu.org/licenses/>. */ |
+ |
+/* An executable stack is *not* required for these functions. */ |
+ .section .note.GNU-stack,"",%progbits |
+ |
/* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. |
Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ |
--- a/libgcc/config/mips/crtn.S |
+++ b/libgcc/config/mips/crtn.S |
@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
<http://www.gnu.org/licenses/>. */ |
+/* An executable stack is *not* required for these functions. */ |
+ .section .note.GNU-stack,"",%progbits |
+ |
/* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. |
Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ |
--- a/libgcc/config/mips/mips16.S |
+++ b/libgcc/config/mips/mips16.S |
@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI |
values using the soft-float calling convention, but do the actual |
operation using the hard floating point instructions. */ |
+/* An executable stack is *not* required for these functions. */ |
+ .section .note.GNU-stack,"",%progbits |
+ .previous |
+ |
#if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64) |
/* This file contains 32-bit assembly code. */ |
--- a/libgcc/config/mips/vr4120-div.S |
+++ b/libgcc/config/mips/vr4120-div.S |
@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI |
-mfix-vr4120. div and ddiv do not give the correct result when one |
of the operands is negative. */ |
+/* An executable stack is *not* required for these functions. */ |
+ .section .note.GNU-stack,"",%progbits |
+ .previous |
+ |
.set nomips16 |
#define DIV \ |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/940-no-clobber-stamp-bits.patch |
---|
@@ -0,0 +1,33 @@ |
commit 548d9a008ff265e9eaa3c7e0e6e301c6bd5645e6 |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Fri Dec 12 17:01:57 2014 +0000 |
gcc: don't clobber stamp-bits with a symlink to itself |
Several versions of gcc have an issue in libstdc++v3 where the build may |
clobber stamp-bits with a link to itself. This doesn't manifest itself |
on all systems. On several Ubuntu systems, this doesn't appear to be a |
problem, but it is an issue on Fedora 16 systems. |
To fix the issue, we'll simply filter out stamp-bits from the symlinks |
to be generated. |
Note: gcc 4.4.7 is unaffected by this issue, so no fix is necessary |
there. |
Signed-off-by: John Szakmeister <john@szakmeister.net> |
SVN-Revision: 43669 |
--- a/libstdc++-v3/include/Makefile.in |
+++ b/libstdc++-v3/include/Makefile.in |
@@ -1476,7 +1476,7 @@ stamp-bits: ${bits_headers} |
@$(STAMP) stamp-bits |
stamp-bits-sup: stamp-bits ${bits_sup_headers} |
- @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null |
+ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null |
@$(STAMP) stamp-bits-sup |
stamp-c_base: ${c_base_headers} |
/branches/18.06.1/toolchain/gcc/patches/arc-2017.09-release/950-cpp_file_path_translation.patch |
---|
@@ -0,0 +1,181 @@ |
commit 331735a357a73c7b8adc205241ac3cc6543d985e |
Author: Felix Fietkau <nbd@openwrt.org> |
Date: Tue Nov 17 12:38:22 2015 +0000 |
gcc: add a patch to 5.x that supports translation of __FILE__ paths |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> |
SVN-Revision: 47490 |
Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047 |
--- a/gcc/c-family/c-opts.c |
+++ b/gcc/c-family/c-opts.c |
@@ -588,6 +588,10 @@ c_common_handle_option (size_t scode, co |
add_path (xstrdup (arg), SYSTEM, 0, true); |
break; |
+ case OPT_iremap: |
+ add_cpp_remap_path (arg); |
+ break; |
+ |
case OPT_iwithprefix: |
add_prefixed_path (arg, SYSTEM); |
break; |
--- a/gcc/c-family/c.opt |
+++ b/gcc/c-family/c.opt |
@@ -1825,6 +1825,10 @@ iquote |
C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs) |
-iquote <dir> Add <dir> to the end of the quote include path. |
+iremap |
+C ObjC C++ ObjC++ Joined Separate |
+-iremap <src:dst> Convert <src> to <dst> if it occurs as prefix in __FILE__. |
+ |
iwithprefix |
C ObjC C++ ObjC++ Joined Separate |
-iwithprefix <dir> Add <dir> to the end of the system include path. |
--- a/gcc/doc/cpp.texi |
+++ b/gcc/doc/cpp.texi |
@@ -4272,6 +4272,7 @@ Refer to the GCC manual for full documen |
@c man begin SYNOPSIS |
cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] |
[@option{-I}@var{dir}@dots{}] [@option{-iquote}@var{dir}@dots{}] |
+ [@option{-iremap}@var{src}:@var{dst}] |
[@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}] |
[@option{-MP}] [@option{-MQ} @var{target}@dots{}] |
[@option{-MT} @var{target}@dots{}] |
--- a/gcc/doc/cppopts.texi |
+++ b/gcc/doc/cppopts.texi |
@@ -220,6 +220,12 @@ extensions @samp{.i}, @samp{.ii} or @sam |
extensions that GCC uses for preprocessed files created by |
@option{-save-temps}. |
+@item -iremap @var{src}:@var{dst} |
+@opindex iremap |
+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. |
+This option can be specified more than once. Processing stops at the first |
+match. |
+ |
@item -fdirectives-only |
@opindex fdirectives-only |
When preprocessing, handle directives, but do not expand macros. |
--- a/gcc/doc/invoke.texi |
+++ b/gcc/doc/invoke.texi |
@@ -11863,6 +11863,12 @@ by @option{-fplugin=@var{name}} instead |
@option{-fplugin=@var{path}/@var{name}.so}. This option is not meant |
to be used by the user, but only passed by the driver. |
+@item -iremap @var{src}:@var{dst} |
+@opindex iremap |
+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. |
+This option can be specified more than once. Processing stops at the first |
+match. |
+ |
@item -L@var{dir} |
@opindex L |
Add directory @var{dir} to the list of directories to be searched |
--- a/libcpp/include/cpplib.h |
+++ b/libcpp/include/cpplib.h |
@@ -820,6 +820,9 @@ extern void cpp_set_lang (cpp_reader *, |
/* Set the include paths. */ |
extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int); |
+/* Provide src:dst pair for __FILE__ remapping. */ |
+extern void add_cpp_remap_path (const char *); |
+ |
/* Call these to get pointers to the options, callback, and deps |
structures for a given reader. These pointers are good until you |
call cpp_finish on that reader. You can either edit the callbacks |
--- a/libcpp/macro.c |
+++ b/libcpp/macro.c |
@@ -227,6 +227,64 @@ static const char * const monthnames[] = |
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" |
}; |
+static size_t remap_pairs; |
+static char **remap_src; |
+static char **remap_dst; |
+ |
+void |
+add_cpp_remap_path (const char *arg) |
+{ |
+ const char *arg_dst; |
+ size_t len; |
+ |
+ arg_dst = strchr(arg, ':'); |
+ if (arg_dst == NULL) |
+ { |
+ fprintf(stderr, "Invalid argument for -iremap\n"); |
+ exit(1); |
+ } |
+ |
+ len = arg_dst - arg; |
+ ++arg_dst; |
+ |
+ remap_src = (char **) xrealloc(remap_src, sizeof(char *) * (remap_pairs + 1)); |
+ remap_dst = (char **) xrealloc(remap_dst, sizeof(char *) * (remap_pairs + 1)); |
+ |
+ remap_src[remap_pairs] = (char *) xmalloc(len + 1); |
+ memcpy(remap_src[remap_pairs], arg, len); |
+ remap_src[remap_pairs][len] = '\0'; |
+ remap_dst[remap_pairs] = xstrdup(arg_dst); |
+ ++remap_pairs; |
+} |
+ |
+static const char * |
+cpp_remap_file (const char *arg, char **tmp_name) |
+{ |
+ char *result; |
+ size_t i, len; |
+ |
+ for (i = 0; i < remap_pairs; ++i) |
+ { |
+ len = strlen (remap_src[i]); |
+ if (strncmp (remap_src[i], arg, len)) |
+ continue; |
+ if (arg[len] == '\0') |
+ return xstrdup (remap_dst[i]); |
+ if (arg[len] != '/') |
+ continue; |
+ arg += len; |
+ len = strlen (remap_dst[i]); |
+ result = (char *) xmalloc (len + strlen (arg) + 1); |
+ memcpy(result, remap_dst[i], len); |
+ strcpy(result + len, arg); |
+ *tmp_name = result; |
+ |
+ return result; |
+ } |
+ |
+ return arg; |
+} |
+ |
/* Helper function for builtin_macro. Returns the text generated by |
a builtin macro. */ |
const uchar * |
@@ -290,6 +348,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi |
{ |
unsigned int len; |
const char *name; |
+ char *tmp_name = NULL; |
uchar *buf; |
if (node->value.builtin == BT_FILE) |
@@ -301,6 +360,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi |
if (!name) |
abort (); |
} |
+ name = cpp_remap_file (name, &tmp_name); |
len = strlen (name); |
buf = _cpp_unaligned_alloc (pfile, len * 2 + 3); |
result = buf; |
@@ -308,6 +368,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi |
buf = cpp_quote_string (buf + 1, (const unsigned char *) name, len); |
*buf++ = '"'; |
*buf = '\0'; |
+ free (tmp_name); |
} |
break; |
/branches/18.06.1/toolchain/gdb/Makefile |
---|
@@ -0,0 +1,68 @@ |
# |
# Copyright (C) 2006-2016 OpenWrt.org |
# |
# This is free software, licensed under the GNU General Public License v2. |
# See /LICENSE for more information. |
# |
include $(TOPDIR)/rules.mk |
PKG_NAME:=gdb |
ifeq ($(CONFIG_arc),y) |
PKG_VERSION:=arc-2017.09-gdb |
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2017.09-gdb |
PKG_HASH:=7e3c2a763bf500a40c5c4591a7e22c591dafc1f214b1d514895c1096e85c883a |
GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION) |
PATCH_DIR:=./patches-arc |
else |
PKG_VERSION:=8.2.1 |
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz |
PKG_SOURCE_URL:=@GNU/gdb |
PKG_HASH:=0a6a432907a03c5c8eaad3c3cffd50c00a40c3a5e3c4039440624bae703f2202 |
GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION) |
endif |
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR) |
HOST_BUILD_PARALLEL:=1 |
include $(INCLUDE_DIR)/toolchain-build.mk |
HOST_CONFIGURE_VARS += \ |
gdb_cv_func_sigsetjmp=yes |
HOST_CONFIGURE_ARGS = \ |
--prefix=$(TOOLCHAIN_DIR) \ |
--build=$(GNU_HOST_NAME) \ |
--host=$(GNU_HOST_NAME) \ |
--target=$(REAL_GNU_TARGET_NAME) \ |
--disable-werror \ |
--without-uiout \ |
--enable-tui --disable-gdbtk --without-x \ |
--without-included-gettext \ |
--enable-threads \ |
--with-expat \ |
--without-python \ |
--disable-binutils \ |
--disable-ld \ |
--disable-gas \ |
--disable-sim |
define Host/Install |
mkdir -p $(TOOLCHAIN_DIR)/bin |
$(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb |
ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb |
strip $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb |
endef |
define Host/Clean |
rm -rf \ |
$(HOST_BUILD_DIR) \ |
$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb \ |
$(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb |
endef |
$(eval $(call HostBuild)) |
/branches/18.06.1/toolchain/gdb/patches/100-no_extern_inline.patch |
---|
@@ -0,0 +1,32 @@ |
--- a/sim/common/sim-arange.c |
+++ b/sim/common/sim-arange.c |
@@ -280,11 +280,7 @@ sim_addr_range_delete (ADDR_RANGE *ar, a |
build_search_tree (ar); |
} |
-#endif /* DEFINE_NON_INLINE_P */ |
- |
-#if DEFINE_INLINE_P |
- |
-SIM_ARANGE_INLINE int |
+int |
sim_addr_range_hit_p (ADDR_RANGE *ar, address_word addr) |
{ |
ADDR_RANGE_TREE *t = ar->range_tree; |
@@ -301,4 +297,4 @@ sim_addr_range_hit_p (ADDR_RANGE *ar, ad |
return 0; |
} |
-#endif /* DEFINE_INLINE_P */ |
+#endif /* DEFINE_NON_INLINE_P */ |
--- a/sim/common/sim-arange.h |
+++ b/sim/common/sim-arange.h |
@@ -73,7 +73,7 @@ extern void sim_addr_range_delete (ADDR_ |
/* Return non-zero if ADDR is in range AR, traversing the entire tree. |
If no range is specified, that is defined to mean "everything". */ |
-SIM_ARANGE_INLINE int |
+extern int |
sim_addr_range_hit_p (ADDR_RANGE * /*ar*/, address_word /*addr*/); |
#define ADDR_RANGE_HIT_P(ar, addr) \ |
((ar)->range_tree == NULL || sim_addr_range_hit_p ((ar), (addr))) |
/branches/18.06.1/toolchain/gdb/patches/110-no_testsuite.patch |
---|
@@ -0,0 +1,21 @@ |
--- a/gdb/configure |
+++ b/gdb/configure |
@@ -915,8 +915,7 @@ MAKEINFOFLAGS |
YACC |
YFLAGS |
XMKMF' |
-ac_subdirs_all='testsuite |
-gdbtk |
+ac_subdirs_all='gdbtk |
multi-ice |
gdbserver' |
@@ -6577,7 +6576,7 @@ $as_echo "$with_auto_load_safe_path" >&6 |
-subdirs="$subdirs testsuite" |
+subdirs="$subdirs" |
# Check whether to support alternative target configurations |
/branches/18.06.1/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch |
---|
@@ -0,0 +1,11 @@ |
--- a/gdb/gdbserver/configure |
+++ b/gdb/gdbserver/configure |
@@ -2508,7 +2508,7 @@ $as_echo "$as_me: error: \`$ac_var' was |
ac_cache_corrupted=: ;; |
,);; |
*) |
- if test "x$ac_old_val" != "x$ac_new_val"; then |
+ if test "`echo x$ac_old_val`" != "`echo x$ac_new_val`"; then |
# differences in whitespace do not lead to failure. |
ac_old_val_w=`echo x $ac_old_val` |
ac_new_val_w=`echo x $ac_new_val` |
/branches/18.06.1/toolchain/gdb/patches-arc/100-no_extern_inline.patch |
---|
@@ -0,0 +1,32 @@ |
--- a/sim/common/sim-arange.c |
+++ b/sim/common/sim-arange.c |
@@ -280,11 +280,7 @@ sim_addr_range_delete (ADDR_RANGE *ar, a |
build_search_tree (ar); |
} |
-#endif /* DEFINE_NON_INLINE_P */ |
- |
-#if DEFINE_INLINE_P |
- |
-SIM_ARANGE_INLINE int |
+int |
sim_addr_range_hit_p (ADDR_RANGE *ar, address_word addr) |
{ |
ADDR_RANGE_TREE *t = ar->range_tree; |
@@ -301,4 +297,4 @@ sim_addr_range_hit_p (ADDR_RANGE *ar, ad |
return 0; |
} |
-#endif /* DEFINE_INLINE_P */ |
+#endif /* DEFINE_NON_INLINE_P */ |
--- a/sim/common/sim-arange.h |
+++ b/sim/common/sim-arange.h |
@@ -73,7 +73,7 @@ extern void sim_addr_range_delete (ADDR_ |
/* Return non-zero if ADDR is in range AR, traversing the entire tree. |
If no range is specified, that is defined to mean "everything". */ |
-SIM_ARANGE_INLINE int |
+extern int |
sim_addr_range_hit_p (ADDR_RANGE * /*ar*/, address_word /*addr*/); |
#define ADDR_RANGE_HIT_P(ar, addr) \ |
((ar)->range_tree == NULL || sim_addr_range_hit_p ((ar), (addr))) |
/branches/18.06.1/toolchain/gdb/patches-arc/110-no_testsuite.patch |
---|
@@ -0,0 +1,21 @@ |
--- a/gdb/configure |
+++ b/gdb/configure |
@@ -870,8 +870,7 @@ MAKEINFOFLAGS |
YACC |
YFLAGS |
XMKMF' |
-ac_subdirs_all='testsuite |
-gdbtk |
+ac_subdirs_all='gdbtk |
multi-ice |
gdbserver' |
@@ -5610,7 +5610,7 @@ $as_echo "$with_auto_load_safe_path" >&6 |
-subdirs="$subdirs testsuite" |
+subdirs="$subdirs" |
# Check whether to support alternative target configurations |
/branches/18.06.1/toolchain/gdb/patches-arc/120-fix-compile-flag-mismatch.patch |
---|
@@ -0,0 +1,11 @@ |
--- a/gdb/gdbserver/configure |
+++ b/gdb/gdbserver/configure |
@@ -2468,7 +2468,7 @@ $as_echo "$as_me: error: \`$ac_var' was |
ac_cache_corrupted=: ;; |
,);; |
*) |
- if test "x$ac_old_val" != "x$ac_new_val"; then |
+ if test "`echo x$ac_old_val`" != "`echo x$ac_new_val`"; then |
# differences in whitespace do not lead to failure. |
ac_old_val_w=`echo x $ac_old_val` |
ac_new_val_w=`echo x $ac_new_val` |
/branches/18.06.1/toolchain/glibc/Makefile |
---|
@@ -0,0 +1,32 @@ |
PATH_PREFIX := . |
VARIANT:=final |
HOST_BUILD_PARALLEL:=1 |
include ./common.mk |
define Host/Compile |
+$(MAKE) -C $(CUR_BUILD_DIR) \ |
PARALLELMFLAGS="$(HOST_JOBS)" \ |
BUILD_CFLAGS="$(HOST_CFLAGS)" \ |
default-rpath="/lib:/usr/lib" \ |
all |
endef |
define Host/Install |
$(call Host/SetToolchainInfo) |
$(MAKE) -C $(CUR_BUILD_DIR) \ |
BUILD_CFLAGS="$(HOST_CFLAGS)" \ |
install_root="$(TOOLCHAIN_DIR)" \ |
install |
( cd $(TOOLCHAIN_DIR) ; \ |
for d in lib usr/lib ; do \ |
for f in libc.so libpthread.so libgcc_s.so ; do \ |
if [ -f $$$$d/$$$$f -a ! -L $$$$d/$$$$f ] ; then \ |
$(SED) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \ |
fi \ |
done \ |
done \ |
) |
endef |
$(eval $(call HostBuild)) |
/branches/18.06.1/toolchain/glibc/common.mk |
---|
@@ -0,0 +1,98 @@ |
# |
# Copyright (C) 2006-2016 OpenWrt.org |
# |
# This is free software, licensed under the GNU General Public License v2. |
# See /LICENSE for more information. |
# |
include $(TOPDIR)/rules.mk |
PKG_NAME:=glibc |
PKG_VERSION:=2.27 |
PKG_SOURCE_PROTO:=git |
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) |
PKG_SOURCE_VERSION:=9f44fa22cb66067e92dc27167426ef4ad046c959 |
PKG_MIRROR_HASH:=fa7f165b8b8f92e7813b69b9b3ce4ce8205bfdc12acae3f513b4456ec899bb2b |
PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git |
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz |
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_SOURCE_SUBDIR) |
CUR_BUILD_DIR:=$(HOST_BUILD_DIR)-$(VARIANT) |
PATCH_DIR:=$(PATH_PREFIX)/patches |
include $(INCLUDE_DIR)/toolchain-build.mk |
HOST_STAMP_PREPARED:=$(HOST_BUILD_DIR)/.prepared |
HOST_STAMP_CONFIGURED:=$(CUR_BUILD_DIR)/.configured |
HOST_STAMP_BUILT:=$(CUR_BUILD_DIR)/.built |
HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.glibc_$(VARIANT)_installed |
ifeq ($(ARCH),mips64) |
ifdef CONFIG_MIPS64_ABI_N64 |
TARGET_CFLAGS += -mabi=64 |
endif |
ifdef CONFIG_MIPS64_ABI_N32 |
TARGET_CFLAGS += -mabi=n32 |
endif |
ifdef CONFIG_MIPS64_ABI_O32 |
TARGET_CFLAGS += -mabi=32 |
endif |
endif |
# -Os miscompiles w. 2.24 gcc5/gcc6 |
# only -O2 tested by upstream changeset |
# "Optimize i386 syscall inlining for GCC 5" |
GLIBC_CONFIGURE:= \ |
unset LD_LIBRARY_PATH; \ |
BUILD_CC="$(HOSTCC)" \ |
$(TARGET_CONFIGURE_OPTS) \ |
CFLAGS="-O2 $(filter-out -Os,$(call qstrip,$(TARGET_CFLAGS)))" \ |
libc_cv_slibdir="/lib" \ |
use_ldconfig=no \ |
$(HOST_BUILD_DIR)/$(GLIBC_PATH)configure \ |
--prefix= \ |
--build=$(GNU_HOST_NAME) \ |
--host=$(REAL_GNU_TARGET_NAME) \ |
--with-headers=$(TOOLCHAIN_DIR)/include \ |
--disable-profile \ |
--disable-werror \ |
--without-gd \ |
--without-cvs \ |
--enable-add-ons \ |
--$(if $(CONFIG_SOFT_FLOAT),without,with)-fp |
export libc_cv_ssp=no |
export libc_cv_ssp_strong=no |
export ac_cv_header_cpuid_h=yes |
export HOST_CFLAGS := $(HOST_CFLAGS) -idirafter $(CURDIR)/$(PATH_PREFIX)/include |
define Host/SetToolchainInfo |
$(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk |
$(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.gnu.org/software/libc/,' $(TOOLCHAIN_DIR)/info.mk |
$(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk |
$(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk |
endef |
define Host/Configure |
[ -f $(HOST_BUILD_DIR)/.autoconf ] || { \ |
cd $(HOST_BUILD_DIR)/; \ |
autoconf --force && \ |
touch $(HOST_BUILD_DIR)/.autoconf; \ |
} |
mkdir -p $(CUR_BUILD_DIR) |
( cd $(CUR_BUILD_DIR); rm -f config.cache; \ |
$(GLIBC_CONFIGURE) \ |
); |
endef |
define Host/Prepare |
$(call Host/Prepare/Default) |
ln -snf $(PKG_SOURCE_SUBDIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) |
endef |
define Host/Clean |
rm -rf $(CUR_BUILD_DIR)* \ |
$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev \ |
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) |
endef |
/branches/18.06.1/toolchain/glibc/headers/Makefile |
---|
@@ -0,0 +1,28 @@ |
PATH_PREFIX:=.. |
VARIANT:=headers |
include ../common.mk |
define Host/Compile |
endef |
define Host/Install |
$(call Host/SetToolchainInfo) |
mkdir -p $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/{include,lib} |
$(MAKE) -C $(CUR_BUILD_DIR) \ |
BUILD_CFLAGS="$(HOST_CFLAGS)" \ |
install_root="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev" \ |
install-bootstrap-headers=yes \ |
install-headers |
$(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/ |
$(MAKE) -C $(CUR_BUILD_DIR) \ |
csu/subdir_lib |
( cd $(CUR_BUILD_DIR); \ |
$(CP) csu/crt1.o csu/crti.o csu/crtn.o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/lib/ \ |
) |
$(TARGET_CC) -nostdlib -nostartfiles -shared -x c /dev/null \ |
-o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/lib/libc.so |
endef |
$(eval $(call HostBuild)) |
/branches/18.06.1/toolchain/glibc/include/libintl.h |
---|
@@ -0,0 +1,6 @@ |
#ifndef __FAKE_LIBINTL_H |
#define __FAKE_LIBINTL_H |
#define _(X) (X) |
#endif |
/branches/18.06.1/toolchain/glibc/patches/100-fix_cross_rpcgen.patch |
---|
@@ -0,0 +1,52 @@ |
--- a/sunrpc/rpc/types.h |
+++ b/sunrpc/rpc/types.h |
@@ -75,18 +75,23 @@ typedef unsigned long rpcport_t; |
#endif |
#ifndef __u_char_defined |
-typedef __u_char u_char; |
-typedef __u_short u_short; |
-typedef __u_int u_int; |
-typedef __u_long u_long; |
-typedef __quad_t quad_t; |
-typedef __u_quad_t u_quad_t; |
-typedef __fsid_t fsid_t; |
+typedef unsigned char u_char; |
+typedef unsigned short u_short; |
+typedef unsigned int u_int; |
+typedef unsigned long u_long; |
+#if __WORDSIZE == 64 |
+typedef long int quad_t; |
+typedef unsigned long int u_quad_t; |
+#elif defined __GLIBC_HAVE_LONG_LONG |
+typedef long long int quad_t; |
+typedef unsigned long long int u_quad_t; |
+#endif |
+typedef u_quad_t fsid_t; |
# define __u_char_defined |
#endif |
-#ifndef __daddr_t_defined |
-typedef __daddr_t daddr_t; |
-typedef __caddr_t caddr_t; |
+#if !defined(__daddr_t_defined) && defined(linux) |
+typedef long int daddr_t; |
+typedef char *caddr_t; |
# define __daddr_t_defined |
#endif |
--- a/sunrpc/rpc_main.c |
+++ b/sunrpc/rpc_main.c |
@@ -958,9 +958,10 @@ mkfile_output (struct commandline *cmd) |
abort (); |
temp = strrchr (cmd->infile, '.'); |
cp = stpcpy (mkfilename, "Makefile."); |
- if (temp != NULL) |
- *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0'; |
- else |
+ if (temp != NULL) { |
+ strncpy(cp, cmd->infile, temp - cmd->infile); |
+ cp[temp - cmd->infile - 1] = 0; |
+ } else |
stpcpy (cp, cmd->infile); |
} |
/branches/18.06.1/toolchain/glibc/patches/200-add-dl-search-paths.patch |
---|
@@ -0,0 +1,14 @@ |
add /usr/lib to default search path for the dynamic linker |
--- a/Makeconfig |
+++ b/Makeconfig |
@@ -589,6 +589,9 @@ else |
default-rpath = $(libdir) |
endif |
+# Add /usr/lib to default search path for the dynamic linker |
+user-defined-trusted-dirs := /usr/lib |
+ |
ifndef link-extra-libs |
link-extra-libs = $(LDLIBS-$(@F)) |
link-extra-libs-static = $(link-extra-libs) |
/branches/18.06.1/toolchain/info.mk |
---|
@@ -0,0 +1,6 @@ |
TARGET_CROSS= |
GCC_VERSION=unknown |
LIBC_TYPE=unknown |
LIBC_URL=unknown |
LIBC_VERSION=unknown |
LIBC_SO_VERSION=unknown |
/branches/18.06.1/toolchain/kernel-headers/Makefile |
---|
@@ -0,0 +1,104 @@ |
# |
# Copyright (C) 2006-2009 OpenWrt.org |
# |
# This is free software, licensed under the GNU General Public License v2. |
# See /LICENSE for more information. |
# |
include $(TOPDIR)/rules.mk |
KERNEL_BUILD_DIR := $(BUILD_DIR_TOOLCHAIN) |
BUILD_DIR := $(KERNEL_BUILD_DIR) |
override QUILT:= |
override HOST_QUILT:= |
include $(INCLUDE_DIR)/kernel.mk |
PKG_NAME:=linux |
PKG_VERSION:=$(LINUX_VERSION) |
PKG_SOURCE:=$(LINUX_SOURCE) |
ifneq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"") |
PKG_SOURCE_PROTO:=git |
PKG_SOURCE_URL:=$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)) |
PKG_SOURCE_VERSION:=$(CONFIG_KERNEL_GIT_REF) |
else |
PKG_SOURCE_URL:=$(LINUX_SITE) |
endif |
HOST_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) |
PKG_HASH:=$(LINUX_KERNEL_HASH) |
LINUX_DIR := $(HOST_BUILD_DIR) |
FILES_DIR := |
PATCH_DIR := ./patches$(if $(wildcard ./patches-$(LINUX_VERSION)),-$(LINUX_VERSION)) |
include $(INCLUDE_DIR)/toolchain-build.mk |
include $(INCLUDE_DIR)/kernel-defaults.mk |
ifeq ($(strip $(BOARD)),uml) |
LINUX_KARCH:=$(subst x86_64,x86,$(subst i386,x86,$(ARCH))) |
endif |
HOST_EXTRACFLAGS= |
LINUX_HAS_HEADERS_INSTALL:=y |
KMAKE := $(MAKE) -C $(HOST_BUILD_DIR) \ |
$(KERNEL_MAKE_FLAGS) \ |
CC="$(KERNEL_CC)" \ |
CFLAGS="$(TARGET_CFLAGS)" |
define Host/Configure/all |
mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev |
$(KMAKE) \ |
INSTALL_HDR_PATH="$(BUILD_DIR_TOOLCHAIN)/linux-dev/" \ |
headers_install |
endef |
# XXX: the following is needed to build lzma-loader |
ifneq ($(CONFIG_mips)$(CONFIG_mipsel),) |
define Host/Configure/lzma |
$(CP) \ |
$(HOST_BUILD_DIR)/arch/mips/include/asm/asm.h \ |
$(HOST_BUILD_DIR)/arch/mips/include/asm/regdef.h \ |
$(HOST_BUILD_DIR)/arch/mips/include/asm/asm-eva.h \ |
$(BUILD_DIR_TOOLCHAIN)/linux-dev/include/asm/ |
endef |
endif |
define Host/Configure/post/mips |
$(call Host/Configure/lzma) |
endef |
define Host/Configure/post/mipsel |
$(call Host/Configure/lzma) |
endef |
define Host/Prepare |
rm -rf $(BUILD_DIR_TOOLCHAIN)/linux-* |
$(call Kernel/Prepare/Default) |
rm -f $(BUILD_DIR_TOOLCHAIN)/linux |
ln -s linux-$(LINUX_VERSION) $(BUILD_DIR_TOOLCHAIN)/linux |
$(SED) 's/@expr length/@-expr length/' $(HOST_BUILD_DIR)/Makefile |
endef |
define Host/Configure |
env |
yes '' | $(KMAKE) oldconfig |
$(call Host/Configure/all) |
$(call Host/Configure/post/$(ARCH)) |
endef |
define Host/Compile |
endef |
define Host/Install |
$(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(TOOLCHAIN_DIR)/ |
endef |
define Host/Clean |
rm -rf \ |
$(HOST_BUILD_DIR) \ |
$(BUILD_DIR_TOOLCHAIN)/linux \ |
$(BUILD_DIR_TOOLCHAIN)/linux-dev |
endef |
$(eval $(call HostBuild)) |
/branches/18.06.1/toolchain/musl/Config.in |
---|
@@ -0,0 +1,12 @@ |
# Password crypt stubbing |
config MUSL_DISABLE_CRYPT_SIZE_HACK |
bool "Include crypt() support for SHA256, SHA512 and Blowfish ciphers" |
depends on TOOLCHAINOPTS && USE_MUSL && !EXTERNAL_TOOLCHAIN |
default n |
help |
Enable this option to re-include crypt() support for the SHA256, SHA512 and |
Blowfish ciphers. Without this option, attempting to hash a string with a salt |
requesting one of these ciphers will cause the crypt() function to call stub |
implementations which will always fail with errno ENOSYS. Including the ciphers |
will increase the library size by about 14KB after LZMA compression. |
/branches/18.06.1/toolchain/musl/Makefile |
---|
@@ -0,0 +1,31 @@ |
PATH_PREFIX=. |
include ./common.mk |
HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built |
HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.musl_installed |
HOST_BUILD_PARALLEL:=1 |
MUSL_MAKEOPTS = -C $(HOST_BUILD_DIR) \ |
DESTDIR="$(TOOLCHAIN_DIR)/" \ |
LIBCC="$(subst libgcc.a,libgcc_initial.a,$(shell $(TARGET_CC) -print-libgcc-file-name))" |
define Host/SetToolchainInfo |
$(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk |
$(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.musl-libc.org/,' $(TOOLCHAIN_DIR)/info.mk |
$(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk |
$(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(LIBC_SO_VERSION),' $(TOOLCHAIN_DIR)/info.mk |
endef |
define Host/Compile |
+$(MAKE) $(HOST_JOBS) $(MUSL_MAKEOPTS) all |
endef |
define Host/Install |
$(call Host/SetToolchainInfo) |
+$(MAKE) $(HOST_JOBS) $(MUSL_MAKEOPTS) DESTDIR="$(TOOLCHAIN_DIR)/" install |
$(CP) ./include $(TOOLCHAIN_DIR)/ |
endef |
$(eval $(call HostBuild)) |
/branches/18.06.1/toolchain/musl/common.mk |
---|
@@ -0,0 +1,58 @@ |
# |
# Copyright (C) 2012-2013 OpenWrt.org |
# |
# This is free software, licensed under the GNU General Public License v2. |
# See /LICENSE for more information. |
# |
include $(TOPDIR)/rules.mk |
include $(INCLUDE_DIR)/target.mk |
PKG_NAME:=musl |
PKG_VERSION:=1.1.21 |
PKG_RELEASE:=1 |
PKG_SOURCE_PROTO:=git |
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) |
PKG_SOURCE_VERSION:=1691b23955590d1eb66a11158fdd91c86337e886 |
PKG_MIRROR_HASH:=4fa312d0ca020d31603ced84a7103fb328c6ae9508239491a228be17e7807147 |
PKG_SOURCE_URL:=git://git.musl-libc.org/musl |
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz |
LIBC_SO_VERSION:=$(PKG_VERSION) |
PATCH_DIR:=$(PATH_PREFIX)/patches |
BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN) |
HOST_BUILD_PREFIX:=$(TOOLCHAIN_DIR) |
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION) |
include $(INCLUDE_DIR)/host-build.mk |
include $(INCLUDE_DIR)/hardening.mk |
TARGET_CFLAGS:= $(filter-out -O%,$(TARGET_CFLAGS)) |
TARGET_CFLAGS+= $(if $(CONFIG_MUSL_DISABLE_CRYPT_SIZE_HACK),,-DCRYPT_SIZE_HACK) |
MUSL_CONFIGURE:= \ |
$(TARGET_CONFIGURE_OPTS) \ |
CFLAGS="$(TARGET_CFLAGS)" \ |
CROSS_COMPILE="$(TARGET_CROSS)" \ |
$(HOST_BUILD_DIR)/configure \ |
--prefix=/ \ |
--host=$(GNU_HOST_NAME) \ |
--target=$(REAL_GNU_TARGET_NAME) \ |
--disable-gcc-wrapper \ |
--enable-debug \ |
--enable-optimize |
define Host/Configure |
ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) |
( cd $(HOST_BUILD_DIR); rm -f config.cache; \ |
$(MUSL_CONFIGURE) \ |
); |
endef |
define Host/Clean |
rm -rf \ |
$(HOST_BUILD_DIR) \ |
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \ |
$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev |
endef |
/branches/18.06.1/toolchain/musl/include/bits/wordsize.h |
---|
@@ -0,0 +1 @@ |
#include <sys/user.h> |
/branches/18.06.1/toolchain/musl/include/features.h |
---|
@@ -0,0 +1,48 @@ |
#ifndef _FEATURES_H |
#define _FEATURES_H |
#ifdef _ALL_SOURCE |
#define _GNU_SOURCE 1 |
#endif |
#if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \ |
&& !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \ |
&& !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__) |
#define _BSD_SOURCE 1 |
#define _XOPEN_SOURCE 700 |
#endif |
#if __STDC_VERSION__ >= 199901L |
#define __restrict restrict |
#elif !defined(__GNUC__) |
#define __restrict |
#endif |
#if __STDC_VERSION__ >= 199901L || defined(__cplusplus) |
#define __inline inline |
#endif |
#if __STDC_VERSION__ >= 201112L |
#elif defined(__GNUC__) |
#define _Noreturn __attribute__((__noreturn__)) |
#else |
#define _Noreturn |
#endif |
/* Convenience macros to test the versions of glibc and gcc. |
Use them like this: |
#if __GNUC_PREREQ (2,8) |
... code requiring gcc 2.8 or later ... |
#endif |
Note - they won't work for gcc1 or glibc1, since the _MINOR macros |
were not defined then. */ |
#if defined __GNUC__ && defined __GNUC_MINOR__ |
# define __GNUC_PREREQ(maj, min) \ |
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) |
#else |
# define __GNUC_PREREQ(maj, min) 0 |
#endif |
#include <sys/glibc-types.h> |
#endif |
/branches/18.06.1/toolchain/musl/include/sgidefs.h |
---|
@@ -0,0 +1,73 @@ |
/* Copyright (C) 1996, 1997, 1998, 2003, 2004 Free Software Foundation, Inc. |
This file is part of the GNU C Library. |
Contributed by Ralf Baechle <ralf@gnu.org>. |
The GNU C Library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 of the License, or (at your option) any later version. |
The GNU C Library 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 |
Lesser General Public License for more details. |
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
#ifndef _SGIDEFS_H |
#define _SGIDEFS_H 1 |
/* |
* A crude hack to stop <asm/sgidefs.h> |
*/ |
#undef __ASM_SGIDEFS_H |
#define __ASM_SGIDEFS_H |
/* |
* And remove any damage it might have already done |
*/ |
#undef _MIPS_ISA_MIPS1 |
#undef _MIPS_ISA_MIPS2 |
#undef _MIPS_ISA_MIPS3 |
#undef _MIPS_ISA_MIPS4 |
#undef _MIPS_ISA_MIPS5 |
#undef _MIPS_ISA_MIPS32 |
#undef _MIPS_ISA_MIPS64 |
#undef _MIPS_SIM_ABI32 |
#undef _MIPS_SIM_NABI32 |
#undef _MIPS_SIM_ABI64 |
/* |
* Definitions for the ISA level |
*/ |
#define _MIPS_ISA_MIPS1 1 |
#define _MIPS_ISA_MIPS2 2 |
#define _MIPS_ISA_MIPS3 3 |
#define _MIPS_ISA_MIPS4 4 |
#define _MIPS_ISA_MIPS5 5 |
#define _MIPS_ISA_MIPS32 6 |
#define _MIPS_ISA_MIPS64 7 |
/* |
* Subprogram calling convention |
*/ |
#ifndef _ABIO32 |
# define _ABIO32 1 |
#endif |
#define _MIPS_SIM_ABI32 _ABIO32 |
#ifndef _ABIN32 |
# define _ABIN32 2 |
#endif |
#define _MIPS_SIM_NABI32 _ABIN32 |
#ifndef _ABI64 |
# define _ABI64 3 |
#endif |
#define _MIPS_SIM_ABI64 _ABI64 |
#endif /* sgidefs.h */ |
/branches/18.06.1/toolchain/musl/include/sys/cdefs.h |
---|
@@ -0,0 +1,378 @@ |
/* Copyright (C) 1992-2002, 2004, 2005, 2006, 2007, 2009, 2011, 2012 |
Free Software Foundation, Inc. |
This file is part of the GNU C Library. |
The GNU C Library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 of the License, or (at your option) any later version. |
The GNU C Library 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 |
Lesser General Public License for more details. |
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, see |
<http://www.gnu.org/licenses/>. */ |
#ifndef _SYS_CDEFS_H |
#define _SYS_CDEFS_H 1 |
/* We are almost always included from features.h. */ |
#ifndef _FEATURES_H |
# include <features.h> |
#endif |
/* The GNU libc does not support any K&R compilers or the traditional mode |
of ISO C compilers anymore. Check for some of the combinations not |
anymore supported. */ |
#if defined __GNUC__ && !defined __STDC__ |
# error "You need a ISO C conforming compiler to use the glibc headers" |
#endif |
/* Some user header file might have defined this before. */ |
#undef __P |
#undef __PMT |
#ifdef __GNUC__ |
/* All functions, except those with callbacks or those that |
synchronize memory, are leaf functions. */ |
# if __GNUC_PREREQ (4, 6) && !defined _LIBC |
# define __LEAF , __leaf__ |
# define __LEAF_ATTR __attribute__ ((__leaf__)) |
# else |
# define __LEAF |
# define __LEAF_ATTR |
# endif |
/* GCC can always grok prototypes. For C++ programs we add throw() |
to help it optimize the function calls. But this works only with |
gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions |
as non-throwing using a function attribute since programs can use |
the -fexceptions options for C code as well. */ |
# if !defined __cplusplus && __GNUC_PREREQ (3, 3) |
# define __THROW __attribute__ ((__nothrow__ __LEAF)) |
# define __THROWNL __attribute__ ((__nothrow__)) |
# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct |
# else |
# if defined __cplusplus && __GNUC_PREREQ (2,8) |
# define __THROW throw () |
# define __THROWNL throw () |
# define __NTH(fct) __LEAF_ATTR fct throw () |
# else |
# define __THROW |
# define __THROWNL |
# define __NTH(fct) fct |
# endif |
# endif |
#else /* Not GCC. */ |
# define __inline /* No inline functions. */ |
# define __THROW |
# define __THROWNL |
# define __NTH(fct) fct |
#endif /* GCC. */ |
/* These two macros are not used in glibc anymore. They are kept here |
only because some other projects expect the macros to be defined. */ |
#define __P(args) args |
#define __PMT(args) args |
/* For these things, GCC behaves the ANSI way normally, |
and the non-ANSI way under -traditional. */ |
#define __CONCAT(x,y) x ## y |
#define __STRING(x) #x |
/* This is not a typedef so `const __ptr_t' does the right thing. */ |
#define __ptr_t void * |
#define __long_double_t long double |
/* C++ needs to know that types and declarations are C, not C++. */ |
#ifdef __cplusplus |
# define __BEGIN_DECLS extern "C" { |
# define __END_DECLS } |
#else |
# define __BEGIN_DECLS |
# define __END_DECLS |
#endif |
/* The standard library needs the functions from the ISO C90 standard |
in the std namespace. At the same time we want to be safe for |
future changes and we include the ISO C99 code in the non-standard |
namespace __c99. The C++ wrapper header take case of adding the |
definitions to the global namespace. */ |
#if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES |
# define __BEGIN_NAMESPACE_STD namespace std { |
# define __END_NAMESPACE_STD } |
# define __USING_NAMESPACE_STD(name) using std::name; |
# define __BEGIN_NAMESPACE_C99 namespace __c99 { |
# define __END_NAMESPACE_C99 } |
# define __USING_NAMESPACE_C99(name) using __c99::name; |
#else |
/* For compatibility we do not add the declarations into any |
namespace. They will end up in the global namespace which is what |
old code expects. */ |
# define __BEGIN_NAMESPACE_STD |
# define __END_NAMESPACE_STD |
# define __USING_NAMESPACE_STD(name) |
# define __BEGIN_NAMESPACE_C99 |
# define __END_NAMESPACE_C99 |
# define __USING_NAMESPACE_C99(name) |
#endif |
/* Support for bounded pointers. */ |
#ifndef __BOUNDED_POINTERS__ |
# define __bounded /* nothing */ |
# define __unbounded /* nothing */ |
# define __ptrvalue /* nothing */ |
#endif |
/* Fortify support. */ |
#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) |
#define __bos0(ptr) __builtin_object_size (ptr, 0) |
#define __fortify_function __extern_always_inline __attribute_artificial__ |
#if __GNUC_PREREQ (4,3) |
# define __warndecl(name, msg) \ |
extern void name (void) __attribute__((__warning__ (msg))) |
# define __warnattr(msg) __attribute__((__warning__ (msg))) |
# define __errordecl(name, msg) \ |
extern void name (void) __attribute__((__error__ (msg))) |
#else |
# define __warndecl(name, msg) extern void name (void) |
# define __warnattr(msg) |
# define __errordecl(name, msg) extern void name (void) |
#endif |
/* Support for flexible arrays. */ |
#if __GNUC_PREREQ (2,97) |
/* GCC 2.97 supports C99 flexible array members. */ |
# define __flexarr [] |
#else |
# ifdef __GNUC__ |
# define __flexarr [0] |
# else |
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L |
# define __flexarr [] |
# else |
/* Some other non-C99 compiler. Approximate with [1]. */ |
# define __flexarr [1] |
# endif |
# endif |
#endif |
/* __asm__ ("xyz") is used throughout the headers to rename functions |
at the assembly language level. This is wrapped by the __REDIRECT |
macro, in order to support compilers that can do this some other |
way. When compilers don't support asm-names at all, we have to do |
preprocessor tricks instead (which don't have exactly the right |
semantics, but it's the best we can do). |
Example: |
int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ |
#if defined __GNUC__ && __GNUC__ >= 2 |
# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) |
# ifdef __cplusplus |
# define __REDIRECT_NTH(name, proto, alias) \ |
name proto __THROW __asm__ (__ASMNAME (#alias)) |
# define __REDIRECT_NTHNL(name, proto, alias) \ |
name proto __THROWNL __asm__ (__ASMNAME (#alias)) |
# else |
# define __REDIRECT_NTH(name, proto, alias) \ |
name proto __asm__ (__ASMNAME (#alias)) __THROW |
# define __REDIRECT_NTHNL(name, proto, alias) \ |
name proto __asm__ (__ASMNAME (#alias)) __THROWNL |
# endif |
# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) |
# define __ASMNAME2(prefix, cname) __STRING (prefix) cname |
/* |
#elif __SOME_OTHER_COMPILER__ |
# define __REDIRECT(name, proto, alias) name proto; \ |
_Pragma("let " #name " = " #alias) |
*/ |
#endif |
/* GCC has various useful declarations that can be made with the |
`__attribute__' syntax. All of the ways we use this do fine if |
they are omitted for compilers that don't understand it. */ |
#if !defined __GNUC__ || __GNUC__ < 2 |
# define __attribute__(xyz) /* Ignore */ |
#endif |
/* At some point during the gcc 2.96 development the `malloc' attribute |
for functions was introduced. We don't want to use it unconditionally |
(although this would be possible) since it generates warnings. */ |
#if __GNUC_PREREQ (2,96) |
# define __attribute_malloc__ __attribute__ ((__malloc__)) |
#else |
# define __attribute_malloc__ /* Ignore */ |
#endif |
/* At some point during the gcc 2.96 development the `pure' attribute |
for functions was introduced. We don't want to use it unconditionally |
(although this would be possible) since it generates warnings. */ |
#if __GNUC_PREREQ (2,96) |
# define __attribute_pure__ __attribute__ ((__pure__)) |
#else |
# define __attribute_pure__ /* Ignore */ |
#endif |
/* This declaration tells the compiler that the value is constant. */ |
#if __GNUC_PREREQ (2,5) |
# define __attribute_const__ __attribute__ ((__const__)) |
#else |
# define __attribute_const__ /* Ignore */ |
#endif |
/* At some point during the gcc 3.1 development the `used' attribute |
for functions was introduced. We don't want to use it unconditionally |
(although this would be possible) since it generates warnings. */ |
#if __GNUC_PREREQ (3,1) |
# define __attribute_used__ __attribute__ ((__used__)) |
# define __attribute_noinline__ __attribute__ ((__noinline__)) |
#else |
# define __attribute_used__ __attribute__ ((__unused__)) |
# define __attribute_noinline__ /* Ignore */ |
#endif |
/* gcc allows marking deprecated functions. */ |
#if __GNUC_PREREQ (3,2) |
# define __attribute_deprecated__ __attribute__ ((__deprecated__)) |
#else |
# define __attribute_deprecated__ /* Ignore */ |
#endif |
/* At some point during the gcc 2.8 development the `format_arg' attribute |
for functions was introduced. We don't want to use it unconditionally |
(although this would be possible) since it generates warnings. |
If several `format_arg' attributes are given for the same function, in |
gcc-3.0 and older, all but the last one are ignored. In newer gccs, |
all designated arguments are considered. */ |
#if __GNUC_PREREQ (2,8) |
# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) |
#else |
# define __attribute_format_arg__(x) /* Ignore */ |
#endif |
/* At some point during the gcc 2.97 development the `strfmon' format |
attribute for functions was introduced. We don't want to use it |
unconditionally (although this would be possible) since it |
generates warnings. */ |
#if __GNUC_PREREQ (2,97) |
# define __attribute_format_strfmon__(a,b) \ |
__attribute__ ((__format__ (__strfmon__, a, b))) |
#else |
# define __attribute_format_strfmon__(a,b) /* Ignore */ |
#endif |
/* The nonull function attribute allows to mark pointer parameters which |
must not be NULL. */ |
#if __GNUC_PREREQ (3,3) |
# define __nonnull(params) __attribute__ ((__nonnull__ params)) |
#else |
# define __nonnull(params) |
#endif |
/* If fortification mode, we warn about unused results of certain |
function calls which can lead to problems. */ |
#if __GNUC_PREREQ (3,4) |
# define __attribute_warn_unused_result__ \ |
__attribute__ ((__warn_unused_result__)) |
# if __USE_FORTIFY_LEVEL > 0 |
# define __wur __attribute_warn_unused_result__ |
# endif |
#else |
# define __attribute_warn_unused_result__ /* empty */ |
#endif |
#ifndef __wur |
# define __wur /* Ignore */ |
#endif |
/* Forces a function to be always inlined. */ |
#if __GNUC_PREREQ (3,2) |
# define __always_inline __inline __attribute__ ((__always_inline__)) |
#else |
# define __always_inline __inline |
#endif |
/* Associate error messages with the source location of the call site rather |
than with the source location inside the function. */ |
#if __GNUC_PREREQ (4,3) |
# define __attribute_artificial__ __attribute__ ((__artificial__)) |
#else |
# define __attribute_artificial__ /* Ignore */ |
#endif |
/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 |
inline semantics, unless -fgnu89-inline is used. */ |
#if !defined __cplusplus || __GNUC_PREREQ (4,3) |
# if defined __GNUC_STDC_INLINE__ || defined __cplusplus |
# define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) |
# define __extern_always_inline \ |
extern __always_inline __attribute__ ((__gnu_inline__)) |
# else |
# define __extern_inline extern __inline |
# define __extern_always_inline extern __always_inline |
# endif |
#endif |
/* GCC 4.3 and above allow passing all anonymous arguments of an |
__extern_always_inline function to some other vararg function. */ |
#if __GNUC_PREREQ (4,3) |
# define __va_arg_pack() __builtin_va_arg_pack () |
# define __va_arg_pack_len() __builtin_va_arg_pack_len () |
#endif |
/* It is possible to compile containing GCC extensions even if GCC is |
run in pedantic mode if the uses are carefully marked using the |
`__extension__' keyword. But this is not generally available before |
version 2.8. */ |
#if !__GNUC_PREREQ (2,8) |
# define __extension__ /* Ignore */ |
#endif |
/* __restrict is known in EGCS 1.2 and above. */ |
#if !__GNUC_PREREQ (2,92) |
# define __restrict /* Ignore */ |
#endif |
/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is |
array_name[restrict] |
GCC 3.1 supports this. */ |
#if __GNUC_PREREQ (3,1) && !defined __GNUG__ |
# define __restrict_arr __restrict |
#else |
# ifdef __GNUC__ |
# define __restrict_arr /* Not supported in old GCC. */ |
# else |
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L |
# define __restrict_arr restrict |
# else |
/* Some other non-C99 compiler. */ |
# define __restrict_arr /* Not supported. */ |
# endif |
# endif |
#endif |
#if __GNUC__ >= 3 |
# define __glibc_unlikely(cond) __builtin_expect((cond), 0) |
#else |
# define __glibc_unlikely(cond) (cond) |
#endif |
#endif /* sys/cdefs.h */ |
/branches/18.06.1/toolchain/musl/include/sys/glibc-types.h |
---|
@@ -0,0 +1,35 @@ |
#ifndef __MUSL_GLIBC_TYPES_H |
#define __MUSL_GLIBC_TYPES_H |
#include <sys/cdefs.h> |
/* Convenience types. */ |
typedef unsigned char __u_char; |
typedef unsigned short int __u_short; |
typedef unsigned int __u_int; |
typedef unsigned long int __u_long; |
/* Fixed-size types, underlying types depend on word size and compiler. */ |
typedef signed char __int8_t; |
typedef unsigned char __uint8_t; |
typedef signed short int __int16_t; |
typedef unsigned short int __uint16_t; |
typedef signed int __int32_t; |
typedef unsigned int __uint32_t; |
#if __WORDSIZE == 64 |
typedef signed long int __int64_t; |
typedef unsigned long int __uint64_t; |
#else |
__extension__ typedef signed long long int __int64_t; |
__extension__ typedef unsigned long long int __uint64_t; |
#endif |
#define __off64_t off_t |
#define __loff_t off_t |
typedef char *__caddr_t; |
#define __locale_t locale_t |
#define __gid_t gid_t |
#define __uid_t uid_t |
#endif |
/branches/18.06.1/toolchain/musl/include/sys/queue.h |
---|
@@ -0,0 +1,574 @@ |
/* |
* Copyright (c) 1991, 1993 |
* The Regents of the University of California. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* 1. Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* 3. Neither the name of the University nor the names of its contributors |
* may be used to endorse or promote products derived from this software |
* without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
* SUCH DAMAGE. |
* |
* @(#)queue.h 8.5 (Berkeley) 8/20/94 |
*/ |
#ifndef _SYS_QUEUE_H_ |
#define _SYS_QUEUE_H_ |
/* |
* This file defines five types of data structures: singly-linked lists, |
* lists, simple queues, tail queues, and circular queues. |
* |
* A singly-linked list is headed by a single forward pointer. The |
* elements are singly linked for minimum space and pointer manipulation |
* overhead at the expense of O(n) removal for arbitrary elements. New |
* elements can be added to the list after an existing element or at the |
* head of the list. Elements being removed from the head of the list |
* should use the explicit macro for this purpose for optimum |
* efficiency. A singly-linked list may only be traversed in the forward |
* direction. Singly-linked lists are ideal for applications with large |
* datasets and few or no removals or for implementing a LIFO queue. |
* |
* A list is headed by a single forward pointer (or an array of forward |
* pointers for a hash table header). The elements are doubly linked |
* so that an arbitrary element can be removed without a need to |
* traverse the list. New elements can be added to the list before |
* or after an existing element or at the head of the list. A list |
* may only be traversed in the forward direction. |
* |
* A simple queue is headed by a pair of pointers, one the head of the |
* list and the other to the tail of the list. The elements are singly |
* linked to save space, so elements can only be removed from the |
* head of the list. New elements can be added to the list after |
* an existing element, at the head of the list, or at the end of the |
* list. A simple queue may only be traversed in the forward direction. |
* |
* A tail queue is headed by a pair of pointers, one to the head of the |
* list and the other to the tail of the list. The elements are doubly |
* linked so that an arbitrary element can be removed without a need to |
* traverse the list. New elements can be added to the list before or |
* after an existing element, at the head of the list, or at the end of |
* the list. A tail queue may be traversed in either direction. |
* |
* A circle queue is headed by a pair of pointers, one to the head of the |
* list and the other to the tail of the list. The elements are doubly |
* linked so that an arbitrary element can be removed without a need to |
* traverse the list. New elements can be added to the list before or after |
* an existing element, at the head of the list, or at the end of the list. |
* A circle queue may be traversed in either direction, but has a more |
* complex end of list detection. |
* |
* For details on the use of these macros, see the queue(3) manual page. |
*/ |
/* |
* List definitions. |
*/ |
#define LIST_HEAD(name, type) \ |
struct name { \ |
struct type *lh_first; /* first element */ \ |
} |
#define LIST_HEAD_INITIALIZER(head) \ |
{ NULL } |
#define LIST_ENTRY(type) \ |
struct { \ |
struct type *le_next; /* next element */ \ |
struct type **le_prev; /* address of previous next element */ \ |
} |
/* |
* List functions. |
*/ |
#define LIST_INIT(head) do { \ |
(head)->lh_first = NULL; \ |
} while (/*CONSTCOND*/0) |
#define LIST_INSERT_AFTER(listelm, elm, field) do { \ |
if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \ |
(listelm)->field.le_next->field.le_prev = \ |
&(elm)->field.le_next; \ |
(listelm)->field.le_next = (elm); \ |
(elm)->field.le_prev = &(listelm)->field.le_next; \ |
} while (/*CONSTCOND*/0) |
#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ |
(elm)->field.le_prev = (listelm)->field.le_prev; \ |
(elm)->field.le_next = (listelm); \ |
*(listelm)->field.le_prev = (elm); \ |
(listelm)->field.le_prev = &(elm)->field.le_next; \ |
} while (/*CONSTCOND*/0) |
#define LIST_INSERT_HEAD(head, elm, field) do { \ |
if (((elm)->field.le_next = (head)->lh_first) != NULL) \ |
(head)->lh_first->field.le_prev = &(elm)->field.le_next;\ |
(head)->lh_first = (elm); \ |
(elm)->field.le_prev = &(head)->lh_first; \ |
} while (/*CONSTCOND*/0) |
#define LIST_REMOVE(elm, field) do { \ |
if ((elm)->field.le_next != NULL) \ |
(elm)->field.le_next->field.le_prev = \ |
(elm)->field.le_prev; \ |
*(elm)->field.le_prev = (elm)->field.le_next; \ |
} while (/*CONSTCOND*/0) |
#define LIST_FOREACH(var, head, field) \ |
for ((var) = ((head)->lh_first); \ |
(var); \ |
(var) = ((var)->field.le_next)) |
/* |
* List access methods. |
*/ |
#define LIST_EMPTY(head) ((head)->lh_first == NULL) |
#define LIST_FIRST(head) ((head)->lh_first) |
#define LIST_NEXT(elm, field) ((elm)->field.le_next) |
/* |
* Singly-linked List definitions. |
*/ |
#define SLIST_HEAD(name, type) \ |
struct name { \ |
struct type *slh_first; /* first element */ \ |
} |
#define SLIST_HEAD_INITIALIZER(head) \ |
{ NULL } |
#define SLIST_ENTRY(type) \ |
struct { \ |
struct type *sle_next; /* next element */ \ |
} |
/* |
* Singly-linked List functions. |
*/ |
#define SLIST_INIT(head) do { \ |
(head)->slh_first = NULL; \ |
} while (/*CONSTCOND*/0) |
#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ |
(elm)->field.sle_next = (slistelm)->field.sle_next; \ |
(slistelm)->field.sle_next = (elm); \ |
} while (/*CONSTCOND*/0) |
#define SLIST_INSERT_HEAD(head, elm, field) do { \ |
(elm)->field.sle_next = (head)->slh_first; \ |
(head)->slh_first = (elm); \ |
} while (/*CONSTCOND*/0) |
#define SLIST_REMOVE_HEAD(head, field) do { \ |
(head)->slh_first = (head)->slh_first->field.sle_next; \ |
} while (/*CONSTCOND*/0) |
#define SLIST_REMOVE(head, elm, type, field) do { \ |
if ((head)->slh_first == (elm)) { \ |
SLIST_REMOVE_HEAD((head), field); \ |
} \ |
else { \ |
struct type *curelm = (head)->slh_first; \ |
while(curelm->field.sle_next != (elm)) \ |
curelm = curelm->field.sle_next; \ |
curelm->field.sle_next = \ |
curelm->field.sle_next->field.sle_next; \ |
} \ |
} while (/*CONSTCOND*/0) |
#define SLIST_FOREACH(var, head, field) \ |
for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next) |
/* |
* Singly-linked List access methods. |
*/ |
#define SLIST_EMPTY(head) ((head)->slh_first == NULL) |
#define SLIST_FIRST(head) ((head)->slh_first) |
#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) |
/* |
* Singly-linked Tail queue declarations. |
*/ |
#define STAILQ_HEAD(name, type) \ |
struct name { \ |
struct type *stqh_first; /* first element */ \ |
struct type **stqh_last; /* addr of last next element */ \ |
} |
#define STAILQ_HEAD_INITIALIZER(head) \ |
{ NULL, &(head).stqh_first } |
#define STAILQ_ENTRY(type) \ |
struct { \ |
struct type *stqe_next; /* next element */ \ |
} |
/* |
* Singly-linked Tail queue functions. |
*/ |
#define STAILQ_INIT(head) do { \ |
(head)->stqh_first = NULL; \ |
(head)->stqh_last = &(head)->stqh_first; \ |
} while (/*CONSTCOND*/0) |
#define STAILQ_INSERT_HEAD(head, elm, field) do { \ |
if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \ |
(head)->stqh_last = &(elm)->field.stqe_next; \ |
(head)->stqh_first = (elm); \ |
} while (/*CONSTCOND*/0) |
#define STAILQ_INSERT_TAIL(head, elm, field) do { \ |
(elm)->field.stqe_next = NULL; \ |
*(head)->stqh_last = (elm); \ |
(head)->stqh_last = &(elm)->field.stqe_next; \ |
} while (/*CONSTCOND*/0) |
#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ |
if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\ |
(head)->stqh_last = &(elm)->field.stqe_next; \ |
(listelm)->field.stqe_next = (elm); \ |
} while (/*CONSTCOND*/0) |
#define STAILQ_REMOVE_HEAD(head, field) do { \ |
if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \ |
(head)->stqh_last = &(head)->stqh_first; \ |
} while (/*CONSTCOND*/0) |
#define STAILQ_REMOVE(head, elm, type, field) do { \ |
if ((head)->stqh_first == (elm)) { \ |
STAILQ_REMOVE_HEAD((head), field); \ |
} else { \ |
struct type *curelm = (head)->stqh_first; \ |
while (curelm->field.stqe_next != (elm)) \ |
curelm = curelm->field.stqe_next; \ |
if ((curelm->field.stqe_next = \ |
curelm->field.stqe_next->field.stqe_next) == NULL) \ |
(head)->stqh_last = &(curelm)->field.stqe_next; \ |
} \ |
} while (/*CONSTCOND*/0) |
#define STAILQ_FOREACH(var, head, field) \ |
for ((var) = ((head)->stqh_first); \ |
(var); \ |
(var) = ((var)->field.stqe_next)) |
#define STAILQ_CONCAT(head1, head2) do { \ |
if (!STAILQ_EMPTY((head2))) { \ |
*(head1)->stqh_last = (head2)->stqh_first; \ |
(head1)->stqh_last = (head2)->stqh_last; \ |
STAILQ_INIT((head2)); \ |
} \ |
} while (/*CONSTCOND*/0) |
/* |
* Singly-linked Tail queue access methods. |
*/ |
#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) |
#define STAILQ_FIRST(head) ((head)->stqh_first) |
#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) |
/* |
* Simple queue definitions. |
*/ |
#define SIMPLEQ_HEAD(name, type) \ |
struct name { \ |
struct type *sqh_first; /* first element */ \ |
struct type **sqh_last; /* addr of last next element */ \ |
} |
#define SIMPLEQ_HEAD_INITIALIZER(head) \ |
{ NULL, &(head).sqh_first } |
#define SIMPLEQ_ENTRY(type) \ |
struct { \ |
struct type *sqe_next; /* next element */ \ |
} |
/* |
* Simple queue functions. |
*/ |
#define SIMPLEQ_INIT(head) do { \ |
(head)->sqh_first = NULL; \ |
(head)->sqh_last = &(head)->sqh_first; \ |
} while (/*CONSTCOND*/0) |
#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ |
if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \ |
(head)->sqh_last = &(elm)->field.sqe_next; \ |
(head)->sqh_first = (elm); \ |
} while (/*CONSTCOND*/0) |
#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ |
(elm)->field.sqe_next = NULL; \ |
*(head)->sqh_last = (elm); \ |
(head)->sqh_last = &(elm)->field.sqe_next; \ |
} while (/*CONSTCOND*/0) |
#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ |
if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\ |
(head)->sqh_last = &(elm)->field.sqe_next; \ |
(listelm)->field.sqe_next = (elm); \ |
} while (/*CONSTCOND*/0) |
#define SIMPLEQ_REMOVE_HEAD(head, field) do { \ |
if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \ |
(head)->sqh_last = &(head)->sqh_first; \ |
} while (/*CONSTCOND*/0) |
#define SIMPLEQ_REMOVE(head, elm, type, field) do { \ |
if ((head)->sqh_first == (elm)) { \ |
SIMPLEQ_REMOVE_HEAD((head), field); \ |
} else { \ |
struct type *curelm = (head)->sqh_first; \ |
while (curelm->field.sqe_next != (elm)) \ |
curelm = curelm->field.sqe_next; \ |
if ((curelm->field.sqe_next = \ |
curelm->field.sqe_next->field.sqe_next) == NULL) \ |
(head)->sqh_last = &(curelm)->field.sqe_next; \ |
} \ |
} while (/*CONSTCOND*/0) |
#define SIMPLEQ_FOREACH(var, head, field) \ |
for ((var) = ((head)->sqh_first); \ |
(var); \ |
(var) = ((var)->field.sqe_next)) |
/* |
* Simple queue access methods. |
*/ |
#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL) |
#define SIMPLEQ_FIRST(head) ((head)->sqh_first) |
#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) |
/* |
* Tail queue definitions. |
*/ |
#define _TAILQ_HEAD(name, type, qual) \ |
struct name { \ |
qual type *tqh_first; /* first element */ \ |
qual type *qual *tqh_last; /* addr of last next element */ \ |
} |
#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,) |
#define TAILQ_HEAD_INITIALIZER(head) \ |
{ NULL, &(head).tqh_first } |
#define _TAILQ_ENTRY(type, qual) \ |
struct { \ |
qual type *tqe_next; /* next element */ \ |
qual type *qual *tqe_prev; /* address of previous next element */\ |
} |
#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,) |
/* |
* Tail queue functions. |
*/ |
#define TAILQ_INIT(head) do { \ |
(head)->tqh_first = NULL; \ |
(head)->tqh_last = &(head)->tqh_first; \ |
} while (/*CONSTCOND*/0) |
#define TAILQ_INSERT_HEAD(head, elm, field) do { \ |
if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ |
(head)->tqh_first->field.tqe_prev = \ |
&(elm)->field.tqe_next; \ |
else \ |
(head)->tqh_last = &(elm)->field.tqe_next; \ |
(head)->tqh_first = (elm); \ |
(elm)->field.tqe_prev = &(head)->tqh_first; \ |
} while (/*CONSTCOND*/0) |
#define TAILQ_INSERT_TAIL(head, elm, field) do { \ |
(elm)->field.tqe_next = NULL; \ |
(elm)->field.tqe_prev = (head)->tqh_last; \ |
*(head)->tqh_last = (elm); \ |
(head)->tqh_last = &(elm)->field.tqe_next; \ |
} while (/*CONSTCOND*/0) |
#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ |
if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ |
(elm)->field.tqe_next->field.tqe_prev = \ |
&(elm)->field.tqe_next; \ |
else \ |
(head)->tqh_last = &(elm)->field.tqe_next; \ |
(listelm)->field.tqe_next = (elm); \ |
(elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ |
} while (/*CONSTCOND*/0) |
#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ |
(elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ |
(elm)->field.tqe_next = (listelm); \ |
*(listelm)->field.tqe_prev = (elm); \ |
(listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ |
} while (/*CONSTCOND*/0) |
#define TAILQ_REMOVE(head, elm, field) do { \ |
if (((elm)->field.tqe_next) != NULL) \ |
(elm)->field.tqe_next->field.tqe_prev = \ |
(elm)->field.tqe_prev; \ |
else \ |
(head)->tqh_last = (elm)->field.tqe_prev; \ |
*(elm)->field.tqe_prev = (elm)->field.tqe_next; \ |
} while (/*CONSTCOND*/0) |
#define TAILQ_FOREACH(var, head, field) \ |
for ((var) = ((head)->tqh_first); \ |
(var); \ |
(var) = ((var)->field.tqe_next)) |
#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ |
for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \ |
(var); \ |
(var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))) |
#define TAILQ_CONCAT(head1, head2, field) do { \ |
if (!TAILQ_EMPTY(head2)) { \ |
*(head1)->tqh_last = (head2)->tqh_first; \ |
(head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ |
(head1)->tqh_last = (head2)->tqh_last; \ |
TAILQ_INIT((head2)); \ |
} \ |
} while (/*CONSTCOND*/0) |
/* |
* Tail queue access methods. |
*/ |
#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) |
#define TAILQ_FIRST(head) ((head)->tqh_first) |
#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) |
#define TAILQ_LAST(head, headname) \ |
(*(((struct headname *)((head)->tqh_last))->tqh_last)) |
#define TAILQ_PREV(elm, headname, field) \ |
(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) |
/* |
* Circular queue definitions. |
*/ |
#define CIRCLEQ_HEAD(name, type) \ |
struct name { \ |
struct type *cqh_first; /* first element */ \ |
struct type *cqh_last; /* last element */ \ |
} |
#define CIRCLEQ_HEAD_INITIALIZER(head) \ |
{ (void *)&head, (void *)&head } |
#define CIRCLEQ_ENTRY(type) \ |
struct { \ |
struct type *cqe_next; /* next element */ \ |
struct type *cqe_prev; /* previous element */ \ |
} |
/* |
* Circular queue functions. |
*/ |
#define CIRCLEQ_INIT(head) do { \ |
(head)->cqh_first = (void *)(head); \ |
(head)->cqh_last = (void *)(head); \ |
} while (/*CONSTCOND*/0) |
#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ |
(elm)->field.cqe_next = (listelm)->field.cqe_next; \ |
(elm)->field.cqe_prev = (listelm); \ |
if ((listelm)->field.cqe_next == (void *)(head)) \ |
(head)->cqh_last = (elm); \ |
else \ |
(listelm)->field.cqe_next->field.cqe_prev = (elm); \ |
(listelm)->field.cqe_next = (elm); \ |
} while (/*CONSTCOND*/0) |
#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ |
(elm)->field.cqe_next = (listelm); \ |
(elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ |
if ((listelm)->field.cqe_prev == (void *)(head)) \ |
(head)->cqh_first = (elm); \ |
else \ |
(listelm)->field.cqe_prev->field.cqe_next = (elm); \ |
(listelm)->field.cqe_prev = (elm); \ |
} while (/*CONSTCOND*/0) |
#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ |
(elm)->field.cqe_next = (head)->cqh_first; \ |
(elm)->field.cqe_prev = (void *)(head); \ |
if ((head)->cqh_last == (void *)(head)) \ |
(head)->cqh_last = (elm); \ |
else \ |
(head)->cqh_first->field.cqe_prev = (elm); \ |
(head)->cqh_first = (elm); \ |
} while (/*CONSTCOND*/0) |
#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ |
(elm)->field.cqe_next = (void *)(head); \ |
(elm)->field.cqe_prev = (head)->cqh_last; \ |
if ((head)->cqh_first == (void *)(head)) \ |
(head)->cqh_first = (elm); \ |
else \ |
(head)->cqh_last->field.cqe_next = (elm); \ |
(head)->cqh_last = (elm); \ |
} while (/*CONSTCOND*/0) |
#define CIRCLEQ_REMOVE(head, elm, field) do { \ |
if ((elm)->field.cqe_next == (void *)(head)) \ |
(head)->cqh_last = (elm)->field.cqe_prev; \ |
else \ |
(elm)->field.cqe_next->field.cqe_prev = \ |
(elm)->field.cqe_prev; \ |
if ((elm)->field.cqe_prev == (void *)(head)) \ |
(head)->cqh_first = (elm)->field.cqe_next; \ |
else \ |
(elm)->field.cqe_prev->field.cqe_next = \ |
(elm)->field.cqe_next; \ |
} while (/*CONSTCOND*/0) |
#define CIRCLEQ_FOREACH(var, head, field) \ |
for ((var) = ((head)->cqh_first); \ |
(var) != (const void *)(head); \ |
(var) = ((var)->field.cqe_next)) |
#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ |
for ((var) = ((head)->cqh_last); \ |
(var) != (const void *)(head); \ |
(var) = ((var)->field.cqe_prev)) |
/* |
* Circular queue access methods. |
*/ |
#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head)) |
#define CIRCLEQ_FIRST(head) ((head)->cqh_first) |
#define CIRCLEQ_LAST(head) ((head)->cqh_last) |
#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) |
#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) |
#define CIRCLEQ_LOOP_NEXT(head, elm, field) \ |
(((elm)->field.cqe_next == (void *)(head)) \ |
? ((head)->cqh_first) \ |
: (elm->field.cqe_next)) |
#define CIRCLEQ_LOOP_PREV(head, elm, field) \ |
(((elm)->field.cqe_prev == (void *)(head)) \ |
? ((head)->cqh_last) \ |
: (elm->field.cqe_prev)) |
#endif /* sys/queue.h */ |
/branches/18.06.1/toolchain/musl/patches/100-add_glob_onlydir.patch |
---|
@@ -0,0 +1,11 @@ |
--- a/include/glob.h |
+++ b/include/glob.h |
@@ -31,6 +31,8 @@ void globfree(glob_t *); |
#define GLOB_NOESCAPE 0x40 |
#define GLOB_PERIOD 0x80 |
+#define GLOB_ONLYDIR 0x100 |
+ |
#define GLOB_NOSPACE 1 |
#define GLOB_ABORTED 2 |
#define GLOB_NOMATCH 3 |
/branches/18.06.1/toolchain/musl/patches/110-read_timezone_from_fs.patch |
---|
@@ -0,0 +1,28 @@ |
--- a/src/time/__tz.c |
+++ b/src/time/__tz.c |
@@ -25,6 +25,9 @@ static int r0[5], r1[5]; |
static const unsigned char *zi, *trans, *index, *types, *abbrevs, *abbrevs_end; |
static size_t map_size; |
+static const char *tzfile; |
+static size_t tzfile_size; |
+ |
static char old_tz_buf[32]; |
static char *old_tz = old_tz_buf; |
static size_t old_tz_size = sizeof old_tz_buf; |
@@ -125,6 +128,15 @@ static void do_tzset() |
"/usr/share/zoneinfo/\0/share/zoneinfo/\0/etc/zoneinfo/\0"; |
s = getenv("TZ"); |
+ |
+ /* if TZ is empty try to read it from /etc/TZ */ |
+ if (!s || !*s) { |
+ if (tzfile) |
+ __munmap((void*)tzfile, tzfile_size); |
+ |
+ s = tzfile = (void *)__map_file("/etc/TZ", &tzfile_size); |
+ } |
+ |
if (!s) s = "/etc/localtime"; |
if (!*s) s = __utc; |
/branches/18.06.1/toolchain/musl/patches/200-add_libssp_nonshared.patch |
---|
@@ -0,0 +1,53 @@ |
From 7ec87fbbc3cac99b4173d082dd6195f47c9a32e7 Mon Sep 17 00:00:00 2001 |
From: Steven Barth <steven@midlink.org> |
Date: Mon, 22 Jun 2015 11:01:56 +0200 |
Subject: [PATCH] Add libssp_nonshared.a so GCC's is not needed |
Signed-off-by: Steven Barth <steven@midlink.org> |
--- a/Makefile |
+++ b/Makefile |
@@ -66,7 +66,7 @@ CRT_LIBS = $(addprefix lib/,$(notdir $(C |
STATIC_LIBS = lib/libc.a |
SHARED_LIBS = lib/libc.so |
TOOL_LIBS = lib/musl-gcc.specs |
-ALL_LIBS = $(CRT_LIBS) $(STATIC_LIBS) $(SHARED_LIBS) $(EMPTY_LIBS) $(TOOL_LIBS) |
+ALL_LIBS = $(CRT_LIBS) $(STATIC_LIBS) $(SHARED_LIBS) $(EMPTY_LIBS) $(TOOL_LIBS) lib/libssp_nonshared.a |
ALL_TOOLS = obj/musl-gcc |
WRAPCC_GCC = gcc |
@@ -86,7 +86,7 @@ else |
all: $(ALL_LIBS) $(ALL_TOOLS) |
-OBJ_DIRS = $(sort $(patsubst %/,%,$(dir $(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(GENH) $(GENH_INT))) obj/include) |
+OBJ_DIRS = $(sort $(patsubst %/,%,$(dir $(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(GENH) $(GENH_INT))) obj/include obj/libssp_nonshared) |
$(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(ALL_OBJS:%.o=%.lo) $(GENH) $(GENH_INT): | $(OBJ_DIRS) |
@@ -113,6 +113,8 @@ obj/crt/rcrt1.o: $(srcdir)/ldso/dlstart. |
obj/crt/Scrt1.o obj/crt/rcrt1.o: CFLAGS_ALL += -fPIC |
+obj/libssp_nonshared/__stack_chk_fail_local.o: CFLAGS_ALL += $(CFLAGS_NOSSP) |
+ |
OPTIMIZE_SRCS = $(wildcard $(OPTIMIZE_GLOBS:%=$(srcdir)/src/%)) |
$(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.o) $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.lo): CFLAGS += -O3 |
@@ -165,6 +167,11 @@ lib/libc.a: $(AOBJS) |
$(AR) rc $@ $(AOBJS) |
$(RANLIB) $@ |
+lib/libssp_nonshared.a: obj/libssp_nonshared/__stack_chk_fail_local.o |
+ rm -f $@ |
+ $(AR) rc $@ $< |
+ $(RANLIB) $@ |
+ |
$(EMPTY_LIBS): |
rm -f $@ |
$(AR) rc $@ |
--- /dev/null |
+++ b/libssp_nonshared/__stack_chk_fail_local.c |
@@ -0,0 +1,2 @@ |
+#include "atomic.h" |
+void __attribute__((visibility ("hidden"))) __stack_chk_fail_local(void) { a_crash(); } |
/branches/18.06.1/toolchain/musl/patches/300-relative.patch |
---|
@@ -0,0 +1,11 @@ |
--- a/Makefile |
+++ b/Makefile |
@@ -215,7 +215,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/inc |
$(INSTALL) -D -m 644 $< $@ |
$(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so |
- $(INSTALL) -D -l $(libdir)/libc.so $@ || true |
+ $(INSTALL) -D -l libc.so $@ || true |
install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),) |
/branches/18.06.1/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch |
---|
@@ -0,0 +1,197 @@ |
From e6683d001a95d7c3d4d992496f00f77e01fcd268 Mon Sep 17 00:00:00 2001 |
From: Hauke Mehrtens <hauke@hauke-m.de> |
Date: Sun, 22 Nov 2015 15:04:23 +0100 |
Subject: [PATCH v2] Add format attribute to some function declarations |
GCC and Clang are able to check the format arguments given to a |
function and warn the user if there is a error in the format arguments |
or if there is a potential uncontrolled format string security problem |
in the code. GCC does this automatically for some functions like |
printf(), but it is also possible to annotate other functions in a way |
that it will check them too. This feature is used by glibc for many |
functions. This patch adds the attribute to the some functions of musl |
expect for these functions where gcc automatically adds it. |
GCC automatically adds checks for these functions: printf, fprintf, |
sprintf, scanf, fscanf, sscanf, strftime, vprintf, vfprintf and |
vsprintf. |
The documentation from gcc is here: |
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html |
The documentation from Clang is here: |
http://clang.llvm.org/docs/AttributeReference.html#format-gnu-format |
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> |
--- |
include/err.h | 26 +++++++++++++++++--------- |
include/monetary.h | 12 ++++++++++-- |
include/stdio.h | 29 ++++++++++++++++++++--------- |
include/syslog.h | 12 ++++++++++-- |
4 files changed, 57 insertions(+), 22 deletions(-) |
--- a/include/err.h |
+++ b/include/err.h |
@@ -8,15 +8,23 @@ |
extern "C" { |
#endif |
-void warn(const char *, ...); |
-void vwarn(const char *, va_list); |
-void warnx(const char *, ...); |
-void vwarnx(const char *, va_list); |
+#if __GNUC__ >= 3 |
+#define __fp(x, y) __attribute__ ((__format__ (__printf__, x, y))) |
+#else |
+#define __fp(x, y) |
+#endif |
+ |
+void warn(const char *, ...) __fp(1, 2); |
+void vwarn(const char *, va_list) __fp(1, 0); |
+void warnx(const char *, ...) __fp(1, 2); |
+void vwarnx(const char *, va_list) __fp(1, 0); |
+ |
+_Noreturn void err(int, const char *, ...) __fp(2, 3); |
+_Noreturn void verr(int, const char *, va_list) __fp(2, 0); |
+_Noreturn void errx(int, const char *, ...) __fp(2, 3); |
+_Noreturn void verrx(int, const char *, va_list) __fp(2, 0); |
-_Noreturn void err(int, const char *, ...); |
-_Noreturn void verr(int, const char *, va_list); |
-_Noreturn void errx(int, const char *, ...); |
-_Noreturn void verrx(int, const char *, va_list); |
+#undef __fp |
#ifdef __cplusplus |
} |
--- a/include/monetary.h |
+++ b/include/monetary.h |
@@ -13,8 +13,16 @@ extern "C" { |
#include <bits/alltypes.h> |
-ssize_t strfmon(char *__restrict, size_t, const char *__restrict, ...); |
-ssize_t strfmon_l(char *__restrict, size_t, locale_t, const char *__restrict, ...); |
+#if __GNUC__ >= 3 |
+#define __fsfm(x, y) __attribute__ ((__format__ (__strfmon__, x, y))) |
+#else |
+#define __fsfm(x, y) |
+#endif |
+ |
+ssize_t strfmon(char *__restrict, size_t, const char *__restrict, ...) __fsfm(3, 4); |
+ssize_t strfmon_l(char *__restrict, size_t, locale_t, const char *__restrict, ...) __fsfm(4, 5); |
+ |
+#undef __fsfm |
#ifdef __cplusplus |
} |
--- a/include/stdio.h |
+++ b/include/stdio.h |
@@ -21,6 +21,14 @@ extern "C" { |
#include <bits/alltypes.h> |
+#if __GNUC__ >= 3 |
+#define __fp(x, y) __attribute__ ((__format__ (__printf__, x, y))) |
+#define __fs(x, y) __attribute__ ((__format__ (__scanf__, x, y))) |
+#else |
+#define __fp(x, y) |
+#define __fs(x, y) |
+#endif |
+ |
#ifdef __cplusplus |
#define NULL 0L |
#else |
@@ -103,19 +111,19 @@ int puts(const char *); |
int printf(const char *__restrict, ...); |
int fprintf(FILE *__restrict, const char *__restrict, ...); |
int sprintf(char *__restrict, const char *__restrict, ...); |
-int snprintf(char *__restrict, size_t, const char *__restrict, ...); |
+int snprintf(char *__restrict, size_t, const char *__restrict, ...) __fp(3, 4); |
int vprintf(const char *__restrict, __isoc_va_list); |
int vfprintf(FILE *__restrict, const char *__restrict, __isoc_va_list); |
int vsprintf(char *__restrict, const char *__restrict, __isoc_va_list); |
-int vsnprintf(char *__restrict, size_t, const char *__restrict, __isoc_va_list); |
+int vsnprintf(char *__restrict, size_t, const char *__restrict, __isoc_va_list) __fp(3, 0); |
int scanf(const char *__restrict, ...); |
int fscanf(FILE *__restrict, const char *__restrict, ...); |
int sscanf(const char *__restrict, const char *__restrict, ...); |
-int vscanf(const char *__restrict, __isoc_va_list); |
-int vfscanf(FILE *__restrict, const char *__restrict, __isoc_va_list); |
-int vsscanf(const char *__restrict, const char *__restrict, __isoc_va_list); |
+int vscanf(const char *__restrict, __isoc_va_list) __fs(1, 0); |
+int vfscanf(FILE *__restrict, const char *__restrict, __isoc_va_list) __fs(2, 0); |
+int vsscanf(const char *__restrict, const char *__restrict, __isoc_va_list) __fs(2, 0); |
void perror(const char *); |
@@ -136,8 +144,8 @@ int pclose(FILE *); |
int fileno(FILE *); |
int fseeko(FILE *, off_t, int); |
off_t ftello(FILE *); |
-int dprintf(int, const char *__restrict, ...); |
-int vdprintf(int, const char *__restrict, __isoc_va_list); |
+int dprintf(int, const char *__restrict, ...) __fp(2, 3); |
+int vdprintf(int, const char *__restrict, __isoc_va_list) __fp(2, 0); |
void flockfile(FILE *); |
int ftrylockfile(FILE *); |
void funlockfile(FILE *); |
@@ -176,8 +184,8 @@ int fileno_unlocked(FILE *); |
int getw(FILE *); |
int putw(int, FILE *); |
char *fgetln(FILE *, size_t *); |
-int asprintf(char **, const char *, ...); |
-int vasprintf(char **, const char *, __isoc_va_list); |
+int asprintf(char **, const char *, ...) __fp(2, 3); |
+int vasprintf(char **, const char *, __isoc_va_list) __fp(2, 0); |
#endif |
#ifdef _GNU_SOURCE |
@@ -199,6 +207,9 @@ typedef struct _IO_cookie_io_functions_t |
FILE *fopencookie(void *, const char *, cookie_io_functions_t); |
#endif |
+#undef __fp |
+#undef __fs |
+ |
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) |
#define tmpfile64 tmpfile |
#define fopen64 fopen |
--- a/include/syslog.h |
+++ b/include/syslog.h |
@@ -56,16 +56,22 @@ extern "C" { |
#define LOG_NOWAIT 0x10 |
#define LOG_PERROR 0x20 |
+#if __GNUC__ >= 3 |
+#define __fp(x, y) __attribute__ ((__format__ (__printf__, x, y))) |
+#else |
+#define __fp(x, y) |
+#endif |
+ |
void closelog (void); |
void openlog (const char *, int, int); |
int setlogmask (int); |
-void syslog (int, const char *, ...); |
+void syslog (int, const char *, ...) __fp(2, 3); |
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
#define _PATH_LOG "/dev/log" |
#define __NEED_va_list |
#include <bits/alltypes.h> |
-void vsyslog (int, const char *, va_list); |
+void vsyslog (int, const char *, va_list) __fp(2, 0); |
#if defined(SYSLOG_NAMES) |
#define INTERNAL_NOPRI 0x10 |
#define INTERNAL_MARK (LOG_NFACILITIES<<3) |
@@ -93,6 +99,8 @@ typedef struct { |
#endif |
#endif |
+#undef __fp |
+ |
#ifdef __cplusplus |
} |
#endif |
/branches/18.06.1/toolchain/musl/patches/900-iconv_size_hack.patch |
---|
@@ -0,0 +1,100 @@ |
--- a/src/locale/iconv.c |
+++ b/src/locale/iconv.c |
@@ -48,6 +48,7 @@ static const unsigned char charmaps[] = |
"utf16\0\0\312" |
"ucs4\0utf32\0\0\313" |
"ucs2\0\0\314" |
+#ifdef FULL_ICONV |
"eucjp\0\0\320" |
"shiftjis\0sjis\0\0\321" |
"iso2022jp\0\0\322" |
@@ -56,6 +57,7 @@ static const unsigned char charmaps[] = |
"gb2312\0\0\332" |
"big5\0bigfive\0cp950\0big5hkscs\0\0\340" |
"euckr\0ksc5601\0ksx1001\0cp949\0\0\350" |
+#endif |
#include "codepages.h" |
; |
@@ -66,6 +68,7 @@ static const unsigned short legacy_chars |
#include "legacychars.h" |
}; |
+#ifdef FULL_ICONV |
static const unsigned short jis0208[84][94] = { |
#include "jis0208.h" |
}; |
@@ -85,6 +88,7 @@ static const unsigned short hkscs[] = { |
static const unsigned short ksc[93][94] = { |
#include "ksc.h" |
}; |
+#endif |
static const unsigned short rev_jis[] = { |
#include "revjis.h" |
@@ -205,6 +209,7 @@ static unsigned legacy_map(const unsigne |
return x < 256 ? x : legacy_chars[x-256]; |
} |
+#ifdef FULL_ICONV |
static unsigned uni_to_jis(unsigned c) |
{ |
unsigned nel = sizeof rev_jis / sizeof *rev_jis; |
@@ -223,6 +228,7 @@ static unsigned uni_to_jis(unsigned c) |
} |
} |
} |
+#endif |
size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restrict out, size_t *restrict outb) |
{ |
@@ -319,6 +325,7 @@ size_t iconv(iconv_t cd, char **restrict |
} |
type = scd->state; |
continue; |
+#ifdef FULL_ICONV |
case SHIFT_JIS: |
if (c < 128) break; |
if (c-0xa1 <= 0xdf-0xa1) { |
@@ -518,6 +525,7 @@ size_t iconv(iconv_t cd, char **restrict |
c = ksc[c][d]; |
if (!c) goto ilseq; |
break; |
+#endif |
default: |
if (!c) break; |
c = legacy_map(map, c); |
@@ -559,6 +567,7 @@ size_t iconv(iconv_t cd, char **restrict |
} |
} |
goto subst; |
+#ifdef FULL_ICONV |
case SHIFT_JIS: |
if (c < 128) goto revout; |
if (c == 0xa5) { |
@@ -632,6 +641,7 @@ size_t iconv(iconv_t cd, char **restrict |
*(*out)++ = 'B'; |
*outb -= 8; |
break; |
+#endif |
case UCS2: |
totype = UCS2BE; |
case UCS2BE: |
--- a/src/locale/codepages.h |
+++ b/src/locale/codepages.h |
@@ -129,6 +129,7 @@ |
"\340\204\43\316\100\344\34\144\316\71\350\244\243\316\72\354\264\343\316\73" |
"\21\361\44\317\74\364\30\145\17\124\146\345\243\317\76\374\134\304\327\77" |
+#ifdef FULL_ICONV |
"cp1250\0" |
"windows1250\0" |
"\0\40" |
@@ -239,6 +240,7 @@ |
"\20\105\163\330\64\324\324\145\315\65\330\144\243\315\66\334\334\145\330\67" |
"\340\204\43\316\100\344\224\143\316\71\350\244\243\316\72\205\265\343\316\73" |
"\21\305\203\330\74\364\330\145\317\75\370\344\243\317\76\374\340\65\362\77" |
+#endif |
"koi8r\0" |
"\0\40" |
/branches/18.06.1/toolchain/musl/patches/901-crypt_size_hack.patch |
---|
@@ -0,0 +1,75 @@ |
--- a/src/crypt/crypt_sha512.c |
+++ b/src/crypt/crypt_sha512.c |
@@ -13,6 +13,17 @@ |
#include <string.h> |
#include <stdint.h> |
+#ifdef CRYPT_SIZE_HACK |
+#include <errno.h> |
+ |
+char *__crypt_sha512(const char *key, const char *setting, char *output) |
+{ |
+ errno = ENOSYS; |
+ return NULL; |
+} |
+ |
+#else |
+ |
/* public domain sha512 implementation based on fips180-3 */ |
/* >=2^64 bits messages are not supported (about 2000 peta bytes) */ |
@@ -369,3 +380,4 @@ char *__crypt_sha512(const char *key, co |
return "*"; |
return p; |
} |
+#endif |
--- a/src/crypt/crypt_blowfish.c |
+++ b/src/crypt/crypt_blowfish.c |
@@ -50,6 +50,17 @@ |
#include <string.h> |
#include <stdint.h> |
+#ifdef CRYPT_SIZE_HACK |
+#include <errno.h> |
+ |
+char *__crypt_blowfish(const char *key, const char *setting, char *output) |
+{ |
+ errno = ENOSYS; |
+ return NULL; |
+} |
+ |
+#else |
+ |
typedef uint32_t BF_word; |
typedef int32_t BF_word_signed; |
@@ -796,3 +807,4 @@ char *__crypt_blowfish(const char *key, |
return "*"; |
} |
+#endif |
--- a/src/crypt/crypt_sha256.c |
+++ b/src/crypt/crypt_sha256.c |
@@ -13,6 +13,17 @@ |
#include <string.h> |
#include <stdint.h> |
+#ifdef CRYPT_SIZE_HACK |
+#include <errno.h> |
+ |
+char *__crypt_sha256(const char *key, const char *setting, char *output) |
+{ |
+ errno = ENOSYS; |
+ return NULL; |
+} |
+ |
+#else |
+ |
/* public domain sha256 implementation based on fips180-3 */ |
struct sha256 { |
@@ -320,3 +331,4 @@ char *__crypt_sha256(const char *key, co |
return "*"; |
return p; |
} |
+#endif |
/branches/18.06.1/toolchain/nasm/Makefile |
---|
@@ -0,0 +1,53 @@ |
# |
# This is free software, licensed under the GNU General Public License v2. |
# See /LICENSE for more information. |
# |
include $(TOPDIR)/rules.mk |
PKG_NAME:=nasm |
PKG_VERSION:=2.13.03 |
PKG_SOURCE_URL:=https://www.nasm.us/pub/nasm/releasebuilds/$(PKG_VERSION)/ |
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz |
PKG_HASH:=812ecfb0dcbc5bd409aaa8f61c7de94c5b8752a7b00c632883d15b2ed6452573 |
HOST_BUILD_PARALLEL:=1 |
include $(INCLUDE_DIR)/toolchain-build.mk |
HOST_CONFIGURE_ARGS+= \ |
--target=$(REAL_GNU_TARGET_NAME) \ |
--with-sysroot=$(TOOLCHAIN_DIR) \ |
--disable-lto \ |
--disable-werror \ |
--disable-gdb \ |
$(SOFT_FLOAT_CONFIG_OPTION) \ |
define Host/Prepare |
$(call Host/Prepare/Default) |
ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) |
$(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/ |
endef |
define Host/Configure |
(cd $(HOST_BUILD_DIR); \ |
./autogen.sh \ |
); |
$(call Host/Configure/Default) |
endef |
define Host/Install |
$(MAKE) -C $(HOST_BUILD_DIR) \ |
$(HOST_MAKE_FLAGS) \ |
prefix=$(TOOLCHAIN_DIR) \ |
install |
endef |
define Host/Clean |
rm -rf \ |
$(HOST_BUILD_DIR) \ |
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) |
endef |
$(eval $(call HostBuild)) |
/branches/18.06.1/toolchain/nasm/patches/100-backport-upstream-GCC8-compatibility-fixes.patch |
---|
@@ -0,0 +1,15 @@ |
--- a/include/nasmlib.h |
+++ b/include/nasmlib.h |
@@ -188,11 +188,9 @@ int64_t readnum(char *str, bool *error); |
int64_t readstrnum(char *str, int length, bool *warn); |
/* |
- * seg_init: Initialise the segment-number allocator. |
* seg_alloc: allocate a hitherto unused segment number. |
*/ |
-void pure_func seg_init(void); |
-int32_t pure_func seg_alloc(void); |
+int32_t seg_alloc(void); |
/* |
* many output formats will be able to make use of this: a standard |
/branches/18.06.1/toolchain/uClibc/Config.in |
---|
@@ -0,0 +1,6 @@ |
# Debug version. |
config UCLIBC_ENABLE_DEBUG |
bool "Build with debug information" |
depends on TOOLCHAINOPTS && USE_UCLIBC && !EXTERNAL_TOOLCHAIN |
default n |
/branches/18.06.1/toolchain/uClibc/Makefile |
---|
@@ -0,0 +1,37 @@ |
PATH_PREFIX=. |
include ./common.mk |
HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built |
HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_installed |
HOST_BUILD_PARALLEL:=1 |
define Host/SetToolchainInfo |
$(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk |
$(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.uclibc.org/,' $(TOOLCHAIN_DIR)/info.mk |
$(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk |
$(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(LIBC_SO_VERSION),' $(TOOLCHAIN_DIR)/info.mk |
endef |
define Host/Compile |
$(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR)/Rules.mak |
$(UCLIBC_MAKE) PREFIX= all |
endef |
define Host/Install |
$(call Host/SetToolchainInfo) |
$(UCLIBC_MAKE) PREFIX="$(TOOLCHAIN_DIR)/" install_runtime install_dev |
$(CP) $(HOST_BUILD_DIR)/libc/libc_so.a $(TOOLCHAIN_DIR)/lib/ |
( cd $(TOOLCHAIN_DIR) ; \ |
for d in lib usr/lib ; do \ |
for f in libc.so libgcc_s.so ; do \ |
if [ -f $$$$d/$$$$f -a ! -L $$$$d/$$$$f ] ; then \ |
$(SED) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \ |
fi \ |
done \ |
done \ |
) |
endef |
$(eval $(call HostBuild)) |
/branches/18.06.1/toolchain/uClibc/common.mk |
---|
@@ -0,0 +1,97 @@ |
# |
# Copyright (C) 2006-2012 OpenWrt.org |
# |
# This is free software, licensed under the GNU General Public License v2. |
# See /LICENSE for more information. |
# |
include $(TOPDIR)/rules.mk |
include $(INCLUDE_DIR)/target.mk |
PKG_VERSION:=1.0.31 |
PKG_NAME:=uClibc-ng |
PKG_SOURCE_URL = http://downloads.uclibc-ng.org/releases/$(PKG_VERSION)/ |
PATCH_DIR:=$(PATH_PREFIX)/patches |
CONFIG_DIR:=$(PATH_PREFIX)/config |
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz |
LIBC_SO_VERSION:=$(PKG_VERSION) |
PKG_HASH:=2215d7377118434d1697fd575f10d7a6be3f29e460d6b0e1ee9f6f5306288060 |
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION) |
include $(INCLUDE_DIR)/toolchain-build.mk |
UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \ |
-e 's/arc.*/arc/' \ |
-e 's/i.86/i386/' \ |
-e 's/sparc.*/sparc/' \ |
-e 's/arm.*/arm/g' \ |
-e 's/m68k.*/m68k/' \ |
-e 's/ppc/powerpc/g' \ |
-e 's/v850.*/v850/g' \ |
-e 's/sh64/sh/' \ |
-e 's/sh[234].*/sh/' \ |
-e 's/mips.*/mips/' \ |
-e 's/mipsel.*/mips/' \ |
) |
GEN_CONFIG=$(SCRIPT_DIR)/kconfig.pl -n \ |
$(if $(wildcard $(CONFIG_DIR)/common),'+' $(CONFIG_DIR)/common) \ |
$(if $(CONFIG_UCLIBC_ENABLE_DEBUG),$(if $(wildcard $(CONFIG_DIR)/debug),'+' $(CONFIG_DIR)/debug)) \ |
$(CONFIG_DIR)/$(ARCH)$(strip \ |
$(if $(wildcard $(CONFIG_DIR)/$(ARCH).$(BOARD)),.$(BOARD), \ |
$(if $(filter archs,$(subst ",,$(CONFIG_CPU_TYPE))),hs, \ |
$(if $(CONFIG_MIPS64_ABI),.$(subst ",,$(CONFIG_MIPS64_ABI)), \ |
$(if $(CONFIG_HAS_SPE_FPU),$(if $(wildcard $(CONFIG_DIR)/$(ARCH).e500),.e500)))))) |
CPU_CFLAGS = \ |
-funsigned-char -fno-builtin -fno-asm \ |
--std=gnu99 -ffunction-sections -fdata-sections \ |
-Wno-unused-but-set-variable \ |
$(TARGET_CFLAGS) -ggdb |
UCLIBC_MAKE = PATH='$(TOOLCHAIN_DIR)/initial/bin:$(TARGET_PATH)' $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ |
$(TARGET_CONFIGURE_OPTS) \ |
DEVEL_PREFIX=/ \ |
RUNTIME_PREFIX=/ \ |
HOSTCC="$(HOSTCC)" \ |
CPU_CFLAGS="$(CPU_CFLAGS)" \ |
ARCH="$(CONFIG_ARCH)" \ |
LIBGCC="$(subst libgcc.a,libgcc_initial.a,$(shell $(TARGET_CC) -print-libgcc-file-name))" \ |
DOSTRIP="" |
define Host/Prepare |
$(call Host/Prepare/Default) |
$(if $(strip $(QUILT)), \ |
cd $(HOST_BUILD_DIR); \ |
if $(QUILT_CMD) next >/dev/null 2>&1; then \ |
$(QUILT_CMD) push -a; \ |
fi |
) |
ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) |
endef |
define Host/Configure |
$(GEN_CONFIG) > $(HOST_BUILD_DIR)/.config.new |
$(SED) 's,^KERNEL_HEADERS=.*,KERNEL_HEADERS=\"$(BUILD_DIR_TOOLCHAIN)/linux-dev/include\",g' \ |
-e 's,^.*UCLIBC_HAS_FPU.*,UCLIBC_HAS_FPU=$(if $(CONFIG_SOFT_FLOAT),n,y),g' \ |
-e 's,^.*UCLIBC_HAS_SOFT_FLOAT.*,UCLIBC_HAS_SOFT_FLOAT=$(if $(CONFIG_SOFT_FLOAT),y,n),g' \ |
-e 's,^.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=$(if $(CONFIG_BUILD_NLS),y,n),g' \ |
-e 's,^.*UCLIBC_BUILD_ALL_LOCALE.*,UCLIBC_BUILD_ALL_LOCALE=$(if $(CONFIG_BUILD_NLS),y,n),g' \ |
-e 's,^.*UCLIBC_HAS_SSP[^_].*,UCLIBC_HAS_SSP=$(if $(or $(CONFIG_PKG_CC_STACKPROTECTOR_REGULAR),$(CONFIG_PKG_CC_STACKPROTECTOR_STRONG)),y,n),g' \ |
$(HOST_BUILD_DIR)/.config.new |
cmp -s $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config.last || { \ |
cp $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config && \ |
$(MAKE) -C $(HOST_BUILD_DIR) olddefconfig KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS" && \ |
$(MAKE) -C $(HOST_BUILD_DIR)/extra/config conf KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS" && \ |
cp $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config.last; \ |
} |
endef |
define Host/Clean |
rm -rf \ |
$(HOST_BUILD_DIR) \ |
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \ |
$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev |
endef |
/branches/18.06.1/toolchain/uClibc/config/arc |
---|
@@ -0,0 +1,10 @@ |
ARCH_ANY_ENDIAN=y |
ARCH_LITTLE_ENDIAN=y |
ARCH_WANTS_LITTLE_ENDIAN=y |
TARGET_ARCH="arc" |
TARGET_arc=y |
CONFIG_ARC_CPU_700=y |
# CONFIG_ARC_CPU_HS is not set |
CONFIG_ARC_PAGE_SIZE_8K=y |
# CONFIG_ARC_PAGE_SIZE_16K is not set |
# CONFIG_ARC_PAGE_SIZE_4K is not set |
/branches/18.06.1/toolchain/uClibc/config/archs |
---|
@@ -0,0 +1,10 @@ |
ARCH_ANY_ENDIAN=y |
ARCH_LITTLE_ENDIAN=y |
ARCH_WANTS_LITTLE_ENDIAN=y |
TARGET_ARCH="arc" |
TARGET_arc=y |
# CONFIG_ARC_CPU_700 is not set |
CONFIG_ARC_CPU_HS=y |
CONFIG_ARC_PAGE_SIZE_8K=y |
# CONFIG_ARC_PAGE_SIZE_16K is not set |
# CONFIG_ARC_PAGE_SIZE_4K is not set |
/branches/18.06.1/toolchain/uClibc/config/arm |
---|
@@ -0,0 +1,9 @@ |
ARCH_ANY_ENDIAN=y |
ARCH_LITTLE_ENDIAN=y |
ARCH_WANTS_LITTLE_ENDIAN=y |
# COMPILE_IN_THUMB_MODE is not set |
TARGET_ARCH="arm" |
TARGET_arm=y |
# USE_BX is not set |
CONFIG_ARM_EABI=y |
/branches/18.06.1/toolchain/uClibc/config/armeb |
---|
@@ -0,0 +1,9 @@ |
ARCH_ANY_ENDIAN=y |
ARCH_BIG_ENDIAN=y |
ARCH_WANTS_BIG_ENDIAN=y |
# COMPILE_IN_THUMB_MODE is not set |
TARGET_ARCH="arm" |
TARGET_arm=y |
# USE_BX is not set |
CONFIG_ARM_EABI=y |
/branches/18.06.1/toolchain/uClibc/config/common |
---|
@@ -0,0 +1,226 @@ |
# ARCH_ANY_ENDIAN is not set |
ARCH_HAS_MMU=y |
# ARCH_HAS_NO_LDSO is not set |
# ARCH_HAS_NO_SHARED is not set |
# ARCH_LITTLE_ENDIAN is not set |
ARCH_USE_MMU=y |
# ARCH_WANTS_BIG_ENDIAN is not set |
# ARCH_WANTS_LITTLE_ENDIAN is not set |
ASSUME_DEVPTS=y |
# COMPAT_ATEXIT is not set |
CROSS_COMPILER_PREFIX="" |
DEVEL_PREFIX="/usr/" |
# DOASSERTS is not set |
# DODEBUG is not set |
# DODEBUG_PT is not set |
# DOMULTI is not set |
DOPIC=y |
DOSTRIP=y |
DO_C99_MATH=y |
# DO_XSI_MATH is not set |
# EXTRA_WARNINGS is not set |
FORCE_OPTIONS_FOR_ARCH=y |
# FORCE_SHAREABLE_TEXT_SEGMENTS is not set |
# HARDWIRED_ABSPATH is not set |
# HAS_NO_THREADS is not set |
HAVE_DOT_CONFIG=y |
# HAVE_NO_PIC is not set |
# HAVE_NO_SSP is not set |
HAVE_SHARED=y |
KERNEL_HEADERS="." |
LDSO_BASE_FILENAME="ld.so" |
LDSO_CACHE_SUPPORT=y |
# LDSO_GNU_HASH_SUPPORT is not set |
LDSO_LD_LIBRARY_PATH=y |
LDSO_LDD_SUPPORT=y |
# LDSO_NO_CLEANUP is not set |
# LDSO_PRELINK_SUPPORT is not set |
# LDSO_PRELOAD_FILE_SUPPORT is not set |
LDSO_PRELOAD_ENV_SUPPORT=y |
LDSO_RUNPATH=y |
LDSO_SAFE_RUNPATH=y |
# LDSO_RUNPATH_OF_EXECUTABLE is not set |
# LDSO_SEARCH_INTERP_PATH is not set |
# LDSO_STANDALONE_SUPPORT is not set |
# LINUXTHREADS_NEW is not set |
# LINUXTHREADS_OLD is not set |
# UCLIBC_HAS_BACKTRACE is not set |
UCLIBC_HAS_THREADS_NATIVE=y |
# MALLOC is not set |
MALLOC_GLIBC_COMPAT=y |
# MALLOC_SIMPLE is not set |
MALLOC_STANDARD=y |
MULTILIB_DIR="lib" |
PTHREADS_DEBUG_SUPPORT=y |
RUNTIME_PREFIX="/" |
# SUPPORT_LD_DEBUG is not set |
# SUPPORT_LD_DEBUG_EARLY is not set |
TARGET_SUBARCH="" |
# TARGET_alpha is not set |
# TARGET_arc is not set |
# TARGET_arm is not set |
# TARGET_avr32 is not set |
# TARGET_bfin is not set |
# TARGET_c6x is not set |
# TARGET_cris is not set |
# TARGET_e1 is not set |
# TARGET_frv is not set |
# TARGET_h8300 is not set |
# TARGET_hppa is not set |
# TARGET_i386 is not set |
# TARGET_i960 is not set |
# TARGET_ia64 is not set |
# TARGET_lm32 is not set |
# TARGET_m68k is not set |
# TARGET_metag is not set |
# TARGET_microblaze is not set |
# TARGET_mips is not set |
# TARGET_nios is not set |
# TARGET_nios2 is not set |
# TARGET_or1k is not set |
# TARGET_powerpc is not set |
# TARGET_sh is not set |
# TARGET_sh64 is not set |
# TARGET_sparc is not set |
# TARGET_v850 is not set |
# TARGET_vax is not set |
# TARGET_x86_64 is not set |
# TARGET_xtensa is not set |
UCLIBC_BSD_SPECIFIC=y |
UCLIBC_BUILD_NOEXECSTACK=y |
# UCLIBC_BUILD_NOW is not set |
# UCLIBC_BUILD_PIE is not set |
UCLIBC_BUILD_RELRO=y |
UCLIBC_CTOR_DTOR=y |
UCLIBC_DYNAMIC_ATEXIT=y |
UCLIBC_EXTRA_CFLAGS="" |
UCLIBC_GRP_BUFFER_SIZE=256 |
UCLIBC_HAS_ADVANCED_REALTIME=y |
# UCLIBC_HAS_ARC4RANDOM is not set |
# UCLIBC_HAS_ARGP is not set |
UCLIBC_HAS_BSD_ERR=y |
UCLIBC_HAS_BSD_RES_CLOSE=y |
# UCLIBC_HAS_COMPAT_RES_STATE is not set |
UCLIBC_HAS_CRYPT=y |
UCLIBC_HAS_CRYPT_IMPL=y |
UCLIBC_HAS_CTYPE_CHECKED=y |
# UCLIBC_HAS_CTYPE_ENFORCED is not set |
UCLIBC_HAS_CTYPE_SIGNED=y |
UCLIBC_HAS_CTYPE_TABLES=y |
# UCLIBC_HAS_CTYPE_UNSAFE is not set |
UCLIBC_HAS_EPOLL=y |
UCLIBC_HAS_ERRNO_MESSAGES=y |
# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set |
# UCLIBC_HAS_FENV is not set |
UCLIBC_HAS_FLOATS=y |
UCLIBC_HAS_FNMATCH=y |
UCLIBC_HAS_FNMATCH_OLD=y |
# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set |
UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y |
# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set |
# UCLIBC_HAS_FPU is not set |
UCLIBC_HAS_FTS=y |
UCLIBC_HAS_FTW=y |
# UCLIBC_HAS_FULL_RPC is not set |
UCLIBC_HAS_GETPT=y |
UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y |
UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y |
# UCLIBC_HAS_GLIBC_DIGIT_GROUPING is not set |
UCLIBC_HAS_GLOB=y |
UCLIBC_HAS_GNU_ERROR=y |
UCLIBC_HAS_GNU_GETOPT=y |
UCLIBC_HAS_GNU_GETSUBOPT=y |
UCLIBC_HAS_GNU_GLOB=y |
UCLIBC_HAS_HEXADECIMAL_FLOATS=y |
UCLIBC_HAS_IPV4=y |
UCLIBC_HAS_IPV6=y |
UCLIBC_HAS_LFS=y |
UCLIBC_HAS_LIBNSL_STUB=y |
UCLIBC_HAS_LIBRESOLV_STUB=y |
UCLIBC_HAS_LIBUTIL=y |
# UCLIBC_HAS_LOCALE is not set |
# UCLIBC_BUILD_ALL_LOCALE is not set |
# UCLIBC_BUILD_MINIMAL_LOCALE is not set |
# UCLIBC_PREGENERATED_LOCALE_DATA is not set |
UCLIBC_HAS_LONG_DOUBLE_MATH=y |
UCLIBC_HAS_NETWORK_SUPPORT=y |
UCLIBC_HAS_NFTW=y |
UCLIBC_HAS_OBSOLETE_BSD_SIGNAL=y |
# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set |
UCLIBC_HAS_PRINTF_M_SPEC=y |
# UCLIBC_HAS_PROFILING is not set |
UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y |
UCLIBC_HAS_PTY=y |
UCLIBC_HAS_REALTIME=y |
# UCLIBC_HAS_REENTRANT_RPC is not set |
UCLIBC_HAS_REGEX=y |
UCLIBC_HAS_REGEX_OLD=y |
UCLIBC_HAS_RESOLVER_SUPPORT=y |
# UCLIBC_HAS_RPC is not set |
UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y |
# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set |
# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set |
UCLIBC_HAS_SHADOW=y |
UCLIBC_HAS_SIGNUM_MESSAGES=y |
UCLIBC_HAS_SOCKET=y |
UCLIBC_HAS_SOFT_FLOAT=y |
# UCLIBC_HAS_SSP is not set |
# UCLIBC_HAS_SSP_COMPAT is not set |
UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y |
# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set |
# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set |
# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set |
UCLIBC_HAS_STDIO_BUFSIZ_4096=y |
# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set |
# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set |
# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set |
# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set |
# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set |
UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y |
UCLIBC_HAS_STDIO_GETC_MACRO=y |
UCLIBC_HAS_STDIO_PUTC_MACRO=y |
# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set |
UCLIBC_HAS_STRING_ARCH_OPT=y |
UCLIBC_HAS_STRING_GENERIC_OPT=y |
# UCLIBC_HAS_STUBS is not set |
UCLIBC_HAS_SYSLOG=y |
# UCLIBC_HAS_SYS_ERRLIST is not set |
# UCLIBC_HAS_SYS_SIGLIST is not set |
UCLIBC_HAS_THREADS=y |
UCLIBC_HAS_TM_EXTENSIONS=y |
UCLIBC_HAS_TZ_CACHING=y |
UCLIBC_HAS_TZ_FILE=y |
UCLIBC_HAS_TZ_FILE_READ_MANY=y |
UCLIBC_HAS_UTMPX=y |
UCLIBC_HAS_UTMP=y |
UCLIBC_HAS_WCHAR=y |
UCLIBC_HAS_WORDEXP=y |
UCLIBC_HAS_XATTR=y |
# UCLIBC_HAS_XLOCALE is not set |
UCLIBC_HAS___PROGNAME=y |
# UCLIBC_LINUX_MODULE_24 is not set |
UCLIBC_LINUX_MODULE_26=y |
UCLIBC_LINUX_SPECIFIC=y |
# UCLIBC_MALLOC_DEBUGGING is not set |
# UCLIBC_MJN3_ONLY is not set |
# UCLIBC_NTP_LEGACY is not set |
# USE_OLD_VFPRINTF is not set |
UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9 |
UCLIBC_PWD_BUFFER_SIZE=256 |
# UCLIBC_STATIC_LDCONFIG is not set |
# UCLIBC_STRICT_HEADERS is not set |
UCLIBC_SUPPORT_AI_ADDRCONFIG=y |
UCLIBC_SUSV3_LEGACY=y |
UCLIBC_SUSV3_LEGACY_MACROS=y |
UCLIBC_SUSV4_LEGACY=y |
# UCLIBC_SV4_DEPRECATED is not set |
UCLIBC_TZ_FILE_PATH="/etc/TZ" |
# UCLIBC_FALLBACK_TO_ETC_LOCALTIME is not set |
UCLIBC_USE_NETLINK=y |
# UNIX98PTY_ONLY is not set |
USE_BX=y |
WARNINGS="-Wall" |
# UCLIBC_HAS_OBSTACK is not set |
# UCLIBC_SUSV2_LEGACY is not set |
# UCLIBC_HAS_CONTEXT_FUNCS is not set |
UCLIBC_HAS_GETOPT_LONG=y |
/branches/18.06.1/toolchain/uClibc/config/debug |
---|
@@ -0,0 +1,6 @@ |
DODEBUG=y |
DODEBUG_PT=y |
PTHREADS_DEBUG_SUPPORT=y |
SUPPORT_LD_DEBUG=y |
SUPPORT_LD_DEBUG_EARLY=y |
UCLIBC_MALLOC_DEBUGGING=y |
/branches/18.06.1/toolchain/uClibc/config/i386 |
---|
@@ -0,0 +1,21 @@ |
ARCH_LITTLE_ENDIAN=y |
# CONFIG_386 is not set |
CONFIG_486=y |
# CONFIG_586 is not set |
# CONFIG_586MMX is not set |
# CONFIG_686 is not set |
# CONFIG_CRUSOE is not set |
# CONFIG_CYRIXIII is not set |
# CONFIG_ELAN is not set |
# CONFIG_GENERIC_386 is not set |
# CONFIG_K6 is not set |
# CONFIG_K7 is not set |
# CONFIG_NEHEMIAH is not set |
# CONFIG_PENTIUM4 is not set |
# CONFIG_PENTIUMII is not set |
# CONFIG_PENTIUMIII is not set |
# CONFIG_WINCHIP2 is not set |
# CONFIG_WINCHIPC6 is not set |
TARGET_ARCH="i386" |
TARGET_i386=y |
UCLIBC_HAS_FPU=y |
/branches/18.06.1/toolchain/uClibc/config/i686 |
---|
@@ -0,0 +1,21 @@ |
ARCH_LITTLE_ENDIAN=y |
# CONFIG_386 is not set |
# CONFIG_486 is not set |
# CONFIG_586 is not set |
# CONFIG_586MMX is not set |
CONFIG_686=y |
# CONFIG_CRUSOE is not set |
# CONFIG_CYRIXIII is not set |
# CONFIG_ELAN is not set |
# CONFIG_GENERIC_386 is not set |
# CONFIG_K6 is not set |
# CONFIG_K7 is not set |
# CONFIG_NEHEMIAH is not set |
# CONFIG_PENTIUM4 is not set |
# CONFIG_PENTIUMII is not set |
# CONFIG_PENTIUMIII is not set |
# CONFIG_WINCHIP2 is not set |
# CONFIG_WINCHIPC6 is not set |
TARGET_ARCH="i386" |
TARGET_i386=y |
UCLIBC_HAS_FPU=y |
/branches/18.06.1/toolchain/uClibc/config/m68k |
---|
@@ -0,0 +1,6 @@ |
ARCH_BIG_ENDIAN=y |
LINUXTHREADS_OLD=y |
TARGET_ARCH="m68k" |
TARGET_SUBARCH="" |
TARGET_m68k=y |
# UCLIBC_HAS_THREADS_NATIVE is not set |
/branches/18.06.1/toolchain/uClibc/config/mips |
---|
@@ -0,0 +1,18 @@ |
ARCH_ANY_ENDIAN=y |
ARCH_BIG_ENDIAN=y |
ARCH_CFLAGS="-mno-split-addresses" |
ARCH_WANTS_BIG_ENDIAN=y |
# CONFIG_MIPS_ISA_1 is not set |
# CONFIG_MIPS_ISA_2 is not set |
# CONFIG_MIPS_ISA_3 is not set |
# CONFIG_MIPS_ISA_4 is not set |
CONFIG_MIPS_ISA_MIPS32=y |
# CONFIG_MIPS_ISA_MIPS32R2 is not set |
# CONFIG_MIPS_ISA_MIPS64 is not set |
# CONFIG_MIPS_ISA_MIPS64R2 is not set |
# CONFIG_MIPS_N32_ABI is not set |
# CONFIG_MIPS_N64_ABI is not set |
CONFIG_MIPS_O32_ABI=y |
TARGET_ARCH="mips" |
TARGET_mips=y |
UCLIBC_HAS_FPU=y |
/branches/18.06.1/toolchain/uClibc/config/mips64 |
---|
@@ -0,0 +1,18 @@ |
ARCH_ANY_ENDIAN=y |
ARCH_BIG_ENDIAN=y |
ARCH_CFLAGS="-mno-split-addresses" |
ARCH_WANTS_BIG_ENDIAN=y |
# CONFIG_MIPS_ISA_1 is not set |
# CONFIG_MIPS_ISA_2 is not set |
# CONFIG_MIPS_ISA_3 is not set |
# CONFIG_MIPS_ISA_4 is not set |
# CONFIG_MIPS_ISA_MIPS32 is not set |
# CONFIG_MIPS_ISA_MIPS32R2 is not set |
CONFIG_MIPS_ISA_MIPS64=y |
# CONFIG_MIPS_ISA_MIPS64R2 is not set |
# CONFIG_MIPS_N32_ABI is not set |
CONFIG_MIPS_N64_ABI=y |
# CONFIG_MIPS_O32_ABI is not set |
TARGET_ARCH="mips" |
TARGET_mips=y |
UCLIBC_HAS_FPU=y |
/branches/18.06.1/toolchain/uClibc/config/mips64.32 |
---|
@@ -0,0 +1,19 @@ |
ARCH_ANY_ENDIAN=y |
ARCH_BIG_ENDIAN=y |
ARCH_CFLAGS="-mno-split-addresses" |
ARCH_WANTS_BIG_ENDIAN=y |
# CONFIG_MIPS_ISA_1 is not set |
# CONFIG_MIPS_ISA_2 is not set |
# CONFIG_MIPS_ISA_3 is not set |
# CONFIG_MIPS_ISA_4 is not set |
# CONFIG_MIPS_ISA_MIPS32 is not set |
# CONFIG_MIPS_ISA_MIPS32R2 is not set |
CONFIG_MIPS_ISA_MIPS64=y |
# CONFIG_MIPS_ISA_MIPS64R2 is not set |
# CONFIG_MIPS_N32_ABI is not set |
# CONFIG_MIPS_N64_ABI is not set |
CONFIG_MIPS_O32_ABI=y |
TARGET_ARCH="mips" |
TARGET_mips=y |
TARGET_SUBARCH="mips64" |
UCLIBC_HAS_FPU=y |
/branches/18.06.1/toolchain/uClibc/config/mips64.64 |
---|
@@ -0,0 +1,19 @@ |
ARCH_ANY_ENDIAN=y |
ARCH_BIG_ENDIAN=y |
ARCH_CFLAGS="-mno-split-addresses" |
ARCH_WANTS_BIG_ENDIAN=y |
# CONFIG_MIPS_ISA_1 is not set |
# CONFIG_MIPS_ISA_2 is not set |
# CONFIG_MIPS_ISA_3 is not set |
# CONFIG_MIPS_ISA_4 is not set |
# CONFIG_MIPS_ISA_MIPS32 is not set |
# CONFIG_MIPS_ISA_MIPS32R2 is not set |
CONFIG_MIPS_ISA_MIPS64=y |
# CONFIG_MIPS_ISA_MIPS64R2 is not set |
# CONFIG_MIPS_N32_ABI is not set |
CONFIG_MIPS_N64_ABI=y |
# CONFIG_MIPS_O32_ABI is not set |
TARGET_ARCH="mips" |
TARGET_mips=y |
TARGET_SUBARCH="mips64" |
UCLIBC_HAS_FPU=y |
/branches/18.06.1/toolchain/uClibc/config/mips64.n32 |
---|
@@ -0,0 +1,19 @@ |
ARCH_ANY_ENDIAN=y |
ARCH_BIG_ENDIAN=y |
ARCH_CFLAGS="-mno-split-addresses" |
ARCH_WANTS_BIG_ENDIAN=y |
# CONFIG_MIPS_ISA_1 is not set |
# CONFIG_MIPS_ISA_2 is not set |
# CONFIG_MIPS_ISA_3 is not set |
# CONFIG_MIPS_ISA_4 is not set |
# CONFIG_MIPS_ISA_MIPS32 is not set |
# CONFIG_MIPS_ISA_MIPS32R2 is not set |
CONFIG_MIPS_ISA_MIPS64=y |
# CONFIG_MIPS_ISA_MIPS64R2 is not set |
CONFIG_MIPS_N32_ABI=y |
# CONFIG_MIPS_N64_ABI is not set |
# CONFIG_MIPS_O32_ABI is not set |
TARGET_ARCH="mips" |
TARGET_mips=y |
TARGET_SUBARCH="mips64" |
UCLIBC_HAS_FPU=y |
/branches/18.06.1/toolchain/uClibc/config/mips64el |
---|
@@ -0,0 +1,18 @@ |
ARCH_ANY_ENDIAN=y |
ARCH_CFLAGS="-mno-split-addresses" |
ARCH_LITTLE_ENDIAN=y |
ARCH_WANTS_LITTLE_ENDIAN=y |
# CONFIG_MIPS_ISA_1 is not set |
# CONFIG_MIPS_ISA_2 is not set |
# CONFIG_MIPS_ISA_3 is not set |
# CONFIG_MIPS_ISA_4 is not set |
# CONFIG_MIPS_ISA_MIPS32 is not set |
# CONFIG_MIPS_ISA_MIPS32R2 is not set |
CONFIG_MIPS_ISA_MIPS64=y |
# CONFIG_MIPS_ISA_MIPS64R2 is not set |
# CONFIG_MIPS_N32_ABI is not set |
CONFIG_MIPS_N64_ABI=y |
# CONFIG_MIPS_O32_ABI is not set |
TARGET_ARCH="mips" |
TARGET_mips=y |
UCLIBC_HAS_FPU=y |
/branches/18.06.1/toolchain/uClibc/config/mips64el.32 |
---|
@@ -0,0 +1,19 @@ |
ARCH_ANY_ENDIAN=y |
ARCH_CFLAGS="-mno-split-addresses" |
ARCH_LITTLE_ENDIAN=y |
ARCH_WANTS_LITTLE_ENDIAN=y |
# CONFIG_MIPS_ISA_1 is not set |
# CONFIG_MIPS_ISA_2 is not set |
# CONFIG_MIPS_ISA_3 is not set |
# CONFIG_MIPS_ISA_4 is not set |
# CONFIG_MIPS_ISA_MIPS32 is not set |
# CONFIG_MIPS_ISA_MIPS32R2 is not set |
CONFIG_MIPS_ISA_MIPS64=y |
# CONFIG_MIPS_ISA_MIPS64R2 is not set |
# CONFIG_MIPS_N32_ABI is not set |
# CONFIG_MIPS_N64_ABI is not set |
CONFIG_MIPS_O32_ABI=y |
TARGET_ARCH="mips" |
TARGET_mips=y |
TARGET_SUBARCH="mips64" |
UCLIBC_HAS_FPU=y |
/branches/18.06.1/toolchain/uClibc/config/mips64el.64 |
---|
@@ -0,0 +1,19 @@ |
ARCH_ANY_ENDIAN=y |
ARCH_CFLAGS="-mno-split-addresses" |
ARCH_LITTLE_ENDIAN=y |
ARCH_WANTS_LITTLE_ENDIAN=y |
# CONFIG_MIPS_ISA_1 is not set |
# CONFIG_MIPS_ISA_2 is not set |
# CONFIG_MIPS_ISA_3 is not set |
# CONFIG_MIPS_ISA_4 is not set |
# CONFIG_MIPS_ISA_MIPS32 is not set |
# CONFIG_MIPS_ISA_MIPS32R2 is not set |
CONFIG_MIPS_ISA_MIPS64=y |
# CONFIG_MIPS_ISA_MIPS64R2 is not set |
# CONFIG_MIPS_N32_ABI is not set |
CONFIG_MIPS_N64_ABI=y |
# CONFIG_MIPS_O32_ABI is not set |
TARGET_ARCH="mips" |
TARGET_mips=y |
TARGET_SUBARCH="mips64" |
UCLIBC_HAS_FPU=y |
/branches/18.06.1/toolchain/uClibc/config/mips64el.n32 |
---|
@@ -0,0 +1,19 @@ |
ARCH_ANY_ENDIAN=y |
ARCH_CFLAGS="-mno-split-addresses" |
ARCH_LITTLE_ENDIAN=y |
ARCH_WANTS_LITTLE_ENDIAN=y |
# CONFIG_MIPS_ISA_1 is not set |
# CONFIG_MIPS_ISA_2 is not set |
# CONFIG_MIPS_ISA_3 is not set |
# CONFIG_MIPS_ISA_4 is not set |
# CONFIG_MIPS_ISA_MIPS32 is not set |
# CONFIG_MIPS_ISA_MIPS32R2 is not set |
CONFIG_MIPS_ISA_MIPS64=y |
# CONFIG_MIPS_ISA_MIPS64R2 is not set |
CONFIG_MIPS_N32_ABI=y |
# CONFIG_MIPS_N64_ABI is not set |
# CONFIG_MIPS_O32_ABI is not set |
TARGET_ARCH="mips" |
TARGET_mips=y |
TARGET_SUBARCH="mips64" |
UCLIBC_HAS_FPU=y |
/branches/18.06.1/toolchain/uClibc/config/mipsel |
---|
@@ -0,0 +1,18 @@ |
ARCH_ANY_ENDIAN=y |
ARCH_CFLAGS="-mno-split-addresses" |
ARCH_LITTLE_ENDIAN=y |
ARCH_WANTS_LITTLE_ENDIAN=y |
# CONFIG_MIPS_ISA_1 is not set |
# CONFIG_MIPS_ISA_2 is not set |
# CONFIG_MIPS_ISA_3 is not set |
# CONFIG_MIPS_ISA_4 is not set |
CONFIG_MIPS_ISA_MIPS32=y |
# CONFIG_MIPS_ISA_MIPS32R2 is not set |
# CONFIG_MIPS_ISA_MIPS64 is not set |
# CONFIG_MIPS_ISA_MIPS64R2 is not set |
# CONFIG_MIPS_N32_ABI is not set |
# CONFIG_MIPS_N64_ABI is not set |
CONFIG_MIPS_O32_ABI=y |
TARGET_ARCH="mips" |
TARGET_mips=y |
UCLIBC_HAS_FPU=y |
/branches/18.06.1/toolchain/uClibc/config/mipsel.cobalt |
---|
@@ -0,0 +1,18 @@ |
ARCH_ANY_ENDIAN=y |
ARCH_CFLAGS="-mno-split-addresses" |
ARCH_LITTLE_ENDIAN=y |
ARCH_WANTS_LITTLE_ENDIAN=y |
# CONFIG_MIPS_ISA_1 is not set |
# CONFIG_MIPS_ISA_2 is not set |
CONFIG_MIPS_ISA_3=y |
# CONFIG_MIPS_ISA_4 is not set |
# CONFIG_MIPS_ISA_MIPS32 is not set |
# CONFIG_MIPS_ISA_MIPS32R2 is not set |
# CONFIG_MIPS_ISA_MIPS64 is not set |
# CONFIG_MIPS_ISA_MIPS64R2 is not set |
# CONFIG_MIPS_N32_ABI is not set |
# CONFIG_MIPS_N64_ABI is not set |
CONFIG_MIPS_O32_ABI=y |
TARGET_ARCH="mips" |
TARGET_mips=y |
UCLIBC_HAS_FPU=y |
/branches/18.06.1/toolchain/uClibc/config/powerpc |
---|
@@ -0,0 +1,6 @@ |
ARCH_BIG_ENDIAN=y |
CONFIG_CLASSIC=y |
# CONFIG_E500 is not set |
TARGET_ARCH="powerpc" |
TARGET_SUBARCH="classic" |
TARGET_powerpc=y |
/branches/18.06.1/toolchain/uClibc/config/powerpc.e500 |
---|
@@ -0,0 +1,6 @@ |
ARCH_BIG_ENDIAN=y |
# CONFIG_CLASSIC is not set |
CONFIG_E500=y |
TARGET_ARCH="powerpc" |
TARGET_SUBARCH="classic" |
TARGET_powerpc=y |
/branches/18.06.1/toolchain/uClibc/config/sparc |
---|
@@ -0,0 +1,8 @@ |
ARCH_BIG_ENDIAN=y |
# CONFIG_SPARC_V7 is not set |
# CONFIG_SPARC_V8 is not set |
CONFIG_SPARC_V9=y |
# CONFIG_SPARC_V9B is not set |
TARGET_ARCH="sparc" |
TARGET_sparc=y |
UCLIBC_HAS_LONG_DOUBLE_MATH=y |
/branches/18.06.1/toolchain/uClibc/config/sparc.leon |
---|
@@ -0,0 +1,8 @@ |
ARCH_BIG_ENDIAN=y |
# CONFIG_SPARC_V7 is not set |
CONFIG_SPARC_V8=y |
# CONFIG_SPARC_V9 is not set |
# CONFIG_SPARC_V9B is not set |
TARGET_ARCH="sparc" |
TARGET_sparc=y |
UCLIBC_HAS_LONG_DOUBLE_MATH=y |
/branches/18.06.1/toolchain/uClibc/config/x86_64 |
---|
@@ -0,0 +1,6 @@ |
ARCH_LITTLE_ENDIAN=y |
# LINUXTHREADS_NEW is not set |
TARGET_ARCH="x86_64" |
TARGET_x86_64=y |
UCLIBC_BSD_SPECIFIC=y |
UCLIBC_HAS_FPU=y |
/branches/18.06.1/toolchain/uClibc/headers/Makefile |
---|
@@ -0,0 +1,27 @@ |
PATH_PREFIX:=.. |
include ../common.mk |
HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.headers_built |
HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_headers_installed |
define Host/Compile |
endef |
define Host/Install |
PATH='$(TARGET_PATH)' $(MAKE) -C $(HOST_BUILD_DIR) \ |
PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \ |
DEVEL_PREFIX=/ \ |
RUNTIME_PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \ |
HOSTCC="$(HOSTCC)" \ |
CC="$(TARGET_CC)" \ |
CPU_CFLAGS="$(TARGET_CFLAGS)" \ |
ARCH="$(CONFIG_ARCH)" \ |
pregen \ |
install_headers |
$(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/ |
endef |
$(eval $(call HostBuild)) |
/branches/18.06.1/toolchain/uClibc/utils/Makefile |
---|
@@ -0,0 +1,24 @@ |
PATH_PREFIX=.. |
include ../common.mk |
HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.utils_built |
HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_utils_installed |
define Host/Compile |
$(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR)/Rules.mak |
$(UCLIBC_MAKE) PREFIX= utils |
endef |
define Host/Install |
$(INSTALL_DIR) $(TOOLCHAIN_DIR)/bin |
$(INSTALL_BIN) \ |
$(HOST_BUILD_DIR)/utils/ldd \ |
$(TOOLCHAIN_DIR)/bin/ |
$(INSTALL_DIR) $(TOOLCHAIN_DIR)/sbin |
$(INSTALL_BIN) \ |
$(HOST_BUILD_DIR)/utils/ldconfig \ |
$(TOOLCHAIN_DIR)/sbin/ |
endef |
$(eval $(call HostBuild)) |
/branches/18.06.1/toolchain/wrapper/Makefile |
---|
@@ -0,0 +1,62 @@ |
# |
# Copyright (C) 2012 OpenWrt.org |
# |
# This is free software, licensed under the GNU General Public License v2. |
# See /LICENSE for more information. |
# |
include $(TOPDIR)/rules.mk |
PKG_NAME:=wrapper |
PKG_VERSION:=1 |
include $(INCLUDE_DIR)/toolchain-build.mk |
# 1: args |
define toolchain_util |
$(strip $(SCRIPT_DIR)/ext-toolchain.sh --toolchain $(CONFIG_TOOLCHAIN_ROOT) \ |
--cflags $(CONFIG_TARGET_OPTIMIZATION) \ |
--cflags "$(if $(call qstrip,$(CONFIG_TOOLCHAIN_LIBC)),-m$(call qstrip,$(CONFIG_TOOLCHAIN_LIBC))) $(if $(CONFIG_SOFT_FLOAT),-msoft-float)" \ |
--cflags "$(patsubst ./%,-I$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_INC_PATH)))" \ |
--cflags "$(patsubst ./%,-L$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_LIB_PATH)))" \ |
$(1)) |
endef |
# 1: config symbol |
# 2: feature |
define toolchain_test |
$$(if $$($(1)), \ |
@echo -n "Testing external toolchain for $(2) support ... "; \ |
if $(call toolchain_util,--test "$(2)"); then \ |
echo "ok"; exit 0; \ |
else \ |
echo "failed"; \ |
echo "ERROR: $(1) is enabled but the external toolchain does not support it"; \ |
exit 1; \ |
fi) |
endef |
define Host/Prepare |
$(call toolchain_test,CONFIG_SOFT_FLOAT,softfloat) |
$(call toolchain_test,CONFIG_IPV6,ipv6) |
$(call toolchain_test,CONFIG_NLS,wchar) |
$(call toolchain_test,CONFIG_PACKAGE_libpthread,threads) |
endef |
define Host/Configure |
endef |
define Host/Compile |
endef |
define Host/Install |
$(call toolchain_util,--wrap "$(TOOLCHAIN_DIR)/bin") |
endef |
define Host/Clean |
rm -rf $(TOOLCHAIN_DIR)/bin |
endef |
$(eval $(call HostBuild)) |