Skip to content

Commit 730586f

Browse files
Ignat Korchaginrichardweinberger
authored andcommitted
um: Allow static linking for non-glibc implementations
It is possible to produce a statically linked UML binary with UML_NET_VECTOR, UML_NET_VDE and UML_NET_PCAP options enabled using alternative libc implementations, which do not rely on NSS, such as musl. Allow static linking in this case. Signed-off-by: Ignat Korchagin <ignat@cloudflare.com> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Tested-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 5e1121c commit 730586f

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎arch/um/Kconfig‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ config NR_CPUS
6262

6363
source "arch/$(HEADER_ARCH)/um/Kconfig"
6464

65-
config FORBID_STATIC_LINK
66-
bool
65+
config MAY_HAVE_RUNTIME_DEPS
66+
bool
6767

6868
config STATIC_LINK
6969
bool "Force a static link"
70-
depends on !FORBID_STATIC_LINK
70+
depends on CC_CAN_LINK_STATIC_NO_RUNTIME_DEPS || !MAY_HAVE_RUNTIME_DEPS
7171
help
7272
This option gives you the ability to force a static link of UML.
7373
Normally, UML is linked as a shared binary. This is inconvenient for

‎arch/um/drivers/Kconfig‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ config UML_NET_DAEMON
234234
config UML_NET_VECTOR
235235
bool "Vector I/O high performance network devices"
236236
depends on UML_NET
237-
select FORBID_STATIC_LINK
237+
select MAY_HAVE_RUNTIME_DEPS
238238
help
239239
This User-Mode Linux network driver uses multi-message send
240240
and receive functions. The host running the UML guest must have
@@ -246,7 +246,7 @@ config UML_NET_VECTOR
246246
config UML_NET_VDE
247247
bool "VDE transport (obsolete)"
248248
depends on UML_NET
249-
select FORBID_STATIC_LINK
249+
select MAY_HAVE_RUNTIME_DEPS
250250
help
251251
This User-Mode Linux network transport allows one or more running
252252
UMLs on a single host to communicate with each other and also
@@ -294,7 +294,7 @@ config UML_NET_MCAST
294294
config UML_NET_PCAP
295295
bool "pcap transport (obsolete)"
296296
depends on UML_NET
297-
select FORBID_STATIC_LINK
297+
select MAY_HAVE_RUNTIME_DEPS
298298
help
299299
The pcap transport makes a pcap packet stream on the host look
300300
like an ethernet device inside UML. This is useful for making

0 commit comments

Comments
 (0)