HomeFreeBSD

Add support for ARCH=um for x86 sub-architectures

Description

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

Details

Provenance
crass <development@efficientek.com>Authored on Jun 15 2022, 9:22 PM
GitHub <noreply@github.com>Committed on Jun 15 2022, 9:22 PM
Parents
rG988431966639: Fix clang 13 compilation errors
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rGbc00d2c711c5: Add support for ARCH=um for x86 sub-architectures (authored by crass <development@efficientek.com>).Jun 15 2022, 9:22 PM