mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge 7.0 Kbuild changes into kbuild-fixes
kbuild-fixes needs to be based on 6.19 to apply some fixes for
62089b8048 ("kbuild: rpm-pkg: Generate debuginfo package manually")
which landed in 6.19-rc1 but the new material of 7.0 needs fixes merged
as well.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
This commit is contained in:
@@ -0,0 +1,227 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0-only
|
||||
.. Copyright (C) 2025 Guillaume Tucker
|
||||
|
||||
====================
|
||||
Containerized Builds
|
||||
====================
|
||||
|
||||
The ``container`` tool can be used to run any command in the kernel source tree
|
||||
from within a container. Doing so facilitates reproducing builds across
|
||||
various platforms, for example when a test bot has reported an issue which
|
||||
requires a specific version of a compiler or an external test suite. While
|
||||
this can already be done by users who are familiar with containers, having a
|
||||
dedicated tool in the kernel tree lowers the barrier to entry by solving common
|
||||
problems once and for all (e.g. user id management). It also makes it easier
|
||||
to share an exact command line leading to a particular result. The main use
|
||||
case is likely to be kernel builds but virtually anything can be run: KUnit,
|
||||
checkpatch etc. provided a suitable image is available.
|
||||
|
||||
|
||||
Options
|
||||
=======
|
||||
|
||||
Command line syntax::
|
||||
|
||||
scripts/container -i IMAGE [OPTION]... CMD...
|
||||
|
||||
Available options:
|
||||
|
||||
``-e, --env-file ENV_FILE``
|
||||
|
||||
Path to an environment file to load in the container.
|
||||
|
||||
``-g, --gid GID``
|
||||
|
||||
Group id to use inside the container.
|
||||
|
||||
``-i, --image IMAGE``
|
||||
|
||||
Container image name (required).
|
||||
|
||||
``-r, --runtime RUNTIME``
|
||||
|
||||
Container runtime name. Supported runtimes: ``docker``, ``podman``.
|
||||
|
||||
If not specified, the first one found on the system will be used
|
||||
i.e. Podman if present, otherwise Docker.
|
||||
|
||||
``-s, --shell``
|
||||
|
||||
Run the container in an interactive shell.
|
||||
|
||||
``-u, --uid UID``
|
||||
|
||||
User id to use inside the container.
|
||||
|
||||
If the ``-g`` option is not specified, the user id will also be used for
|
||||
the group id.
|
||||
|
||||
``-v, --verbose``
|
||||
|
||||
Enable verbose output.
|
||||
|
||||
``-h, --help``
|
||||
|
||||
Show the help message and exit.
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
It's entirely up to the user to choose which image to use and the ``CMD``
|
||||
arguments are passed directly as an arbitrary command line to run in the
|
||||
container. The tool will take care of mounting the source tree as the current
|
||||
working directory and adjust the user and group id as needed.
|
||||
|
||||
The container image which would typically include a compiler toolchain is
|
||||
provided by the user and selected via the ``-i`` option. The container runtime
|
||||
can be selected with the ``-r`` option, which can be either ``docker`` or
|
||||
``podman``. If none is specified, the first one found on the system will be
|
||||
used while giving priority to Podman. Support for other runtimes may be added
|
||||
later depending on their popularity among users.
|
||||
|
||||
By default, commands are run non-interactively. The user can abort a running
|
||||
container with SIGINT (Ctrl-C). To run commands interactively with a TTY, the
|
||||
``--shell`` or ``-s`` option can be used. Signals will then be received by the
|
||||
shell directly rather than the parent ``container`` process. To exit an
|
||||
interactive shell, use Ctrl-D or ``exit``.
|
||||
|
||||
.. note::
|
||||
|
||||
The only host requirement aside from a container runtime is Python 3.10 or
|
||||
later.
|
||||
|
||||
.. note::
|
||||
|
||||
Out-of-tree builds are not fully supported yet. The ``O=`` option can
|
||||
however already be used with a relative path inside the source tree to keep
|
||||
separate build outputs. A workaround to build outside the tree is to use
|
||||
``mount --bind``, see the examples section further down.
|
||||
|
||||
|
||||
Environment Variables
|
||||
=====================
|
||||
|
||||
Environment variables are not propagated to the container so they have to be
|
||||
either defined in the image itself or via the ``-e`` option using an
|
||||
environment file. In some cases it makes more sense to have them defined in
|
||||
the Containerfile used to create the image. For example, a Clang-only compiler
|
||||
toolchain image may have ``LLVM=1`` defined.
|
||||
|
||||
The local environment file is more useful for user-specific variables added
|
||||
during development. It is passed as-is to the container runtime so its format
|
||||
may vary. Typically, it will look like the output of ``env``. For example::
|
||||
|
||||
INSTALL_MOD_STRIP=1
|
||||
SOME_RANDOM_TEXT=One upon a time
|
||||
|
||||
Please also note that ``make`` options can still be passed on the command line,
|
||||
so while this can't be done since the first argument needs to be the
|
||||
executable::
|
||||
|
||||
scripts/container -i docker.io/tuxmake/korg-clang LLVM=1 make # won't work
|
||||
|
||||
this will work::
|
||||
|
||||
scripts/container -i docker.io/tuxmake/korg-clang make LLVM=1
|
||||
|
||||
|
||||
User IDs
|
||||
========
|
||||
|
||||
This is an area where the behaviour will vary slightly depending on the
|
||||
container runtime. The goal is to run commands as the user invoking the tool.
|
||||
With Podman, a namespace is created to map the current user id to a different
|
||||
one in the container (1000 by default). With Docker, while this is also
|
||||
possible with recent versions it requires a special feature to be enabled in
|
||||
the daemon so it's not used here for simplicity. Instead, the container is run
|
||||
with the current user id directly. In both cases, this will provide the same
|
||||
file permissions for the kernel source tree mounted as a volume. The only
|
||||
difference is that when using Docker without a namespace, the user id may not
|
||||
be the same as the default one set in the image.
|
||||
|
||||
Say, we're using an image which sets up a default user with id 1000 and the
|
||||
current user calling the ``container`` tool has id 1234. The kernel source
|
||||
tree was checked out by this same user so the files belong to user 1234. With
|
||||
Podman, the container will be running as user id 1000 with a mapping to id 1234
|
||||
so that the files from the mounted volume appear to belong to id 1000 inside
|
||||
the container. With Docker and no namespace, the container will be running
|
||||
with user id 1234 which can access the files in the volume but not in the user
|
||||
1000 home directory. This shouldn't be an issue when running commands only in
|
||||
the kernel tree but it is worth highlighting here as it might matter for
|
||||
special corner cases.
|
||||
|
||||
.. note::
|
||||
|
||||
Podman's `Docker compatibility
|
||||
<https://podman-desktop.io/docs/migrating-from-docker/managing-docker-compatibility>`__
|
||||
mode to run ``docker`` commands on top of a Podman backend is more complex
|
||||
and not fully supported yet. As such, Podman will take priority if both
|
||||
runtimes are available on the system.
|
||||
|
||||
|
||||
Examples
|
||||
========
|
||||
|
||||
The TuxMake project provides a variety of prebuilt container images available
|
||||
on `Docker Hub <https://hub.docker.com/u/tuxmake>`__. Here's the shortest
|
||||
example to build a kernel using a TuxMake Clang image::
|
||||
|
||||
scripts/container -i docker.io/tuxmake/korg-clang -- make LLVM=1 defconfig
|
||||
scripts/container -i docker.io/tuxmake/korg-clang -- make LLVM=1 -j$(nproc)
|
||||
|
||||
.. note::
|
||||
|
||||
When running a command with options within the container, it should be
|
||||
separated with a double dash ``--`` to not confuse them with the
|
||||
``container`` tool options. Plain commands with no options don't strictly
|
||||
require the double dashes e.g.::
|
||||
|
||||
scripts/container -i docker.io/tuxmake/korg-clang make mrproper
|
||||
|
||||
To run ``checkpatch.pl`` in a ``patches`` directory with a generic Perl image::
|
||||
|
||||
scripts/container -i perl:slim-trixie scripts/checkpatch.pl patches/*
|
||||
|
||||
As an alternative to the TuxMake images, the examples below refer to
|
||||
``kernel.org`` images which are based on the `kernel.org compiler toolchains
|
||||
<https://mirrors.edge.kernel.org/pub/tools/>`__. These aren't (yet) officially
|
||||
available in any public registry but users can build their own locally instead
|
||||
using this `experimental repository
|
||||
<https://gitlab.com/gtucker/korg-containers>`__ by running ``make
|
||||
PREFIX=kernel.org/``.
|
||||
|
||||
To build just ``bzImage`` using Clang::
|
||||
|
||||
scripts/container -i kernel.org/clang -- make bzImage -j$(nproc)
|
||||
|
||||
Same with GCC 15 as a particular version tag::
|
||||
|
||||
scripts/container -i kernel.org/gcc:15 -- make bzImage -j$(nproc)
|
||||
|
||||
For an out-of-tree build, a trick is to bind-mount the destination directory to
|
||||
a relative path inside the source tree::
|
||||
|
||||
mkdir -p $HOME/tmp/my-kernel-build
|
||||
mkdir -p build
|
||||
sudo mount --bind $HOME/tmp/my-kernel-build build
|
||||
scripts/container -i kernel.org/gcc -- make mrproper
|
||||
scripts/container -i kernel.org/gcc -- make O=build defconfig
|
||||
scripts/container -i kernel.org/gcc -- make O=build -j$(nproc)
|
||||
|
||||
To run KUnit in an interactive shell and get the full output::
|
||||
|
||||
scripts/container -s -i kernel.org/gcc:kunit -- \
|
||||
tools/testing/kunit/kunit.py \
|
||||
run \
|
||||
--arch=x86_64 \
|
||||
--cross_compile=x86_64-linux-
|
||||
|
||||
To just start an interactive shell::
|
||||
|
||||
scripts/container -si kernel.org/gcc bash
|
||||
|
||||
To build the HTML documentation, which requires the ``kdocs`` image built with
|
||||
``make PREFIX=kernel.org/ extra`` as it's not a compiler toolchain::
|
||||
|
||||
scripts/container -i kernel.org/kdocs make htmldocs
|
||||
@@ -38,6 +38,7 @@ Documentation/process/debugging/index.rst
|
||||
gpio-sloppy-logic-analyzer
|
||||
autofdo
|
||||
propeller
|
||||
container
|
||||
|
||||
|
||||
.. only:: subproject and html
|
||||
|
||||
@@ -14,23 +14,46 @@ selected, **gendwarfksyms** is used instead to calculate symbol versions
|
||||
from the DWARF debugging information, which contains the necessary
|
||||
details about the final module ABI.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
gendwarfksyms depends on the libelf, libdw, and zlib libraries.
|
||||
|
||||
Here are a few examples of how to install these dependencies:
|
||||
|
||||
* Arch Linux and derivatives::
|
||||
|
||||
sudo pacman --needed -S libelf zlib
|
||||
|
||||
* Debian, Ubuntu, and derivatives::
|
||||
|
||||
sudo apt install libelf-dev libdw-dev zlib1g-dev
|
||||
|
||||
* Fedora and derivatives::
|
||||
|
||||
sudo dnf install elfutils-libelf-devel elfutils-devel zlib-devel
|
||||
|
||||
* openSUSE and derivatives::
|
||||
|
||||
sudo zypper install libelf-devel libdw-devel zlib-devel
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
gendwarfksyms accepts a list of object files on the command line, and a
|
||||
list of symbol names (one per line) in standard input::
|
||||
|
||||
Usage: gendwarfksyms [options] elf-object-file ... < symbol-list
|
||||
Usage: gendwarfksyms [options] elf-object-file ... < symbol-list
|
||||
|
||||
Options:
|
||||
-d, --debug Print debugging information
|
||||
--dump-dies Dump DWARF DIE contents
|
||||
--dump-die-map Print debugging information about die_map changes
|
||||
--dump-types Dump type strings
|
||||
--dump-versions Dump expanded type strings used for symbol versions
|
||||
-s, --stable Support kABI stability features
|
||||
-T, --symtypes file Write a symtypes file
|
||||
-h, --help Print this message
|
||||
Options:
|
||||
-d, --debug Print debugging information
|
||||
--dump-dies Dump DWARF DIE contents
|
||||
--dump-die-map Print debugging information about die_map changes
|
||||
--dump-types Dump type strings
|
||||
--dump-versions Dump expanded type strings used for symbol versions
|
||||
-s, --stable Support kABI stability features
|
||||
-T, --symtypes file Write a symtypes file
|
||||
-h, --help Print this message
|
||||
|
||||
|
||||
Type information availability
|
||||
@@ -46,9 +69,9 @@ TU where symbols are actually exported, gendwarfksyms adds a pointer
|
||||
to exported symbols in the `EXPORT_SYMBOL()` macro using the following
|
||||
macro::
|
||||
|
||||
#define __GENDWARFKSYMS_EXPORT(sym) \
|
||||
static typeof(sym) *__gendwarfksyms_ptr_##sym __used \
|
||||
__section(".discard.gendwarfksyms") = &sym;
|
||||
#define __GENDWARFKSYMS_EXPORT(sym) \
|
||||
static typeof(sym) *__gendwarfksyms_ptr_##sym __used \
|
||||
__section(".discard.gendwarfksyms") = &sym;
|
||||
|
||||
|
||||
When a symbol pointer is found in DWARF, gendwarfksyms can use its
|
||||
@@ -71,14 +94,14 @@ either a type reference or a symbol name. Type references have a
|
||||
one-letter prefix followed by "#" and the name of the type. Four
|
||||
reference types are supported::
|
||||
|
||||
e#<type> = enum
|
||||
s#<type> = struct
|
||||
t#<type> = typedef
|
||||
u#<type> = union
|
||||
e#<type> = enum
|
||||
s#<type> = struct
|
||||
t#<type> = typedef
|
||||
u#<type> = union
|
||||
|
||||
Type names with spaces in them are wrapped in single quotes, e.g.::
|
||||
|
||||
s#'core::result::Result<u8, core::num::error::ParseIntError>'
|
||||
s#'core::result::Result<u8, core::num::error::ParseIntError>'
|
||||
|
||||
The rest of the line contains a type string. Unlike with genksyms that
|
||||
produces C-style type strings, gendwarfksyms uses the same simple parsed
|
||||
@@ -128,8 +151,8 @@ the rules. The fields are as follows:
|
||||
The following helper macros, for example, can be used to specify rules
|
||||
in the source code::
|
||||
|
||||
#define ___KABI_RULE(hint, target, value) \
|
||||
static const char __PASTE(__gendwarfksyms_rule_, \
|
||||
#define ___KABI_RULE(hint, target, value) \
|
||||
static const char __PASTE(__gendwarfksyms_rule_, \
|
||||
__COUNTER__)[] __used __aligned(1) \
|
||||
__section(".discard.gendwarfksyms.kabi_rules") = \
|
||||
"1\0" #hint "\0" target "\0" value
|
||||
@@ -250,18 +273,18 @@ The rule fields are expected to be as follows:
|
||||
|
||||
Using the `__KABI_RULE` macro, this rule can be defined as::
|
||||
|
||||
#define KABI_BYTE_SIZE(fqn, value) \
|
||||
__KABI_RULE(byte_size, fqn, value)
|
||||
#define KABI_BYTE_SIZE(fqn, value) \
|
||||
__KABI_RULE(byte_size, fqn, value)
|
||||
|
||||
Example usage::
|
||||
|
||||
struct s {
|
||||
/* Unchanged original members */
|
||||
/* Unchanged original members */
|
||||
unsigned long a;
|
||||
void *p;
|
||||
void *p;
|
||||
|
||||
/* Appended new members */
|
||||
KABI_IGNORE(0, unsigned long n);
|
||||
/* Appended new members */
|
||||
KABI_IGNORE(0, unsigned long n);
|
||||
};
|
||||
|
||||
KABI_BYTE_SIZE(s, 16);
|
||||
@@ -330,21 +353,21 @@ reserved member needs a unique name, but as the actual purpose is usually
|
||||
not known at the time the space is reserved, for convenience, names that
|
||||
start with `__kabi_` are left out when calculating symbol versions::
|
||||
|
||||
struct s {
|
||||
long a;
|
||||
long __kabi_reserved_0; /* reserved for future use */
|
||||
};
|
||||
struct s {
|
||||
long a;
|
||||
long __kabi_reserved_0; /* reserved for future use */
|
||||
};
|
||||
|
||||
The reserved space can be taken into use by wrapping the member in a
|
||||
union, which includes the original type and the replacement member::
|
||||
|
||||
struct s {
|
||||
long a;
|
||||
union {
|
||||
long __kabi_reserved_0; /* original type */
|
||||
struct b b; /* replaced field */
|
||||
};
|
||||
};
|
||||
struct s {
|
||||
long a;
|
||||
union {
|
||||
long __kabi_reserved_0; /* original type */
|
||||
struct b b; /* replaced field */
|
||||
};
|
||||
};
|
||||
|
||||
If the `__kabi_` naming scheme was used when reserving space, the name
|
||||
of the first member of the union must start with `__kabi_reserved`. This
|
||||
@@ -369,11 +392,11 @@ Predicting which structures will require changes during the support
|
||||
timeframe isn't always possible, in which case one might have to resort
|
||||
to placing new members into existing alignment holes::
|
||||
|
||||
struct s {
|
||||
int a;
|
||||
/* a 4-byte alignment hole */
|
||||
unsigned long b;
|
||||
};
|
||||
struct s {
|
||||
int a;
|
||||
/* a 4-byte alignment hole */
|
||||
unsigned long b;
|
||||
};
|
||||
|
||||
|
||||
While this won't change the size of the data structure, one needs to
|
||||
@@ -382,14 +405,14 @@ to reserved fields, this can be accomplished by wrapping the added
|
||||
member to a union where one of the fields has a name starting with
|
||||
`__kabi_ignored`::
|
||||
|
||||
struct s {
|
||||
int a;
|
||||
union {
|
||||
char __kabi_ignored_0;
|
||||
int n;
|
||||
};
|
||||
unsigned long b;
|
||||
};
|
||||
struct s {
|
||||
int a;
|
||||
union {
|
||||
char __kabi_ignored_0;
|
||||
int n;
|
||||
};
|
||||
unsigned long b;
|
||||
};
|
||||
|
||||
With **--stable**, both versions produce the same symbol version. The
|
||||
examples include a `KABI_IGNORE` macro to simplify the code.
|
||||
|
||||
@@ -118,7 +118,7 @@ applicable everywhere (see syntax).
|
||||
This is a shorthand notation for a type definition plus a value.
|
||||
Optionally dependencies for this default value can be added with "if".
|
||||
|
||||
- dependencies: "depends on" <expr>
|
||||
- dependencies: "depends on" <expr> ["if" <expr>]
|
||||
|
||||
This defines a dependency for this menu entry. If multiple
|
||||
dependencies are defined, they are connected with '&&'. Dependencies
|
||||
@@ -134,6 +134,16 @@ applicable everywhere (see syntax).
|
||||
bool "foo"
|
||||
default y
|
||||
|
||||
The dependency definition itself may be conditional by appending "if"
|
||||
followed by an expression. For example::
|
||||
|
||||
config FOO
|
||||
tristate
|
||||
depends on BAR if BAZ
|
||||
|
||||
meaning that FOO is constrained by the value of BAR only if BAZ is
|
||||
also set.
|
||||
|
||||
- reverse dependencies: "select" <symbol> ["if" <expr>]
|
||||
|
||||
While normal dependencies reduce the upper limit of a symbol (see
|
||||
@@ -602,8 +612,14 @@ Some drivers are able to optionally use a feature from another module
|
||||
or build cleanly with that module disabled, but cause a link failure
|
||||
when trying to use that loadable module from a built-in driver.
|
||||
|
||||
The most common way to express this optional dependency in Kconfig logic
|
||||
uses the slightly counterintuitive::
|
||||
The recommended way to express this optional dependency in Kconfig logic
|
||||
uses the conditional form::
|
||||
|
||||
config FOO
|
||||
tristate "Support for foo hardware"
|
||||
depends on BAR if BAR
|
||||
|
||||
This slightly counterintuitive style is also widely used::
|
||||
|
||||
config FOO
|
||||
tristate "Support for foo hardware"
|
||||
|
||||
@@ -6386,6 +6386,12 @@ S: Supported
|
||||
F: drivers/video/console/
|
||||
F: include/linux/console*
|
||||
|
||||
CONTAINER BUILD SCRIPT
|
||||
M: Guillaume Tucker <gtucker@gtucker.io>
|
||||
S: Maintained
|
||||
F: Documentation/dev-tools/container.rst
|
||||
F: scripts/container
|
||||
|
||||
CONTEXT TRACKING
|
||||
M: Frederic Weisbecker <frederic@kernel.org>
|
||||
M: "Paul E. McKenney" <paulmck@kernel.org>
|
||||
@@ -13683,8 +13689,10 @@ F: scripts/Makefile*
|
||||
F: scripts/bash-completion/
|
||||
F: scripts/basic/
|
||||
F: scripts/clang-tools/
|
||||
F: scripts/container
|
||||
F: scripts/dummy-tools/
|
||||
F: scripts/include/
|
||||
F: scripts/install.sh
|
||||
F: scripts/mk*
|
||||
F: scripts/mod/
|
||||
F: scripts/package/
|
||||
|
||||
@@ -295,7 +295,8 @@ no-dot-config-targets := $(clean-targets) \
|
||||
cscope gtags TAGS tags help% %docs check% coccicheck \
|
||||
$(version_h) headers headers_% archheaders archscripts \
|
||||
%asm-generic kernelversion %src-pkg dt_binding_check \
|
||||
outputmakefile rustavailable rustfmt rustfmtcheck
|
||||
outputmakefile rustavailable rustfmt rustfmtcheck \
|
||||
run-command
|
||||
no-sync-config-targets := $(no-dot-config-targets) %install modules_sign kernelrelease \
|
||||
image_name
|
||||
single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.rsi %.s %/
|
||||
@@ -447,6 +448,8 @@ ifneq ($(filter %/,$(LLVM)),)
|
||||
LLVM_PREFIX := $(LLVM)
|
||||
else ifneq ($(filter -%,$(LLVM)),)
|
||||
LLVM_SUFFIX := $(LLVM)
|
||||
else ifneq ($(LLVM),1)
|
||||
$(error Invalid value for LLVM, see Documentation/kbuild/llvm.rst)
|
||||
endif
|
||||
|
||||
HOSTCC = $(LLVM_PREFIX)clang$(LLVM_SUFFIX)
|
||||
@@ -1102,7 +1105,7 @@ KBUILD_CFLAGS += -fno-builtin-wcslen
|
||||
|
||||
# change __FILE__ to the relative path to the source directory
|
||||
ifdef building_out_of_srctree
|
||||
KBUILD_CPPFLAGS += $(call cc-option,-fmacro-prefix-map=$(srcroot)/=)
|
||||
KBUILD_CPPFLAGS += -fmacro-prefix-map=$(srcroot)/=
|
||||
endif
|
||||
|
||||
# include additional Makefiles when needed
|
||||
@@ -1417,6 +1420,10 @@ ifdef CONFIG_HEADERS_INSTALL
|
||||
prepare: headers
|
||||
endif
|
||||
|
||||
PHONY += usr_gen_init_cpio
|
||||
usr_gen_init_cpio: scripts_basic
|
||||
$(Q)$(MAKE) $(build)=usr usr/gen_init_cpio
|
||||
|
||||
PHONY += scripts_unifdef
|
||||
scripts_unifdef: scripts_basic
|
||||
$(Q)$(MAKE) $(build)=scripts scripts/unifdef
|
||||
@@ -1670,6 +1677,8 @@ distclean: mrproper
|
||||
# Packaging of the kernel to various formats
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
modules-cpio-pkg: usr_gen_init_cpio
|
||||
|
||||
%src-pkg: FORCE
|
||||
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.package $@
|
||||
%pkg: include/config/kernel.release FORCE
|
||||
|
||||
@@ -79,6 +79,7 @@ static const char *rel_type(unsigned type)
|
||||
REL_TYPE(R_MIPS_HIGHEST),
|
||||
REL_TYPE(R_MIPS_PC21_S2),
|
||||
REL_TYPE(R_MIPS_PC26_S2),
|
||||
REL_TYPE(R_MIPS_PC32),
|
||||
#undef REL_TYPE
|
||||
};
|
||||
const char *name = "unknown type rel type name";
|
||||
@@ -522,6 +523,7 @@ static int do_reloc(struct section *sec, Elf_Rel *rel, Elf_Sym *sym,
|
||||
case R_MIPS_PC16:
|
||||
case R_MIPS_PC21_S2:
|
||||
case R_MIPS_PC26_S2:
|
||||
case R_MIPS_PC32:
|
||||
/*
|
||||
* NONE can be ignored and PC relative relocations don't
|
||||
* need to be adjusted.
|
||||
|
||||
@@ -29,6 +29,13 @@ void die(char *fmt, ...);
|
||||
#define R_MIPS_PC26_S2 61
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GNU extension that available in glibc only since 2023, not available on musl.
|
||||
*/
|
||||
#ifndef R_MIPS_PC32
|
||||
#define R_MIPS_PC32 248
|
||||
#endif
|
||||
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
|
||||
enum symtype {
|
||||
|
||||
@@ -123,6 +123,8 @@
|
||||
#define R_MIPS_LOVENDOR 100
|
||||
#define R_MIPS_HIVENDOR 127
|
||||
|
||||
#define R_MIPS_PC32 248
|
||||
|
||||
#define SHN_MIPS_ACCOMON 0xff00 /* Allocated common symbols */
|
||||
#define SHN_MIPS_TEXT 0xff01 /* Allocated test symbols. */
|
||||
#define SHN_MIPS_DATA 0xff02 /* Allocated data symbols. */
|
||||
|
||||
@@ -22,7 +22,6 @@ subdir-ccflags-y += $(call cc-option, -Wstringop-truncation)
|
||||
# The following turn off the warnings enabled by -Wextra
|
||||
ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),)
|
||||
subdir-ccflags-y += -Wno-missing-field-initializers
|
||||
subdir-ccflags-y += -Wno-type-limits
|
||||
subdir-ccflags-y += -Wno-shift-negative-value
|
||||
endif
|
||||
ifeq ($(findstring 3, $(KBUILD_EXTRA_WARN)),)
|
||||
|
||||
@@ -17,7 +17,6 @@ subdir-ccflags-y += $(condflags)
|
||||
# The following turn off the warnings enabled by -Wextra
|
||||
subdir-ccflags-y += -Wno-missing-field-initializers
|
||||
subdir-ccflags-y += -Wno-sign-compare
|
||||
subdir-ccflags-y += -Wno-type-limits
|
||||
subdir-ccflags-y += -Wno-shift-negative-value
|
||||
|
||||
obj-$(CONFIG_BTRFS_FS) := btrfs.o
|
||||
|
||||
@@ -36,12 +36,6 @@
|
||||
#define __type_min(T) ((T)((T)-type_max(T)-(T)1))
|
||||
#define type_min(t) __type_min(typeof(t))
|
||||
|
||||
/*
|
||||
* Avoids triggering -Wtype-limits compilation warning,
|
||||
* while using unsigned data types to check a < 0.
|
||||
*/
|
||||
#define is_non_negative(a) ((a) > 0 || (a) == 0)
|
||||
#define is_negative(a) (!(is_non_negative(a)))
|
||||
|
||||
/*
|
||||
* Allows for effectively applying __must_check to a macro so we can have
|
||||
@@ -201,9 +195,9 @@ static inline bool __must_check __must_check_overflow(bool overflow)
|
||||
typeof(d) _d = d; \
|
||||
unsigned long long _a_full = _a; \
|
||||
unsigned int _to_shift = \
|
||||
is_non_negative(_s) && _s < 8 * sizeof(*d) ? _s : 0; \
|
||||
_s >= 0 && _s < 8 * sizeof(*d) ? _s : 0; \
|
||||
*_d = (_a_full << _to_shift); \
|
||||
(_to_shift != _s || is_negative(*_d) || is_negative(_a) || \
|
||||
(_to_shift != _s || *_d < 0 || _a < 0 || \
|
||||
(*_d >> _to_shift) != _a); \
|
||||
}))
|
||||
|
||||
|
||||
@@ -362,7 +362,7 @@ struct hv_kvp_exchg_msg_value {
|
||||
__u8 value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE];
|
||||
__u32 value_u32;
|
||||
__u64 value_u64;
|
||||
};
|
||||
} __attribute__((packed));
|
||||
} __attribute__((packed));
|
||||
|
||||
struct hv_kvp_msg_enumerate {
|
||||
|
||||
@@ -236,7 +236,7 @@ struct vmmdev_hgcm_function_parameter32 {
|
||||
/** Relative to the request header. */
|
||||
__u32 offset;
|
||||
} page_list;
|
||||
} u;
|
||||
} __packed u;
|
||||
} __packed;
|
||||
VMMDEV_ASSERT_SIZE(vmmdev_hgcm_function_parameter32, 4 + 8);
|
||||
|
||||
@@ -251,7 +251,7 @@ struct vmmdev_hgcm_function_parameter64 {
|
||||
union {
|
||||
__u64 phys_addr;
|
||||
__u64 linear_addr;
|
||||
} u;
|
||||
} __packed u;
|
||||
} __packed pointer;
|
||||
struct {
|
||||
/** Size of the buffer described by the page list. */
|
||||
|
||||
+1
-1
@@ -247,7 +247,7 @@ config WERROR
|
||||
|
||||
config UAPI_HEADER_TEST
|
||||
bool "Compile test UAPI headers"
|
||||
depends on HEADERS_INSTALL && CC_CAN_LINK
|
||||
depends on HEADERS_INSTALL
|
||||
help
|
||||
Compile test headers exported to user-space to ensure they are
|
||||
self-contained, i.e. compilable as standalone units.
|
||||
|
||||
+4
-2
@@ -151,8 +151,10 @@ static unsigned int get_symbol_offset(unsigned long pos)
|
||||
|
||||
unsigned long kallsyms_sym_address(int idx)
|
||||
{
|
||||
/* values are unsigned offsets */
|
||||
return kallsyms_relative_base + (u32)kallsyms_offsets[idx];
|
||||
/* non-relocatable 32-bit kernels just embed the value directly */
|
||||
if (!IS_ENABLED(CONFIG_64BIT) && !IS_ENABLED(CONFIG_RELOCATABLE))
|
||||
return (u32)kallsyms_offsets[idx];
|
||||
return (unsigned long)offset_to_ptr(kallsyms_offsets + idx);
|
||||
}
|
||||
|
||||
static unsigned int get_symbol_seq(int index)
|
||||
|
||||
@@ -8,7 +8,6 @@ extern const int kallsyms_offsets[];
|
||||
extern const u8 kallsyms_names[];
|
||||
|
||||
extern const unsigned int kallsyms_num_syms;
|
||||
extern const unsigned long kallsyms_relative_base;
|
||||
|
||||
extern const char kallsyms_token_table[];
|
||||
extern const u16 kallsyms_token_index[];
|
||||
|
||||
@@ -242,7 +242,6 @@ static int __init crash_save_vmcoreinfo_init(void)
|
||||
VMCOREINFO_SYMBOL(kallsyms_token_table);
|
||||
VMCOREINFO_SYMBOL(kallsyms_token_index);
|
||||
VMCOREINFO_SYMBOL(kallsyms_offsets);
|
||||
VMCOREINFO_SYMBOL(kallsyms_relative_base);
|
||||
#endif /* CONFIG_KALLSYMS */
|
||||
|
||||
arch_crash_save_vmcoreinfo();
|
||||
|
||||
@@ -73,8 +73,6 @@ rustc-llvm-version := $(shell,$(srctree)/scripts/rustc-llvm-version.sh $(RUSTC))
|
||||
|
||||
# $(rustc-option,<flag>)
|
||||
# Return y if the Rust compiler supports <flag>, n otherwise
|
||||
# Calls to this should be guarded so that they are not evaluated if
|
||||
# CONFIG_RUST_IS_AVAILABLE is not set.
|
||||
# If you are testing for unstable features, consider testing RUSTC_VERSION
|
||||
# instead, as features may have different completeness while available.
|
||||
rustc-option = $(success,trap "rm -rf .tmp_$$" EXIT; mkdir .tmp_$$; $(RUSTC) $(1) --crate-type=rlib /dev/null --out-dir=.tmp_$$ -o .tmp_$$/tmp.rlib)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user