All of lore.kernel.org
 help / color / mirror / Atom feed
* Build fix for VDE and PCAP drivers
@ 2019-10-16  7:53 Anton Ivanov
  2019-10-16  7:53 ` [PATCH] um: Fix pcap and vde driver builds Anton Ivanov
  0 siblings, 1 reply; 3+ messages in thread
From: Anton Ivanov @ 2019-10-16  7:53 UTC (permalink / raw)
  To: linux-um; +Cc: richard, 938962

Hi all,

A patch to fix the build for these follows.

I will stick to my original suggestion - pcap should be obsoleted in favour of
vector raw + BPF firmware load. The latter will work on interfaces where gso/gro
is enabled. The original pcap will fail on that due to the 1500 bytes size limit
in the legacy net code.

I had to dig the root cause here and figure out what is going on while working
on an AF_XDP transport as that had the same problem - it needed to pass -lbpf
-lelf -lz which could not be passed under the current build system.

A.



_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] um: Fix pcap and vde driver builds
  2019-10-16  7:53 Build fix for VDE and PCAP drivers Anton Ivanov
@ 2019-10-16  7:53 ` Anton Ivanov
  2019-10-16  9:12   ` Anton Ivanov
  0 siblings, 1 reply; 3+ messages in thread
From: Anton Ivanov @ 2019-10-16  7:53 UTC (permalink / raw)
  To: linux-um; +Cc: richard, Anton Ivanov, 938962

Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
---
 arch/um/drivers/Makefile | 8 ++++++++
 scripts/link-vmlinux.sh  | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile
index 693319839f69..34355057ec85 100644
--- a/arch/um/drivers/Makefile
+++ b/arch/um/drivers/Makefile
@@ -24,6 +24,14 @@ LDFLAGS_vde.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libvdeplug.a)
 
 targets := pcap_kern.o pcap_user.o vde_kern.o vde_user.o
 
+ifeq ($(CONFIG_UML_NET_PCAP),y)
+	export UML_EXTRA_LIBS += -lpcap
+endif
+ifeq ($(CONFIG_UML_NET_VDE),y)
+	export UML_EXTRA_LIBS += -lvde -lvdeplug
+endif
+
+
 $(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o
 	$(LD) -r -dp -o $@ $^ $(ld_flags)
 
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index 915775eb2921..d3e6a6cdfc13 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -86,7 +86,7 @@ vmlinux_link()
 		${CC} ${CFLAGS_vmlinux} -o ${2}			\
 			-Wl,-T,${lds}				\
 			${objects}				\
-			-lutil -lrt -lpthread
+			-lutil -lrt -lpthread ${UML_EXTRA_LIBS}
 		rm -f linux
 	fi
 }
-- 
2.20.1


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] um: Fix pcap and vde driver builds
  2019-10-16  7:53 ` [PATCH] um: Fix pcap and vde driver builds Anton Ivanov
@ 2019-10-16  9:12   ` Anton Ivanov
  0 siblings, 0 replies; 3+ messages in thread
From: Anton Ivanov @ 2019-10-16  9:12 UTC (permalink / raw)
  To: linux-um; +Cc: richard, 938962

On 16/10/2019 08:53, Anton Ivanov wrote:
> Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
> ---
>   arch/um/drivers/Makefile | 8 ++++++++
>   scripts/link-vmlinux.sh  | 2 +-
>   2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile
> index 693319839f69..34355057ec85 100644
> --- a/arch/um/drivers/Makefile
> +++ b/arch/um/drivers/Makefile
> @@ -24,6 +24,14 @@ LDFLAGS_vde.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libvdeplug.a)
>   
>   targets := pcap_kern.o pcap_user.o vde_kern.o vde_user.o
>   
> +ifeq ($(CONFIG_UML_NET_PCAP),y)
> +	export UML_EXTRA_LIBS += -lpcap
> +endif
> +ifeq ($(CONFIG_UML_NET_VDE),y)
> +	export UML_EXTRA_LIBS += -lvde -lvdeplug
> +endif
> +
> +
>   $(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o
>   	$(LD) -r -dp -o $@ $^ $(ld_flags)
>   
> diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
> index 915775eb2921..d3e6a6cdfc13 100755
> --- a/scripts/link-vmlinux.sh
> +++ b/scripts/link-vmlinux.sh
> @@ -86,7 +86,7 @@ vmlinux_link()
>   		${CC} ${CFLAGS_vmlinux} -o ${2}			\
>   			-Wl,-T,${lds}				\
>   			${objects}				\
> -			-lutil -lrt -lpthread
> +			-lutil -lrt -lpthread ${UML_EXTRA_LIBS}
>   		rm -f linux
>   	fi
>   }


This will not work as advertised unfortunately - I have to write out the 
libs list somewhere and load it again in the link script instead of 
passing it as an environment variable.

A fixed patch will follow shortly.

-- 
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-16  9:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-16  7:53 Build fix for VDE and PCAP drivers Anton Ivanov
2019-10-16  7:53 ` [PATCH] um: Fix pcap and vde driver builds Anton Ivanov
2019-10-16  9:12   ` Anton Ivanov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.