]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add support for ARCH=um for x86 sub-architectures
authorcrass <development@efficientek.com>
Wed, 15 Jun 2022 21:22:52 +0000 (16:22 -0500)
committerGitHub <noreply@github.com>
Wed, 15 Jun 2022 21:22:52 +0000 (14:22 -0700)
commitbc00d2c711c5bd930fe63deae3946ed3fb2463b4
treeb92cab7f601d7ab16980831553d6900aae020441
parent988431966639d791ac269011d136e85f3602df75
Add support for ARCH=um for x86 sub-architectures

When building modules (as well as the kernel) with ARCH=um, the options
-Dsetjmp=kernel_setjmp and -Dlongjmp=kernel_longjmp are passed to the C
preprocessor for C files. This causes the setjmp and longjmp used in
module/lua/ldo.c to be kernel_setjmp and kernel_longjmp respectively in
the object file. However, the setjmp and longjmp that is intended to be
called is defined in an architecture dependent assembly file under the
directory module/lua/setjmp. Since it is an assembly and not a C file,
the preprocessor define is not given and the names do not change. This
becomes an issue when modpost is trying to create the Module.symvers
and sees no defined symbol for kernel_setjmp and kernel_longjmp. To fix
this, if the macro CONFIG_UML is defined, then setjmp and longjmp
macros are undefined.

When building with ARCH=um for x86 sub-architectures, CONFIG_X86 is not
defined. Instead, CONFIG_UML_X86 is defined. Despite this, the UML x86
sub-architecture can use the same object files as the x86 architectures
because the x86 sub-architecture UML kernel is running with the same
instruction set as CONFIG_X86. So the modules/Kbuild build file is
updated to add the same object files that CONFIG_X86 would add when
CONFIG_UML_X86 is defined.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Glenn Washburn <development@efficientek.com>
Closes #13547
include/os/linux/zfs/sys/zfs_context_os.h
module/Kbuild.in