1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
PCAP and VDE network transports require linking with userspace
libraries. The current build system has no means of passing these
as arguments.
This patch adds a script to expand the library list for linking
for these transports as well as any future driver that needs to
rely on additional libraries on the userspace side.
Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
---
arch/um/scripts/extra-libs.sh | 10 ++++++++++
scripts/link-vmlinux.sh | 4 +++-
2 files changed, 13 insertions(+), 1 deletion(-)
create mode 100644 arch/um/scripts/extra-libs.sh
--- /dev/null
+++ b/arch/um/scripts/extra-libs.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# This file should be included from link-vmlinux, not executed!!!
+
+if [ "${CONFIG_UML_NET_VDE}" = "y" ] ; then
+ UML_EXTRA_LIBS="$UML_EXTRA_LIBS -lvdeplug"
+fi
+if [ "${CONFIG_UML_NET_PCAP}" = "y" ] ; then
+ UML_EXTRA_LIBS="$UML_EXTRA_LIBS -lpcap"
+fi
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -124,12 +124,14 @@
-Wl,--end-group \
${@}"
+ . arch/um/scripts/extra-libs.sh
+
${CC} ${CFLAGS_vmlinux} \
${strip_debug} \
-o ${output} \
-Wl,-T,${lds} \
${objects} \
- -lutil -lrt -lpthread
+ -lutil -lrt -lpthread ${UML_EXTRA_LIBS}
rm -f linux
fi
}
|