Skip to content

Commit a74b6c0

Browse files
sulixjmberg-intel
authored andcommitted
um: Don't rename vmap to kernel_vmap
In order to work around the existence of a vmap symbol in libpcap, the UML makefile unconditionally redefines vmap to kernel_vmap. However, this not only affects the actual vmap symbol, but also anything else named vmap, including a number of struct members in DRM. This would not be too much of a problem, since all uses are also updated, except we now have Rust DRM bindings, which expect the corresponding Rust structs to have 'vmap' names. Since the redefinition applies in bindgen, but not to Rust code, we end up with errors such as: error[E0560]: struct `drm_gem_object_funcs` has no fields named `vmap` --> rust/kernel/drm/gem/mod.rs:210:9 Since libpcap support was removed in commit 12b8e7e ("um: Remove obsolete pcap driver"), remove the, now unnecessary, define as well. We also take this opportunity to update the comment. Signed-off-by: David Gow <davidgow@google.com> Acked-by: Miguel Ojeda <ojeda@kernel.org> Link: https://patch.msgid.link/20251122083213.3996586-1-davidgow@google.com Fixes: 12b8e7e ("um: Remove obsolete pcap driver") [adjust commmit message a bit] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 5461800 commit a74b6c0

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

arch/um/Makefile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,17 @@ ARCH_INCLUDE := -I$(srctree)/$(SHARED_HEADERS)
4646
ARCH_INCLUDE += -I$(srctree)/$(HOST_DIR)/um/shared
4747
KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/um
4848

49-
# -Dvmap=kernel_vmap prevents anything from referencing the libpcap.o symbol so
50-
# named - it's a common symbol in libpcap, so we get a binary which crashes.
51-
#
52-
# Same things for in6addr_loopback and mktime - found in libc. For these two we
53-
# only get link-time error, luckily.
49+
# -Dstrrchr=kernel_strrchr (as well as the various in6addr symbols) prevents
50+
# anything from referencing
51+
# libc symbols with the same name, which can cause a linker error.
5452
#
5553
# -Dlongjmp=kernel_longjmp prevents anything from referencing the libpthread.a
5654
# embedded copy of longjmp, same thing for setjmp.
5755
#
58-
# These apply to USER_CFLAGS to.
56+
# These apply to USER_CFLAGS too.
5957

6058
KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -D__arch_um__ \
61-
$(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \
59+
$(ARCH_INCLUDE) $(MODE_INCLUDE) \
6260
-Dlongjmp=kernel_longjmp -Dsetjmp=kernel_setjmp \
6361
-Din6addr_loopback=kernel_in6addr_loopback \
6462
-Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr \

0 commit comments

Comments
 (0)