initial buildroot for linux 5.15

This commit is contained in:
Huan.Feng
2021-12-06 14:12:13 +08:00
parent d7767d594e
commit 7b6fc358fa
12736 changed files with 508822 additions and 0 deletions
@@ -0,0 +1,27 @@
From 08e14a662b9e75daec29722e49150869952ba1b6 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Mon, 20 Nov 2017 22:09:39 +0100
Subject: [PATCH] Makefile: remove -Werror to avoid build failures
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Matthew: Refactoring of Thomas Petazzoni's original.]
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
---
Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/Makefile b/Makefile
index 7231334..d9ad42b 100644
--- a/Makefile
+++ b/Makefile
@@ -53,7 +53,6 @@ cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
COMMON_CFLAGS += -g $(autodepend-flags)
COMMON_CFLAGS += -Wall -Wwrite-strings -Wclobbered -Wempty-body -Wuninitialized
COMMON_CFLAGS += -Wignored-qualifiers -Wunused-but-set-parameter
-COMMON_CFLAGS += -Werror
frame-pointer-flag=-f$(if $(KEEP_FRAME_POINTER),no-,)omit-frame-pointer
fomit_frame_pointer := $(call cc-option, $(frame-pointer-flag), "")
fnostack_protector := $(call cc-option, -fno-stack-protector, "")
--
2.14.2
@@ -0,0 +1,110 @@
From 8d9a62a5fa89001266352a929c5d40b28c0dda85 Mon Sep 17 00:00:00 2001
From: Matt Weber <matthew.weber@rockwellcollins.com>
Date: Fri, 12 Jan 2018 19:07:27 -0600
Subject: [PATCH v2] kvm-unit-tests: test for rdseed/rdrand
The build fails when the host binutils isn't at least 2.23
(2.22.x introduced RDSEED).
Fixes:
http://autobuild.buildroot.net/results/c39/c3987a3cbd2960b0ff50f872636bdfd8d1a9c820/
Upstream:
https://marc.info/?l=kvm&m=151580743523259&w=2
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
---
Makefile | 2 +-
configure | 18 ++++++++++++++++++
x86/vmx_tests.c | 6 ++++++
3 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index d9ad42b..799e9b5 100644
--- a/Makefile
+++ b/Makefile
@@ -50,7 +50,7 @@ include $(SRCDIR)/$(TEST_DIR)/Makefile
cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
-COMMON_CFLAGS += -g $(autodepend-flags)
+COMMON_CFLAGS += -g $(autodepend-flags) $(EXTRA_CFLAGS)
COMMON_CFLAGS += -Wall -Wwrite-strings -Wclobbered -Wempty-body -Wuninitialized
COMMON_CFLAGS += -Wignored-qualifiers -Wunused-but-set-parameter
frame-pointer-flag=-f$(if $(KEEP_FRAME_POINTER),no-,)omit-frame-pointer
diff --git a/configure b/configure
index dd9d361..21c0219 100755
--- a/configure
+++ b/configure
@@ -171,6 +171,23 @@ mkdir -p lib
ln -sf "$asm" lib/asm
+cat > rd_test.c <<EOF
+#include <stdint.h>
+int main() {
+ uint16_t seed=0;
+ unsigned char ok;
+ asm volatile ("rdseed %0; setc %1"
+ : "=r" (seed), "=qm" (ok));
+ return ok;
+}
+EOF
+if $cross_prefix$cc -o /dev/null rd_test.c &> /dev/null; then
+ echo "Checking for rdseed/rdrand... Yes."
+else
+ echo "Checking for rdseed/rdrand... No."
+ extra_cflags="-DNO_RDSEEDRAND"
+fi
+
# create the config
cat <<EOF > config.mak
SRCDIR=$srcdir
@@ -181,6 +198,7 @@ ARCH_NAME=$arch_name
PROCESSOR=$processor
CC=$cross_prefix$cc
CXX=$cross_prefix$cxx
+EXTRA_CFLAGS=$extra_cflags
LD=$cross_prefix$ld
OBJCOPY=$cross_prefix$objcopy
OBJDUMP=$cross_prefix$objdump
diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index 4a3e94b..2cbe3eb 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -770,8 +770,10 @@ asm(
"insn_sldt: sldt %ax;ret\n\t"
"insn_lldt: xor %eax, %eax; lldt %ax;ret\n\t"
"insn_str: str %ax;ret\n\t"
+#ifndef NO_RDSEEDRAND
"insn_rdrand: rdrand %rax;ret\n\t"
"insn_rdseed: rdseed %rax;ret\n\t"
+#endif
);
extern void insn_hlt();
extern void insn_invlpg();
@@ -796,8 +798,10 @@ extern void insn_lldt();
extern void insn_str();
extern void insn_cpuid();
extern void insn_invd();
+#ifndef NO_RDSEEDRAND
extern void insn_rdrand();
extern void insn_rdseed();
+#endif
u32 cur_insn;
u64 cr3;
@@ -853,8 +857,10 @@ static struct insn_table insn_table[] = {
{"DESC_TABLE (LLDT)", CPU_DESC_TABLE, insn_lldt, INSN_CPU1, 47, 0, 0, 0},
{"DESC_TABLE (STR)", CPU_DESC_TABLE, insn_str, INSN_CPU1, 47, 0, 0, 0},
/* LTR causes a #GP if done with a busy selector, so it is not tested. */
+#ifndef NO_RDSEEDRAND
{"RDRAND", CPU_RDRAND, insn_rdrand, INSN_CPU1, VMX_RDRAND, 0, 0, 0},
{"RDSEED", CPU_RDSEED, insn_rdseed, INSN_CPU1, VMX_RDSEED, 0, 0, 0},
+#endif
// Instructions always trap
{"CPUID", 0, insn_cpuid, INSN_ALWAYS_TRAP, 10, 0, 0, 0},
{"INVD", 0, insn_invd, INSN_ALWAYS_TRAP, 13, 0, 0, 0},
--
1.9.1
@@ -0,0 +1,36 @@
From 9bf9155804652c0b3a94af9723c79b6de430187b Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Mon, 24 Feb 2020 00:04:06 +0100
Subject: [PATCH] Makefile: fix stack-protector tests
Rename fnostack_protector into fno_stack_protector and
fnostack_protector_all into fnostack_protector_all otherwise build will
fail if -fstack-protector is passed by the toolchain
Fixes:
- http://autobuild.buildroot.org/results/ad689b08173548af21dd1fb0e827fd561de6dfef
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: sent to kvm@vger.kernel.org]
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 767b6c6..754ed65 100644
--- a/Makefile
+++ b/Makefile
@@ -55,8 +55,8 @@ COMMON_CFLAGS += -Wignored-qualifiers -Werror
frame-pointer-flag=-f$(if $(KEEP_FRAME_POINTER),no-,)omit-frame-pointer
fomit_frame_pointer := $(call cc-option, $(frame-pointer-flag), "")
-fnostack_protector := $(call cc-option, -fno-stack-protector, "")
-fnostack_protector_all := $(call cc-option, -fno-stack-protector-all, "")
+fno_stack_protector := $(call cc-option, -fno-stack-protector, "")
+fno_stack_protector_all := $(call cc-option, -fno-stack-protector-all, "")
wno_frame_address := $(call cc-option, -Wno-frame-address, "")
fno_pic := $(call cc-option, -fno-pic, "")
no_pie := $(call cc-option, -no-pie, "")
--
2.25.0
@@ -0,0 +1,61 @@
From 5126732d73aa75a0bc84f898042bfe35640624b8 Mon Sep 17 00:00:00 2001
From: Thomas Huth <thuth@redhat.com>
Date: Wed, 13 May 2020 13:14:46 +0200
Subject: [PATCH] Fix powerpc issue with the linker from Fedora 32
The linker from Fedora 32 complains:
powerpc64-linux-gnu-ld: powerpc/selftest.elf: error: PHDR segment not
covered by LOAD segment
Let's introduce some fake PHDRs to the linker script to get this
working again.
Message-Id: <20200514192626.9950-7-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Matthew Weber <matthew.weber@collins.com>
---
powerpc/flat.lds | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/powerpc/flat.lds b/powerpc/flat.lds
index 53221e8..5eed368 100644
--- a/powerpc/flat.lds
+++ b/powerpc/flat.lds
@@ -1,7 +1,17 @@
+PHDRS
+{
+ text PT_LOAD FLAGS(5);
+ data PT_LOAD FLAGS(6);
+}
+
SECTIONS
{
- .text : { *(.init) *(.text) *(.text.*) }
+ .text : {
+ *(.init)
+ *(.text)
+ *(.text.*)
+ } :text
. = ALIGN(64K);
etext = .;
.opd : { *(.opd) }
@@ -19,9 +29,12 @@ SECTIONS
.data : {
*(.data)
*(.data.rel*)
- }
+ } :data
. = ALIGN(16);
- .rodata : { *(.rodata) *(.rodata.*) }
+ .rodata : {
+ *(.rodata)
+ *(.rodata.*)
+ } :data
. = ALIGN(16);
.bss : { *(.bss) }
. = ALIGN(256);
--
2.17.1
+39
View File
@@ -0,0 +1,39 @@
config BR2_PACKAGE_KVM_UNIT_TESTS_ARCH_SUPPORTS
bool
# On ARM, it uses virtualization extensions
default y if BR2_cortex_a7 || BR2_cortex_a12 || \
BR2_cortex_a15 || BR2_cortex_a15_a7 || \
BR2_cortex_a17 || BR2_cortex_a17_a7
default y if BR2_i386 || BR2_x86_64
default y if BR2_powerpc64 || BR2_powerpc64le
config BR2_PACKAGE_KVM_UNIT_TESTS
bool "kvm-unit-tests"
depends on BR2_PACKAGE_KVM_UNIT_TESTS_ARCH_SUPPORTS
# on i386 and x86-64, __builtin_reachable is used, so we need
# gcc 4.5 at least. on i386, we use the target gcc, while on
# x86-64 we use the host gcc (see .mk file for details)
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_5 || !BR2_i386
depends on BR2_HOSTARCH = "x86_64" || !BR2_x86_64
select BR2_HOSTARCH_NEEDS_IA32_COMPILER if BR2_x86_64=y
help
kvm-unit-tests is a project as old as KVM. As its name
suggests, it's purpose is to provide unit tests for KVM. The
unit tests are tiny guest operating systems that generally
execute only tens of lines of C and assembler test code in
order to obtain its PASS/FAIL result. Unit tests provide KVM
and virt hardware functional testing by targeting the
features through minimal implementations of their use per
the hardware specification. The simplicity of unit tests
make them easy to verify they are correct, easy to maintain,
and easy to use in timing measurements. Unit tests are also
often used for quick and dirty bug reproducers. The
reproducers may then be kept as regression tests. It's
strongly encouraged that patches implementing new KVM
features are submitted with accompanying unit tests.
http://www.linux-kvm.org/page/KVM-unit-tests
comment "kvm-unit-tests needs a toolchain w/ gcc >= 4.5"
depends on BR2_i386
depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_5
@@ -0,0 +1,3 @@
# Locally computed
sha256 e476443cd76c8f540734e075b419638b2f200ae002986d6fc14076d410f3751e kvm-unit-tests-kvm-unit-tests-20171020-br1.tar.gz
sha256 d9bbb60891710d248f01c8bdac50ef7ad39188de512610437872e83112b38a1b COPYRIGHT
+58
View File
@@ -0,0 +1,58 @@
################################################################################
#
# kvm-unit-tests
#
################################################################################
KVM_UNIT_TESTS_VERSION = kvm-unit-tests-20171020
KVM_UNIT_TESTS_SITE = https://git.kernel.org/pub/scm/virt/kvm/kvm-unit-tests.git
KVM_UNIT_TESTS_SITE_METHOD = git
KVM_UNIT_TESTS_LICENSE = LGPL-2.0
KVM_UNIT_TESTS_LICENSE_FILES = COPYRIGHT
ifeq ($(BR2_arm),y)
KVM_UNIT_TESTS_ARCH = arm
else ifeq ($(BR2_i386),y)
KVM_UNIT_TESTS_ARCH = i386
else ifeq ($(BR2_powerpc64)$(BR2_powerpc64le),y)
KVM_UNIT_TESTS_ARCH = ppc64
else ifeq ($(BR2_x86_64),y)
KVM_UNIT_TESTS_ARCH = x86_64
endif
ifeq ($(BR2_ENDIAN),"LITTLE")
KVM_UNIT_TESTS_ENDIAN = little
else
KVM_UNIT_TESTS_ENDIAN = big
endif
KVM_UNIT_TESTS_CONF_OPTS =\
--arch="$(KVM_UNIT_TESTS_ARCH)" \
--processor="$(GCC_TARGET_CPU)" \
--endian="$(KVM_UNIT_TESTS_ENDIAN)"
# For all architectures but x86-64, we use the target
# compiler. However, for x86-64, we use the host compiler, as
# kvm-unit-tests builds 32 bit code, which Buildroot toolchains for
# x86-64 cannot do.
ifeq ($(BR2_x86_64),)
KVM_UNIT_TESTS_CONF_OPTS += --cross-prefix="$(TARGET_CROSS)"
endif
define KVM_UNIT_TESTS_CONFIGURE_CMDS
cd $(@D) && ./configure $(KVM_UNIT_TESTS_CONF_OPTS)
endef
define KVM_UNIT_TESTS_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) $(KVM_UNIT_TESTS_MAKE_OPTS) -C $(@D) \
standalone
endef
define KVM_UNIT_TESTS_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) $(KVM_UNIT_TESTS_MAKE_OPTS) -C $(@D) \
DESTDIR=$(TARGET_DIR)/usr/share/kvm-unit-tests/ \
install
endef
# Does use configure script but not an autotools one
$(eval $(generic-package))