From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZbGrH-0004WI-IP for mharc-grub-devel@gnu.org; Sun, 13 Sep 2015 19:38:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbGrE-0004Vh-CY for grub-devel@gnu.org; Sun, 13 Sep 2015 19:38:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbGrB-000416-3d for grub-devel@gnu.org; Sun, 13 Sep 2015 19:38:52 -0400 Received: from world.peace.net ([50.252.239.5]:59140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbGrA-0003vy-VJ for grub-devel@gnu.org; Sun, 13 Sep 2015 19:38:49 -0400 Received: from c-98-217-13-77.hsd1.ma.comcast.net ([98.217.13.77] helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1ZbGqq-0000ZI-Hv; Sun, 13 Sep 2015 19:38:28 -0400 From: Mark H Weaver To: Andrei Borzenkov Subject: Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI. References: <1440009323-8667-1-git-send-email-mhw@netris.org> <55D6A36D.205@gmail.com> <876147ryhy.fsf@netris.org> <55DAC58C.1030105@gmail.com> <87si79nmp3.fsf@netris.org> <55DAD1F9.7080302@gmail.com> <55DAE394.6030306@gmail.com> <87mvxfp6y8.fsf@netris.org> <55F2EDF4.4040207@gmail.com> <87a8srjb1h.fsf@netris.org> <55F583DD.2020805@gmail.com> Date: Sun, 13 Sep 2015 19:37:22 -0400 In-Reply-To: <55F583DD.2020805@gmail.com> (Andrei Borzenkov's message of "Sun, 13 Sep 2015 17:10:37 +0300") Message-ID: <87pp1lx559.fsf@netris.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 50.252.239.5 Cc: The development of GNU GRUB X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2015 23:38:53 -0000 Andrei Borzenkov writes: > 13.09.2015 05:41, Mark H Weaver =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >> I'm glad to report that with your new patch, GRUB successfully builds on >> GuixSD mips64el with TARGET_CC=3Dclang. I haven't yet tried booting it >> though. >> > > Did you have chance to test whether compiled grub actually work? Not yet. I'll try to do it in the next few days. >> The warning above makes me doubt the portability and future-proofness of >> the link step of this test. This problem could be avoided entirely by >> omitting the link step. The link step serves no purpose in this test, >> and is a potential source of portability problems. >> > > This step helped us to catch endianness mismatch; we want to ensure in > this case that full toolchain works to produce final binary. Okay, fair enough :) > Please test two attached patches. They separate o32 test from > endianness test. I compile-tested them using cross-binutils for mips > and powerpc64le to compile for mipsel and powerpc. The first patch > also adds additional _start and __start symbols to endianness tests to > avoid compiler warnings. The little-endian-option test fails with GCC 5.2.0. The relevant errors from config.log are: gcc: error: unrecognized command line option '-target' gcc: error: unrecognized command line option '-mlittle-endian' I guess the error messages above should be enough. Let me know if you want more. It succeeds with clang 3.6.0. See below for the relevant excerpts of config.log. Thanks, Mark --8<---------------cut here---------------start------------->8--- configure:24669: checking for options to get little-endian compilation configure:24704: /gnu/store/yjmchvkz0kmz4s1sxc0p89imfik68qzg-clang-3.6.0/bi= n/clang -o conftest -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-s= ubscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv= -by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -= Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-b= races -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -W= sequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragm= as -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-va= lue -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes= -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-al= ign -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast = -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpoi= nter-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-va= r -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-decl= arations -Wformat=3D2 -target mipsel -Wl,-EL -Werror -Wall -W -DGRUB_CPU_= MIPSEL=3D1 -DGRUB_MACHINE_MIPS_LOONGSON=3D1 -DGRUB_MACHINE=3DMIPS_LOONGSON = -nostdlib -static conftest.c >&5 ld: /tmp/conftest-78445a.o: ABI is incompatible with that of the selected e= mulation ld: failed to merge target specific data of file /tmp/conftest-78445a.o collect2: error: ld returned 1 exit status clang-3.6: error: linker (via gcc) command failed with exit code 1 (use -v = to see invocation) configure:24704: $? =3D 1 configure: failed program was: [...] configure:24704: /gnu/store/yjmchvkz0kmz4s1sxc0p89imfik68qzg-clang-3.6.0/bi= n/clang -o conftest -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-s= ubscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv= -by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -= Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-b= races -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -W= sequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragm= as -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-va= lue -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes= -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-al= ign -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast = -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpoi= nter-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-va= r -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-decl= arations -Wformat=3D2 -target mipsel -Werror -Wall -W -DGRUB_CPU_MIPSEL= =3D1 -DGRUB_MACHINE_MIPS_LOONGSON=3D1 -DGRUB_MACHINE=3DMIPS_LOONGSON -nost= dlib -static conftest.c >&5 ld: /tmp/conftest-66051b.o: ABI is incompatible with that of the selected e= mulation ld: failed to merge target specific data of file /tmp/conftest-66051b.o collect2: error: ld returned 1 exit status clang-3.6: error: linker (via gcc) command failed with exit code 1 (use -v = to see invocation) configure:24704: $? =3D 1 configure: failed program was: [...] configure:24704: /gnu/store/yjmchvkz0kmz4s1sxc0p89imfik68qzg-clang-3.6.0/bi= n/clang -o conftest -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-s= ubscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv= -by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -= Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-b= races -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -W= sequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragm= as -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-va= lue -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes= -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-al= ign -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast = -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpoi= nter-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-va= r -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-decl= arations -Wformat=3D2 -target mipsel-linux-gnu -Wl,-EL -Werror -Wall -W -= DGRUB_CPU_MIPSEL=3D1 -DGRUB_MACHINE_MIPS_LOONGSON=3D1 -DGRUB_MACHINE=3DMIPS= _LOONGSON -nostdlib -static conftest.c >&5 configure:24704: $? =3D 0 configure:24712: result: -target mipsel-linux-gnu -Wl,-EL configure:24728: checking for options to force MIPS o32 ABI configure:24761: /gnu/store/yjmchvkz0kmz4s1sxc0p89imfik68qzg-clang-3.6.0/bi= n/clang -o conftest -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-s= ubscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv= -by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -= Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-b= races -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -W= sequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragm= as -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-va= lue -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes= -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-al= ign -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast = -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpoi= nter-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-va= r -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-decl= arations -Wformat=3D2 -target mipsel-linux-gnu -Werror -Wall -W -DGRUB_= CPU_MIPSEL=3D1 -DGRUB_MACHINE_MIPS_LOONGSON=3D1 -DGRUB_MACHINE=3DMIPS_LOONG= SON -nostdlib -static conftest.c >&5 configure:24761: $? =3D 0 configure:24769: result:=20 --8<---------------cut here---------------end--------------->8---