Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled

This commit is contained in:
domenico
2025-06-24 14:35:53 +02:00
commit c06fb25d1f
9263 changed files with 1750214 additions and 0 deletions

379
toolchain/Config.in Normal file
View File

@@ -0,0 +1,379 @@
# 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.
choice BPF_TOOLCHAIN
prompt "BPF toolchain" if DEVEL
default BPF_TOOLCHAIN_BUILD_LLVM if BUILDBOT
default BPF_TOOLCHAIN_PREBUILT if HAS_PREBUILT_LLVM_TOOLCHAIN
default BPF_TOOLCHAIN_NONE
config BPF_TOOLCHAIN_NONE
bool "None"
config BPF_TOOLCHAIN_PREBUILT
bool "Use prebuilt LLVM toolchain"
depends on HAS_PREBUILT_LLVM_TOOLCHAIN
select USE_LLVM_PREBUILT
config BPF_TOOLCHAIN_HOST
select USE_LLVM_HOST
bool "Use host LLVM toolchain"
config BPF_TOOLCHAIN_BUILD_LLVM
select USE_LLVM_BUILD
bool "Build LLVM toolchain for eBPF"
help
If enabled, a LLVM toolchain for building eBPF binaries will be built.
If this is not enabled, eBPF packages can only be built if the host
has a suitable toolchain
endchoice
config BPF_TOOLCHAIN_HOST_PATH
string
depends on BPF_TOOLCHAIN_HOST
prompt "Host LLVM toolchain path (prefix)" if DEVEL
default "/usr/local/opt/llvm" if HOST_OS_MACOS
default ""
menuconfig EXTERNAL_TOOLCHAIN
bool
prompt "Use external toolchain" if DEVEL
help
If enabled, the buildroot 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, the buildroot 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 "loongarch64-unknown-linux-gnu" if loongarch64
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 "loongarch64-unknown-linux-gnu-" if loongarch64
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/loongarch64-unknown-linux-gnu" if loongarch64
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_MUSL
bool "musl"
select USE_MUSL
endchoice
config EXTERNAL_GCC_VERSION
string
prompt "External Toolchain GCC Version" if DEVEL
depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
help
Manually specify the GCC version used by the selected
external toolchain.
config TOOLCHAIN_LIBC
string
depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
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/fortify ./include" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
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
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"
config DWARVES
bool
prompt "Build pahole" if TOOLCHAINOPTS
depends on !HOST_OS_MACOS
help
Enable if you want to build pahole and the dwarves tools.
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_GLIBC if arc
default LIBC_USE_MUSL
help
Select the C library implementation.
config LIBC_USE_GLIBC
bool "Use glibc"
select USE_GLIBC
config LIBC_USE_MUSL
select USE_MUSL
bool "Use musl"
depends on !arc
endchoice
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 GDB_PYTHON
bool
depends on GDB
prompt "Build gdb with python binding"
help
Enable the python bindings for GDB to allow using python in the gdb shell.
config HAS_BPF_TOOLCHAIN
bool
config HAS_PREBUILT_LLVM_TOOLCHAIN
def_bool $(shell, [ -f llvm-bpf/.llvm-version ] && echo y || echo n)
config USE_LLVM_HOST
select HAS_BPF_TOOLCHAIN
bool
config USE_LLVM_PREBUILT
select HAS_BPF_TOOLCHAIN
default y if !DEVEL && !BUILDBOT && HAS_PREBUILT_LLVM_TOOLCHAIN
bool
config USE_LLVM_BUILD
default y if !DEVEL && BUILDBOT
select HAS_BPF_TOOLCHAIN
bool
config USE_GLIBC
default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
bool
config USE_MUSL
default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc)
bool
config SSP_SUPPORT
default y if !PKG_CC_STACKPROTECTOR_NONE
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 "musl" if USE_MUSL
config TARGET_SUFFIX
string
default "gnueabi" if USE_GLIBC && (arm || armeb)
default "gnu" if USE_GLIBC && !(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"

92
toolchain/Makefile Normal file
View File

@@ -0,0 +1,92 @@
#
# 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
#
# 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) $(if $(CONFIG_USE_MOLD),mold)
# builddir dependencies
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
ifdef CONFIG_USE_MUSL
$(curdir)/gcc/initial/compile:=$(curdir)/binutils/compile
$(curdir)/kernel-headers/compile:=$(curdir)/gcc/initial/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)/$(LIBC)/compile:=$(curdir)/gcc/initial/compile $(curdir)/kernel-headers/compile
$(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/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_final_installed:
endif
$(curdir)/install: $(curdir)/compile
$(eval $(call stampfile,$(curdir),toolchain,compile,$(TOOLCHAIN_DIR)/stamp/.gcc_final_installed,,$(TOOLCHAIN_DIR)))
$(eval $(call stampfile,$(curdir),toolchain,check,$(TMP_DIR)/.build))
$(eval $(call subdir,$(curdir)))

View File

@@ -0,0 +1,27 @@
# Choose binutils version.
choice
prompt "Binutils Version" if TOOLCHAINOPTS
default BINUTILS_USE_VERSION_2_42
help
Select the version of binutils you wish to use.
config BINUTILS_USE_VERSION_2_40
bool "Binutils 2.40"
select BINUTILS_VERSION_2_40
config BINUTILS_USE_VERSION_2_42
bool "Binutils 2.42"
select BINUTILS_VERSION_2_42
config BINUTILS_USE_VERSION_2_43
bool "Binutils 2.43.1"
select BINUTILS_VERSION_2_43
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....

View File

@@ -0,0 +1,16 @@
config BINUTILS_VERSION_2_40
bool
config BINUTILS_VERSION_2_42
default y if !TOOLCHAINOPTS
bool
config BINUTILS_VERSION_2_43
bool
config BINUTILS_VERSION
string
default "2.40" if BINUTILS_VERSION_2_40
default "2.42" if BINUTILS_VERSION_2_42
default "2.43.1" if BINUTILS_VERSION_2_43

103
toolchain/binutils/Makefile Normal file
View File

@@ -0,0 +1,103 @@
#
# 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
PKG_CPE_ID:=cpe:/a:gnu:binutils
TAR_OPTIONS += --exclude='*.rej'
ifeq ($(PKG_VERSION),2.40)
PKG_HASH:=0f8a4c272d7f17f369ded10a4aca28b8e304828e95526da482b0ccc4dfc9d8e1
endif
ifeq ($(PKG_VERSION),2.42)
PKG_HASH:=f6e4d41fd5fc778b06b7891457b3620da5ecea1006c6a4a41ae998109f85a800
endif
ifeq ($(PKG_VERSION),2.43.1)
PKG_HASH:=13f74202a3c4c51118b797a39ea4200d3f6cfbe224da6d1d95bb938480132dfd
endif
HOST_BUILD_PARALLEL:=1
PATCH_DIR:=./patches/$(PKG_VERSION)
include $(INCLUDE_DIR)/toolchain-build.mk
ifdef CONFIG_GCC_USE_GRAPHITE
GRAPHITE_CONFIGURE:= --with-isl=$(STAGING_DIR_HOST)
else
GRAPHITE_CONFIGURE:= --without-isl --without-cloog
endif
HOST_CONFIGURE_ARGS = \
--prefix=$(TOOLCHAIN_DIR) \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
--with-sysroot=$(TOOLCHAIN_DIR) \
--with-system-zlib \
--with-zstd \
--enable-deterministic-archives \
--enable-plugins \
--enable-lto \
--disable-gprofng \
--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),)
HOST_CONFIGURE_ARGS+= \
--enable-libssp
else
HOST_CONFIGURE_ARGS+= \
--disable-libssp
endif
ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
HOST_CONFIGURE_ARGS+= \
--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
endif
HOST_CONFIGURE_VARS += \
acx_cv_cc_gcc_supports_ada=false
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/Compile
+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
endef
define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) \
install
$(call FixupLibdir,$(TOOLCHAIN_DIR))
$(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(HOST_BUILD_PREFIX)/bin/readelf
endef
define Host/Clean
rm -rf \
$(HOST_BUILD_DIR) \
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,218 @@
From 3c6c32951e292a51ede70b8087bb0308d7dbc4fc Mon Sep 17 00:00:00 2001
From: Alan Modra <amodra@gmail.com>
Date: Thu, 28 Mar 2024 20:33:32 +1030
Subject: [PATCH 2/2] PR 30569, delete _bfd_mips_elf_early_size_sections
PR30569 was triggered by a patch of mine 6540edd52cc0 moving the call
to always_size_sections in bfd_elf_size_dynamic_sections earlier, made
to support the x86 DT_RELR implementation. This broke mips16 code
handling stubs when --export-dynamic is passed to the linker, because
numerous symbols then became dynamic after always_size_sections. The
mips backend fiddles with symbols in its always_size_sections. Maciej
in 902e9fc76a0e had moved the call to always_size_sections to after
the export-dynamic code. Prior to that, Nathan in 04c3a75556c0 moved
it before the exec stack code, back to the start of
bfd_elf_size_dynamic_sections which was where Ian put it originally
in ff12f303355b. So the call has moved around a little. I'm leaving
it where it is, and instead calling mips_elf_check_symbols from
late_size_sections (the old size_dynamic_sections) which is now always
called. In fact, the whole of _bfd_mips_elf_early_size_sections can
be merged into _bfd_mips_elf_late_size_sections.
---
bfd/elf32-mips.c | 1 -
bfd/elf64-mips.c | 2 --
bfd/elfn32-mips.c | 1 -
bfd/elfxx-mips.c | 84 +++++++++++++++++++----------------------------
bfd/elfxx-mips.h | 2 --
5 files changed, 34 insertions(+), 56 deletions(-)
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -2534,7 +2534,6 @@ static const struct ecoff_debug_swap mip
#define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag
#define elf_backend_adjust_dynamic_symbol \
_bfd_mips_elf_adjust_dynamic_symbol
-#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections
#define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_relocate_section _bfd_mips_elf_relocate_section
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -4745,8 +4745,6 @@ const struct elf_size_info mips_elf64_si
#define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag
#define elf_backend_adjust_dynamic_symbol \
_bfd_mips_elf_adjust_dynamic_symbol
-#define elf_backend_early_size_sections \
- _bfd_mips_elf_early_size_sections
#define elf_backend_late_size_sections \
_bfd_mips_elf_late_size_sections
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
--- a/bfd/elfn32-mips.c
+++ b/bfd/elfn32-mips.c
@@ -4131,7 +4131,6 @@ static const struct ecoff_debug_swap mip
#define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag
#define elf_backend_adjust_dynamic_symbol \
_bfd_mips_elf_adjust_dynamic_symbol
-#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections
#define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_relocate_section _bfd_mips_elf_relocate_section
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -9614,48 +9614,6 @@ _bfd_mips_elf_adjust_dynamic_symbol (str
return _bfd_elf_adjust_dynamic_copy (info, h, s);
}
-/* This function is called after all the input files have been read,
- and the input sections have been assigned to output sections. We
- check for any mips16 stub sections that we can discard. */
-
-bool
-_bfd_mips_elf_early_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
-{
- asection *sect;
- struct mips_elf_link_hash_table *htab;
- struct mips_htab_traverse_info hti;
-
- htab = mips_elf_hash_table (info);
- BFD_ASSERT (htab != NULL);
-
- /* The .reginfo section has a fixed size. */
- sect = bfd_get_section_by_name (output_bfd, ".reginfo");
- if (sect != NULL)
- {
- bfd_set_section_size (sect, sizeof (Elf32_External_RegInfo));
- sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
- }
-
- /* The .MIPS.abiflags section has a fixed size. */
- sect = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags");
- if (sect != NULL)
- {
- bfd_set_section_size (sect, sizeof (Elf_External_ABIFlags_v0));
- sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
- }
-
- hti.info = info;
- hti.output_bfd = output_bfd;
- hti.error = false;
- mips_elf_link_hash_traverse (mips_elf_hash_table (info),
- mips_elf_check_symbols, &hti);
- if (hti.error)
- return false;
-
- return true;
-}
-
/* If the link uses a GOT, lay it out and work out its size. */
static bool
@@ -9960,7 +9918,8 @@ mips_elf_set_plt_sym_value (struct mips_
return true;
}
-/* Set the sizes of the dynamic sections. */
+/* Set the sizes of the dynamic sections, some mips non-dynamic sections,
+ and check for any mips16 stub sections that we can discard. */
bool
_bfd_mips_elf_late_size_sections (bfd *output_bfd,
@@ -9970,14 +9929,39 @@ _bfd_mips_elf_late_size_sections (bfd *o
asection *s, *sreldyn;
bool reltext;
struct mips_elf_link_hash_table *htab;
+ struct mips_htab_traverse_info hti;
htab = mips_elf_hash_table (info);
BFD_ASSERT (htab != NULL);
- dynobj = elf_hash_table (info)->dynobj;
+
+ /* The .reginfo section has a fixed size. */
+ s = bfd_get_section_by_name (output_bfd, ".reginfo");
+ if (s != NULL)
+ {
+ bfd_set_section_size (s, sizeof (Elf32_External_RegInfo));
+ s->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
+ }
+
+ /* The .MIPS.abiflags section has a fixed size. */
+ s = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags");
+ if (s != NULL)
+ {
+ bfd_set_section_size (s, sizeof (Elf_External_ABIFlags_v0));
+ s->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
+ }
+
+ hti.info = info;
+ hti.output_bfd = output_bfd;
+ hti.error = false;
+ mips_elf_link_hash_traverse (htab, mips_elf_check_symbols, &hti);
+ if (hti.error)
+ return false;
+
+ dynobj = htab->root.dynobj;
if (dynobj == NULL)
return true;
- if (elf_hash_table (info)->dynamic_sections_created)
+ if (htab->root.dynamic_sections_created)
{
/* Set the contents of the .interp section to the interpreter. */
if (bfd_link_executable (info) && !info->nointerp)
@@ -10117,7 +10101,7 @@ _bfd_mips_elf_late_size_sections (bfd *o
}
}
else if (bfd_link_executable (info)
- && ! mips_elf_hash_table (info)->use_rld_obj_head
+ && !htab->use_rld_obj_head
&& startswith (name, ".rld_map"))
{
/* We add a room for __rld_map. It will be filled in by the
@@ -10126,7 +10110,7 @@ _bfd_mips_elf_late_size_sections (bfd *o
}
else if (SGI_COMPAT (output_bfd)
&& startswith (name, ".compact_rel"))
- s->size += mips_elf_hash_table (info)->compact_rel_size;
+ s->size += htab->compact_rel_size;
else if (s == htab->root.splt)
{
/* If the last PLT entry has a branch delay slot, allocate
@@ -10166,7 +10150,7 @@ _bfd_mips_elf_late_size_sections (bfd *o
}
}
- if (elf_hash_table (info)->dynamic_sections_created)
+ if (htab->root.dynamic_sections_created)
{
/* Add some entries to the .dynamic section. We fill in the
values later, in _bfd_mips_elf_finish_dynamic_sections, but we
@@ -14900,7 +14884,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str
input_section->flags &= ~SEC_HAS_CONTENTS;
}
- /* Size has been set in _bfd_mips_elf_early_size_sections. */
+ /* Size has been set in _bfd_mips_elf_late_size_sections. */
BFD_ASSERT(o->size == sizeof (Elf_External_ABIFlags_v0));
/* Skip this section later on (I don't think this currently
@@ -14959,7 +14943,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str
input_section->flags &= ~SEC_HAS_CONTENTS;
}
- /* Size has been set in _bfd_mips_elf_early_size_sections. */
+ /* Size has been set in _bfd_mips_elf_late_size_sections. */
BFD_ASSERT(o->size == sizeof (Elf32_External_RegInfo));
/* Skip this section later on (I don't think this currently
--- a/bfd/elfxx-mips.h
+++ b/bfd/elfxx-mips.h
@@ -61,8 +61,6 @@ extern bool _bfd_mips_elf_check_relocs
(bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
extern bool _bfd_mips_elf_adjust_dynamic_symbol
(struct bfd_link_info *, struct elf_link_hash_entry *);
-extern bool _bfd_mips_elf_early_size_sections
- (bfd *, struct bfd_link_info *);
extern bool _bfd_mips_elf_late_size_sections
(bfd *, struct bfd_link_info *);
extern int _bfd_mips_elf_relocate_section

View File

@@ -0,0 +1,70 @@
From f7c5db99b76e8dde89335d794c82fcbfbf53c612 Mon Sep 17 00:00:00 2001
From: Enze Li <enze.li@hotmail.com>
Date: Sat, 14 Jan 2023 11:33:48 +0800
Subject: [PATCH 05/50] libctf: update regexp to allow makeinfo to build
document
While trying to build gdb on latest openSUSE Tumbleweed, I noticed the
following warning,
checking for makeinfo... makeinfo --split-size=5000000
configure: WARNING:
*** Makeinfo is too old. Info documentation will not be built.
then I checked the version of makeinfo, it said,
======
$ makeinfo --version
texi2any (GNU texinfo) 7.0.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
======
After digging a little bit, it became quite obvious that a dot is
missing in regexp that makes it impossible to match versions higher than
7.0, and here's the solution:
- | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9])' >/dev/null 2>&1; then
+ | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]\.[0-9])' >/dev/null 2>&1; then
However, Eli pointed out that the solution above has another problem: it
will stop working when Texinfo 10.1 will be released. Meanwhile, he
suggested to solve this problem permanently. That is, we don't care
about the minor version for Texinfo > 6.9, we only care about the major
version.
In this way, the problem will be resolved permanently, thanks to Eli.
libctf/ChangeLog:
* configure: Regenerated.
* configure.ac: Update regexp to match versions higher than 7.0.
---
libctf/configure | 2 +-
libctf/configure.ac | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/libctf/configure
+++ b/libctf/configure
@@ -14865,7 +14865,7 @@ esac
# We require texinfo to be 6.3 or later, for a working synindex
# and validatemenus: otherwise we fall back to /bin/true.
if ${MAKEINFO} --version \
- | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9])' >/dev/null 2>&1; then
+ | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]|[1-6][0-9])' >/dev/null 2>&1; then
build_info=yes
else
build_info=
--- a/libctf/configure.ac
+++ b/libctf/configure.ac
@@ -184,7 +184,7 @@ changequote(,)
# We require texinfo to be 6.3 or later, for a working synindex
# and validatemenus: otherwise we fall back to /bin/true.
if ${MAKEINFO} --version \
- | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9])' >/dev/null 2>&1; then
+ | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]|[1-6][0-9])' >/dev/null 2>&1; then
build_info=yes
else
build_info=

View File

@@ -0,0 +1,444 @@
From 59706683feafb6252d0ad369cf8759f75fd147be Mon Sep 17 00:00:00 2001
From: Nick Clifton <nickc@redhat.com>
Date: Tue, 17 Jan 2023 12:02:56 +0000
Subject: [PATCH 07/50] Fix version number snafu in some configuration files:
2.40.00 should be 2.40
---
binutils/configure | 20 ++++++++++----------
gprof/configure | 20 ++++++++++----------
gprofng/configure | 20 ++++++++++----------
gprofng/doc/version.texi | 4 ++--
gprofng/libcollector/configure | 20 ++++++++++----------
ld/configure | 20 ++++++++++----------
6 files changed, 52 insertions(+), 52 deletions(-)
--- a/binutils/configure
+++ b/binutils/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for binutils 2.40.00.
+# Generated by GNU Autoconf 2.69 for binutils 2.40.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='binutils'
PACKAGE_TARNAME='binutils'
-PACKAGE_VERSION='2.40.00'
-PACKAGE_STRING='binutils 2.40.00'
+PACKAGE_VERSION='2.40'
+PACKAGE_STRING='binutils 2.40'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1401,7 +1401,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures binutils 2.40.00 to adapt to many kinds of systems.
+\`configure' configures binutils 2.40 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1472,7 +1472,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of binutils 2.40.00:";;
+ short | recursive ) echo "Configuration of binutils 2.40:";;
esac
cat <<\_ACEOF
@@ -1631,7 +1631,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-binutils configure 2.40.00
+binutils configure 2.40
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2099,7 +2099,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by binutils $as_me 2.40.00, which was
+It was created by binutils $as_me 2.40, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3081,7 +3081,7 @@ fi
# Define the identity of the package.
PACKAGE='binutils'
- VERSION='2.40.00'
+ VERSION='2.40'
cat >>confdefs.h <<_ACEOF
@@ -15326,7 +15326,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by binutils $as_me 2.40.00, which was
+This file was extended by binutils $as_me 2.40, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -15392,7 +15392,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-binutils config.status 2.40.00
+binutils config.status 2.40
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
--- a/gprof/configure
+++ b/gprof/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gprof 2.40.00.
+# Generated by GNU Autoconf 2.69 for gprof 2.40.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gprof'
PACKAGE_TARNAME='gprof'
-PACKAGE_VERSION='2.40.00'
-PACKAGE_STRING='gprof 2.40.00'
+PACKAGE_VERSION='2.40'
+PACKAGE_STRING='gprof 2.40'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1338,7 +1338,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures gprof 2.40.00 to adapt to many kinds of systems.
+\`configure' configures gprof 2.40 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1409,7 +1409,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of gprof 2.40.00:";;
+ short | recursive ) echo "Configuration of gprof 2.40:";;
esac
cat <<\_ACEOF
@@ -1520,7 +1520,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-gprof configure 2.40.00
+gprof configure 2.40
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1885,7 +1885,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by gprof $as_me 2.40.00, which was
+It was created by gprof $as_me 2.40, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2864,7 +2864,7 @@ fi
# Define the identity of the package.
PACKAGE='gprof'
- VERSION='2.40.00'
+ VERSION='2.40'
cat >>confdefs.h <<_ACEOF
@@ -12572,7 +12572,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by gprof $as_me 2.40.00, which was
+This file was extended by gprof $as_me 2.40, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -12638,7 +12638,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-gprof config.status 2.40.00
+gprof config.status 2.40
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
--- a/gprofng/configure
+++ b/gprofng/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gprofng 2.40.00.
+# Generated by GNU Autoconf 2.69 for gprofng 2.40.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gprofng'
PACKAGE_TARNAME='gprofng'
-PACKAGE_VERSION='2.40.00'
-PACKAGE_STRING='gprofng 2.40.00'
+PACKAGE_VERSION='2.40'
+PACKAGE_STRING='gprofng 2.40'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1362,7 +1362,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures gprofng 2.40.00 to adapt to many kinds of systems.
+\`configure' configures gprofng 2.40 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1433,7 +1433,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of gprofng 2.40.00:";;
+ short | recursive ) echo "Configuration of gprofng 2.40:";;
esac
cat <<\_ACEOF
@@ -1547,7 +1547,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-gprofng configure 2.40.00
+gprofng configure 2.40
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2079,7 +2079,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by gprofng $as_me 2.40.00, which was
+It was created by gprofng $as_me 2.40, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3052,7 +3052,7 @@ fi
# Define the identity of the package.
PACKAGE='gprofng'
- VERSION='2.40.00'
+ VERSION='2.40'
cat >>confdefs.h <<_ACEOF
@@ -17467,7 +17467,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by gprofng $as_me 2.40.00, which was
+This file was extended by gprofng $as_me 2.40, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -17533,7 +17533,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-gprofng config.status 2.40.00
+gprofng config.status 2.40
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
--- a/gprofng/doc/version.texi
+++ b/gprofng/doc/version.texi
@@ -1,4 +1,4 @@
@set UPDATED 5 January 2023
@set UPDATED-MONTH January 2023
-@set EDITION 2.40.00
-@set VERSION 2.40.00
+@set EDITION 2.40
+@set VERSION 2.40
--- a/gprofng/libcollector/configure
+++ b/gprofng/libcollector/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gprofng 2.40.00.
+# Generated by GNU Autoconf 2.69 for gprofng 2.40.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gprofng'
PACKAGE_TARNAME='gprofng'
-PACKAGE_VERSION='2.40.00'
-PACKAGE_STRING='gprofng 2.40.00'
+PACKAGE_VERSION='2.40'
+PACKAGE_STRING='gprofng 2.40'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1325,7 +1325,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures gprofng 2.40.00 to adapt to many kinds of systems.
+\`configure' configures gprofng 2.40 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1396,7 +1396,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of gprofng 2.40.00:";;
+ short | recursive ) echo "Configuration of gprofng 2.40:";;
esac
cat <<\_ACEOF
@@ -1505,7 +1505,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-gprofng configure 2.40.00
+gprofng configure 2.40
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1991,7 +1991,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by gprofng $as_me 2.40.00, which was
+It was created by gprofng $as_me 2.40, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2968,7 +2968,7 @@ fi
# Define the identity of the package.
PACKAGE='gprofng'
- VERSION='2.40.00'
+ VERSION='2.40'
cat >>confdefs.h <<_ACEOF
@@ -16098,7 +16098,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by gprofng $as_me 2.40.00, which was
+This file was extended by gprofng $as_me 2.40, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -16164,7 +16164,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-gprofng config.status 2.40.00
+gprofng config.status 2.40
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
--- a/ld/configure
+++ b/ld/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for ld 2.40.00.
+# Generated by GNU Autoconf 2.69 for ld 2.40.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ld'
PACKAGE_TARNAME='ld'
-PACKAGE_VERSION='2.40.00'
-PACKAGE_STRING='ld 2.40.00'
+PACKAGE_VERSION='2.40'
+PACKAGE_STRING='ld 2.40'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1423,7 +1423,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures ld 2.40.00 to adapt to many kinds of systems.
+\`configure' configures ld 2.40 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1494,7 +1494,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of ld 2.40.00:";;
+ short | recursive ) echo "Configuration of ld 2.40:";;
esac
cat <<\_ACEOF
@@ -1661,7 +1661,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-ld configure 2.40.00
+ld configure 2.40
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2376,7 +2376,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by ld $as_me 2.40.00, which was
+It was created by ld $as_me 2.40, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3359,7 +3359,7 @@ fi
# Define the identity of the package.
PACKAGE='ld'
- VERSION='2.40.00'
+ VERSION='2.40'
cat >>confdefs.h <<_ACEOF
@@ -18083,7 +18083,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by ld $as_me 2.40.00, which was
+This file was extended by ld $as_me 2.40, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -18149,7 +18149,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-ld config.status 2.40.00
+ld config.status 2.40
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@@ -0,0 +1,60 @@
From bcea253f5fa194e57f9564e8461c718e228bd26e Mon Sep 17 00:00:00 2001
From: Indu Bhagat <indu.bhagat@oracle.com>
Date: Wed, 18 Jan 2023 23:17:49 -0800
Subject: [PATCH 10/50] toplevel: Makefile.def: add install-strip dependency on
libsframe
As noted in PR libsframe/30014 - FTBFS: install-strip fails because
bfdlib relinks and fails to find libsframe, the install time
dependencies of libbfd need to be updated.
PR libsframe/30014
* Makefile.def: Reflect that libsframe needs to installed before
libbfd. Reorder a bit to better track libsframe dependencies.
* Makefile.in: Regenerate.
(cherry picked from commit b8d21eb0cd10d6127e77cc437d82e949adb0c454)
---
Makefile.def | 5 ++++-
Makefile.in | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
--- a/Makefile.def
+++ b/Makefile.def
@@ -493,7 +493,6 @@ dependencies = { module=install-binutils
dependencies = { module=install-strip-binutils; on=install-strip-opcodes; };
// Likewise for ld, libctf, and bfd.
-dependencies = { module=install-bfd; on=install-libsframe; };
dependencies = { module=install-libctf; on=install-bfd; };
dependencies = { module=install-ld; on=install-bfd; };
dependencies = { module=install-ld; on=install-libctf; };
@@ -501,6 +500,10 @@ dependencies = { module=install-strip-li
dependencies = { module=install-strip-ld; on=install-strip-bfd; };
dependencies = { module=install-strip-ld; on=install-strip-libctf; };
+// libbfd depends on libsframe
+dependencies = { module=install-bfd; on=install-libsframe; };
+dependencies = { module=install-strip-bfd; on=install-strip-libsframe; };
+
// libopcodes depends on libbfd
dependencies = { module=configure-opcodes; on=configure-bfd; hard=true; };
dependencies = { module=install-opcodes; on=install-bfd; };
--- a/Makefile.in
+++ b/Makefile.in
@@ -64549,13 +64549,14 @@ all-stageautoprofile-binutils: maybe-all
all-stageautofeedback-binutils: maybe-all-stageautofeedback-libsframe
install-binutils: maybe-install-opcodes
install-strip-binutils: maybe-install-strip-opcodes
-install-bfd: maybe-install-libsframe
install-libctf: maybe-install-bfd
install-ld: maybe-install-bfd
install-ld: maybe-install-libctf
install-strip-libctf: maybe-install-strip-bfd
install-strip-ld: maybe-install-strip-bfd
install-strip-ld: maybe-install-strip-libctf
+install-bfd: maybe-install-libsframe
+install-strip-bfd: maybe-install-strip-libsframe
configure-opcodes: configure-bfd
configure-stage1-opcodes: configure-stage1-bfd
configure-stage2-opcodes: configure-stage2-bfd

View File

@@ -0,0 +1,703 @@
From c6e269febbc946a54ed9dbbb2dc70feba6017607 Mon Sep 17 00:00:00 2001
From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
Date: Fri, 20 Jan 2023 15:39:55 -0800
Subject: [PATCH 18/50] gprofng: PR29521 [docs] man pages are not in the
release tarball
gprofng/ChangeLog
2023-01-20 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
PR gprofng/29521
* configure.ac: Check if $MAKEINFO and $HELP2MAN are missing.
* Makefile.am: Build doc if $MAKEINFO exists.
* doc/gprofng.texi: Update documentation for gprofng.
* doc/Makefile.am: Build gprofng.1.
* src/Makefile.am: Move the build of gprofng.1 to doc/Makefile.am.
* configure: Rebuild.
* Makefile.in: Rebuild.
* doc/Makefile.in: Rebuild.
* src/Makefile.in: Rebuild.
---
gprofng/Makefile.am | 2 +-
gprofng/Makefile.in | 2 +-
gprofng/configure | 79 +++++++++++++++---
gprofng/configure.ac | 21 +++--
gprofng/doc/Makefile.am | 24 +++++-
gprofng/doc/Makefile.in | 93 ++++++++++++++++++---
gprofng/doc/gprofng.texi | 169 +++++++++++++++++++++++++++++++++++++++
gprofng/src/Makefile.am | 8 +-
gprofng/src/Makefile.in | 8 +-
9 files changed, 364 insertions(+), 42 deletions(-)
--- a/gprofng/Makefile.am
+++ b/gprofng/Makefile.am
@@ -23,7 +23,7 @@ AUTOMAKE_OPTIONS = dejagnu foreign
if BUILD_COLLECTOR
COLLECTOR_SUBDIRS = libcollector
endif
-if BUILD_MAN
+if BUILD_DOC
DOC_SUBDIR = doc
endif
if BUILD_SRC
--- a/gprofng/Makefile.in
+++ b/gprofng/Makefile.in
@@ -381,7 +381,7 @@ zlibinc = @zlibinc@
ACLOCAL_AMFLAGS = -I . -I ..
AUTOMAKE_OPTIONS = dejagnu foreign
@BUILD_COLLECTOR_TRUE@COLLECTOR_SUBDIRS = libcollector
-@BUILD_MAN_TRUE@DOC_SUBDIR = doc
+@BUILD_DOC_TRUE@DOC_SUBDIR = doc
@BUILD_SRC_TRUE@SRC_SUBDIRS = src gp-display-html $(DOC_SUBDIR)
SUBDIRS = $(COLLECTOR_SUBDIRS) $(SRC_SUBDIRS)
DIST_SUBDIRS = libcollector src gp-display-html $(DOC_SUBDIR)
--- a/gprofng/configure
+++ b/gprofng/configure
@@ -639,6 +639,8 @@ GPROFNG_CPPFLAGS
GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS
GPROFNG_CFLAGS
LD_NO_AS_NEEDED
+BUILD_DOC_FALSE
+BUILD_DOC_TRUE
BUILD_MAN_FALSE
BUILD_MAN_TRUE
HELP2MAN
@@ -12221,7 +12223,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12224 "configure"
+#line 12226 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12327,7 +12329,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12330 "configure"
+#line 12332 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16737,9 +16739,58 @@ fi
# Generate manpages, if possible.
build_man=false
+build_doc=false
if test $cross_compiling = no; then
+ for ac_prog in help2man
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_HELP2MAN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$HELP2MAN"; then
+ ac_cv_prog_HELP2MAN="$HELP2MAN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_HELP2MAN="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+HELP2MAN=$ac_cv_prog_HELP2MAN
+if test -n "$HELP2MAN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HELP2MAN" >&5
+$as_echo "$HELP2MAN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
-HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"}
+
+ test -n "$HELP2MAN" && break
+done
+test -n "$HELP2MAN" || HELP2MAN="$MISSING help2man"
+
+ case "x$HELP2MAN" in
+ x | */missing\ help2man* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gprofng: help2man is missing. Man pages will not be built." >&5
+$as_echo "$as_me: WARNING: gprofng: help2man is missing. Man pages will not be built." >&2;}
+ ;;
+ * ) build_man=true ;;
+ esac
for ac_prog in makeinfo
do
@@ -16782,10 +16833,10 @@ fi
test -n "$MAKEINFO" && break
done
-test -n "$MAKEINFO" || MAKEINFO=""@echo makeinfo missing; true""
+test -n "$MAKEINFO" || MAKEINFO="$MISSING makeinfo"
- case "$MAKEINFO" in
- *true)
+ case "x$MAKEINFO" in
+ x | */missing\ makeinfo*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gprofng: makeinfo is missing. Info documentation will not be built." >&5
$as_echo "$as_me: WARNING: gprofng: makeinfo is missing. Info documentation will not be built." >&2;}
;;
@@ -16796,9 +16847,7 @@ $as_echo "$as_me: WARNING: gprofng: make
$as_echo "$as_me: WARNING: gprofng: $MAKEINFO is too old. Info documentation will not be built." >&2;}
MAKEINFO="@echo $MAKEINFO is too old, 6.5 or newer required; true"
;;
- x* )
- build_man=true
- ;;
+ x* ) build_doc=true ;;
esac
;;
esac
@@ -16812,6 +16861,14 @@ else
BUILD_MAN_FALSE=
fi
+ if test x$build_doc = xtrue; then
+ BUILD_DOC_TRUE=
+ BUILD_DOC_FALSE='#'
+else
+ BUILD_DOC_TRUE='#'
+ BUILD_DOC_FALSE=
+fi
+
LD_NO_AS_NEEDED=${no_as_needed}
@@ -17070,6 +17127,10 @@ if test -z "${BUILD_MAN_TRUE}" && test -
as_fn_error $? "conditional \"BUILD_MAN\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${BUILD_DOC_TRUE}" && test -z "${BUILD_DOC_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_DOC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
--- a/gprofng/configure.ac
+++ b/gprofng/configure.ac
@@ -210,11 +210,19 @@ AM_ZLIB
# Generate manpages, if possible.
build_man=false
+build_doc=false
if test $cross_compiling = no; then
- AM_MISSING_PROG(HELP2MAN, help2man)
- AC_CHECK_PROGS([MAKEINFO], makeinfo, ["@echo makeinfo missing; true"])
- case "$MAKEINFO" in
- *true)
+ AC_CHECK_PROGS([HELP2MAN], help2man, [$MISSING help2man])
+ case "x$HELP2MAN" in
+ x | */missing\ help2man* )
+ AC_MSG_WARN([gprofng: help2man is missing. Man pages will not be built.])
+ ;;
+ * ) build_man=true ;;
+ esac
+
+ AC_CHECK_PROGS([MAKEINFO], makeinfo, [$MISSING makeinfo])
+ case "x$MAKEINFO" in
+ x | */missing\ makeinfo*)
AC_MSG_WARN([gprofng: makeinfo is missing. Info documentation will not be built.])
;;
*)
@@ -223,15 +231,14 @@ if test $cross_compiling = no; then
AC_MSG_WARN([gprofng: $MAKEINFO is too old. Info documentation will not be built.])
MAKEINFO="@echo $MAKEINFO is too old, 6.5 or newer required; true"
;;
- x* )
- build_man=true
- ;;
+ x* ) build_doc=true ;;
esac
;;
esac
AC_SUBST(MAKEINFO)
fi
AM_CONDITIONAL([BUILD_MAN], [test x$build_man = xtrue])
+AM_CONDITIONAL([BUILD_DOC], [test x$build_doc = xtrue])
AC_SUBST(LD_NO_AS_NEEDED, [${no_as_needed}])
AC_SUBST(GPROFNG_CFLAGS, [${gprofng_cflags}])
--- a/gprofng/doc/Makefile.am
+++ b/gprofng/doc/Makefile.am
@@ -19,9 +19,31 @@
AUTOMAKE_OPTIONS = info-in-builddir foreign no-texinfo.tex
+# Options to extract the man page
+MANCONF = -Dman
+
+TEXI2POD = perl $(srcdir)/../../etc/texi2pod.pl $(AM_MAKEINFOFLAGS)
+POD2MAN = pod2man --center="User Commands" \
+ --release="binutils-$(VERSION)" --section=1
+
info_TEXINFOS = gprofng.texi
gprofng_TEXINFOS = fdl.texi
TEXINFO_TEX = .
MAKEINFOHTML = $(MAKEINFO) --html --no-split
-MAINTAINERCLEANFILES = gprofng.info
+man_MANS = gprofng.1
+
+# Build the man page from the texinfo file
+# The sed command removes the no-adjust Nroff command so that
+# the man output looks standard.
+gprofng.1: $(srcdir)/gprofng.texi
+ $(AM_V_GEN)touch $@
+ $(AM_V_at)-$(TEXI2POD) $(MANCONF) < $(srcdir)/gprofng.texi > gprofng.pod
+ $(AM_V_at)-($(POD2MAN) gprofng.pod | \
+ sed -e '/^.if n .na/d' > $@.tmp && \
+ mv -f $@.tmp $@) || (rm -f $@.tmp && exit 1)
+ $(AM_V_at)rm -f gprofng.pod
+
+MAINTAINERCLEANFILES = gprofng.info $(man_MANS)
+
+info: $(man_MANS)
--- a/gprofng/doc/Makefile.in
+++ b/gprofng/doc/Makefile.in
@@ -182,7 +182,7 @@ am__can_run_installinfo = \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
-am__installdirs = "$(DESTDIR)$(infodir)"
+am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -210,6 +210,9 @@ am__uninstall_files_from_dir = { \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(man_MANS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(gprofng_TEXINFOS) $(srcdir)/Makefile.in \
$(top_srcdir)/../mkinstalldirs mdate-sh texinfo.tex
@@ -361,11 +364,19 @@ top_srcdir = @top_srcdir@
zlibdir = @zlibdir@
zlibinc = @zlibinc@
AUTOMAKE_OPTIONS = info-in-builddir foreign no-texinfo.tex
+
+# Options to extract the man page
+MANCONF = -Dman
+TEXI2POD = perl $(srcdir)/../../etc/texi2pod.pl $(AM_MAKEINFOFLAGS)
+POD2MAN = pod2man --center="User Commands" \
+ --release="binutils-$(VERSION)" --section=1
+
info_TEXINFOS = gprofng.texi
gprofng_TEXINFOS = fdl.texi
TEXINFO_TEX = .
MAKEINFOHTML = $(MAKEINFO) --html --no-split
-MAINTAINERCLEANFILES = gprofng.info
+man_MANS = gprofng.1
+MAINTAINERCLEANFILES = gprofng.info $(man_MANS)
all: all-am
.SUFFIXES:
@@ -558,6 +569,49 @@ maintainer-clean-aminfo:
echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
done
+install-man1: $(man_MANS)
+ @$(NORMAL_INSTALL)
+ @list1=''; \
+ list2='$(man_MANS)'; \
+ test -n "$(man1dir)" \
+ && test -n "`echo $$list1$$list2`" \
+ || exit 0; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+ { for i in $$list1; do echo "$$i"; done; \
+ if test -n "$$list2"; then \
+ for i in $$list2; do echo "$$i"; done \
+ | sed -n '/\.1[a-z]*$$/p'; \
+ fi; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list=''; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
tags TAGS:
ctags CTAGS:
@@ -600,9 +654,9 @@ distdir: $(DISTFILES)
dist-info
check-am: all-am
check: check-am
-all-am: Makefile $(INFO_DEPS)
+all-am: Makefile $(INFO_DEPS) $(MANS)
installdirs:
- for dir in "$(DESTDIR)$(infodir)"; do \
+ for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
@@ -652,11 +706,9 @@ html: html-am
html-am: $(HTMLS)
-info: info-am
-
info-am: $(INFO_DEPS)
-install-data-am: install-info-am
+install-data-am: install-info-am install-man
install-dvi: install-dvi-am
@@ -739,7 +791,7 @@ install-info-am: $(INFO_DEPS)
install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
done; \
else : ; fi
-install-man:
+install-man: install-man1
install-pdf: install-pdf-am
@@ -794,7 +846,9 @@ ps: ps-am
ps-am: $(PSS)
uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
- uninstall-pdf-am uninstall-ps-am
+ uninstall-man uninstall-pdf-am uninstall-ps-am
+
+uninstall-man: uninstall-man1
.MAKE: install-am install-strip
@@ -804,19 +858,32 @@ uninstall-am: uninstall-dvi-am uninstall
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
+ install-info-am install-man install-man1 install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-aminfo maintainer-clean-generic \
maintainer-clean-vti mostlyclean mostlyclean-aminfo \
mostlyclean-generic mostlyclean-libtool mostlyclean-vti pdf \
pdf-am ps ps-am tags-am uninstall uninstall-am \
uninstall-dvi-am uninstall-html-am uninstall-info-am \
- uninstall-pdf-am uninstall-ps-am
+ uninstall-man uninstall-man1 uninstall-pdf-am uninstall-ps-am
.PRECIOUS: Makefile
+# Build the man page from the texinfo file
+# The sed command removes the no-adjust Nroff command so that
+# the man output looks standard.
+gprofng.1: $(srcdir)/gprofng.texi
+ $(AM_V_GEN)touch $@
+ $(AM_V_at)-$(TEXI2POD) $(MANCONF) < $(srcdir)/gprofng.texi > gprofng.pod
+ $(AM_V_at)-($(POD2MAN) gprofng.pod | \
+ sed -e '/^.if n .na/d' > $@.tmp && \
+ mv -f $@.tmp $@) || (rm -f $@.tmp && exit 1)
+ $(AM_V_at)rm -f gprofng.pod
+
+info: $(man_MANS)
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
--- a/gprofng/doc/gprofng.texi
+++ b/gprofng/doc/gprofng.texi
@@ -1,5 +1,8 @@
\input texinfo @c -*-texinfo-*-
+@c for $sect (qw(NAME SYNOPSIS TARGET DESCRIPTION OPTIONS ENVIRONMENT FILES
+@c BUGS NOTES FOOTNOTES SEEALSO AUTHOR COPYRIGHT)) {
+
@c ----------------------------------------------------------------------------
@c This is the Texinfo source file for the GPROFNG manual.
@c
@@ -59,6 +62,10 @@ gprofng
@cindex \label\, \string\
@end macro
+@macro gcctabopt{body}
+@code{\body\}
+@end macro
+
@c -- Get the version information ---------------------------------------------
@include version.texi
@@ -99,6 +106,20 @@ section entitled ``GNU Free Documentatio
@page
@vskip 0pt plus 1filll
@insertcopying
+
+@c man begin COPYRIGHT
+
+Copyright @copyright{} 2022-2023 Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled ``GNU Free Documentation License''.
+
+@c man end
+
@end titlepage
@c -- Generate the Table of Contents ------------------------------------------
@@ -163,6 +184,154 @@ Terminology
@end menu
@end ifinfo
+@ifset man
+
+@c man title gprofng the driver for the gprofng tool suite
+
+@c man begin SYNOPSIS
+gprofng [OPTION(S)] ACTION [@b{QUALIFIER}] [ARGUMENTS] TARGET
+@c man end
+
+@c man begin DESCRIPTION
+This is the driver for the GPROFNG tools suite to gather and analyze performance data.
+
+The driver executes the action specified. An example of an action is @code{collect}
+to collect performance data. Depending on the action, a qualifier may be needed to
+define the command. Several qualifiers support options. The last item on the command
+is the target the command applies to.
+
+For example, to collect performance data for an application called @code{a.out} and
+store the results in experiment directory @code{mydata.er}, the following command may
+be used:
+
+@smallexample
+$ gprofng collect app -o mydata.er a.out
+@end smallexample
+
+In this example, the action is @code{collect}, the qualifier is @code{app}, the single
+argument is @code{-o mydata.er} and the target is @code{a.out}.
+
+If gprofng is executed without any additional option, action, or target, a usage
+overview is printed.
+
+@c man end
+
+@c man begin OPTIONS
+
+@table @gcctabopt
+
+@item @var{--version}
+print the version number and exit.
+
+@item @var{--help}
+print usage information and exit.
+
+@end table
+
+@c man end
+
+@c man begin NOTES
+
+The gprofng driver supports the following commands.
+
+@c The man pages for the commands below can be viewed using the command name with "gprofng" replaced by "gp" and the spaces replaced by a dash ("-"). For example the man page
+@c name for "gprofng collect app" is "gp-collect-app".
+
+Collect performance data:
+
+@table @code
+
+@item gprofng collect app
+collect application performance data.
+
+@end table
+
+Display the performance results:
+
+@table @code
+
+@item gprofng display text
+display the performance data in ASCII format.
+
+@item gprofng display html
+generate an HTML file from one or more experiments.
+
+@end table
+
+Miscellaneous commands:
+
+@table @code
+
+@item gprofng display src
+display source or disassembly with compiler annotations.
+
+@item gprofng archive
+include binaries and source code in an experiment directory.
+
+@end table
+
+It is also possible to invoke the lower level commands directly, but since
+these are subject to change, in particular the options, we recommend to
+use the driver.
+
+@c man end
+
+@c man begin ENVIRONMENT
+The following environment variables are supported:
+
+@table @code
+
+@item @env{GPROFNG_MAX_CALL_STACK_DEPTH}
+set the depth of the call stack (default is 256).
+
+@item @env{GPROFNG_USE_JAVA_OPTIONS}
+may be set when profiling a C/C++ application that uses dlopen() to execute Java code.
+
+@item @env{GPROFNG_SSH_REMOTE_DISPLAY}
+use this variable to define the ssh command executed by the remote display tool.
+
+@item @env{GPROFNG_SKIP_VALIDATION}
+set this variable to disable checking hardware, system, and Java versions.
+
+@item @env{GPROFNG_ALLOW_CORE_DUMP}
+set this variable to allow a core file to be generated; otherwise an error report is created on /tmp.
+
+@item @env{GPROFNG_ARCHIVE}
+use this variable to define the settings for automatic archiving upon experiment recording completion.
+
+@item @env{GPROFNG_ARCHIVE_COMMON_DIR}
+set this variable to the location of the common archive.
+
+@item @env{GPROFNG_JAVA_MAX_CALL_STACK_DEPTH}
+set the depth of the Java call stack; the default is 256; set to 0 to disable capturing of call stacks.
+
+@item @env{GPROFNG_JAVA_NATIVE_MAX_CALL_STACK_DEPTH}
+set the depth of the Java native call stack; the default is 256; set to 0 to disable capturing of call stacks (JNI and assembly call stacks are not captured).
+
+@end table
+
+@c man end
+
+@c man begin SEEALSO
+The man pages for the various gprofng commands are not available yet, but
+the @option{--help} option supported on each of the commands lists the options
+and provides more information.
+
+For example this displays the options supported on the @command{gprofng collect app}
+command:
+
+@smallexample
+$ gprofng collect app --help
+@end smallexample
+
+The user guide is available as an Info entry for @file{gprofng}.
+@c man end
+
+@end ifset
+
+@c man begin DESCRIPTION
+@c man end
+
@c -- A new node --------------------------------------------------------------
@node Introduction
@chapter Introduction
--- a/gprofng/src/Makefile.am
+++ b/gprofng/src/Makefile.am
@@ -160,7 +160,7 @@ gp_display_text_LDADD = $(LIBGPROFNG) $(
if BUILD_MAN
-man_MANS = gprofng.1 \
+man_MANS = \
gp-archive.1 \
gp-collect-app.1 \
gp-display-src.1 \
@@ -191,10 +191,6 @@ H2M_FILTER = | sed 's/\.TP/\.TP\n.B/' |
| sed 's/See also:/\.SH SEE ALSO/' | sed 's/Documentation:/.SH DOCUMENTATION/' \
| sed 's/Limitations:/.SH LIMITATIONS/'
-gprofng.1: $(srcdir)/gprofng.cc $(common_mandeps) | ./gprofng$(EXEEXT)
- $(AM_V_GEN)_BUILDING_MANPAGE=1 $(HELP2MAN) $(HELP2MAN_OPT) \
- --name=$(TEXT_GPROFNG) ./gprofng$(EXEEXT) $(H2M_FILTER) > $@
-
gp-archive.1: $(srcdir)/gp-archive.cc $(common_mandeps) | ./gp-archive$(EXEEXT)
$(AM_V_GEN)_BUILDING_MANPAGE=1 $(HELP2MAN) $(HELP2MAN_OPT) \
--name=$(TEXT_GP_ARCHIVE) ./gp-archive$(EXEEXT) $(H2M_FILTER) > $@
@@ -223,3 +219,5 @@ dist-hook: $(LIBGPROFNG)
install-data-local: install-pkglibLTLIBRARIES
rm -f $(DESTDIR)/$(pkglibdir)/*.la $(DESTDIR)/$(pkglibdir)/*.a
+
+$(srcdir)/DbeSession.cc: QLParser.tab.hh
--- a/gprofng/src/Makefile.in
+++ b/gprofng/src/Makefile.in
@@ -572,7 +572,7 @@ gp_display_src_SOURCES = gp-display-src.
gp_display_src_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
gp_display_text_SOURCES = gp-display-text.cc ipc.cc ipcio.cc
gp_display_text_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
-@BUILD_MAN_TRUE@man_MANS = gprofng.1 \
+@BUILD_MAN_TRUE@man_MANS = \
@BUILD_MAN_TRUE@ gp-archive.1 \
@BUILD_MAN_TRUE@ gp-collect-app.1 \
@BUILD_MAN_TRUE@ gp-display-src.1 \
@@ -1176,10 +1176,6 @@ uninstall-man: uninstall-man1
QLParser.tab.cc QLParser.tab.hh: QLParser.yy
$(BISON) $^
-@BUILD_MAN_TRUE@gprofng.1: $(srcdir)/gprofng.cc $(common_mandeps) | ./gprofng$(EXEEXT)
-@BUILD_MAN_TRUE@ $(AM_V_GEN)_BUILDING_MANPAGE=1 $(HELP2MAN) $(HELP2MAN_OPT) \
-@BUILD_MAN_TRUE@ --name=$(TEXT_GPROFNG) ./gprofng$(EXEEXT) $(H2M_FILTER) > $@
-
@BUILD_MAN_TRUE@gp-archive.1: $(srcdir)/gp-archive.cc $(common_mandeps) | ./gp-archive$(EXEEXT)
@BUILD_MAN_TRUE@ $(AM_V_GEN)_BUILDING_MANPAGE=1 $(HELP2MAN) $(HELP2MAN_OPT) \
@BUILD_MAN_TRUE@ --name=$(TEXT_GP_ARCHIVE) ./gp-archive$(EXEEXT) $(H2M_FILTER) > $@
@@ -1207,6 +1203,8 @@ dist-hook: $(LIBGPROFNG)
install-data-local: install-pkglibLTLIBRARIES
rm -f $(DESTDIR)/$(pkglibdir)/*.la $(DESTDIR)/$(pkglibdir)/*.a
+$(srcdir)/DbeSession.cc: QLParser.tab.hh
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -0,0 +1,212 @@
From edd36b26f3506eeb259534ba2493e15c728cd280 Mon Sep 17 00:00:00 2001
From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
Date: Wed, 25 Jan 2023 19:21:38 -0800
Subject: [PATCH 20/50] gprofng: PR30043 libgprofng.so.* are installed to a
wrong location
gprofng/ChangeLog
2023-01-25 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
PR gprofng/30043
PR gprofng/28972
* src/Makefile.am: Use lib_LTLIBRARIES instead of pkglib_LTLIBRARIES.
* src/Makefile.in: Rebuild.
---
gprofng/src/Makefile.am | 7 +---
gprofng/src/Makefile.in | 76 +++++++++++++++++++----------------------
2 files changed, 37 insertions(+), 46 deletions(-)
--- a/gprofng/src/Makefile.am
+++ b/gprofng/src/Makefile.am
@@ -124,7 +124,7 @@ BUILT_SOURCES = QLParser.tab.hh
EXTRA_DIST = QLParser.yy $(man_MANS)
-pkglib_LTLIBRARIES = $(LIBGPROFNG)
+lib_LTLIBRARIES = $(LIBGPROFNG)
libgprofng_la_SOURCES = $(CCSOURCES) $(CSOURCES)
libgprofng_la_LDFLAGS = -version-info 0:0:0
@@ -215,9 +215,4 @@ endif
# so ensure that the necessary libraries are built at dist time.
dist-hook: $(LIBGPROFNG)
-.PHONY: install-data-local
-
-install-data-local: install-pkglibLTLIBRARIES
- rm -f $(DESTDIR)/$(pkglibdir)/*.la $(DESTDIR)/$(pkglibdir)/*.a
-
$(srcdir)/DbeSession.cc: QLParser.tab.hh
--- a/gprofng/src/Makefile.in
+++ b/gprofng/src/Makefile.in
@@ -155,9 +155,9 @@ am__uninstall_files_from_dir = { \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
-am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(bindir)" \
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(man1dir)" "$(DESTDIR)$(dbedir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
+LTLIBRARIES = $(lib_LTLIBRARIES)
am__DEPENDENCIES_1 =
libgprofng_la_DEPENDENCIES = $(top_builddir)/../opcodes/libopcodes.la \
$(top_builddir)/../bfd/libbfd.la $(am__DEPENDENCIES_1)
@@ -548,7 +548,7 @@ AM_CFLAGS = $(GPROFNG_CFLAGS) $(PTHREAD_
AM_CXXFLAGS = $(AM_CFLAGS)
BUILT_SOURCES = QLParser.tab.hh
EXTRA_DIST = QLParser.yy $(man_MANS)
-pkglib_LTLIBRARIES = $(LIBGPROFNG)
+lib_LTLIBRARIES = $(LIBGPROFNG)
libgprofng_la_SOURCES = $(CCSOURCES) $(CSOURCES)
libgprofng_la_LDFLAGS = -version-info 0:0:0
@@ -636,33 +636,33 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
- @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
- echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
-uninstall-pkglibLTLIBRARIES:
+uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
- @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
-clean-pkglibLTLIBRARIES:
- -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
- @list='$(pkglib_LTLIBRARIES)'; \
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ @list='$(lib_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
@@ -672,7 +672,7 @@ clean-pkglibLTLIBRARIES:
}
libgprofng.la: $(libgprofng_la_OBJECTS) $(libgprofng_la_DEPENDENCIES) $(EXTRA_libgprofng_la_DEPENDENCIES)
- $(AM_V_CXXLD)$(libgprofng_la_LINK) -rpath $(pkglibdir) $(libgprofng_la_OBJECTS) $(libgprofng_la_LIBADD) $(LIBS)
+ $(AM_V_CXXLD)$(libgprofng_la_LINK) -rpath $(libdir) $(libgprofng_la_OBJECTS) $(libgprofng_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
@@ -1039,8 +1039,10 @@ check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(DATA)
+install-binPROGRAMS: install-libLTLIBRARIES
+
installdirs:
- for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(dbedir)"; do \
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(dbedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
@@ -1078,8 +1080,8 @@ maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
-clean-am: clean-binPROGRAMS clean-generic clean-libtool \
- clean-pkglibLTLIBRARIES mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
+ clean-libtool mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
@@ -1099,13 +1101,13 @@ info: info-am
info-am:
-install-data-am: install-data-local install-dbeDATA install-man
+install-data-am: install-dbeDATA install-man
install-dvi: install-dvi-am
install-dvi-am:
-install-exec-am: install-binPROGRAMS install-pkglibLTLIBRARIES
+install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
install-html: install-html-am
@@ -1145,30 +1147,29 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-binPROGRAMS uninstall-dbeDATA uninstall-man \
- uninstall-pkglibLTLIBRARIES
+uninstall-am: uninstall-binPROGRAMS uninstall-dbeDATA \
+ uninstall-libLTLIBRARIES uninstall-man
uninstall-man: uninstall-man1
.MAKE: all check install install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
- clean-binPROGRAMS clean-generic clean-libtool \
- clean-pkglibLTLIBRARIES cscopelist-am ctags ctags-am dist-hook \
- distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-binPROGRAMS \
- install-data install-data-am install-data-local \
- install-dbeDATA install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-man1 install-pdf \
- install-pdf-am install-pkglibLTLIBRARIES install-ps \
+ clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
+ clean-libtool cscopelist-am ctags ctags-am dist-hook distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-binPROGRAMS install-data \
+ install-data-am install-dbeDATA install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-libLTLIBRARIES \
+ install-man install-man1 install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-binPROGRAMS uninstall-dbeDATA \
- uninstall-man uninstall-man1 uninstall-pkglibLTLIBRARIES
+ uninstall-libLTLIBRARIES uninstall-man uninstall-man1
.PRECIOUS: Makefile
@@ -1198,11 +1199,6 @@ QLParser.tab.cc QLParser.tab.hh: QLParse
# so ensure that the necessary libraries are built at dist time.
dist-hook: $(LIBGPROFNG)
-.PHONY: install-data-local
-
-install-data-local: install-pkglibLTLIBRARIES
- rm -f $(DESTDIR)/$(pkglibdir)/*.la $(DESTDIR)/$(pkglibdir)/*.a
-
$(srcdir)/DbeSession.cc: QLParser.tab.hh
# Tell versions [3.59,3.63) of GNU make to not export all variables.

View File

@@ -0,0 +1,115 @@
From 27f59ec47a18277b6ea3548f405263ef558f5217 Mon Sep 17 00:00:00 2001
From: Jan Beulich <jbeulich@suse.com>
Date: Tue, 31 Jan 2023 09:47:22 +0100
Subject: [PATCH 26/50] RISC-V: make C-extension JAL available again for
(32-bit) assembly
Along with the normal JAL alias, the C-extension one should have been
moved as well by 839189bc932e ("RISC-V: re-arrange opcode table for
consistent alias handling"), for the assembler to actually be able to
use it where/when possible.
Since neither this nor any other compressed branch insn was being tested
so far, take the opportunity and introduce a new testcase covering those.
---
gas/config/tc-riscv.c | 3 +++
gas/testsuite/gas/riscv/c-branch-na.d | 20 ++++++++++++++++++++
gas/testsuite/gas/riscv/c-branch.d | 19 +++++++++++++++++++
gas/testsuite/gas/riscv/c-branch.s | 11 +++++++++++
opcodes/riscv-opc.c | 2 +-
5 files changed, 54 insertions(+), 1 deletion(-)
create mode 100644 gas/testsuite/gas/riscv/c-branch-na.d
create mode 100644 gas/testsuite/gas/riscv/c-branch.d
create mode 100644 gas/testsuite/gas/riscv/c-branch.s
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -2762,6 +2762,8 @@ riscv_ip (char *str, struct riscv_cl_ins
case 'p':
goto branch;
case 'a':
+ if (oparg == insn->args + 1)
+ goto jump_check_gpr;
goto jump;
case 'S': /* Floating-point RS1 x8-x15. */
if (!reg_lookup (&asarg, RCLASS_FPR, &regno)
@@ -3271,6 +3273,7 @@ riscv_ip (char *str, struct riscv_cl_ins
but the 2nd (with 2 operands) might. */
if (oparg == insn->args)
{
+ jump_check_gpr:
asargStart = asarg;
if (reg_lookup (&asarg, RCLASS_GPR, NULL)
&& (*asarg == ',' || (ISSPACE (*asarg) && asarg[1] == ',')))
--- /dev/null
+++ b/gas/testsuite/gas/riscv/c-branch-na.d
@@ -0,0 +1,20 @@
+#as: -march=rv32ic
+#source: c-branch.s
+#objdump: -drw -Mno-aliases
+
+.*:[ ]+file format .*
+
+
+Disassembly of section .text:
+
+0+ <target>:
+[ ]+[0-9a-f]+:[ ]+c001[ ]+c\.beqz[ ]+s0,0 <target>[ ]+0: R_RISCV_RVC_BRANCH .*
+[ ]+[0-9a-f]+:[ ]+dcfd[ ]+c\.beqz[ ]+s1,0 <target>[ ]+2: R_RISCV_RVC_BRANCH .*
+[ ]+[0-9a-f]+:[ ]+fc75[ ]+c\.bnez[ ]+s0,0 <target>[ ]+4: R_RISCV_RVC_BRANCH .*
+[ ]+[0-9a-f]+:[ ]+fced[ ]+c\.bnez[ ]+s1,0 <target>[ ]+6: R_RISCV_RVC_BRANCH .*
+[ ]+[0-9a-f]+:[ ]+bfe5[ ]+c\.j[ ]+0 <target>[ ]+8: R_RISCV_RVC_JUMP .*
+[ ]+[0-9a-f]+:[ ]+3fdd[ ]+c\.jal[ ]+0 <target>[ ]+a: R_RISCV_RVC_JUMP .*
+[ ]+[0-9a-f]+:[ ]+9302[ ]+c\.jalr[ ]+t1
+[ ]+[0-9a-f]+:[ ]+8382[ ]+c\.jr[ ]+t2
+[ ]+[0-9a-f]+:[ ]+8082[ ]+c\.jr[ ]+ra
+#...
--- /dev/null
+++ b/gas/testsuite/gas/riscv/c-branch.d
@@ -0,0 +1,19 @@
+#as: -march=rv64ic
+#objdump: -drw
+
+.*:[ ]+file format .*
+
+
+Disassembly of section .text:
+
+0+ <target>:
+[ ]+[0-9a-f]+:[ ]+c001[ ]+beqz[ ]+s0,0 <target>[ ]+0: R_RISCV_RVC_BRANCH .*
+[ ]+[0-9a-f]+:[ ]+dcfd[ ]+beqz[ ]+s1,0 <target>[ ]+2: R_RISCV_RVC_BRANCH .*
+[ ]+[0-9a-f]+:[ ]+fc75[ ]+bnez[ ]+s0,0 <target>[ ]+4: R_RISCV_RVC_BRANCH .*
+[ ]+[0-9a-f]+:[ ]+fced[ ]+bnez[ ]+s1,0 <target>[ ]+6: R_RISCV_RVC_BRANCH .*
+[ ]+[0-9a-f]+:[ ]+bfe5[ ]+j[ ]+0 <target>[ ]+8: R_RISCV_RVC_JUMP .*
+[ ]+[0-9a-f]+:[ ]+ff7ff0ef[ ]+jal[ ]+0 <target>[ ]+a: R_RISCV_JAL .*
+[ ]+[0-9a-f]+:[ ]+9302[ ]+jalr[ ]+t1
+[ ]+[0-9a-f]+:[ ]+8382[ ]+jr[ ]+t2
+[ ]+[0-9a-f]+:[ ]+8082[ ]+ret
+#...
--- /dev/null
+++ b/gas/testsuite/gas/riscv/c-branch.s
@@ -0,0 +1,11 @@
+ .text
+target:
+ beq x8, x0, target
+ beqz x9, target
+ bne x8, x0, target
+ bnez x9, target
+ j target
+ jal target
+ jalr x6
+ jr x7
+ ret
--- a/opcodes/riscv-opc.c
+++ b/opcodes/riscv-opc.c
@@ -340,9 +340,9 @@ const struct riscv_opcode riscv_opcodes[
{"jalr", 0, INSN_CLASS_I, "d,s,j", MATCH_JALR, MASK_JALR, match_opcode, INSN_JSR },
{"j", 0, INSN_CLASS_C, "Ca", MATCH_C_J, MASK_C_J, match_opcode, INSN_ALIAS|INSN_BRANCH },
{"j", 0, INSN_CLASS_I, "a", MATCH_JAL, MASK_JAL|MASK_RD, match_opcode, INSN_ALIAS|INSN_BRANCH },
+{"jal", 32, INSN_CLASS_C, "Ca", MATCH_C_JAL, MASK_C_JAL, match_opcode, INSN_ALIAS|INSN_JSR },
{"jal", 0, INSN_CLASS_I, "a", MATCH_JAL|(X_RA << OP_SH_RD), MASK_JAL|MASK_RD, match_opcode, INSN_ALIAS|INSN_JSR },
{"jal", 0, INSN_CLASS_I, "d,a", MATCH_JAL, MASK_JAL, match_opcode, INSN_JSR },
-{"jal", 32, INSN_CLASS_C, "Ca", MATCH_C_JAL, MASK_C_JAL, match_opcode, INSN_ALIAS|INSN_JSR },
{"call", 0, INSN_CLASS_I, "d,c", (X_T1 << OP_SH_RS1), (int) M_CALL, match_never, INSN_MACRO },
{"call", 0, INSN_CLASS_I, "c", (X_RA << OP_SH_RS1)|(X_RA << OP_SH_RD), (int) M_CALL, match_never, INSN_MACRO },
{"tail", 0, INSN_CLASS_I, "c", (X_T1 << OP_SH_RS1), (int) M_CALL, match_never, INSN_MACRO },

View File

@@ -0,0 +1,209 @@
From 3e888977f165594cf44dbe8f67e3a4960b22c11f Mon Sep 17 00:00:00 2001
From: "Guillermo E. Martinez" <guillermo.e.martinez@oracle.com>
Date: Fri, 3 Feb 2023 11:17:49 -0600
Subject: [PATCH 34/50] bpf: fix error conversion from long unsigned int to
unsigned int [-Werror=overflow]
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Regenerating BPF target using the maintainer mode emits:
.../opcodes/bpf-opc.c:57:11: error: conversion from long unsigned int to unsigned int changes value from 18446744073709486335 to 4294902015 [-Werror=overflow]
57 | 64, 64, 0xffffffffffff00ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
The use of a narrow size to handle the mask CGEN in instruction format
is causing this error. Additionally eBPF `call' instructions
constructed by expressions using symbols (BPF_PSEUDO_CALL) emits
annotations in `src' field of the instruction, used to identify BPF
target endianness.
cpu/
* bpf.cpu (define-call-insn): Remove `src' field from
instruction mask.
include/
*opcode/cge.h (CGEN_IFMT): Adjust mask bit width.
opcodes/
* bpf-opc.c: Regenerate.
(cherry picked from commit 7f6ebecd56e690012b05af0a492280765b17f186)
---
cpu/bpf.cpu | 2 +-
include/opcode/cgen.h | 2 +-
opcodes/bpf-opc.c | 54 +++++++++++++++++++++++--------------------
opcodes/cgen-dis.c | 2 +-
4 files changed, 32 insertions(+), 28 deletions(-)
--- a/cpu/bpf.cpu
+++ b/cpu/bpf.cpu
@@ -768,7 +768,7 @@
"call"
(endian-isas x-endian)
"call $disp32"
- (+ disp32 (f-offset16 0) (f-regs 0)
+ (+ disp32 (f-offset16 0) (.sym src x-endian) ((.sym f-dst x-endian) 0)
OP_CLASS_JMP OP_SRC_K OP_CODE_CALL)
(c-call VOID
"bpfbf_call" disp32 (ifield (.sym f-src x-endian)))
--- a/include/opcode/cgen.h
+++ b/include/opcode/cgen.h
@@ -914,7 +914,7 @@ typedef struct
Each insn's value is stored with the insn.
The first step in recognizing an insn for disassembly is
(opcode & mask) == value. */
- CGEN_INSN_INT mask;
+ CGEN_INSN_LGUINT mask;
#define CGEN_IFMT_MASK(ifmt) ((ifmt)->mask)
/* Instruction fields.
--- a/opcodes/bpf-opc.c
+++ b/opcodes/bpf-opc.c
@@ -50,99 +50,103 @@ static const CGEN_IFMT ifmt_empty ATTRIB
};
static const CGEN_IFMT ifmt_addile ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xfffff0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_addrle ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xffffffffffff00ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_negle ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xfffffffffffff0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_addibe ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xffff0fff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_addrbe ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xffffffffffff00ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_negbe ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xffffffffffff0fff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_endlele ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xfffff0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_endlebe ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xffff0fff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_lddwle ATTRIBUTE_UNUSED = {
- 64, 128, 0xff, { { F (F_IMM64) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 128, 0xfffff0ff, { { F (F_IMM64) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_lddwbe ATTRIBUTE_UNUSED = {
- 64, 128, 0xff, { { F (F_IMM64) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 128, 0xffff0fff, { { F (F_IMM64) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_ldabsw ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xffffffff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_ldindwle ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xffff0fff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_ldindwbe ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xfffff0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_ldxwle ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xffffffff000000ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_ldxwbe ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xffffffff000000ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_stble ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xf0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_stbbe ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xfff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_jeqile ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xf0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_jeqrle ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xffffffff000000ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_jeqibe ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xfff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_jeqrbe ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xffffffff000000ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_callle ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_CODE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xffff0fff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
+};
+
+static const CGEN_IFMT ifmt_callbe ATTRIBUTE_UNUSED = {
+ 64, 64, 0xfffff0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_ja ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_CODE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xffffffff0000ffff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_CODE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
};
static const CGEN_IFMT ifmt_exit ATTRIBUTE_UNUSED = {
- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_CODE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
+ 64, 64, 0xffffffffffffffff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_CODE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
};
#undef F
@@ -1646,7 +1650,7 @@ static const CGEN_OPCODE bpf_cgen_insn_o
{
{ 0, 0, 0, 0 },
{ { MNEM, ' ', OP (DISP32), 0 } },
- & ifmt_callle, { 0x85 }
+ & ifmt_callbe, { 0x85 }
},
/* call $dstle */
{
--- a/opcodes/cgen-dis.c
+++ b/opcodes/cgen-dis.c
@@ -39,7 +39,7 @@ static void add_insn_to_hash_chain (CG
static int
count_decodable_bits (const CGEN_INSN *insn)
{
- unsigned mask = CGEN_INSN_BASE_MASK (insn);
+ CGEN_INSN_LGUINT mask = CGEN_INSN_BASE_MASK (insn);
#if GCC_VERSION >= 3004
return __builtin_popcount (mask);
#else

View File

@@ -0,0 +1,50 @@
From e1815414077347097e5bf0d75162add955e241d9 Mon Sep 17 00:00:00 2001
From: Romain Geissler <romain.geissler@amadeus.com>
Date: Sun, 5 Feb 2023 13:56:34 +0000
Subject: [PATCH 35/50] Pass $JANSSON_LIBS and $ZSTD_LIBS to
ld-bootstrap/bootrap.exp
---
ld/Makefile.am | 1 +
ld/Makefile.in | 1 +
ld/testsuite/ld-bootstrap/bootstrap.exp | 4 ++--
3 files changed, 4 insertions(+), 2 deletions(-)
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -992,6 +992,7 @@ check-DEJAGNU: site.exp
CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" CTFLIB="$(TESTCTFLIB) $(ZLIB)" \
SFRAMELIB="$(TESTSFRAMELIB)" \
+ JANSSON_LIBS="$(JANSSON_LIBS)" ZSTD_LIBS="$(ZSTD_LIBS)" \
LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \
DO_COMPARE="`echo '$(do_compare)' | sed -e 's,\\$$,,g'`" \
$(RUNTESTFLAGS); \
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -2645,6 +2645,7 @@ check-DEJAGNU: site.exp
CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" CTFLIB="$(TESTCTFLIB) $(ZLIB)" \
SFRAMELIB="$(TESTSFRAMELIB)" \
+ JANSSON_LIBS="$(JANSSON_LIBS)" ZSTD_LIBS="$(ZSTD_LIBS)" \
LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \
DO_COMPARE="`echo '$(do_compare)' | sed -e 's,\\$$,,g'`" \
$(RUNTESTFLAGS); \
--- a/ld/testsuite/ld-bootstrap/bootstrap.exp
+++ b/ld/testsuite/ld-bootstrap/bootstrap.exp
@@ -162,13 +162,13 @@ foreach flags $test_flags {
}
if { [lindex [remote_exec build grep "-q \"HAVE_ZSTD 1\" config.h" ] 0] == 0 } then {
- set extralibs "$extralibs -lzstd"
+ set extralibs "$extralibs $ZSTD_LIBS"
}
# Check if the system's jansson library is used. If so, the object files will
# be using symbols from it, so link to it.
if { [lindex [remote_exec build grep "-q \"HAVE_JANSSON 1\" config.h" ] 0] == 0 } then {
- set extralibs "$extralibs -ljansson"
+ set extralibs "$extralibs $JANSSON_LIBS"
}
# Plugin support requires linking with libdl.

View File

@@ -0,0 +1,714 @@
From 1fc096a4c590f28e0efb1823cdca653f2db9de74 Mon Sep 17 00:00:00 2001
From: Alan Modra <amodra@gmail.com>
Date: Mon, 6 Feb 2023 10:48:59 +1030
Subject: [PATCH 36/50] Regen config files
For the version update to 2.40.0
---
bfd/configure | 20 ++++++++++----------
binutils/configure | 20 ++++++++++----------
gas/configure | 20 ++++++++++----------
gprof/configure | 20 ++++++++++----------
gprofng/configure | 20 ++++++++++----------
gprofng/doc/version.texi | 8 ++++----
gprofng/libcollector/configure | 20 ++++++++++----------
intl/configure | 3 +++
ld/configure | 20 ++++++++++----------
opcodes/configure | 20 ++++++++++----------
10 files changed, 87 insertions(+), 84 deletions(-)
--- a/bfd/configure
+++ b/bfd/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for bfd 2.40.
+# Generated by GNU Autoconf 2.69 for bfd 2.40.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='bfd'
PACKAGE_TARNAME='bfd'
-PACKAGE_VERSION='2.40'
-PACKAGE_STRING='bfd 2.40'
+PACKAGE_VERSION='2.40.0'
+PACKAGE_STRING='bfd 2.40.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1400,7 +1400,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures bfd 2.40 to adapt to many kinds of systems.
+\`configure' configures bfd 2.40.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1471,7 +1471,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of bfd 2.40:";;
+ short | recursive ) echo "Configuration of bfd 2.40.0:";;
esac
cat <<\_ACEOF
@@ -1608,7 +1608,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-bfd configure 2.40
+bfd configure 2.40.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2202,7 +2202,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by bfd $as_me 2.40, which was
+It was created by bfd $as_me 2.40.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3184,7 +3184,7 @@ fi
# Define the identity of the package.
PACKAGE='bfd'
- VERSION='2.40'
+ VERSION='2.40.0'
cat >>confdefs.h <<_ACEOF
@@ -15906,7 +15906,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by bfd $as_me 2.40, which was
+This file was extended by bfd $as_me 2.40.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -15972,7 +15972,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-bfd config.status 2.40
+bfd config.status 2.40.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
--- a/binutils/configure
+++ b/binutils/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for binutils 2.40.
+# Generated by GNU Autoconf 2.69 for binutils 2.40.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='binutils'
PACKAGE_TARNAME='binutils'
-PACKAGE_VERSION='2.40'
-PACKAGE_STRING='binutils 2.40'
+PACKAGE_VERSION='2.40.0'
+PACKAGE_STRING='binutils 2.40.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1401,7 +1401,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures binutils 2.40 to adapt to many kinds of systems.
+\`configure' configures binutils 2.40.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1472,7 +1472,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of binutils 2.40:";;
+ short | recursive ) echo "Configuration of binutils 2.40.0:";;
esac
cat <<\_ACEOF
@@ -1631,7 +1631,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-binutils configure 2.40
+binutils configure 2.40.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2099,7 +2099,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by binutils $as_me 2.40, which was
+It was created by binutils $as_me 2.40.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3081,7 +3081,7 @@ fi
# Define the identity of the package.
PACKAGE='binutils'
- VERSION='2.40'
+ VERSION='2.40.0'
cat >>confdefs.h <<_ACEOF
@@ -15326,7 +15326,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by binutils $as_me 2.40, which was
+This file was extended by binutils $as_me 2.40.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -15392,7 +15392,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-binutils config.status 2.40
+binutils config.status 2.40.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
--- a/gas/configure
+++ b/gas/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gas 2.40.
+# Generated by GNU Autoconf 2.69 for gas 2.40.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gas'
PACKAGE_TARNAME='gas'
-PACKAGE_VERSION='2.40'
-PACKAGE_STRING='gas 2.40'
+PACKAGE_VERSION='2.40.0'
+PACKAGE_STRING='gas 2.40.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1381,7 +1381,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures gas 2.40 to adapt to many kinds of systems.
+\`configure' configures gas 2.40.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1452,7 +1452,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of gas 2.40:";;
+ short | recursive ) echo "Configuration of gas 2.40.0:";;
esac
cat <<\_ACEOF
@@ -1600,7 +1600,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-gas configure 2.40
+gas configure 2.40.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2011,7 +2011,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by gas $as_me 2.40, which was
+It was created by gas $as_me 2.40.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2990,7 +2990,7 @@ fi
# Define the identity of the package.
PACKAGE='gas'
- VERSION='2.40'
+ VERSION='2.40.0'
cat >>confdefs.h <<_ACEOF
@@ -14910,7 +14910,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by gas $as_me 2.40, which was
+This file was extended by gas $as_me 2.40.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -14976,7 +14976,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-gas config.status 2.40
+gas config.status 2.40.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
--- a/gprof/configure
+++ b/gprof/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gprof 2.40.
+# Generated by GNU Autoconf 2.69 for gprof 2.40.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gprof'
PACKAGE_TARNAME='gprof'
-PACKAGE_VERSION='2.40'
-PACKAGE_STRING='gprof 2.40'
+PACKAGE_VERSION='2.40.0'
+PACKAGE_STRING='gprof 2.40.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1338,7 +1338,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures gprof 2.40 to adapt to many kinds of systems.
+\`configure' configures gprof 2.40.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1409,7 +1409,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of gprof 2.40:";;
+ short | recursive ) echo "Configuration of gprof 2.40.0:";;
esac
cat <<\_ACEOF
@@ -1520,7 +1520,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-gprof configure 2.40
+gprof configure 2.40.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1885,7 +1885,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by gprof $as_me 2.40, which was
+It was created by gprof $as_me 2.40.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2864,7 +2864,7 @@ fi
# Define the identity of the package.
PACKAGE='gprof'
- VERSION='2.40'
+ VERSION='2.40.0'
cat >>confdefs.h <<_ACEOF
@@ -12572,7 +12572,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by gprof $as_me 2.40, which was
+This file was extended by gprof $as_me 2.40.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -12638,7 +12638,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-gprof config.status 2.40
+gprof config.status 2.40.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
--- a/gprofng/configure
+++ b/gprofng/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gprofng 2.40.
+# Generated by GNU Autoconf 2.69 for gprofng 2.40.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gprofng'
PACKAGE_TARNAME='gprofng'
-PACKAGE_VERSION='2.40'
-PACKAGE_STRING='gprofng 2.40'
+PACKAGE_VERSION='2.40.0'
+PACKAGE_STRING='gprofng 2.40.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1364,7 +1364,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures gprofng 2.40 to adapt to many kinds of systems.
+\`configure' configures gprofng 2.40.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1435,7 +1435,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of gprofng 2.40:";;
+ short | recursive ) echo "Configuration of gprofng 2.40.0:";;
esac
cat <<\_ACEOF
@@ -1549,7 +1549,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-gprofng configure 2.40
+gprofng configure 2.40.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2081,7 +2081,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by gprofng $as_me 2.40, which was
+It was created by gprofng $as_me 2.40.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3054,7 +3054,7 @@ fi
# Define the identity of the package.
PACKAGE='gprofng'
- VERSION='2.40'
+ VERSION='2.40.0'
cat >>confdefs.h <<_ACEOF
@@ -17528,7 +17528,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by gprofng $as_me 2.40, which was
+This file was extended by gprofng $as_me 2.40.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -17594,7 +17594,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-gprofng config.status 2.40
+gprofng config.status 2.40.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
--- a/gprofng/doc/version.texi
+++ b/gprofng/doc/version.texi
@@ -1,4 +1,4 @@
-@set UPDATED 5 January 2023
-@set UPDATED-MONTH January 2023
-@set EDITION 2.40
-@set VERSION 2.40
+@set UPDATED 1 February 2023
+@set UPDATED-MONTH February 2023
+@set EDITION 2.40.0
+@set VERSION 2.40.0
--- a/gprofng/libcollector/configure
+++ b/gprofng/libcollector/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gprofng 2.40.
+# Generated by GNU Autoconf 2.69 for gprofng 2.40.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gprofng'
PACKAGE_TARNAME='gprofng'
-PACKAGE_VERSION='2.40'
-PACKAGE_STRING='gprofng 2.40'
+PACKAGE_VERSION='2.40.0'
+PACKAGE_STRING='gprofng 2.40.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1325,7 +1325,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures gprofng 2.40 to adapt to many kinds of systems.
+\`configure' configures gprofng 2.40.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1396,7 +1396,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of gprofng 2.40:";;
+ short | recursive ) echo "Configuration of gprofng 2.40.0:";;
esac
cat <<\_ACEOF
@@ -1505,7 +1505,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-gprofng configure 2.40
+gprofng configure 2.40.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1991,7 +1991,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by gprofng $as_me 2.40, which was
+It was created by gprofng $as_me 2.40.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2968,7 +2968,7 @@ fi
# Define the identity of the package.
PACKAGE='gprofng'
- VERSION='2.40'
+ VERSION='2.40.0'
cat >>confdefs.h <<_ACEOF
@@ -16098,7 +16098,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by gprofng $as_me 2.40, which was
+This file was extended by gprofng $as_me 2.40.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -16164,7 +16164,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-gprofng config.status 2.40
+gprofng config.status 2.40.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
--- a/intl/configure
+++ b/intl/configure
@@ -6857,6 +6857,9 @@ case "${host}" in
# sets the default TLS model and affects inlining.
PICFLAG=-fPIC
;;
+ loongarch*-*-*)
+ PICFLAG=-fpic
+ ;;
mips-sgi-irix6*)
# PIC is the default.
;;
--- a/ld/configure
+++ b/ld/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for ld 2.40.
+# Generated by GNU Autoconf 2.69 for ld 2.40.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ld'
PACKAGE_TARNAME='ld'
-PACKAGE_VERSION='2.40'
-PACKAGE_STRING='ld 2.40'
+PACKAGE_VERSION='2.40.0'
+PACKAGE_STRING='ld 2.40.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1423,7 +1423,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures ld 2.40 to adapt to many kinds of systems.
+\`configure' configures ld 2.40.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1494,7 +1494,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of ld 2.40:";;
+ short | recursive ) echo "Configuration of ld 2.40.0:";;
esac
cat <<\_ACEOF
@@ -1661,7 +1661,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-ld configure 2.40
+ld configure 2.40.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2376,7 +2376,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by ld $as_me 2.40, which was
+It was created by ld $as_me 2.40.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3359,7 +3359,7 @@ fi
# Define the identity of the package.
PACKAGE='ld'
- VERSION='2.40'
+ VERSION='2.40.0'
cat >>confdefs.h <<_ACEOF
@@ -18083,7 +18083,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by ld $as_me 2.40, which was
+This file was extended by ld $as_me 2.40.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -18149,7 +18149,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-ld config.status 2.40
+ld config.status 2.40.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
--- a/opcodes/configure
+++ b/opcodes/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for opcodes 2.40.
+# Generated by GNU Autoconf 2.69 for opcodes 2.40.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='opcodes'
PACKAGE_TARNAME='opcodes'
-PACKAGE_VERSION='2.40'
-PACKAGE_STRING='opcodes 2.40'
+PACKAGE_VERSION='2.40.0'
+PACKAGE_STRING='opcodes 2.40.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1360,7 +1360,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures opcodes 2.40 to adapt to many kinds of systems.
+\`configure' configures opcodes 2.40.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1431,7 +1431,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of opcodes 2.40:";;
+ short | recursive ) echo "Configuration of opcodes 2.40.0:";;
esac
cat <<\_ACEOF
@@ -1545,7 +1545,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-opcodes configure 2.40
+opcodes configure 2.40.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2139,7 +2139,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by opcodes $as_me 2.40, which was
+It was created by opcodes $as_me 2.40.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3118,7 +3118,7 @@ fi
# Define the identity of the package.
PACKAGE='opcodes'
- VERSION='2.40'
+ VERSION='2.40.0'
cat >>confdefs.h <<_ACEOF
@@ -13191,7 +13191,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by opcodes $as_me 2.40, which was
+This file was extended by opcodes $as_me 2.40.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -13257,7 +13257,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-opcodes config.status 2.40
+opcodes config.status 2.40.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@@ -0,0 +1,51 @@
From 17294931e3e361bee6810b1a39493e214b38c5e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= <chigot@adacore.com>
Date: Tue, 3 Jan 2023 14:24:43 +0100
Subject: [PATCH 40/50] configure: remove dependencies on gmp and mpfr when gdb
is disabled
Since 991180627851801f1999d1ebbc0e569a17e47c74, the configure checks
about GMP and MPFR for gdb builds have been moved to the toplevel
configure.
However, it doesn't take into account the --disable-gdb option. Meaning
that a build without gdb will require these libraries even if not
needed.
ChangeLog:
* configure.ac: Skip GMP and MPFR when --disable-gdb is
provided.
* configure: Regenerate.
(cherry picked from commit 5fb0e308577143ceb313fde5538dc9ecb038f29f)
---
configure | 4 +++-
configure.ac | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
--- a/configure
+++ b/configure
@@ -8032,7 +8032,9 @@ if test -d ${srcdir}/gcc ; then
require_mpc=yes
fi
if test -d ${srcdir}/gdb ; then
- require_gmp=yes
+ if test "x$enable_gdb" != xno; then
+ require_gmp=yes
+ fi
fi
gmplibs="-lmpfr -lgmp"
--- a/configure.ac
+++ b/configure.ac
@@ -1585,7 +1585,9 @@ if test -d ${srcdir}/gcc ; then
require_mpc=yes
fi
if test -d ${srcdir}/gdb ; then
- require_gmp=yes
+ if test "x$enable_gdb" != xno; then
+ require_gmp=yes
+ fi
fi
gmplibs="-lmpfr -lgmp"

View File

@@ -0,0 +1,46 @@
From b2bc62b7b4e7638c3a249d2d2728ceb4d5f2b22c Mon Sep 17 00:00:00 2001
From: Jan Beulich <jbeulich@suse.com>
Date: Tue, 14 Feb 2023 08:35:02 +0100
Subject: [PATCH 46/50] gas: correct symbol name comparison in
.startof./.sizeof. handling
In 162c6aef1f3a ("gas: fold symbol table entries generated for
.startof.() / .sizeof.()") I screwed up quite badly, inverting the case
sensitive and case insensitive comparison functions.
---
gas/expr.c | 4 ++--
gas/testsuite/gas/elf/startof.d | 2 ++
gas/testsuite/gas/elf/startof.s | 3 +++
3 files changed, 7 insertions(+), 2 deletions(-)
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -149,8 +149,8 @@ symbol_lookup_or_make (const char *name,
name = S_GET_NAME (symbolP);
if ((symbols_case_sensitive
- ? strcasecmp (buf, name)
- : strcmp (buf, name)) == 0)
+ ? strcmp (buf, name)
+ : strcasecmp (buf, name)) == 0)
{
free (buf);
return symbolP;
--- a/gas/testsuite/gas/elf/startof.d
+++ b/gas/testsuite/gas/elf/startof.d
@@ -7,4 +7,6 @@ Symbol table .*
#...
[1-8]: 0+ .* UND \.startof\.\.text
[2-9]: 0+ .* UND \.sizeof\.\.text
+ +[1-9][0-9]*: 0+ .* UND \.startof\.\.Text
+ +[1-9][0-9]*: 0+ .* UND \.sizeof\.\.TEXT
#pass
--- a/gas/testsuite/gas/elf/startof.s
+++ b/gas/testsuite/gas/elf/startof.s
@@ -4,3 +4,6 @@
.dc.a 0
.dc.a .sizeof.(.text)
.dc.a .startof.(.text)
+ .dc.a 0
+ .dc.a .startof.(.Text)
+ .dc.a .sizeof.(.TEXT)

View File

@@ -0,0 +1,22 @@
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -50,7 +50,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)
EMUL = @EMUL@
EMULATION_OFILES = @EMULATION_OFILES@
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -573,7 +573,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

View File

@@ -0,0 +1,18 @@
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -8119,6 +8119,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)))
@@ -8131,6 +8132,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)
{

View File

@@ -0,0 +1,38 @@
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -944,12 +944,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
@@ -585,12 +585,12 @@ mips*-*-vxworks*) targ_emul=elf32ebmipvx
;;
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

View File

@@ -0,0 +1,218 @@
From 3c6c32951e292a51ede70b8087bb0308d7dbc4fc Mon Sep 17 00:00:00 2001
From: Alan Modra <amodra@gmail.com>
Date: Thu, 28 Mar 2024 20:33:32 +1030
Subject: [PATCH 2/2] PR 30569, delete _bfd_mips_elf_early_size_sections
PR30569 was triggered by a patch of mine 6540edd52cc0 moving the call
to always_size_sections in bfd_elf_size_dynamic_sections earlier, made
to support the x86 DT_RELR implementation. This broke mips16 code
handling stubs when --export-dynamic is passed to the linker, because
numerous symbols then became dynamic after always_size_sections. The
mips backend fiddles with symbols in its always_size_sections. Maciej
in 902e9fc76a0e had moved the call to always_size_sections to after
the export-dynamic code. Prior to that, Nathan in 04c3a75556c0 moved
it before the exec stack code, back to the start of
bfd_elf_size_dynamic_sections which was where Ian put it originally
in ff12f303355b. So the call has moved around a little. I'm leaving
it where it is, and instead calling mips_elf_check_symbols from
late_size_sections (the old size_dynamic_sections) which is now always
called. In fact, the whole of _bfd_mips_elf_early_size_sections can
be merged into _bfd_mips_elf_late_size_sections.
---
bfd/elf32-mips.c | 1 -
bfd/elf64-mips.c | 2 --
bfd/elfn32-mips.c | 1 -
bfd/elfxx-mips.c | 84 +++++++++++++++++++----------------------------
bfd/elfxx-mips.h | 2 --
5 files changed, 34 insertions(+), 56 deletions(-)
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -2537,7 +2537,6 @@ static const struct ecoff_debug_swap mip
#define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag
#define elf_backend_adjust_dynamic_symbol \
_bfd_mips_elf_adjust_dynamic_symbol
-#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections
#define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_relocate_section _bfd_mips_elf_relocate_section
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -4748,8 +4748,6 @@ const struct elf_size_info mips_elf64_si
#define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag
#define elf_backend_adjust_dynamic_symbol \
_bfd_mips_elf_adjust_dynamic_symbol
-#define elf_backend_early_size_sections \
- _bfd_mips_elf_early_size_sections
#define elf_backend_late_size_sections \
_bfd_mips_elf_late_size_sections
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
--- a/bfd/elfn32-mips.c
+++ b/bfd/elfn32-mips.c
@@ -4138,7 +4138,6 @@ static const struct ecoff_debug_swap mip
#define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag
#define elf_backend_adjust_dynamic_symbol \
_bfd_mips_elf_adjust_dynamic_symbol
-#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections
#define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_relocate_section _bfd_mips_elf_relocate_section
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -9644,48 +9644,6 @@ _bfd_mips_elf_adjust_dynamic_symbol (str
return _bfd_elf_adjust_dynamic_copy (info, h, s);
}
-/* This function is called after all the input files have been read,
- and the input sections have been assigned to output sections. We
- check for any mips16 stub sections that we can discard. */
-
-bool
-_bfd_mips_elf_early_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
-{
- asection *sect;
- struct mips_elf_link_hash_table *htab;
- struct mips_htab_traverse_info hti;
-
- htab = mips_elf_hash_table (info);
- BFD_ASSERT (htab != NULL);
-
- /* The .reginfo section has a fixed size. */
- sect = bfd_get_section_by_name (output_bfd, ".reginfo");
- if (sect != NULL)
- {
- bfd_set_section_size (sect, sizeof (Elf32_External_RegInfo));
- sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
- }
-
- /* The .MIPS.abiflags section has a fixed size. */
- sect = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags");
- if (sect != NULL)
- {
- bfd_set_section_size (sect, sizeof (Elf_External_ABIFlags_v0));
- sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
- }
-
- hti.info = info;
- hti.output_bfd = output_bfd;
- hti.error = false;
- mips_elf_link_hash_traverse (mips_elf_hash_table (info),
- mips_elf_check_symbols, &hti);
- if (hti.error)
- return false;
-
- return true;
-}
-
/* If the link uses a GOT, lay it out and work out its size. */
static bool
@@ -9990,7 +9948,8 @@ mips_elf_set_plt_sym_value (struct mips_
return true;
}
-/* Set the sizes of the dynamic sections. */
+/* Set the sizes of the dynamic sections, some mips non-dynamic sections,
+ and check for any mips16 stub sections that we can discard. */
bool
_bfd_mips_elf_late_size_sections (bfd *output_bfd,
@@ -10000,14 +9959,39 @@ _bfd_mips_elf_late_size_sections (bfd *o
asection *s, *sreldyn;
bool reltext;
struct mips_elf_link_hash_table *htab;
+ struct mips_htab_traverse_info hti;
htab = mips_elf_hash_table (info);
BFD_ASSERT (htab != NULL);
- dynobj = elf_hash_table (info)->dynobj;
+
+ /* The .reginfo section has a fixed size. */
+ s = bfd_get_section_by_name (output_bfd, ".reginfo");
+ if (s != NULL)
+ {
+ bfd_set_section_size (s, sizeof (Elf32_External_RegInfo));
+ s->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
+ }
+
+ /* The .MIPS.abiflags section has a fixed size. */
+ s = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags");
+ if (s != NULL)
+ {
+ bfd_set_section_size (s, sizeof (Elf_External_ABIFlags_v0));
+ s->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
+ }
+
+ hti.info = info;
+ hti.output_bfd = output_bfd;
+ hti.error = false;
+ mips_elf_link_hash_traverse (htab, mips_elf_check_symbols, &hti);
+ if (hti.error)
+ return false;
+
+ dynobj = htab->root.dynobj;
if (dynobj == NULL)
return true;
- if (elf_hash_table (info)->dynamic_sections_created)
+ if (htab->root.dynamic_sections_created)
{
/* Set the contents of the .interp section to the interpreter. */
if (bfd_link_executable (info) && !info->nointerp)
@@ -10147,7 +10131,7 @@ _bfd_mips_elf_late_size_sections (bfd *o
}
}
else if (bfd_link_executable (info)
- && ! mips_elf_hash_table (info)->use_rld_obj_head
+ && !htab->use_rld_obj_head
&& startswith (name, ".rld_map"))
{
/* We add a room for __rld_map. It will be filled in by the
@@ -10156,7 +10140,7 @@ _bfd_mips_elf_late_size_sections (bfd *o
}
else if (SGI_COMPAT (output_bfd)
&& startswith (name, ".compact_rel"))
- s->size += mips_elf_hash_table (info)->compact_rel_size;
+ s->size += htab->compact_rel_size;
else if (s == htab->root.splt)
{
/* If the last PLT entry has a branch delay slot, allocate
@@ -10196,7 +10180,7 @@ _bfd_mips_elf_late_size_sections (bfd *o
}
}
- if (elf_hash_table (info)->dynamic_sections_created)
+ if (htab->root.dynamic_sections_created)
{
/* Add some entries to the .dynamic section. We fill in the
values later, in _bfd_mips_elf_finish_dynamic_sections, but we
@@ -14939,7 +14923,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str
input_section->flags &= ~SEC_HAS_CONTENTS;
}
- /* Size has been set in _bfd_mips_elf_early_size_sections. */
+ /* Size has been set in _bfd_mips_elf_late_size_sections. */
BFD_ASSERT(o->size == sizeof (Elf_External_ABIFlags_v0));
/* Skip this section later on (I don't think this currently
@@ -14998,7 +14982,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str
input_section->flags &= ~SEC_HAS_CONTENTS;
}
- /* Size has been set in _bfd_mips_elf_early_size_sections. */
+ /* Size has been set in _bfd_mips_elf_late_size_sections. */
BFD_ASSERT(o->size == sizeof (Elf32_External_RegInfo));
/* Skip this section later on (I don't think this currently
--- a/bfd/elfxx-mips.h
+++ b/bfd/elfxx-mips.h
@@ -67,8 +67,6 @@ extern bool _bfd_mips_elf_check_relocs
(bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
extern bool _bfd_mips_elf_adjust_dynamic_symbol
(struct bfd_link_info *, struct elf_link_hash_entry *);
-extern bool _bfd_mips_elf_early_size_sections
- (bfd *, struct bfd_link_info *);
extern bool _bfd_mips_elf_late_size_sections
(bfd *, struct bfd_link_info *);
extern int _bfd_mips_elf_relocate_section

View File

@@ -0,0 +1,22 @@
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -50,7 +50,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CFLAGS)
# 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
@@ -583,7 +583,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CFLAGS)
# 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

View File

@@ -0,0 +1,18 @@
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -8149,6 +8149,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)))
@@ -8161,6 +8162,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)
{

View File

@@ -0,0 +1,48 @@
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -962,8 +962,8 @@ case "${targ}" in
want64=true
;;
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*-gnuabi64)
targ_defvec=mips_elf64_trad_be_vec
@@ -971,8 +971,8 @@ case "${targ}" in
want64=true
;;
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
@@ -597,8 +597,8 @@ mips64*el-*-linux-gnuabi64)
targ_extra_emuls="elf64btsmip elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip"
targ_extra_libpath=$targ_extra_emuls
;;
-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-gnuabi64)
@@ -606,8 +606,8 @@ mips64*-*-linux-gnuabi64)
targ_extra_emuls="elf64ltsmip elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip"
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

View File

@@ -0,0 +1,22 @@
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -50,7 +50,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CFLAGS)
# 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
@@ -583,7 +583,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CFLAGS)
# 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

View File

@@ -0,0 +1,18 @@
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -8161,6 +8161,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)))
@@ -8173,6 +8174,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)
{

View File

@@ -0,0 +1,48 @@
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -962,8 +962,8 @@ case "${targ}" in
want64=true
;;
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*-gnuabi64)
targ_defvec=mips_elf64_trad_be_vec
@@ -971,8 +971,8 @@ case "${targ}" in
want64=true
;;
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
@@ -597,8 +597,8 @@ mips64*el-*-linux-gnuabi64)
targ_extra_emuls="elf64btsmip elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip"
targ_extra_libpath=$targ_extra_emuls
;;
-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-gnuabi64)
@@ -606,8 +606,8 @@ mips64*-*-linux-gnuabi64)
targ_extra_emuls="elf64ltsmip elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip"
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

1
toolchain/build_version Normal file
View File

@@ -0,0 +1 @@
1

View File

@@ -0,0 +1,30 @@
#
# 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.1
PKG_RELEASE=3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/jvoisin/$(PKG_NAME).git
PKG_SOURCE_DATE:=2019-04-14
PKG_SOURCE_VERSION:=e3fee64643279c144efd3d6856ed4e818c0d5ca2
PKG_MIRROR_HASH:=f2ce18b031aecbf43d18142941ece7c90691a8b4e96fbb1d5af94f24e5572dad
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))

View File

@@ -0,0 +1,11 @@
--- a/include/poll.h
+++ b/include/poll.h
@@ -39,7 +39,7 @@ _FORTIFY_FN(poll) int poll(struct pollfd
return __orig_poll(__f, __n, __s);
}
-#ifdef _GNU_SOURCE
+#if defined(_GNU_SOURCE) && !(defined(_REDIR_TIME64) && _REDIR_TIME64)
#undef ppoll
_FORTIFY_FN(ppoll) int ppoll(struct pollfd *__f, nfds_t __n, const struct timespec *__s,
const sigset_t *__m)

View File

@@ -0,0 +1,24 @@
From 9ee4b9bd8df55ebbd5f6426fda4a36e1958b64c5 Mon Sep 17 00:00:00 2001
From: Matthias Van Parys <matthias.vanparys@softathome.com>
Date: Mon, 10 Jul 2023 14:31:05 +0200
Subject: [PATCH] strings.h: Add __extension__ mark to include_next to silence
-pedantic
Add __extension__ before #include-next in strings.h as was done for all other header files in commits
7fd984fcb532be01f68cddc194c09a7ca10c1ea6 and a9ffac8596b094da8563aa5dd5d81c946670afe
---
include/strings.h | 3 +++
1 file changed, 3 insertions(+)
--- a/include/strings.h
+++ b/include/strings.h
@@ -16,6 +16,9 @@
#ifndef _FORTIFY_STRINGS_H
#define _FORTIFY_STRINGS_H
+#ifndef __cplusplus
+__extension__
+#endif
#include_next <strings.h>
#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0

64
toolchain/gcc/Config.in Normal file
View File

@@ -0,0 +1,64 @@
# Choose gcc version.
choice
prompt "GCC compiler Version" if TOOLCHAINOPTS
default GCC_USE_VERSION_13
help
Select the version of gcc you wish to use.
config GCC_USE_VERSION_11
bool "gcc 11.x"
config GCC_USE_VERSION_12
bool "gcc 12.x"
config GCC_USE_VERSION_13
bool "gcc 13.x"
config GCC_USE_VERSION_14
bool "gcc 14.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
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
help
Use gcc configure option --enable-default-ssp to turn on -fstack-protector-strong by default.
config SJLJ_EXCEPTIONS
bool
prompt "Use setjump()/longjump() exceptions" if TOOLCHAINOPTS
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
help
Build/install GNU fortran compiler ?
config INSTALL_GCCGO
bool
prompt "Build/install Go compiler?" if TOOLCHAINOPTS
depends on USE_GLIBC || BROKEN
help
Build/install GNU gccgo compiler ?

View File

@@ -0,0 +1,24 @@
config GCC_VERSION_11
default y if GCC_USE_VERSION_11
bool
config GCC_VERSION_12
default y if GCC_USE_VERSION_12
bool
config GCC_VERSION_14
default y if GCC_USE_VERSION_14
bool
config GCC_VERSION
string
default EXTERNAL_GCC_VERSION if EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
default "11.3.0" if GCC_VERSION_11
default "12.3.0" if GCC_VERSION_12
default "14.2.0" if GCC_VERSION_14
default "13.3.0"
config GCC_USE_DEFAULT_VERSION
bool
default y if !TOOLCHAINOPTS || GCC_USE_VERSION_13
imply KERNEL_WERROR

238
toolchain/gcc/common.mk Normal file
View File

@@ -0,0 +1,238 @@
#
# 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_MAJOR_VERSION:=$(word 1,$(subst ., ,$(PKG_VERSION)))
GCC_DIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_CPE_ID:=cpe:/a:gnu:gcc
ifeq ($(PKG_VERSION),11.3.0)
PKG_HASH:=b47cf2818691f5b1e21df2bb38c795fac2cfbd640ede2d0a5e1c89e338a3ac39
endif
ifeq ($(PKG_VERSION),12.3.0)
PKG_HASH:=949a5d4f99e786421a93b532b22ffab5578de7321369975b91aec97adfda8c3b
endif
ifeq ($(PKG_VERSION),13.3.0)
PKG_HASH:=0845e9621c9543a13f484e94584a49ffc0129970e9914624235fc1d061a0c083
endif
ifeq ($(PKG_VERSION),14.2.0)
PKG_HASH:=a7b39bc69cbf9e25826c5a60ab26477001f7c08d85cec04bc0e29cabed6f3cc9
endif
PATCH_DIR=../patches-$(GCC_MAJOR_VERSION).x
BUGURL=http://bugs.openwrt.org/
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
# this needs to be without -L/-lzstd flags or other parts fail to build
# use an absolute path to ensure it really picks up our version
export ac_cv_search_ZSTD_compress=$(STAGING_DIR_HOST)/lib/libzstd.a -pthread
export libgcc_cv_fixed_point=no
ifdef CONFIG_INSTALL_GCCGO
export libgo_cv_c_split_stack_supported=no
endif
ifdef CONFIG_GCC_USE_GRAPHITE
GRAPHITE_CONFIGURE:= --with-isl=$(STAGING_DIR_HOST)
else
GRAPHITE_CONFIGURE:= --without-isl --without-cloog
endif
GCC_CONFIGURE:= \
SHELL="$(BASH)" \
$(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 \
--disable-libssp \
$(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)) \
$(if $(CONFIG_powerpc64), $(if $(CONFIG_USE_MUSL),--with-abi=elfv2)) \
--with-system-zlib=$(STAGING_DIR_HOST) \
--with-zstd=$(STAGING_DIR_HOST) \
--with-gmp=$(STAGING_DIR_HOST) \
--with-mpfr=$(STAGING_DIR_HOST) \
--with-mpc=$(STAGING_DIR_HOST) \
--disable-decimal-float \
--with-diagnostics-color=auto-if-env \
--enable-__cxa_atexit \
--enable-libstdcxx-dual-abi \
--with-default-libstdcxx-abi=new
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_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
ifneq ($(GCC_ARCH),)
GCC_CONFIGURE+= --with-arch=$(GCC_ARCH)
endif
ifeq ($(CONFIG_arm),y)
GCC_CONFIGURE+= \
--with-cpu=$(word 1, $(subst +," ,$(CONFIG_CPU_TYPE)))
ifneq ($(CONFIG_SOFT_FLOAT),y)
GCC_CONFIGURE+= \
--with-fpu=$(word 2, $(subst +, ",$(CONFIG_CPU_TYPE))) \
--with-float=hard
endif
# Do not let TARGET_CFLAGS get poisoned by extra CPU optimization flags
# that do not belong here. The cpu,fpu type should be specified via
# --with-cpu and --with-fpu for ARM and not CFLAGS.
TARGET_CFLAGS:=$(filter-out -m%,$(call qstrip,$(TARGET_CFLAGS)))
endif
ifeq ($(CONFIG_TARGET_x86)$(CONFIG_USE_GLIBC)$(CONFIG_INSTALL_GCCGO),yyy)
TARGET_CFLAGS+=-fno-split-stack
endif
CFLAGS:=$(HOST_CFLAGS) -pipe
ifneq ($(shell gcc --version 2>&1 | grep -E "Apple.(LLVM|clang)"),)
CFLAGS+= -fbracket-depth=512
endif
GCC_CONFIGURE+= \
CFLAGS="$(CFLAGS)" \
CXXFLAGS="$(CFLAGS)" \
CFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
GOCFLAGS_FOR_TARGET="$(TARGET_CFLAGS)"
GCC_MAKE:= \
export SHELL="$(BASH)"; \
$(MAKE)
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
ifeq ($(GCC_MAJOR_VERSION),11)
GCC_VERSION_FILE:=gcc/version.c
else
GCC_VERSION_FILE:=gcc/genversion.cc
endif
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_FILE)
$(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

View File

@@ -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*

View File

@@ -0,0 +1,3 @@
#!/bin/sh
exec @CC_BASE@ @EXTRA_ARCH_OPTS@ "$@"

View File

@@ -0,0 +1,91 @@
GCC_VARIANT:=final
include ../common.mk
GCC_CONFIGURE += \
--with-headers=$(TOOLCHAIN_DIR)/include \
--enable-languages=$(TARGET_LANGUAGES) \
--enable-shared \
--enable-threads \
--with-slibdir=$(TOOLCHAIN_DIR)/lib \
--enable-plugins \
--enable-lto \
--with-libelf=$(STAGING_DIR_HOST)
ifndef CONFIG_USE_GLIBC
GCC_CONFIGURE += --disable-libsanitizer
endif
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))

View File

@@ -0,0 +1,28 @@
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) \
install-gcc \
install-target-libgcc
$(call FixupLibdir,$(TOOLCHAIN_DIR))
endef
$(eval $(call HostBuild))

View File

@@ -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))

View File

@@ -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
@@ -44,11 +44,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)

View File

@@ -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
@@ -3348,18 +3348,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)

View File

@@ -0,0 +1,46 @@
From ea650cae26da4a8fc04f0c4666f4dd776d0b5fc0 Mon Sep 17 00:00:00 2001
From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Date: Sun, 14 Nov 2021 21:54:25 -0800
Subject: [PATCH] configure: define TARGET_LIBC_GNUSTACK on musl
musl only uses PT_GNU_STACK to set default thread stack size and has no
executable stack support[0], so there is no reason not to emit the
.note.GNU-stack section on musl builds.
[0]: https://lore.kernel.org/all/20190423192534.GN23599@brightrain.aerifal.cx/T/#u
gcc/ChangeLog:
* configure: Regenerate.
* configure.ac: define TARGET_LIBC_GNUSTACK on musl
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
---
gcc/configure | 3 +++
gcc/configure.ac | 3 +++
2 files changed, 6 insertions(+)
--- a/gcc/configure
+++ b/gcc/configure
@@ -31533,6 +31533,9 @@ fi
# Check if the target LIBC handles PT_GNU_STACK.
gcc_cv_libc_gnustack=unknown
case "$target" in
+ mips*-*-linux-musl*)
+ gcc_cv_libc_gnustack=yes
+ ;;
mips*-*-linux*)
if test $glibc_version_major -gt 2 \
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7023,6 +7023,9 @@ fi
# Check if the target LIBC handles PT_GNU_STACK.
gcc_cv_libc_gnustack=unknown
case "$target" in
+ mips*-*-linux-musl*)
+ gcc_cv_libc_gnustack=yes
+ ;;
mips*-*-linux*)
GCC_GLIBC_VERSION_GTE_IFELSE([2], [31], [gcc_cv_libc_gnustack=yes], )
;;

View File

@@ -0,0 +1,139 @@
From 9970b576b7e4ae337af1268395ff221348c4b34a Mon Sep 17 00:00:00 2001
From: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Date: Thu, 7 Mar 2024 14:36:03 +0100
Subject: [PATCH] Include safe-ctype.h after C++ standard headers, to avoid
over-poisoning
When building gcc's C++ sources against recent libc++, the poisoning of
the ctype macros due to including safe-ctype.h before including C++
standard headers such as <list>, <map>, etc, causes many compilation
errors, similar to:
In file included from /home/dim/src/gcc/master/gcc/gensupport.cc:23:
In file included from /home/dim/src/gcc/master/gcc/system.h:233:
In file included from /usr/include/c++/v1/vector:321:
In file included from
/usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from
/usr/include/c++/v1/__format/formatter_integral.h:32:
In file included from /usr/include/c++/v1/locale:202:
/usr/include/c++/v1/__locale:546:5: error: '__abi_tag__' attribute
only applies to structs, variables, functions, and namespaces
546 | _LIBCPP_INLINE_VISIBILITY
| ^
/usr/include/c++/v1/__config:813:37: note: expanded from macro
'_LIBCPP_INLINE_VISIBILITY'
813 | # define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
| ^
/usr/include/c++/v1/__config:792:26: note: expanded from macro
'_LIBCPP_HIDE_FROM_ABI'
792 |
__attribute__((__abi_tag__(_LIBCPP_TOSTRING(
_LIBCPP_VERSIONED_IDENTIFIER))))
| ^
In file included from /home/dim/src/gcc/master/gcc/gensupport.cc:23:
In file included from /home/dim/src/gcc/master/gcc/system.h:233:
In file included from /usr/include/c++/v1/vector:321:
In file included from
/usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from
/usr/include/c++/v1/__format/formatter_integral.h:32:
In file included from /usr/include/c++/v1/locale:202:
/usr/include/c++/v1/__locale:547:37: error: expected ';' at end of
declaration list
547 | char_type toupper(char_type __c) const
| ^
/usr/include/c++/v1/__locale:553:48: error: too many arguments
provided to function-like macro invocation
553 | const char_type* toupper(char_type* __low, const
char_type* __high) const
| ^
/home/dim/src/gcc/master/gcc/../include/safe-ctype.h:146:9: note:
macro 'toupper' defined here
146 | #define toupper(c) do_not_use_toupper_with_safe_ctype
| ^
This is because libc++ uses different transitive includes than
libstdc++, and some of those transitive includes pull in various ctype
declarations (typically via <locale>).
There was already a special case for including <string> before
safe-ctype.h, so move the rest of the C++ standard header includes to
the same location, to fix the problem.
gcc/ChangeLog:
* system.h: Include safe-ctype.h after C++ standard headers.
Signed-off-by: Dimitry Andric <dimitry@andric.com>
---
gcc/system.h | 39 ++++++++++++++++++---------------------
1 file changed, 18 insertions(+), 21 deletions(-)
diff --git a/gcc/system.h b/gcc/system.h
index b0edab02885..ab29fc19776 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -194,27 +194,8 @@ extern int fprintf_unlocked (FILE *, const char *, ...);
#undef fread_unlocked
#undef fwrite_unlocked
-/* Include <string> before "safe-ctype.h" to avoid GCC poisoning
- the ctype macros through safe-ctype.h */
-
-#ifdef __cplusplus
-#ifdef INCLUDE_STRING
-# include <string>
-#endif
-#endif
-
-/* There are an extraordinary number of issues with <ctype.h>.
- The last straw is that it varies with the locale. Use libiberty's
- replacement instead. */
-#include "safe-ctype.h"
-
-#include <sys/types.h>
-
-#include <errno.h>
-
-#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
-extern int errno;
-#endif
+/* Include C++ standard headers before "safe-ctype.h" to avoid GCC
+ poisoning the ctype macros through safe-ctype.h */
#ifdef __cplusplus
#if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
@@ -229,6 +210,9 @@ extern int errno;
#ifdef INCLUDE_SET
# include <set>
#endif
+#ifdef INCLUDE_STRING
+# include <string>
+#endif
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
@@ -244,6 +228,19 @@ extern int errno;
# include <type_traits>
#endif
+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. */
+#include "safe-ctype.h"
+
+#include <sys/types.h>
+
+#include <errno.h>
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
+#endif
+
/* Some of glibc's string inlines cause warnings. Plus we'd rather
rely on (and therefore test) GCC's string builtins. */
#define __NO_STRING_INLINES
--
2.39.3

View File

@@ -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
@@ -3132,6 +3132,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)

View File

@@ -0,0 +1,13 @@
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -978,7 +978,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

View File

@@ -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
@@ -20041,7 +20041,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];

View File

@@ -0,0 +1,39 @@
From d2356ebb0084a0d80dbfe33040c9afe938c15d19 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Mon, 11 Jul 2022 22:03:14 +0200
Subject: [PATCH] libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream
9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 [sanitizer] Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
(cherry picked from commit 2701442d0cf6292f6624443c15813d6d1a3562fe)
---
.../sanitizer_platform_limits_posix.cpp | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -72,7 +72,9 @@
#include <sys/vt.h>
#include <linux/cdrom.h>
#include <linux/fd.h>
+#if SANITIZER_ANDROID
#include <linux/fs.h>
+#endif
#include <linux/hdreg.h>
#include <linux/input.h>
#include <linux/ioctl.h>
@@ -828,10 +830,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
#endif
- unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
- unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
- unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
- unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
+ unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
+ unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
+ unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
+ unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
unsigned IOCTL_GIO_CMAP = GIO_CMAP;
unsigned IOCTL_GIO_FONT = GIO_FONT;
unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,36 @@
From 203f3060dd363361b172f7295f42bb6bf5ac0b3b Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@suse.de>
Date: Sat, 23 Apr 2022 15:48:42 +0200
Subject: [PATCH] riscv/linux: Don't add -latomic with -pthread
Now that we have support for inline subword atomic operations, it is no
longer necessary to link against libatomic. This also fixes testsuite
failures because the framework does not properly set up the linker flags
for finding libatomic.
The use of atomic operations is also independent of the use of libpthread.
gcc/
* config/riscv/linux.h (LIB_SPEC): Don't redefine.
---
gcc/config/riscv/linux.h | 10 ----------
1 file changed, 10 deletions(-)
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -35,16 +35,6 @@ along with GCC; see the file COPYING3.
#undef MUSL_DYNAMIC_LINKER
#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-riscv" XLEN_SPEC MUSL_ABI_SUFFIX ".so.1"
-/* Because RISC-V only has word-sized atomics, it requries libatomic where
- others do not. So link libatomic by default, as needed. */
-#undef LIB_SPEC
-#ifdef LD_AS_NEEDED_OPTION
-#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC \
- " %{pthread:" LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION "}"
-#else
-#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC " -latomic "
-#endif
-
#define ICACHE_FLUSH_FUNC "__riscv_flush_icache"
#define CPP_SPEC "%{pthread:-D_REENTRANT}"

View File

@@ -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*} \

View File

@@ -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
@@ -930,11 +930,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)"; \
@@ -958,7 +959,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)
@@ -1164,6 +1165,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))))

View File

@@ -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
@@ -91,10 +91,15 @@
#define MUSL_DYNAMIC_LINKER \
"/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.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)

View File

@@ -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
@@ -132,10 +132,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
@@ -66,6 +66,10 @@ see the files COPYING3 and COPYING.RUNTI
builtin_version ("CRuntime_Musl"); \
} 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
@@ -62,6 +62,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}"

View File

@@ -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

View File

@@ -0,0 +1,11 @@
--- a/gcc/config/rs6000/rs6000-logue.c
+++ b/gcc/config/rs6000/rs6000-logue.c
@@ -348,7 +348,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;

View File

@@ -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
#elif !defined(USE_TM_CLONE_REGISTRY)
# define USE_TM_CLONE_REGISTRY 0
#endif

View File

@@ -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

View File

@@ -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);
@@ -469,6 +472,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;
@@ -1198,6 +1207,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
@@ -1663,6 +1663,9 @@ C++ ObjC++ Optimization Alias(fexception
fhonor-std
C++ ObjC++ WarnRemoved
+fhonour-copts
+C ObjC C++ ObjC++ RejectNegative
+
fhosted
C ObjC
Assume normal C execution environment.
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1698,6 +1698,9 @@ fguess-branch-probability
Common 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/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -9059,6 +9059,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
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -2448,6 +2448,9 @@ common_handle_option (struct gcc_options
/* Currently handled in a prescan. */
break;
+ case OPT_fhonour_copts:
+ break;
+
case OPT_Werror:
dc->warning_as_error_requested = value;
break;

View File

@@ -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
@@ -10106,8 +10106,10 @@ getenv_spec_function (int argc, const ch
}
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

View File

@@ -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)

View File

@@ -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
@@ -337,6 +337,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)
@@ -346,7 +347,8 @@ LIBGOTOOL = $(libgodir)/libgotool.a
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
cmdsrcdir = $(libgosrcdir)/cmd

View File

@@ -0,0 +1,45 @@
commit 9c6e71079b46ad5433165feaa2001450f2017b56
Author: Przemysław Buczkowski <prem@prem.moe>
Date: Mon Aug 16 13:16:21 2021 +0100
GCC: Patch for Apple Silicon compatibility
This patch fixes a linker error occuring when compiling
the cross-compiler on macOS and ARM64 architecture.
Adapted from:
https://github.com/richfelker/musl-cross-make/issues/116#issuecomment-823612404
Change-Id: Ia3ee98a163bbb62689f42e2da83a5ef36beb0913
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4329
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -1236,7 +1236,7 @@ extern const char *aarch64_rewrite_mcpu
#define MCPU_TO_MARCH_SPEC_FUNCTIONS \
{ "rewrite_mcpu", aarch64_rewrite_mcpu },
-#if defined(__aarch64__)
+#if defined(__aarch64__) && ! defined(__APPLE__)
extern const char *host_detect_local_cpu (int argc, const char **argv);
#define HAVE_LOCAL_CPU_DETECT
# define EXTRA_SPEC_FUNCTIONS \
--- a/gcc/config/host-darwin.c
+++ b/gcc/config/host-darwin.c
@@ -22,6 +22,8 @@
#include "coretypes.h"
#include "diagnostic-core.h"
#include "config/host-darwin.h"
+#include "hosthooks.h"
+#include "hosthooks-def.h"
/* Yes, this is really supposed to work. */
/* This allows for a pagesize of 16384, which we have on Darwin20, but should
@@ -79,3 +81,5 @@ darwin_gt_pch_use_address (void *addr, s
return ret;
}
+
+const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;

View File

@@ -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
@@ -44,11 +44,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)

View File

@@ -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
@@ -3366,18 +3366,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)

View File

@@ -0,0 +1,139 @@
From 9970b576b7e4ae337af1268395ff221348c4b34a Mon Sep 17 00:00:00 2001
From: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Date: Thu, 7 Mar 2024 14:36:03 +0100
Subject: [PATCH] Include safe-ctype.h after C++ standard headers, to avoid
over-poisoning
When building gcc's C++ sources against recent libc++, the poisoning of
the ctype macros due to including safe-ctype.h before including C++
standard headers such as <list>, <map>, etc, causes many compilation
errors, similar to:
In file included from /home/dim/src/gcc/master/gcc/gensupport.cc:23:
In file included from /home/dim/src/gcc/master/gcc/system.h:233:
In file included from /usr/include/c++/v1/vector:321:
In file included from
/usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from
/usr/include/c++/v1/__format/formatter_integral.h:32:
In file included from /usr/include/c++/v1/locale:202:
/usr/include/c++/v1/__locale:546:5: error: '__abi_tag__' attribute
only applies to structs, variables, functions, and namespaces
546 | _LIBCPP_INLINE_VISIBILITY
| ^
/usr/include/c++/v1/__config:813:37: note: expanded from macro
'_LIBCPP_INLINE_VISIBILITY'
813 | # define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
| ^
/usr/include/c++/v1/__config:792:26: note: expanded from macro
'_LIBCPP_HIDE_FROM_ABI'
792 |
__attribute__((__abi_tag__(_LIBCPP_TOSTRING(
_LIBCPP_VERSIONED_IDENTIFIER))))
| ^
In file included from /home/dim/src/gcc/master/gcc/gensupport.cc:23:
In file included from /home/dim/src/gcc/master/gcc/system.h:233:
In file included from /usr/include/c++/v1/vector:321:
In file included from
/usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from
/usr/include/c++/v1/__format/formatter_integral.h:32:
In file included from /usr/include/c++/v1/locale:202:
/usr/include/c++/v1/__locale:547:37: error: expected ';' at end of
declaration list
547 | char_type toupper(char_type __c) const
| ^
/usr/include/c++/v1/__locale:553:48: error: too many arguments
provided to function-like macro invocation
553 | const char_type* toupper(char_type* __low, const
char_type* __high) const
| ^
/home/dim/src/gcc/master/gcc/../include/safe-ctype.h:146:9: note:
macro 'toupper' defined here
146 | #define toupper(c) do_not_use_toupper_with_safe_ctype
| ^
This is because libc++ uses different transitive includes than
libstdc++, and some of those transitive includes pull in various ctype
declarations (typically via <locale>).
There was already a special case for including <string> before
safe-ctype.h, so move the rest of the C++ standard header includes to
the same location, to fix the problem.
gcc/ChangeLog:
* system.h: Include safe-ctype.h after C++ standard headers.
Signed-off-by: Dimitry Andric <dimitry@andric.com>
---
gcc/system.h | 39 ++++++++++++++++++---------------------
1 file changed, 18 insertions(+), 21 deletions(-)
diff --git a/gcc/system.h b/gcc/system.h
index b0edab02885..ab29fc19776 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -194,27 +194,8 @@ extern int fprintf_unlocked (FILE *, const char *, ...);
#undef fread_unlocked
#undef fwrite_unlocked
-/* Include <string> before "safe-ctype.h" to avoid GCC poisoning
- the ctype macros through safe-ctype.h */
-
-#ifdef __cplusplus
-#ifdef INCLUDE_STRING
-# include <string>
-#endif
-#endif
-
-/* There are an extraordinary number of issues with <ctype.h>.
- The last straw is that it varies with the locale. Use libiberty's
- replacement instead. */
-#include "safe-ctype.h"
-
-#include <sys/types.h>
-
-#include <errno.h>
-
-#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
-extern int errno;
-#endif
+/* Include C++ standard headers before "safe-ctype.h" to avoid GCC
+ poisoning the ctype macros through safe-ctype.h */
#ifdef __cplusplus
#if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
@@ -229,6 +210,9 @@ extern int errno;
#ifdef INCLUDE_SET
# include <set>
#endif
+#ifdef INCLUDE_STRING
+# include <string>
+#endif
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
@@ -245,6 +229,19 @@ extern int errno;
# include <type_traits>
#endif
+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. */
+#include "safe-ctype.h"
+
+#include <sys/types.h>
+
+#include <errno.h>
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
+#endif
+
/* Some of glibc's string inlines cause warnings. Plus we'd rather
rely on (and therefore test) GCC's string builtins. */
#define __NO_STRING_INLINES
--
2.39.3

View File

@@ -0,0 +1,65 @@
From 5213047b1d50af63dfabb5e5649821a6cb157e33 Mon Sep 17 00:00:00 2001
From: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Date: Sat, 16 Mar 2024 09:50:00 +0100
Subject: [PATCH] libcc1: fix <vector> include
Use INCLUDE_VECTOR before including system.h, instead of directly
including <vector>, to avoid running into poisoned identifiers.
Signed-off-by: Dimitry Andric <dimitry@andric.com>
libcc1/ChangeLog:
PR middle-end/111632
* libcc1plugin.cc: Fix include.
* libcp1plugin.cc: Fix include.
---
libcc1/libcc1plugin.cc | 3 +--
libcc1/libcp1plugin.cc | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
index 72d17c3b81c..e64847466f4 100644
--- a/libcc1/libcc1plugin.cc
+++ b/libcc1/libcc1plugin.cc
@@ -32,6 +32,7 @@
#undef PACKAGE_VERSION
#define INCLUDE_MEMORY
+#define INCLUDE_VECTOR
#include "gcc-plugin.h"
#include "system.h"
#include "coretypes.h"
@@ -69,8 +70,6 @@
#include "gcc-c-interface.h"
#include "context.hh"
-#include <vector>
-
using namespace cc1_plugin;
diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
index 0eff7c68d29..da68c5d0ac1 100644
--- a/libcc1/libcp1plugin.cc
+++ b/libcc1/libcp1plugin.cc
@@ -33,6 +33,7 @@
#undef PACKAGE_VERSION
#define INCLUDE_MEMORY
+#define INCLUDE_VECTOR
#include "gcc-plugin.h"
#include "system.h"
#include "coretypes.h"
@@ -71,8 +72,6 @@
#include "rpc.hh"
#include "context.hh"
-#include <vector>
-
using namespace cc1_plugin;
--
2.39.3

View File

@@ -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.cc
+++ b/gcc/config/mips/mips.cc
@@ -3134,6 +3134,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)

View File

@@ -0,0 +1,13 @@
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -987,7 +987,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

View File

@@ -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.cc
+++ b/gcc/config/mips/mips.cc
@@ -20216,7 +20216,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];

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,36 @@
From 203f3060dd363361b172f7295f42bb6bf5ac0b3b Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@suse.de>
Date: Sat, 23 Apr 2022 15:48:42 +0200
Subject: [PATCH] riscv/linux: Don't add -latomic with -pthread
Now that we have support for inline subword atomic operations, it is no
longer necessary to link against libatomic. This also fixes testsuite
failures because the framework does not properly set up the linker flags
for finding libatomic.
The use of atomic operations is also independent of the use of libpthread.
gcc/
* config/riscv/linux.h (LIB_SPEC): Don't redefine.
---
gcc/config/riscv/linux.h | 10 ----------
1 file changed, 10 deletions(-)
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -35,16 +35,6 @@ along with GCC; see the file COPYING3.
#undef MUSL_DYNAMIC_LINKER
#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-riscv" XLEN_SPEC MUSL_ABI_SUFFIX ".so.1"
-/* Because RISC-V only has word-sized atomics, it requries libatomic where
- others do not. So link libatomic by default, as needed. */
-#undef LIB_SPEC
-#ifdef LD_AS_NEEDED_OPTION
-#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC \
- " %{pthread:" LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION "}"
-#else
-#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC " -latomic "
-#endif
-
#define ICACHE_FLUSH_FUNC "__riscv_flush_icache"
#define CPP_SPEC "%{pthread:-D_REENTRANT}"

View File

@@ -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*} \

View File

@@ -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
@@ -930,11 +930,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)"; \
@@ -958,7 +959,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)
@@ -1164,6 +1165,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))))

View File

@@ -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
@@ -91,10 +91,15 @@
#define MUSL_DYNAMIC_LINKER \
"/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.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)

View File

@@ -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
@@ -132,10 +132,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
@@ -71,6 +71,10 @@ see the files COPYING3 and COPYING.RUNTI
builtin_version ("CRuntime_Musl"); \
} 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
@@ -67,6 +67,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}"

View File

@@ -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

View File

@@ -0,0 +1,11 @@
--- a/gcc/config/rs6000/rs6000-logue.cc
+++ b/gcc/config/rs6000/rs6000-logue.cc
@@ -348,7 +348,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;

View File

@@ -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
#elif !defined(USE_TM_CLONE_REGISTRY)
# define USE_TM_CLONE_REGISTRY 0
#endif

View File

@@ -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

View File

@@ -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.cc
+++ b/gcc/c-family/c-opts.cc
@@ -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);
@@ -478,6 +481,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;
@@ -1218,6 +1227,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
@@ -1755,6 +1755,9 @@ C++ ObjC++ Optimization Alias(fexception
fhonor-std
C++ ObjC++ WarnRemoved
+fhonour-copts
+C ObjC C++ ObjC++ RejectNegative
+
fhosted
C ObjC
Assume normal C execution environment.
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1770,6 +1770,9 @@ fharden-conditional-branches
Common Var(flag_harden_conditional_branches) Optimization
Harden conditional branches by checking reversed conditions.
+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/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -9597,6 +9597,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
--- a/gcc/opts.cc
+++ b/gcc/opts.cc
@@ -2699,6 +2699,9 @@ common_handle_option (struct gcc_options
add_comma_separated_to_vector (&opts->x_flag_ignored_attributes, arg);
break;
+ case OPT_fhonour_copts:
+ break;
+
case OPT_Werror:
dc->warning_as_error_requested = value;
break;

View File

@@ -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.cc
+++ b/gcc/gcc.cc
@@ -10186,8 +10186,10 @@ getenv_spec_function (int argc, const ch
}
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

View File

@@ -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
@@ -337,6 +337,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)
@@ -346,7 +347,8 @@ LIBGOTOOL = $(libgodir)/libgotool.a
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
cmdsrcdir = $(libgosrcdir)/cmd

View File

@@ -0,0 +1,45 @@
commit 9c6e71079b46ad5433165feaa2001450f2017b56
Author: Przemysław Buczkowski <prem@prem.moe>
Date: Mon Aug 16 13:16:21 2021 +0100
GCC: Patch for Apple Silicon compatibility
This patch fixes a linker error occuring when compiling
the cross-compiler on macOS and ARM64 architecture.
Adapted from:
https://github.com/richfelker/musl-cross-make/issues/116#issuecomment-823612404
Change-Id: Ia3ee98a163bbb62689f42e2da83a5ef36beb0913
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4329
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -1293,7 +1293,7 @@ extern const char *aarch64_rewrite_mcpu
#define MCPU_TO_MARCH_SPEC_FUNCTIONS \
{ "rewrite_mcpu", aarch64_rewrite_mcpu },
-#if defined(__aarch64__)
+#if defined(__aarch64__) && ! defined(__APPLE__)
extern const char *host_detect_local_cpu (int argc, const char **argv);
#define HAVE_LOCAL_CPU_DETECT
# define EXTRA_SPEC_FUNCTIONS \
--- a/gcc/config/host-darwin.cc
+++ b/gcc/config/host-darwin.cc
@@ -23,6 +23,8 @@
#include "options.h"
#include "diagnostic-core.h"
#include "config/host-darwin.h"
+#include "hosthooks.h"
+#include "hosthooks-def.h"
#include <errno.h>
/* For Darwin (macOS only) platforms, without ASLR (PIE) enabled on the
@@ -181,3 +183,5 @@ darwin_gt_pch_use_address (void *&addr,
return 1;
}
+
+const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;

View File

@@ -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
@@ -44,11 +44,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)

View File

@@ -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
@@ -3397,18 +3397,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)

View File

@@ -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.cc
+++ b/gcc/config/mips/mips.cc
@@ -3134,6 +3134,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)

View File

@@ -0,0 +1,13 @@
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -972,7 +972,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

View File

@@ -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.cc
+++ b/gcc/config/mips/mips.cc
@@ -20219,7 +20219,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];

View File

@@ -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*} \

View File

@@ -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
@@ -933,11 +933,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)"; \
@@ -961,7 +962,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)
@@ -1167,6 +1168,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))))

View File

@@ -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}%{mfdpic:-fdpic}.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)

View File

@@ -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
@@ -129,10 +129,6 @@
"%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared: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
@@ -58,6 +58,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
@@ -67,6 +67,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}"

View File

@@ -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

View File

@@ -0,0 +1,11 @@
--- a/gcc/config/rs6000/rs6000-logue.cc
+++ b/gcc/config/rs6000/rs6000-logue.cc
@@ -344,7 +344,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;

View File

@@ -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
#elif !defined(USE_TM_CLONE_REGISTRY)
# define USE_TM_CLONE_REGISTRY 0
#endif

View File

@@ -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

View File

@@ -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.cc
+++ b/gcc/c-family/c-opts.cc
@@ -104,6 +104,9 @@ static size_t include_cursor;
/* 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);
@@ -475,6 +478,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;
@@ -1228,6 +1237,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
@@ -1837,6 +1837,9 @@ C++ ObjC++ Optimization Alias(fexception
fhonor-std
C++ ObjC++ WarnRemoved
+fhonour-copts
+C ObjC C++ ObjC++ RejectNegative
+
fhosted
C ObjC
Assume normal C execution environment.
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1801,6 +1801,9 @@ fharden-conditional-branches
Common Var(flag_harden_conditional_branches) Optimization
Harden conditional branches by checking reversed conditions.
+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/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10065,6 +10065,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.
+
@opindex Wstack-protector
@opindex Wno-stack-protector
@item -Wstack-protector
--- a/gcc/opts.cc
+++ b/gcc/opts.cc
@@ -2767,6 +2767,9 @@ common_handle_option (struct gcc_options
add_comma_separated_to_vector (&opts->x_flag_ignored_attributes, arg);
break;
+ case OPT_fhonour_copts:
+ break;
+
case OPT_Werror:
dc->warning_as_error_requested = value;
break;

View File

@@ -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.cc
+++ b/gcc/gcc.cc
@@ -10174,8 +10174,10 @@ getenv_spec_function (int argc, const ch
}
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

Some files were not shown because too many files have changed in this diff Show More