From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Rothwell Subject: Re: [GIT] Networking Date: Thu, 21 Jun 2018 23:46:46 +1000 Message-ID: <20180621234646.3aed20b9@canb.auug.org.au> References: <20180620.213540.214945910722071226.davem@davemloft.net> <20180621084510.GA22870@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/xv6CjjNrjE7bD6EFJGZCKU1"; protocol="application/pgp-signature" Cc: mingo@kernel.org, "David S . Miller" , alexei.starovoitov@gmail.com, torvalds@linux-foundation.org, akpm@linux-foundation.org, netdev , linux-kernel@vger.kernel.org, tglx@linutronix.de To: Matteo Croce Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org --Sig_/xv6CjjNrjE7bD6EFJGZCKU1 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Matteo, On Thu, 21 Jun 2018 13:40:43 +0000 Matteo Croce wrote: > > On Thu, Jun 21, 2018 at 8:46 AM Ingo Molnar wrote: > > > > * David Miller wrote: > > =20 > > > 1) Fix crash on bpf_prog_load() errors, from Daniel Borkmann. =20 > > =20 > > > Daniel Borkmann (4): > > > Merge branch 'bpf-misc-fixes' > > > bpf: fix panic in prog load calls cleanup > > > bpf: reject any prog that failed read-only lock > > > bpf, xdp, i40e: fix i40e_build_skb skb reserve and truesize =20 > > > > JFYI, I'm still seeing this BPF build error upstream, on a 32-bit allye= sconfig I'm > > getting: > > > > LD vmlinux.o > > ld: i386:x86-64 architecture of input file `net/bpfilter/bpfilter_umh= .o' is incompatible with i386 output > > Makefile:1010: recipe for target 'vmlinux' failed > > make: *** [vmlinux] Error 1 > > > > A similar looking build bug was reported by sfr three weeks ago: > > =20 > > > Subject: linux-next: build failure after merge of the net-next tree > > > > > > ... > > > > > > x86_64-linux-ld: unknown architecture of input file `net/bpfilter/bpf= ilter_umh.o' > > > is incompatible with i386:x86-64 output > > > > > > Caused by commit > > > > > > d2ba09c17a06 ("net: add skeleton of bpfilter kernel module") > > > > > > In my builds, the host is PowerPC 64 LE ... > > > > > > I have reverted that commit along with > > > > > > 61a552eb487f ("bpfilter: fix build dependency") > > > 13405468f49d ("bpfilter: don't pass O_CREAT when opening console for= debug") > > > > > > for today. =20 > > > > Is there a fix I could try? >=20 > are you compiling a 32 bit kernel on an x86_64 host? I tried to > compile an i386 bit kernel on an i386 host and I have no issue, > running objdump by hand produces correct output: >=20 > $ uname -a > Linux debian32 4.16.0-2-686-pae #1 SMP Debian 4.16.16-1 (2018-06-19) > i686 GNU/Linux > $ objdump -f net/bpfilter/bpfilter_umh |awk -F' |,' '/file > format/{print "-O",$NF} /^architecture:/{print "-B",$2}' > -O elf32-i386 > -B i386 >=20 > then I tried to compile an i386 kernel on an x86_64 host and I get the > same error: >=20 > $ make -j8 ARCH=3Di386 > ... > LD vmlinux.o > ld: i386:x86-64 architecture of input file > `net/bpfilter/bpfilter_umh.o' is incompatible with i386 output > make: *** [Makefile:1015: vmlinux] Error 1 >=20 > the problem seems to be that bpfilter_umh is compiled with host flags, > and so it's a 64 bit binary in my case: >=20 > gcc -static -o net/bpfilter/bpfilter_umh net/bpfilter/main.o > objcopy -I binary `LC_ALL=3DC objdump -f net/bpfilter/bpfilter_umh |awk > -F' |,' '/file format/{print "-O",$NF} /^architecture:/{print > "-B",$2}'` --rename-section .data=3D.init.rodata > net/bpfilter/bpfilter_umh net/bpfilter/bpfilter_umh.o > ld -m elf_i386 -r -o vmlinux.o --whole-archive built-in.a > --no-whole-archive --start-group lib/lib.a arch/x86/lib/lib.a > --end-group > ld: i386:x86-64 architecture of input file > `net/bpfilter/bpfilter_umh.o' is incompatible with i386 output >=20 > Any idea how to fix it without building it twice, for host and target? This presumably has the same root cause that means I can't build a big endian PowerPC version on a little endian host ... Either I have to have CONFIG_BPFILTER turned off (or maybe just CONFIG_BPFILTER_UMH) or build with a compiler that cannot link user mode programs (which effectively does the same). --=20 Cheers, Stephen Rothwell --Sig_/xv6CjjNrjE7bD6EFJGZCKU1 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEENIC96giZ81tWdLgKAVBC80lX0GwFAlsrrEYACgkQAVBC80lX 0GzjQQf9F/JrmeUq3TMYazH9gCuP27sSvCKKVXegO7ryCef/zEH7Vk+DOsi2IMYD jfu57WtRSoH/QStFIq3UG2x2V8uhIgjyrXTukHQEsjYW0bwZdLeBMldBH7dCdOMk 8x+9TFZQ9Ya37JeQfF3AG7++7Cob0n/74V8fzNdC7UEMd9sSmCZfhVGDpvUb7q3U wwZt5qvCmd2hueHLBzOrKORG1dSu1DBX/0yNyhdpC65LF2+XCLwUMwkdKWF5ODxE OjqT7wqVmoE1QwgexJxdhItAbbGfHbxZD5jJVokJg2W49+U+4Y++YEIRuBnF+2Vh OTP3ZbzdrWaTWajoLT0r4UV9b/DKYw== =Qfuh -----END PGP SIGNATURE----- --Sig_/xv6CjjNrjE7bD6EFJGZCKU1--