All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
@ 2015-08-19 18:35 Mark H Weaver
  2015-08-21  4:05 ` Andrei Borzenkov
  0 siblings, 1 reply; 29+ messages in thread
From: Mark H Weaver @ 2015-08-19 18:35 UTC (permalink / raw)
  To: grub-devel; +Cc: Mark H Weaver

Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
code for the O32 ABI when targetting MIPS, since the MIPS assembly code
in GRUB assumes this.  This flag is also needed when compiling
asm-tests/mips.S from configure, because GNU as rejects MIPS register
names such as $t2 unless the O32 ABI is selected.
---
 conf/Makefile.common | 4 ++++
 configure.ac         | 7 +++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/conf/Makefile.common b/conf/Makefile.common
index fcb8d2e..bd125da 100644
--- a/conf/Makefile.common
+++ b/conf/Makefile.common
@@ -20,6 +20,10 @@ endif
 if COND_powerpc_ieee1275
   CFLAGS_PLATFORM += -mcpu=powerpc
 endif
+if COND_mips
+  CFLAGS_PLATFORM += -mabi=32
+  CCASFLAGS_PLATFORM = -mabi=32
+endif
 
 #FIXME: discover and check XEN headers
 CPPFLAGS_XEN = -I/usr/include
diff --git a/configure.ac b/configure.ac
index c864311..1f5e8a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,8 @@
 
 # Process this file with autoconf to produce a configure script.
 
-# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010  Free Software Foundation, Inc.
+# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,
+#   2012,2013,2014,2015  Free Software Foundation, Inc.
 #
 # This configure.ac is free software; the author
 # gives unlimited permission to copy and/or distribute it,
@@ -599,9 +600,11 @@ fi
 
 AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [
 test_program=
+test_ccasflags=
 case "x$target_cpu-$platform" in
      xmips-* | xmipsel-*)
         test_program=mips
+        test_ccasflags=-mabi=32
 	;;
      xi386-pc)
        test_program=i386-pc
@@ -618,7 +621,7 @@ if test x"$test_program" = x ; then
 else
   found=no
   for arg in "" "-no-integrated-as"; do
-    cmdline="$TARGET_CC -c -o /dev/null $TARGET_CCASFLAGS $arg $TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S"
+    cmdline="$TARGET_CC -c -o /dev/null $TARGET_CCASFLAGS $test_ccasflags $arg $TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S"
     echo "Running $cmdline" >&AS_MESSAGE_LOG_FD
     if $cmdline >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
       grub_cv_cc_target_asm_compile="$arg"
-- 
2.4.3



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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-08-19 18:35 [PATCH] Ensure that MIPS target code is compiled for the O32 ABI Mark H Weaver
@ 2015-08-21  4:05 ` Andrei Borzenkov
  2015-08-22 18:04   ` Mark H Weaver
  0 siblings, 1 reply; 29+ messages in thread
From: Andrei Borzenkov @ 2015-08-21  4:05 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Mark H Weaver

19.08.2015 21:35, Mark H Weaver пишет:
> Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
> code for the O32 ABI when targetting MIPS, since the MIPS assembly code
> in GRUB assumes this.  This flag is also needed when compiling
> asm-tests/mips.S from configure, because GNU as rejects MIPS register
> names such as $t2 unless the O32 ABI is selected.
> ---
>   conf/Makefile.common | 4 ++++
>   configure.ac         | 7 +++++--
>   2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/conf/Makefile.common b/conf/Makefile.common
> index fcb8d2e..bd125da 100644
> --- a/conf/Makefile.common
> +++ b/conf/Makefile.common
> @@ -20,6 +20,10 @@ endif
>   if COND_powerpc_ieee1275
>     CFLAGS_PLATFORM += -mcpu=powerpc
>   endif
> +if COND_mips
> +  CFLAGS_PLATFORM += -mabi=32
> +  CCASFLAGS_PLATFORM = -mabi=32
> +endif
>

Does it work with clang?

>   #FIXME: discover and check XEN headers
>   CPPFLAGS_XEN = -I/usr/include
> diff --git a/configure.ac b/configure.ac
> index c864311..1f5e8a2 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2,7 +2,8 @@
>
>   # Process this file with autoconf to produce a configure script.
>
> -# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010  Free Software Foundation, Inc.
> +# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,
> +#   2012,2013,2014,2015  Free Software Foundation, Inc.
>   #
>   # This configure.ac is free software; the author
>   # gives unlimited permission to copy and/or distribute it,
> @@ -599,9 +600,11 @@ fi
>
>   AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [
>   test_program=
> +test_ccasflags=
>   case "x$target_cpu-$platform" in
>        xmips-* | xmipsel-*)
>           test_program=mips
> +        test_ccasflags=-mabi=32
>   	;;
>        xi386-pc)
>          test_program=i386-pc
> @@ -618,7 +621,7 @@ if test x"$test_program" = x ; then
>   else
>     found=no
>     for arg in "" "-no-integrated-as"; do
> -    cmdline="$TARGET_CC -c -o /dev/null $TARGET_CCASFLAGS $arg $TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S"
> +    cmdline="$TARGET_CC -c -o /dev/null $TARGET_CCASFLAGS $test_ccasflags $arg $TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S"
>       echo "Running $cmdline" >&AS_MESSAGE_LOG_FD
>       if $cmdline >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
>         grub_cv_cc_target_asm_compile="$arg"
>



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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-08-21  4:05 ` Andrei Borzenkov
@ 2015-08-22 18:04   ` Mark H Weaver
  2015-08-23  9:51     ` Andrei Borzenkov
  2015-08-24  7:19     ` [PATCH] " Andrei Borzenkov
  0 siblings, 2 replies; 29+ messages in thread
From: Mark H Weaver @ 2015-08-22 18:04 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: The development of GNU GRUB

Andrei Borzenkov <arvidjaar@gmail.com> writes:

> 19.08.2015 21:35, Mark H Weaver пишет:
>> Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
>> code for the O32 ABI when targetting MIPS, since the MIPS assembly code
>> in GRUB assumes this.  This flag is also needed when compiling
>> asm-tests/mips.S from configure, because GNU as rejects MIPS register
>> names such as $t2 unless the O32 ABI is selected.
>> ---
>>   conf/Makefile.common | 4 ++++
>>   configure.ac         | 7 +++++--
>>   2 files changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/conf/Makefile.common b/conf/Makefile.common
>> index fcb8d2e..bd125da 100644
>> --- a/conf/Makefile.common
>> +++ b/conf/Makefile.common
>> @@ -20,6 +20,10 @@ endif
>>   if COND_powerpc_ieee1275
>>     CFLAGS_PLATFORM += -mcpu=powerpc
>>   endif
>> +if COND_mips
>> +  CFLAGS_PLATFORM += -mabi=32
>> +  CCASFLAGS_PLATFORM = -mabi=32
>> +endif
>>
>
> Does it work with clang?

Based on the error message below, clang seems to accept and understand
the -mabi=32 option, but the version of clang that we have in GNU Guix
(which uses the N32 ABI on MIPS) seems to lack support for compiling for
O32:

  mhw@librenote:~$ clang -mabi=32 mips.S 
  error: unknown target CPU 'mips32r2'

However, it doesn't work without that option either:

  mhw@librenote:~$ clang mips.S 
  mips.S: Assembler messages:
  mips.S:7: Error: invalid operands `ld $t2,0($t6)'
  mips.S:10: Error: invalid operands `addiu $t7,$s0,(b-a)'
  clang-3.6: error: assembler command failed with exit code 1 (use -v to see invocation)

This is the same failure that occurs with gcc when configured to use the
N32 ABI by default.  I also tried passing -fno-integrated-as in both
cases above, but it made no difference.

      Mark


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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-08-22 18:04   ` Mark H Weaver
@ 2015-08-23  9:51     ` Andrei Borzenkov
  2015-08-23 17:27       ` Mark H Weaver
  2015-08-24  6:50       ` [PATCH v2] " Mark H Weaver
  2015-08-24  7:19     ` [PATCH] " Andrei Borzenkov
  1 sibling, 2 replies; 29+ messages in thread
From: Andrei Borzenkov @ 2015-08-23  9:51 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: The development of GNU GRUB

22.08.2015 21:04, Mark H Weaver пишет:
> Andrei Borzenkov <arvidjaar@gmail.com> writes:
>
>> 19.08.2015 21:35, Mark H Weaver пишет:
>>> Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
>>> code for the O32 ABI when targetting MIPS, since the MIPS assembly code
>>> in GRUB assumes this.  This flag is also needed when compiling
>>> asm-tests/mips.S from configure, because GNU as rejects MIPS register
>>> names such as $t2 unless the O32 ABI is selected.

BTW, I assume this did work at some point; so this needs more verbose 
explanation what changed and why it stopped working.

>>> ---
>>>    conf/Makefile.common | 4 ++++
>>>    configure.ac         | 7 +++++--
>>>    2 files changed, 9 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/conf/Makefile.common b/conf/Makefile.common
>>> index fcb8d2e..bd125da 100644
>>> --- a/conf/Makefile.common
>>> +++ b/conf/Makefile.common
>>> @@ -20,6 +20,10 @@ endif
>>>    if COND_powerpc_ieee1275
>>>      CFLAGS_PLATFORM += -mcpu=powerpc
>>>    endif
>>> +if COND_mips
>>> +  CFLAGS_PLATFORM += -mabi=32
>>> +  CCASFLAGS_PLATFORM = -mabi=32
>>> +endif
>>>
>>
>> Does it work with clang?
>
> Based on the error message below, clang seems to accept and understand
> the -mabi=32 option, but the version of clang that we have in GNU Guix
> (which uses the N32 ABI on MIPS) seems to lack support for compiling for
> O32:
>
>    mhw@librenote:~$ clang -mabi=32 mips.S
>    error: unknown target CPU 'mips32r2'
>

Are you on native MIPS platform or cross-compiling? Which clang version? 
This works for me using current upstream clang (I do not have cross 
binutils so linking fails, but that's different story).

bor@bor-Latitude-E5450:~/build/grub$ ~/build/llvm/bin/clang 
--target=mips -mabi=32 -v -integrated-as -c asm-tests/mips.S
clang version 3.8.0 (git://github.com/llvm-mirror/clang.git 
2b06a033d151865ca944dedf899e9b36aa630f42) 
(git://github.com/llvm-mirror/llvm.git 
8f7e8462cdf3b0eed913202b81f14e2fead62be4)
Target: mips
Thread model: posix
InstalledDir: /home/bor/build/llvm/bin
  "/home/bor/build/llvm/bin/clang-3.8" -cc1 -triple mips -E 
-disable-free -main-file-name mips.S -mrelocation-model static 
-mthread-model posix -mdisable-fp-elim -fmath-errno 
-mconstructor-aliases -target-cpu mips32r2 -target-abi o32 -mfloat-abi 
hard -v -dwarf-column-info -coverage-file /home/bor/build/grub/mips.S 
-resource-dir /home/bor/build/llvm/bin/../lib/clang/3.8.0 
-fdebug-compilation-dir /home/bor/build/grub -ferror-limit 19 
-fmessage-length 95 -mstackrealign -fobjc-runtime=gcc 
-fdiagnostics-show-option -o /tmp/mips-b9949a.s -x assembler-with-cpp 
asm-tests/mips.S
clang -cc1 version 3.8.0 based upon LLVM 3.8.0svn default target 
x86_64-unknown-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
  /usr/local/include
  /home/bor/build/llvm/bin/../lib/clang/3.8.0/include
  /usr/include
End of search list.
  "/home/bor/build/llvm/bin/clang-3.8" -cc1as -triple mips -filetype obj 
-main-file-name mips.S -target-cpu mips32r2 -fdebug-compilation-dir 
/home/bor/build/grub -dwarf-debug-producer clang version 3.8.0 
(git://github.com/llvm-mirror/clang.git 
2b06a033d151865ca944dedf899e9b36aa630f42) 
(git://github.com/llvm-mirror/llvm.git 
8f7e8462cdf3b0eed913202b81f14e2fead62be4) -mrelocation-model static 
-target-abi o32 -o mips.o /tmp/mips-b9949a.s

Actually this works for me also without -mabi=32 and produced object 
type is identical

> However, it doesn't work without that option either:
>
>    mhw@librenote:~$ clang mips.S
>    mips.S: Assembler messages:
>    mips.S:7: Error: invalid operands `ld $t2,0($t6)'
>    mips.S:10: Error: invalid operands `addiu $t7,$s0,(b-a)'
>    clang-3.6: error: assembler command failed with exit code 1 (use -v to see invocation)
>
> This is the same failure that occurs with gcc when configured to use the
> N32 ABI by default.  I also tried passing -fno-integrated-as in both
> cases above, but it made no difference.
>
>        Mark
>



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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-08-23  9:51     ` Andrei Borzenkov
@ 2015-08-23 17:27       ` Mark H Weaver
  2015-08-24  6:50       ` [PATCH v2] " Mark H Weaver
  1 sibling, 0 replies; 29+ messages in thread
From: Mark H Weaver @ 2015-08-23 17:27 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: The development of GNU GRUB

Andrei Borzenkov <arvidjaar@gmail.com> writes:

> 22.08.2015 21:04, Mark H Weaver пишет:
>> Andrei Borzenkov <arvidjaar@gmail.com> writes:
>>
>>> 19.08.2015 21:35, Mark H Weaver пишет:
>>>> Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
>>>> code for the O32 ABI when targetting MIPS, since the MIPS assembly code
>>>> in GRUB assumes this.  This flag is also needed when compiling
>>>> asm-tests/mips.S from configure, because GNU as rejects MIPS register
>>>> names such as $t2 unless the O32 ABI is selected.
>
> BTW, I assume this did work at some point; so this needs more verbose
> explanation what changed and why it stopped working.

It worked, and probably still works, on MIPS systems that use the O32
ABI.  It has never worked on systems that use one of the newer ABIs for
MIPS.

>>>> ---
>>>>    conf/Makefile.common | 4 ++++
>>>>    configure.ac         | 7 +++++--
>>>>    2 files changed, 9 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/conf/Makefile.common b/conf/Makefile.common
>>>> index fcb8d2e..bd125da 100644
>>>> --- a/conf/Makefile.common
>>>> +++ b/conf/Makefile.common
>>>> @@ -20,6 +20,10 @@ endif
>>>>    if COND_powerpc_ieee1275
>>>>      CFLAGS_PLATFORM += -mcpu=powerpc
>>>>    endif
>>>> +if COND_mips
>>>> +  CFLAGS_PLATFORM += -mabi=32
>>>> +  CCASFLAGS_PLATFORM = -mabi=32
>>>> +endif
>>>>
>>>
>>> Does it work with clang?
>>
>> Based on the error message below, clang seems to accept and understand
>> the -mabi=32 option, but the version of clang that we have in GNU Guix
>> (which uses the N32 ABI on MIPS) seems to lack support for compiling for
>> O32:
>>
>>    mhw@librenote:~$ clang -mabi=32 mips.S
>>    error: unknown target CPU 'mips32r2'
>>
>
> Are you on native MIPS platform or cross-compiling?

I've done all of my tests on a native MIPS platform.  I haven't tried
cross-compiling, and would prefer to avoid it.

> Which clang version?

3.6.0.

> This works for me using current upstream clang (I do not have
> cross binutils so linking fails, but that's different story).
[...]
> Actually this works for me also without -mabi=32 and produced object
> type is identical

That's because the compiler you're using has been configured to use the
O32 ABI by default.  In that case, -mabi=32 has no effect because that
flag means "compile for the O32 ABI", which is already the default.

    Thanks,
      Mark


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

* [PATCH v2] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-08-23  9:51     ` Andrei Borzenkov
  2015-08-23 17:27       ` Mark H Weaver
@ 2015-08-24  6:50       ` Mark H Weaver
  2015-09-08 17:11         ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 1 reply; 29+ messages in thread
From: Mark H Weaver @ 2015-08-24  6:50 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: The development of GNU GRUB

Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
code for the O32 ABI when targetting MIPS, since the MIPS assembly code
in GRUB assumes this.  This flag is also needed when compiling
asm-tests/mips.S from configure, because GNU as rejects MIPS register
names such as $t2 unless the O32 ABI is selected.

This is needed when using a compiler that defaults to one of the newer
MIPS ABIs such as N32 or N64, e.g. when natively compiling on a system
that uses one of these newer MIPS ABIs.
---
 conf/Makefile.common | 4 ++++
 configure.ac         | 7 +++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/conf/Makefile.common b/conf/Makefile.common
index fcb8d2e..bd125da 100644
--- a/conf/Makefile.common
+++ b/conf/Makefile.common
@@ -20,6 +20,10 @@ endif
 if COND_powerpc_ieee1275
   CFLAGS_PLATFORM += -mcpu=powerpc
 endif
+if COND_mips
+  CFLAGS_PLATFORM += -mabi=32
+  CCASFLAGS_PLATFORM = -mabi=32
+endif
 
 #FIXME: discover and check XEN headers
 CPPFLAGS_XEN = -I/usr/include
diff --git a/configure.ac b/configure.ac
index c864311..1f5e8a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,8 @@
 
 # Process this file with autoconf to produce a configure script.
 
-# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010  Free Software Foundation, Inc.
+# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,
+#   2012,2013,2014,2015  Free Software Foundation, Inc.
 #
 # This configure.ac is free software; the author
 # gives unlimited permission to copy and/or distribute it,
@@ -599,9 +600,11 @@ fi
 
 AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [
 test_program=
+test_ccasflags=
 case "x$target_cpu-$platform" in
      xmips-* | xmipsel-*)
         test_program=mips
+        test_ccasflags=-mabi=32
 	;;
      xi386-pc)
        test_program=i386-pc
@@ -618,7 +621,7 @@ if test x"$test_program" = x ; then
 else
   found=no
   for arg in "" "-no-integrated-as"; do
-    cmdline="$TARGET_CC -c -o /dev/null $TARGET_CCASFLAGS $arg $TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S"
+    cmdline="$TARGET_CC -c -o /dev/null $TARGET_CCASFLAGS $test_ccasflags $arg $TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S"
     echo "Running $cmdline" >&AS_MESSAGE_LOG_FD
     if $cmdline >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
       grub_cv_cc_target_asm_compile="$arg"
-- 
2.5.0



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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-08-22 18:04   ` Mark H Weaver
  2015-08-23  9:51     ` Andrei Borzenkov
@ 2015-08-24  7:19     ` Andrei Borzenkov
  2015-08-24  7:57       ` Mark H Weaver
  1 sibling, 1 reply; 29+ messages in thread
From: Andrei Borzenkov @ 2015-08-24  7:19 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: The development of GNU GRUB

22.08.2015 21:04, Mark H Weaver пишет:
> Andrei Borzenkov <arvidjaar@gmail.com> writes:
>
>> 19.08.2015 21:35, Mark H Weaver пишет:
>>> Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
>>> code for the O32 ABI when targetting MIPS, since the MIPS assembly code
>>> in GRUB assumes this.  This flag is also needed when compiling
>>> asm-tests/mips.S from configure, because GNU as rejects MIPS register
>>> names such as $t2 unless the O32 ABI is selected.
>>> ---
>>>    conf/Makefile.common | 4 ++++
>>>    configure.ac         | 7 +++++--
>>>    2 files changed, 9 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/conf/Makefile.common b/conf/Makefile.common
>>> index fcb8d2e..bd125da 100644
>>> --- a/conf/Makefile.common
>>> +++ b/conf/Makefile.common
>>> @@ -20,6 +20,10 @@ endif
>>>    if COND_powerpc_ieee1275
>>>      CFLAGS_PLATFORM += -mcpu=powerpc
>>>    endif
>>> +if COND_mips
>>> +  CFLAGS_PLATFORM += -mabi=32
>>> +  CCASFLAGS_PLATFORM = -mabi=32
>>> +endif
>>>
>>
>> Does it work with clang?
>
> Based on the error message below, clang seems to accept and understand
> the -mabi=32 option, but the version of clang that we have in GNU Guix
> (which uses the N32 ABI on MIPS) seems to lack support for compiling for
> O32:
>
>    mhw@librenote:~$ clang -mabi=32 mips.S
>    error: unknown target CPU 'mips32r2'
>
> However, it doesn't work without that option either:
>
>    mhw@librenote:~$ clang mips.S
>    mips.S: Assembler messages:
>    mips.S:7: Error: invalid operands `ld $t2,0($t6)'
>    mips.S:10: Error: invalid operands `addiu $t7,$s0,(b-a)'
>    clang-3.6: error: assembler command failed with exit code 1 (use -v to see invocation)
>
> This is the same failure that occurs with gcc when configured to use the
> N32 ABI by default.  I also tried passing -fno-integrated-as in both
> cases above, but it made no difference.
>

Could you paste "clang -v" output for both cases? I believe I understand 
what's going on.


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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-08-24  7:19     ` [PATCH] " Andrei Borzenkov
@ 2015-08-24  7:57       ` Mark H Weaver
  2015-08-24  8:12         ` Andrei Borzenkov
  0 siblings, 1 reply; 29+ messages in thread
From: Mark H Weaver @ 2015-08-24  7:57 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: The development of GNU GRUB

Andrei Borzenkov <arvidjaar@gmail.com> writes:
> Could you paste "clang -v" output for both cases? I believe I
> understand what's going on.

Okay, I've included it below.  It might be relevant to mention that the
MIPS port of GNU Guix is not a 'multilib' system: it includes support
only for the N32 ABI.  However, our gcc is still capable of generating
freestanding code for the O32 ABI, as demonstrated by the fact that I've
been successfully building and using GRUB on it.

    Thanks,
      Mark

--8<---------------cut here---------------start------------->8---
mhw@librenote:~$ clang -v -mabi=32 mips.S
clang version 3.6.0 (tags/RELEASE_360/final)
Target: mips64el-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /gnu/store/1phn21k7w04nsc38zlzrslqcqivcn714-gcc-4.9.3-lib/lib/gcc/mips64el-unknown-linux-gnu/4.9.3
Selected GCC installation: /gnu/store/1phn21k7w04nsc38zlzrslqcqivcn714-gcc-4.9.3-lib/lib/gcc/mips64el-unknown-linux-gnu/4.9.3
Candidate multilib: .;
Selected multilib: .;
 "/gnu/store/hy0fp4z8ar362cnry5ifwmcrq2nqmjfc-clang-3.6.0/bin/clang-3.6" -cc1 -triple mips64el-unknown-linux-gnu -E -disable-free -disable-llvm-verifier -main-file-name mips.S -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -no-integrated-as -mconstructor-aliases -fuse-init-array -target-cpu mips32r2 -target-feature -n64 -target-feature +o32 -target-abi o32 -mfloat-abi hard -v -dwarf-column-info -resource-dir /gnu/store/hy0fp4z8ar362cnry5ifwmcrq2nqmjfc-clang-3.6.0/bin/../lib/clang/3.6.0 -I/home/mhw/.guix-profile/include -internal-isystem /usr/local/include -internal-isystem /gnu/store/hy0fp4z8ar362cnry5ifwmcrq2nqmjfc-clang-3.6.0/bin/../lib/clang/3.6.0/include -internal-externc-isystem /gnu/store/cncig2c9n92ndz97pw0ply1jjc0xycmf-glibc-2.21/include -fno-dwarf-directory-asm -fdebug-compilation-dir /home/mhw -ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gcc -fdiagnostics-show-option -o /tmp/mips-a6494a.s -x assembler-with-cpp mips.S
error: unknown target CPU 'mips32r2'
mhw@librenote:~$ clang -v mips.S
clang version 3.6.0 (tags/RELEASE_360/final)
Target: mips64el-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /gnu/store/1phn21k7w04nsc38zlzrslqcqivcn714-gcc-4.9.3-lib/lib/gcc/mips64el-unknown-linux-gnu/4.9.3
Selected GCC installation: /gnu/store/1phn21k7w04nsc38zlzrslqcqivcn714-gcc-4.9.3-lib/lib/gcc/mips64el-unknown-linux-gnu/4.9.3
Candidate multilib: .;
Selected multilib: .;
 "/gnu/store/hy0fp4z8ar362cnry5ifwmcrq2nqmjfc-clang-3.6.0/bin/clang-3.6" -cc1 -triple mips64el-unknown-linux-gnu -E -disable-free -disable-llvm-verifier -main-file-name mips.S -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -no-integrated-as -mconstructor-aliases -fuse-init-array -target-cpu mips64r2 -target-feature -o32 -target-feature +n64 -target-abi n64 -mfloat-abi hard -v -dwarf-column-info -resource-dir /gnu/store/hy0fp4z8ar362cnry5ifwmcrq2nqmjfc-clang-3.6.0/bin/../lib/clang/3.6.0 -I/home/mhw/.guix-profile/include -internal-isystem /usr/local/include -internal-isystem /gnu/store/hy0fp4z8ar362cnry5ifwmcrq2nqmjfc-clang-3.6.0/bin/../lib/clang/3.6.0/include -internal-externc-isystem /gnu/store/cncig2c9n92ndz97pw0ply1jjc0xycmf-glibc-2.21/include -fno-dwarf-directory-asm -fdebug-compilation-dir /home/mhw -ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gcc -fdiagnostics-show-option -o /tmp/mips-aee666.s -x assembler-with-cpp mips.S
clang -cc1 version 3.6.0 based upon LLVM 3.6.0 default target mips64el-unknown-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
 /home/mhw/.guix-profile/include
 /usr/local/include
 /gnu/store/hy0fp4z8ar362cnry5ifwmcrq2nqmjfc-clang-3.6.0/bin/../lib/clang/3.6.0/include
 /gnu/store/cncig2c9n92ndz97pw0ply1jjc0xycmf-glibc-2.21/include
End of search list.
 "/home/mhw/.guix-profile/bin/as" -march mips64r2 -mabi 64 -mno-shared -KPIC -EL -o /tmp/mips-e5abd7.o /tmp/mips-aee666.s
mips.S: Assembler messages:
mips.S:7: Error: invalid operands `ld $t2,0($t6)'
mips.S:10: Error: invalid operands `addiu $t7,$s0,(b-a)'
clang-3.6: error: assembler command failed with exit code 1 (use -v to see invocation)
mhw@librenote:~$
--8<---------------cut here---------------end--------------->8---


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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-08-24  7:57       ` Mark H Weaver
@ 2015-08-24  8:12         ` Andrei Borzenkov
  2015-08-24  9:27           ` Andrei Borzenkov
  0 siblings, 1 reply; 29+ messages in thread
From: Andrei Borzenkov @ 2015-08-24  8:12 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 950 bytes --]

24.08.2015 10:57, Mark H Weaver пишет:
> Andrei Borzenkov <arvidjaar@gmail.com> writes:
>> Could you paste "clang -v" output for both cases? I believe I
>> understand what's going on.
>
> Okay, I've included it below.  It might be relevant to mention that the
> MIPS port of GNU Guix is not a 'multilib' system: it includes support
> only for the N32 ABI.  However, our gcc is still capable of generating
> freestanding code for the O32 ABI, as demonstrated by the fact that I've
> been successfully building and using GRUB on it.
>
>      Thanks,
>        Mark
>
> --8<---------------cut here---------------start------------->8---
> mhw@librenote:~$ clang -v -mabi=32 mips.S
> clang version 3.6.0 (tags/RELEASE_360/final)
> Target: mips64el-unknown-linux-gnu

Yes, as expected. clang treats mips and mips64 as two different targets 
so o32 is invalid for mips64.

Could you test attached patch for both gcc and clang? Use

configure TARGET_CC=clang

[-- Attachment #2: mips-o32.patch --]
[-- Type: text/x-patch, Size: 2033 bytes --]

From: Andrei Borzenkov <arvidjaar@gmail.com>
Subject: [PATCH] configure: try to force o32 ABI on MIPS

GRUB expects o32 ABI, in particular used assembly is valid only in this mode.
Some systems (e.g. GNU Guix) default to using newer n64 or n32 ABI. Try to
find suitable options to force o32.

For GCC this is simply -mabi=32. While clang supports this option as well,
o32 ABI is valid for MIPS target and n32/64 ABI are valid for MIPS64 target 
only, so use "-target mips -mabi=32".

Reported-By: Mark H Weaver <mhw@netris.org>
Also-By: Mark H Weaver <mhw@netris.org>

---
 configure.ac | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/configure.ac b/configure.ac
index c864311..d857e47 100644
--- a/configure.ac
+++ b/configure.ac
@@ -597,6 +597,35 @@ int main (void);
   TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_big_endian"
 fi
 
+if test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ; then
+  AC_CACHE_CHECK([for options to force MIPS o32 ABI], grub_cv_target_cc_mips_o32_abi, [
+    grub_cv_target_cc_mips_o32_abi=no
+    for arg in "" "-mabi=32" "-target mips -mabi=32"
+      if test x"$grub_cv_target_cc_mips_o32_abi" != xno ; then
+        break
+      fi
+      CFLAGS="$TARGET_CFLAGS $arg -Werror"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#if !defined(_ABIO32) || !defined(_MIPS_SIM) || (_MIPS_SIM != _ABIO32)
+#error not o32 ABI
+#endif
+asm (".globl start; start:");
+void __main (void);
+void __main (void) {}
+int main (void);
+]], [[]])],
+		        [grub_cv_target_cc_mips_o32_abi="$arg"], [])
+    done
+  ])
+
+  if test x"$grub_cv_target_cc_mips_o32_abi" = xno ; then
+    AC_MSG_ERROR([could not force MIPS o32 ABI])
+  fi
+
+  TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_mips_o32_abi"
+  TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_mips_o32_abi"
+fi
+
 AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [
 test_program=
 case "x$target_cpu-$platform" in
-- 
tg: (ba218c1..) u/mips-o32 (depends on: master)

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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-08-24  8:12         ` Andrei Borzenkov
@ 2015-08-24  9:27           ` Andrei Borzenkov
  2015-08-25 18:18             ` Mark H Weaver
  0 siblings, 1 reply; 29+ messages in thread
From: Andrei Borzenkov @ 2015-08-24  9:27 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 1065 bytes --]

24.08.2015 11:12, Andrei Borzenkov пишет:
> 24.08.2015 10:57, Mark H Weaver пишет:
>> Andrei Borzenkov <arvidjaar@gmail.com> writes:
>>> Could you paste "clang -v" output for both cases? I believe I
>>> understand what's going on.
>>
>> Okay, I've included it below.  It might be relevant to mention that the
>> MIPS port of GNU Guix is not a 'multilib' system: it includes support
>> only for the N32 ABI.  However, our gcc is still capable of generating
>> freestanding code for the O32 ABI, as demonstrated by the fact that I've
>> been successfully building and using GRUB on it.
>>
>>      Thanks,
>>        Mark
>>
>> --8<---------------cut here---------------start------------->8---
>> mhw@librenote:~$ clang -v -mabi=32 mips.S
>> clang version 3.6.0 (tags/RELEASE_360/final)
>> Target: mips64el-unknown-linux-gnu
>
> Yes, as expected. clang treats mips and mips64 as two different targets
> so o32 is invalid for mips64.
>
> Could you test attached patch for both gcc and clang? Use
>
> configure TARGET_CC=clang

Sorry, was broken, fixed version attached.

[-- Attachment #2: mips-o32.patch --]
[-- Type: text/x-patch, Size: 2038 bytes --]

From: Andrei Borzenkov <arvidjaar@gmail.com>
Subject: [PATCH] configure: try to force o32 ABI on MIPS

GRUB expects o32 ABI, in particular used assembly is valid only in this mode.
Some systems (e.g. GNU Guix) default to using newer n64 or n32 ABI. Try to
find suitable options to force o32.

For GCC this is simply -mabi=32. While clang supports this option as well,
o32 ABI is valid for MIPS target and n32/64 ABI are valid for MIPS64 target 
only, so use "-target mips -mabi=32".

Reported-By: Mark H Weaver <mhw@netris.org>
Also-By: Mark H Weaver <mhw@netris.org>

---
 configure.ac | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/configure.ac b/configure.ac
index c864311..2e73b3f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -597,6 +597,35 @@ int main (void);
   TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_big_endian"
 fi
 
+if test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ; then
+  AC_CACHE_CHECK([for options to force MIPS o32 ABI], grub_cv_target_cc_mips_o32_abi, [
+    grub_cv_target_cc_mips_o32_abi=no
+    for arg in "" "-mabi=32" "-target mips -mabi=32" ; do
+      if test x"$grub_cv_target_cc_mips_o32_abi" != xno ; then
+        break
+      fi
+      CFLAGS="$TARGET_CFLAGS $arg -Werror"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#if !defined(_ABIO32) || !defined(_MIPS_SIM) || (_MIPS_SIM != _ABIO32)
+#error not o32 ABI
+#endif
+asm (".globl start; start:");
+void __main (void);
+void __main (void) {}
+int main (void);
+]], [[]])],
+		        [grub_cv_target_cc_mips_o32_abi="$arg"], [])
+    done
+  ])
+
+  if test x"$grub_cv_target_cc_mips_o32_abi" = xno ; then
+    AC_MSG_ERROR([could not force MIPS o32 ABI])
+  fi
+
+  TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_mips_o32_abi"
+  TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_mips_o32_abi"
+fi
+
 AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [
 test_program=
 case "x$target_cpu-$platform" in
-- 
tg: (ba218c1..) u/mips-o32 (depends on: master)

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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-08-24  9:27           ` Andrei Borzenkov
@ 2015-08-25 18:18             ` Mark H Weaver
  2015-09-11 15:06               ` Andrei Borzenkov
  0 siblings, 1 reply; 29+ messages in thread
From: Mark H Weaver @ 2015-08-25 18:18 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: The development of GNU GRUB

Andrei Borzenkov <arvidjaar@gmail.com> writes:

> 24.08.2015 11:12, Andrei Borzenkov пишет:
>> Could you test attached patch for both gcc and clang? Use
>>
>> configure TARGET_CC=clang
>
> Sorry, was broken, fixed version attached.

Your patch works for me with gcc, although config.log shows this warning
when building the test program in your new code with the correct flags
for gcc (-mabi=32):

  ld: warning: cannot find entry symbol __start; defaulting to 00000000004000d0

Here's the relevant excerpt:

--8<---------------cut here---------------start------------->8---
configure:24700: gcc -o conftest  -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -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-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -mabi=32 -Werror  -Wall -W  -DGRUB_CPU_MIPSEL=1 -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE=MIPS_LOONGSON  -nostdlib -static conftest.c  >&5
ld: warning: cannot find entry symbol __start; defaulting to 00000000004000d0
configure:24700: $? = 0
configure:24708: result: -mabi=32
--8<---------------cut here---------------end--------------->8---

I also worry that linking an O32 executable might be fragile on a pure
non-multilib N32 system such as GNU Guix, where we lack even the gcc
runtime library (libgcc_s) for O32.  For now it seems to work, but I
wonder if it might be more robust to do the test compilation with -c and
-freestanding?

 clang: with TARGET_CC=clang, it fails for me.  Here are the
relevant excerpts from config.log:

--8<---------------cut here---------------start------------->8---
configure:24700: /gnu/store/yjmchvkz0kmz4s1sxc0p89imfik68qzg-clang-3.6.0/bin/clang -o conftest  -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -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-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -mabi=32 -Werror  -Wall -W  -DGRUB_CPU_MIPSEL=1 -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE=MIPS_LOONGSON  -nostdlib -static conftest.c  >&5
error: unknown target CPU 'mips32r2'
configure:24700: $? = 1
configure: failed program was:
[...]
configure:24700: /gnu/store/yjmchvkz0kmz4s1sxc0p89imfik68qzg-clang-3.6.0/bin/clang -o conftest  -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -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-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -target mips -mabi=32 -Werror  -Wall -W  -DGRUB_CPU_MIPSEL=1 -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE=MIPS_LOONGSON  -nostdlib -static conftest.c  >&5
ld: /tmp/conftest-efc530.o: compiled for a big endian system and target is little endian
ld: /tmp/conftest-efc530.o: endianness incompatible with that of the selected emulation
ld: failed to merge target specific data of file /tmp/conftest-efc530.o
ld: warning: cannot find entry symbol __start; defaulting to 00000000004000f0
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:24700: $? = 1
configure: failed program was:
[...]
--8<---------------cut here---------------end--------------->8---

I guess that "-target mips" is interpreted as requesting big endian.

I suspect that simply passing -mabi=32 is the right thing to do for
clang as well, but that the clang we have built in GNU Guix doesn't
include support for targetting the O32 ABI.  It's possible that the only
way to target O32 from a non-multilib N32 system using clang is to do
cross-compilation.  Or perhaps we need to explicitly request support for
'mips32r2' when building clang.

      Mark


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

* Re: [PATCH v2] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-08-24  6:50       ` [PATCH v2] " Mark H Weaver
@ 2015-09-08 17:11         ` Vladimir 'φ-coder/phcoder' Serbinenko
  2015-09-09  1:37           ` Mark H Weaver
  2015-09-13  6:32           ` Andrei Borzenkov
  0 siblings, 2 replies; 29+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2015-09-08 17:11 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 2713 bytes --]

On 23.08.2015 23:50, Mark H Weaver wrote:
> Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
> code for the O32 ABI when targetting MIPS, since the MIPS assembly code
> in GRUB assumes this.
Could you be more precise where we assume this? Why not fix the assembly
instead?
>  This flag is also needed when compiling
> asm-tests/mips.S from configure, because GNU as rejects MIPS register
> names such as $t2 unless the O32 ABI is selected.
> 
> This is needed when using a compiler that defaults to one of the newer
> MIPS ABIs such as N32 or N64, e.g. when natively compiling on a system
> that uses one of these newer MIPS ABIs.
> ---
>  conf/Makefile.common | 4 ++++
>  configure.ac         | 7 +++++--
>  2 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/conf/Makefile.common b/conf/Makefile.common
> index fcb8d2e..bd125da 100644
> --- a/conf/Makefile.common
> +++ b/conf/Makefile.common
> @@ -20,6 +20,10 @@ endif
>  if COND_powerpc_ieee1275
>    CFLAGS_PLATFORM += -mcpu=powerpc
>  endif
> +if COND_mips
> +  CFLAGS_PLATFORM += -mabi=32
> +  CCASFLAGS_PLATFORM = -mabi=32
> +endif
>  
>  #FIXME: discover and check XEN headers
>  CPPFLAGS_XEN = -I/usr/include
> diff --git a/configure.ac b/configure.ac
> index c864311..1f5e8a2 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2,7 +2,8 @@
>  
>  # Process this file with autoconf to produce a configure script.
>  
> -# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010  Free Software Foundation, Inc.
> +# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,
> +#   2012,2013,2014,2015  Free Software Foundation, Inc.
>  #
>  # This configure.ac is free software; the author
>  # gives unlimited permission to copy and/or distribute it,
> @@ -599,9 +600,11 @@ fi
>  
>  AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [
>  test_program=
> +test_ccasflags=
>  case "x$target_cpu-$platform" in
>       xmips-* | xmipsel-*)
>          test_program=mips
> +        test_ccasflags=-mabi=32
>  	;;
>       xi386-pc)
>         test_program=i386-pc
> @@ -618,7 +621,7 @@ if test x"$test_program" = x ; then
>  else
>    found=no
>    for arg in "" "-no-integrated-as"; do
> -    cmdline="$TARGET_CC -c -o /dev/null $TARGET_CCASFLAGS $arg $TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S"
> +    cmdline="$TARGET_CC -c -o /dev/null $TARGET_CCASFLAGS $test_ccasflags $arg $TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S"
>      echo "Running $cmdline" >&AS_MESSAGE_LOG_FD
>      if $cmdline >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
>        grub_cv_cc_target_asm_compile="$arg"
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

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

* Re: [PATCH v2] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-09-08 17:11         ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2015-09-09  1:37           ` Mark H Weaver
  2015-09-13  6:32           ` Andrei Borzenkov
  1 sibling, 0 replies; 29+ messages in thread
From: Mark H Weaver @ 2015-09-09  1:37 UTC (permalink / raw)
  To: Vladimir 'φ-coder/phcoder' Serbinenko
  Cc: The development of GNU GRUB

"Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com> writes:

> On 23.08.2015 23:50, Mark H Weaver wrote:
>> Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
>> code for the O32 ABI when targetting MIPS, since the MIPS assembly code
>> in GRUB assumes this.
> Could you be more precise where we assume this?

Well, to begin with, most of the MIPS assembly code in GRUB uses the
MIPS register names such as $tN, $sN, $aN, $vN, etc.  Such code is
rejected by the assembler unless the O32 ABI is being used, which makes
sense since those names are based on the registers' roles in the O32
ABI.

In addition, I guess that any MIPS assembly code in *.S that is called
by C (or calls into C) will need to be adjusted to use the calling
conventions of the ABI in use (N32 or N64).  There may be other issues
as well; I haven't researched it.

> Why not fix the assembly instead?

If someone wants to do that job, I'd be pleased, but I don't have time
to do it.  I have too many other more important things to work on, and
not enough time.  Too few people are working on non-Intel platforms,
leaving most of the work on both the MIPS and ARMHF ports of GNU Guix to
me.  Many other important packages still need to be fixed on both MIPS
and ARMHF, whereas I have GRUB working well.

     Regards,
       Mark


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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-08-25 18:18             ` Mark H Weaver
@ 2015-09-11 15:06               ` Andrei Borzenkov
  2015-09-13  2:41                 ` Mark H Weaver
  0 siblings, 1 reply; 29+ messages in thread
From: Andrei Borzenkov @ 2015-09-11 15:06 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 6969 bytes --]

25.08.2015 21:18, Mark H Weaver пишет:
> Andrei Borzenkov <arvidjaar@gmail.com> writes:
>
>> 24.08.2015 11:12, Andrei Borzenkov пишет:
>>> Could you test attached patch for both gcc and clang? Use
>>>
>>> configure TARGET_CC=clang
>>
>> Sorry, was broken, fixed version attached.
>
> Your patch works for me with gcc, although config.log shows this warning
> when building the test program in your new code with the correct flags
> for gcc (-mabi=32):
>
>    ld: warning: cannot find entry symbol __start; defaulting to 00000000004000d0
>

Well, I just reused existing checks in this case; we worry about it later.

> Here's the relevant excerpt:
>
> --8<---------------cut here---------------start------------->8---
> configure:24700: gcc -o conftest  -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -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-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations 
-Wformat=2 -mabi=32 -Werror  -Wall -W  -DGRUB_CPU_MIPSEL=1 -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE=MIPS_LOONGSON  -nostdlib -static conftest.c  >&5
> ld: warning: cannot find entry symbol __start; defaulting to 00000000004000d0
> configure:24700: $? = 0
> configure:24708: result: -mabi=32
> --8<---------------cut here---------------end--------------->8---
>
> I also worry that linking an O32 executable might be fragile on a pure
> non-multilib N32 system such as GNU Guix, where we lack even the gcc
> runtime library (libgcc_s) for O32.  For now it seems to work, but I
> wonder if it might be more robust to do the test compilation with -c and
> -freestanding?
>

It is using -nostdlib; is it not enough?

>   clang: with TARGET_CC=clang, it fails for me.  Here are the
> relevant excerpts from config.log:
>
> --8<---------------cut here---------------start------------->8---
> configure:24700: /gnu/store/yjmchvkz0kmz4s1sxc0p89imfik68qzg-clang-3.6.0/bin/clang -o conftest  -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -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-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmis
sing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -mabi=32 -Werror  -Wall -W  -DGRUB_CPU_MIPSEL=1 -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE=MIPS_LOONGSON  -nostdlib -static conftest.c  >&5
> error: unknown target CPU 'mips32r2'
> configure:24700: $? = 1
> configure: failed program was:
> [...]
> configure:24700: /gnu/store/yjmchvkz0kmz4s1sxc0p89imfik68qzg-clang-3.6.0/bin/clang -o conftest  -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -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-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmis
sing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -target mips -mabi=32 -Werror  -Wall -W  -DGRUB_CPU_MIPSEL=1 -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE=MIPS_LOONGSON  -nostdlib -static conftest.c  >&5
> ld: /tmp/conftest-efc530.o: compiled for a big endian system and target is little endian
> ld: /tmp/conftest-efc530.o: endianness incompatible with that of the selected emulation

This is the same problem we had on powerpc. Your binutils are set to use 
little-endian output by default; we need to explicitly enable either big 
or little endian in this case as well. Could you try attached patch to 
verify?  Although I guess we need to unify endianness checks for all 
supported platforms.

> ld: failed to merge target specific data of file /tmp/conftest-efc530.o
> ld: warning: cannot find entry symbol __start; defaulting to 00000000004000f0
> 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:24700: $? = 1
> configure: failed program was:
> [...]
> --8<---------------cut here---------------end--------------->8---
>
> I guess that "-target mips" is interpreted as requesting big endian.
>
> I suspect that simply passing -mabi=32 is the right thing to do for
> clang as well, but that the clang we have built in GNU Guix doesn't
> include support for targetting the O32 ABI.

As far as I can tell, clang can enable full platform (i.e. MIPS) but not 
platform variant. So if clang can compile for MIPS at all it should be 
able to produce both versions. The problem is, endianness in clang is 
property of target; and what makes it even worse, options that are 
passed to backend toolchains are also target dependent.

 >                                            It's possible that the only
> way to target O32 from a non-multilib N32 system using clang is to do
> cross-compilation.  Or perhaps we need to explicitly request support for
> 'mips32r2' when building clang.
>
>        Mark
>


[-- Attachment #2: mips-32.patch --]
[-- Type: text/x-patch, Size: 2052 bytes --]

From: Andrei Borzenkov <arvidjaar@gmail.com>
Subject: [PATCH] configure: try to force o32 ABI on MIPS

GRUB expects o32 ABI, in particular used assembly is valid only in this mode.
Some systems (e.g. GNU Guix) default to using newer n64 or n32 ABI. Try to
find suitable options to force o32.

For GCC this is simply -mabi=32. While clang supports this option as well,
o32 ABI is valid for MIPS target and n32/64 ABI are valid for MIPS64 target 
only, so use "-target mips/mipsel -mabi=32".

Reported-By: Mark H Weaver <mhw@netris.org>
Also-By: Mark H Weaver <mhw@netris.org>

---
 configure.ac | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/configure.ac b/configure.ac
index c864311..f3c9b90 100644
--- a/configure.ac
+++ b/configure.ac
@@ -597,6 +597,35 @@ int main (void);
   TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_big_endian"
 fi
 
+if test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ; then
+  AC_CACHE_CHECK([for options to force MIPS o32 ABI], grub_cv_target_cc_mips_o32_abi, [
+    grub_cv_target_cc_mips_o32_abi=no
+    for arg in "" "-mabi=32" "-target $target_cpu -mabi=32" ; do
+      if test x"$grub_cv_target_cc_mips_o32_abi" != xno ; then
+        break
+      fi
+      CFLAGS="$TARGET_CFLAGS $arg -Werror"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#if !defined(_ABIO32) || !defined(_MIPS_SIM) || (_MIPS_SIM != _ABIO32)
+#error not o32 ABI
+#endif
+asm (".globl start; start:");
+void __main (void);
+void __main (void) {}
+int main (void);
+]], [[]])],
+		        [grub_cv_target_cc_mips_o32_abi="$arg"], [])
+    done
+  ])
+
+  if test x"$grub_cv_target_cc_mips_o32_abi" = xno ; then
+    AC_MSG_ERROR([could not force MIPS o32 ABI])
+  fi
+
+  TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_mips_o32_abi"
+  TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_mips_o32_abi"
+fi
+
 AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [
 test_program=
 case "x$target_cpu-$platform" in
-- 
tg: (8e3d2c8..) u/mips-o32 (depends on: master)

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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-09-11 15:06               ` Andrei Borzenkov
@ 2015-09-13  2:41                 ` Mark H Weaver
  2015-09-13  3:46                   ` Mark H Weaver
  2015-09-13 14:10                   ` Andrei Borzenkov
  0 siblings, 2 replies; 29+ messages in thread
From: Mark H Weaver @ 2015-09-13  2:41 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: The development of GNU GRUB

Andrei Borzenkov <arvidjaar@gmail.com> writes:

>> ld: /tmp/conftest-efc530.o: compiled for a big endian system and target is little endian
>> ld: /tmp/conftest-efc530.o: endianness incompatible with that of the selected emulation
>
> This is the same problem we had on powerpc. Your binutils are set to
> use little-endian output by default; we need to explicitly enable
> either big or little endian in this case as well. Could you try
> attached patch to verify?

I'm glad to report that with your new patch, GRUB successfully builds on
GuixSD mips64el with TARGET_CC=clang.  I haven't yet tried booting it
though.

>> Your patch works for me with gcc, although config.log shows this warning
>> when building the test program in your new code with the correct flags
>> for gcc (-mabi=32):
>>
>>    ld: warning: cannot find entry symbol __start; defaulting to 00000000004000d0
>>
>
> Well, I just reused existing checks in this case; we worry about it later.

Okay.  I guess the name of the start symbol depends on the platform and
linker.  E.g. boot/mips/loongson/fwstart.S has this:

--8<---------------cut here---------------start------------->8---
	.global start,_start,__start
start:
_start:
__start:	
--8<---------------cut here---------------end--------------->8---

Other platforms have only '_start', or both 'start' and '_start'.

>> I also worry that linking an O32 executable might be fragile on a pure
>> non-multilib N32 system such as GNU Guix, where we lack even the gcc
>> runtime library (libgcc_s) for O32.  For now it seems to work, but I
>> wonder if it might be more robust to do the test compilation with -c and
>> -freestanding?
>>
>
> It is using -nostdlib; is it not enough?

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.

Having said that, if you prefer to keep the link step, I guess it will
probably be okay in practice to define 'start', '_start', and '__start'
as above.  Do as you think best.

Thanks for you help.

      Mark


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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-09-13  2:41                 ` Mark H Weaver
@ 2015-09-13  3:46                   ` Mark H Weaver
  2015-09-13 14:10                   ` Andrei Borzenkov
  1 sibling, 0 replies; 29+ messages in thread
From: Mark H Weaver @ 2015-09-13  3:46 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 149 bytes --]

Hi Andrei,

Here's a patch on top of yours that omits the link step from the new
autoconf test.  This eliminates the warnings I encountered before:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] Omit the link step in the MIPS O32 check --]
[-- Type: text/x-patch, Size: 630 bytes --]

diff --git a/configure.ac b/configure.ac
index f3c9b90..cd9fa8d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -605,14 +605,10 @@ if test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ; then
         break
       fi
       CFLAGS="$TARGET_CFLAGS $arg -Werror"
-      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #if !defined(_ABIO32) || !defined(_MIPS_SIM) || (_MIPS_SIM != _ABIO32)
 #error not o32 ABI
 #endif
-asm (".globl start; start:");
-void __main (void);
-void __main (void) {}
-int main (void);
 ]], [[]])],
 		        [grub_cv_target_cc_mips_o32_abi="$arg"], [])
     done

[-- Attachment #3: Type: text/plain, Size: 75 bytes --]


Here's an updated version of your commit, incorporating the above patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: [PATCH] configure: try to force o32 ABI on MIPS --]
[-- Type: text/x-patch, Size: 2024 bytes --]

From 8adcca69d3d9aacd20010a450aa20083a834392b Mon Sep 17 00:00:00 2001
From: Andrei Borzenkov <arvidjaar@gmail.com>
Date: Fri, 11 Sep 2015 11:28:49 -0400
Subject: [PATCH] configure: try to force o32 ABI on MIPS

GRUB expects o32 ABI, in particular used assembly is valid only in this mode.
Some systems (e.g. GNU Guix) default to using newer n64 or n32 ABI. Try to
find suitable options to force o32.

For GCC this is simply -mabi=32. While clang supports this option as well,
o32 ABI is valid for MIPS target and n32/64 ABI are valid for MIPS64 target
only, so use "-target mips/mipsel -mabi=32".

Reported-By: Mark H Weaver <mhw@netris.org>
Also-By: Mark H Weaver <mhw@netris.org>
---
 configure.ac | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/configure.ac b/configure.ac
index c864311..cd9fa8d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -597,6 +597,31 @@ int main (void);
   TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_big_endian"
 fi
 
+if test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ; then
+  AC_CACHE_CHECK([for options to force MIPS o32 ABI], grub_cv_target_cc_mips_o32_abi, [
+    grub_cv_target_cc_mips_o32_abi=no
+    for arg in "" "-mabi=32" "-target $target_cpu -mabi=32" ; do
+      if test x"$grub_cv_target_cc_mips_o32_abi" != xno ; then
+        break
+      fi
+      CFLAGS="$TARGET_CFLAGS $arg -Werror"
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if !defined(_ABIO32) || !defined(_MIPS_SIM) || (_MIPS_SIM != _ABIO32)
+#error not o32 ABI
+#endif
+]], [[]])],
+		        [grub_cv_target_cc_mips_o32_abi="$arg"], [])
+    done
+  ])
+
+  if test x"$grub_cv_target_cc_mips_o32_abi" = xno ; then
+    AC_MSG_ERROR([could not force MIPS o32 ABI])
+  fi
+
+  TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_mips_o32_abi"
+  TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_mips_o32_abi"
+fi
+
 AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [
 test_program=
 case "x$target_cpu-$platform" in
-- 
2.5.0


[-- Attachment #5: Type: text/plain, Size: 144 bytes --]


I tested this on MIPS with GCC 5.2.0 and clang 3.6.0.  It works the same
as before, but the warnings are gone.

What do you think?

      Mark

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

* Re: [PATCH v2] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-09-08 17:11         ` Vladimir 'φ-coder/phcoder' Serbinenko
  2015-09-09  1:37           ` Mark H Weaver
@ 2015-09-13  6:32           ` Andrei Borzenkov
  2015-10-09 21:14             ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 1 reply; 29+ messages in thread
From: Andrei Borzenkov @ 2015-09-13  6:32 UTC (permalink / raw)
  To: grub-devel

08.09.2015 20:11, Vladimir 'φ-coder/phcoder' Serbinenko пишет:
> On 23.08.2015 23:50, Mark H Weaver wrote:
>> Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
>> code for the O32 ABI when targetting MIPS, since the MIPS assembly code
>> in GRUB assumes this.
> Could you be more precise where we assume this? Why not fix the assembly
> instead?

If I understand it correctly, this is not only about assembly - ABIs 
differ in sizes of types as well, so we'd need to define whole new CPU 
in grub. Not sure if it's worth it. We can consider ourselves lucky it 
was caught that early.


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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-09-13  2:41                 ` Mark H Weaver
  2015-09-13  3:46                   ` Mark H Weaver
@ 2015-09-13 14:10                   ` Andrei Borzenkov
  2015-09-13 23:37                     ` Mark H Weaver
  1 sibling, 1 reply; 29+ messages in thread
From: Andrei Borzenkov @ 2015-09-13 14:10 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 2979 bytes --]

13.09.2015 05:41, Mark H Weaver пишет:
> Andrei Borzenkov <arvidjaar@gmail.com> writes:
>
>>> ld: /tmp/conftest-efc530.o: compiled for a big endian system and target is little endian
>>> ld: /tmp/conftest-efc530.o: endianness incompatible with that of the selected emulation
>>
>> This is the same problem we had on powerpc. Your binutils are set to
>> use little-endian output by default; we need to explicitly enable
>> either big or little endian in this case as well. Could you try
>> attached patch to verify?
>
> I'm glad to report that with your new patch, GRUB successfully builds on
> GuixSD mips64el with TARGET_CC=clang.  I haven't yet tried booting it
> though.
>

Did you have chance to test whether compiled grub actually work?

>>> Your patch works for me with gcc, although config.log shows this warning
>>> when building the test program in your new code with the correct flags
>>> for gcc (-mabi=32):
>>>
>>>     ld: warning: cannot find entry symbol __start; defaulting to 00000000004000d0
>>>
>>
>> Well, I just reused existing checks in this case; we worry about it later.
>
> Okay.  I guess the name of the start symbol depends on the platform and
> linker.  E.g. boot/mips/loongson/fwstart.S has this:
>
> --8<---------------cut here---------------start------------->8---
> 	.global start,_start,__start
> start:
> _start:
> __start:	
> --8<---------------cut here---------------end--------------->8---
>
> Other platforms have only '_start', or both 'start' and '_start'.
>
>>> I also worry that linking an O32 executable might be fragile on a pure
>>> non-multilib N32 system such as GNU Guix, where we lack even the gcc
>>> runtime library (libgcc_s) for O32.  For now it seems to work, but I
>>> wonder if it might be more robust to do the test compilation with -c and
>>> -freestanding?
>>>
>>
>> It is using -nostdlib; is it not enough?
>
> 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.

> Having said that, if you prefer to keep the link step, I guess it will
> probably be okay in practice to define 'start', '_start', and '__start'
> as above.  Do as you think best.
>


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.

I am interested in both native and cross compilation - i.e. please test 
for both --target=mipsel and --target=mips both with gcc and clang. 
config.log from all runs would be interesting even for successful cases.

[-- Attachment #2: 0001-configure-try-to-find-options-to-force-endian-on-MIP.patch --]
[-- Type: text/x-patch, Size: 3108 bytes --]

From ca80d768a43685e3e67fe9092dc10d9c574ee596 Mon Sep 17 00:00:00 2001
From: Andrei Borzenkov <arvidjaar@gmail.com>
Date: Sun, 13 Sep 2015 16:51:13 +0300
Subject: [PATCH 1/2] configure: try to find options to force endian on MIPS

---
 configure.ac | 43 ++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 40 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index c864311..4760fe8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -562,11 +562,11 @@ AC_COMPILE_IFELSE(
 ]])],
 [grub_cv_cc_target_clang=no], [grub_cv_cc_target_clang=yes])])
 
-if test x$target_cpu = xpowerpc; then
+if test x$target_cpu = xpowerpc -o x$target_cpu = xmips; then
   AC_CACHE_CHECK([for options to get big-endian compilation], grub_cv_target_cc_big_endian, [
     grub_cv_target_cc_big_endian=no
-    for cand in "-target powerpc -Wl,-EB" "-target powerpc" \
-		"-target powerpc-linux-gnu -Wl,-EB" "-target powerpc-linux-gnu" \
+    for cand in "-target $target_cpu -Wl,-EB" "-target $target_cpu" \
+		"-target $target_cpu-linux-gnu -Wl,-EB" "-target $target_cpu-linux-gnu" \
 		"-mbig-endian"; do
       if test x"$grub_cv_target_cc_big_endian" != xno ; then
         break
@@ -577,6 +577,8 @@ if test x$target_cpu = xpowerpc; then
 #error still little endian
 #endif
 asm (".globl start; start:");
+asm (".globl _start; _start:");
+asm (".globl __start; __start:");
 void __main (void);
 void __main (void) {}
 int main (void);
@@ -595,6 +597,41 @@ int main (void);
   TARGET_CPPFLAGS="$TARGET_CPPFLAGS $skip_linkflags"
   TARGET_CCASFLAGS="$TARGET_CCASFLAGS $skip_linkflags"
   TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_big_endian"
+elif test x$target_cpu = xmipsel; then
+  AC_CACHE_CHECK([for options to get little-endian compilation], grub_cv_target_cc_little_endian, [
+    grub_cv_target_cc_little_endian=no
+    for cand in "-target $target_cpu -Wl,-EL" "-target $target_cpu" \
+		"-target $target_cpu-linux-gnu -Wl,-EL" "-target $target_cpu-linux-gnu" \
+		"-mlittle-endian"; do
+      if test x"$grub_cv_target_cc_little_endian" != xno ; then
+        break
+      fi
+      CFLAGS="$TARGET_CFLAGS $cand -Werror"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__ORDER_BIG_ENDIAN__ == __BYTE_ORDER__)
+#error still big endian
+#endif
+asm (".globl start; start:");
+asm (".globl _start; _start:");
+asm (".globl __start; __start:");
+void __main (void);
+void __main (void) {}
+int main (void);
+]], [[]])],
+		        [grub_cv_target_cc_little_endian="$cand"], [])
+    done
+  ])
+
+  if test x"$grub_cv_target_cc_little_endian" = xno ; then
+    AC_MSG_ERROR([could not force little-endian])
+  fi
+
+  skip_linkflags="$(echo "$grub_cv_target_cc_little_endian"|sed 's@-Wl,-EL@@')"
+
+  TARGET_CFLAGS="$TARGET_CFLAGS $skip_linkflags"
+  TARGET_CPPFLAGS="$TARGET_CPPFLAGS $skip_linkflags"
+  TARGET_CCASFLAGS="$TARGET_CCASFLAGS $skip_linkflags"
+  TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_little_endian"
 fi
 
 AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [
-- 
1.9.1


[-- Attachment #3: 0002-configure-try-to-force-o32-ABI-on-MIPS.patch --]
[-- Type: text/x-patch, Size: 2195 bytes --]

From b69cb301dca85c60b25f0118e5532a2b12f7bae6 Mon Sep 17 00:00:00 2001
From: Andrei Borzenkov <arvidjaar@gmail.com>
Date: Sun, 13 Sep 2015 16:51:13 +0300
Subject: [PATCH 2/2] configure: try to force o32 ABI on MIPS

GRUB expects o32 ABI, in particular used assembly is valid only in this mode.
Some systems (e.g. GNU Guix) default to using newer n64 or n32 ABI. Try to
find suitable options to force o32.

For GCC this is simply -mabi=32. While clang supports this option as well,
o32 ABI is valid for MIPS target and n32/64 ABI are valid for MIPS64 target
only, so use "-target mips/mipsel -mabi=32".

Reported-By: Mark H Weaver <mhw@netris.org>
Also-By: Mark H Weaver <mhw@netris.org>
---
 configure.ac | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/configure.ac b/configure.ac
index 4760fe8..7b4e5bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -634,6 +634,37 @@ int main (void);
   TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_little_endian"
 fi
 
+if test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ; then
+  AC_CACHE_CHECK([for options to force MIPS o32 ABI], grub_cv_target_cc_mips_o32_abi, [
+    grub_cv_target_cc_mips_o32_abi=no
+    for arg in "" "-mabi=32" "-target $target_cpu -mabi=32" ; do
+      if test x"$grub_cv_target_cc_mips_o32_abi" != xno ; then
+        break
+      fi
+      CFLAGS="$TARGET_CFLAGS $arg -Werror"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#if !defined(_ABIO32) || !defined(_MIPS_SIM) || (_MIPS_SIM != _ABIO32)
+#error not o32 ABI
+#endif
+asm (".globl start; start:");
+asm (".globl _start; _start:");
+asm (".globl __start; __start:");
+void __main (void);
+void __main (void) {}
+int main (void);
+]], [[]])],
+		        [grub_cv_target_cc_mips_o32_abi="$arg"], [])
+    done
+  ])
+
+  if test x"$grub_cv_target_cc_mips_o32_abi" = xno ; then
+    AC_MSG_ERROR([could not force MIPS o32 ABI])
+  fi
+
+  TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_mips_o32_abi"
+  TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_mips_o32_abi"
+fi
+
 AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [
 test_program=
 case "x$target_cpu-$platform" in
-- 
1.9.1


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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-09-13 14:10                   ` Andrei Borzenkov
@ 2015-09-13 23:37                     ` Mark H Weaver
  2015-09-20  4:44                       ` Andrei Borzenkov
  0 siblings, 1 reply; 29+ messages in thread
From: Mark H Weaver @ 2015-09-13 23:37 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: The development of GNU GRUB

Andrei Borzenkov <arvidjaar@gmail.com> writes:

> 13.09.2015 05:41, Mark H Weaver пишет:
>> I'm glad to report that with your new patch, GRUB successfully builds on
>> GuixSD mips64el with TARGET_CC=clang.  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/bin/clang -o conftest  -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -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-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -target mipsel -Wl,-EL -Werror  -Wall -W  -DGRUB_CPU_MIPSEL=1 -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE=MIPS_LOONGSON  -nostdlib -static conftest.c  >&5
ld: /tmp/conftest-78445a.o: ABI is incompatible with that of the selected emulation
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: $? = 1
configure: failed program was:
[...]
configure:24704: /gnu/store/yjmchvkz0kmz4s1sxc0p89imfik68qzg-clang-3.6.0/bin/clang -o conftest  -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -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-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -target mipsel -Werror  -Wall -W  -DGRUB_CPU_MIPSEL=1 -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE=MIPS_LOONGSON  -nostdlib -static conftest.c  >&5
ld: /tmp/conftest-66051b.o: ABI is incompatible with that of the selected emulation
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: $? = 1
configure: failed program was:
[...]
configure:24704: /gnu/store/yjmchvkz0kmz4s1sxc0p89imfik68qzg-clang-3.6.0/bin/clang -o conftest  -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -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-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -target mipsel-linux-gnu -Wl,-EL -Werror  -Wall -W  -DGRUB_CPU_MIPSEL=1 -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE=MIPS_LOONGSON  -nostdlib -static conftest.c  >&5
configure:24704: $? = 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/bin/clang -o conftest  -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -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-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -target mipsel-linux-gnu   -Werror  -Wall -W  -DGRUB_CPU_MIPSEL=1 -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE=MIPS_LOONGSON  -nostdlib -static conftest.c  >&5
configure:24761: $? = 0
configure:24769: result: 
--8<---------------cut here---------------end--------------->8---


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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-09-13 23:37                     ` Mark H Weaver
@ 2015-09-20  4:44                       ` Andrei Borzenkov
  2015-09-21 16:09                         ` Mark H Weaver
  0 siblings, 1 reply; 29+ messages in thread
From: Andrei Borzenkov @ 2015-09-20  4:44 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 329 bytes --]

Sorry for delay.

14.09.2015 02:37, Mark H Weaver пишет:
>
> 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'
>

Oh, well ... let's try once more.

[-- Attachment #2: 0001-configure-try-to-find-options-to-force-endian-on-MIP.patch --]
[-- Type: text/x-patch, Size: 3136 bytes --]

From 4a3d2cfc3a1f8d0325b3964b836b5fe584784bb8 Mon Sep 17 00:00:00 2001
From: Andrei Borzenkov <arvidjaar@gmail.com>
Date: Sun, 20 Sep 2015 07:42:12 +0300
Subject: [PATCH 1/2] configure: try to find options to force endian on MIPS

---
 configure.ac | 45 +++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 41 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index c864311..baf8525 100644
--- a/configure.ac
+++ b/configure.ac
@@ -562,12 +562,12 @@ AC_COMPILE_IFELSE(
 ]])],
 [grub_cv_cc_target_clang=no], [grub_cv_cc_target_clang=yes])])
 
-if test x$target_cpu = xpowerpc; then
+if test x$target_cpu = xpowerpc -o x$target_cpu = xmips; then
   AC_CACHE_CHECK([for options to get big-endian compilation], grub_cv_target_cc_big_endian, [
     grub_cv_target_cc_big_endian=no
-    for cand in "-target powerpc -Wl,-EB" "-target powerpc" \
-		"-target powerpc-linux-gnu -Wl,-EB" "-target powerpc-linux-gnu" \
-		"-mbig-endian"; do
+    for cand in "-target $target_cpu -Wl,-EB" "-target $target_cpu" \
+		"-target $target_cpu-linux-gnu -Wl,-EB" "-target $target_cpu-linux-gnu" \
+		"-EB" "-mbig-endian"; do
       if test x"$grub_cv_target_cc_big_endian" != xno ; then
         break
       fi
@@ -577,6 +577,8 @@ if test x$target_cpu = xpowerpc; then
 #error still little endian
 #endif
 asm (".globl start; start:");
+asm (".globl _start; _start:");
+asm (".globl __start; __start:");
 void __main (void);
 void __main (void) {}
 int main (void);
@@ -595,6 +597,41 @@ int main (void);
   TARGET_CPPFLAGS="$TARGET_CPPFLAGS $skip_linkflags"
   TARGET_CCASFLAGS="$TARGET_CCASFLAGS $skip_linkflags"
   TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_big_endian"
+elif test x$target_cpu = xmipsel; then
+  AC_CACHE_CHECK([for options to get little-endian compilation], grub_cv_target_cc_little_endian, [
+    grub_cv_target_cc_little_endian=no
+    for cand in "-target $target_cpu -Wl,-EL" "-target $target_cpu" \
+		"-target $target_cpu-linux-gnu -Wl,-EL" "-target $target_cpu-linux-gnu" \
+		"-EL"; do
+      if test x"$grub_cv_target_cc_little_endian" != xno ; then
+        break
+      fi
+      CFLAGS="$TARGET_CFLAGS $cand -Werror"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__ORDER_BIG_ENDIAN__ == __BYTE_ORDER__)
+#error still big endian
+#endif
+asm (".globl start; start:");
+asm (".globl _start; _start:");
+asm (".globl __start; __start:");
+void __main (void);
+void __main (void) {}
+int main (void);
+]], [[]])],
+		        [grub_cv_target_cc_little_endian="$cand"], [])
+    done
+  ])
+
+  if test x"$grub_cv_target_cc_little_endian" = xno ; then
+    AC_MSG_ERROR([could not force little-endian])
+  fi
+
+  skip_linkflags="$(echo "$grub_cv_target_cc_little_endian"|sed 's@-Wl,-EL@@')"
+
+  TARGET_CFLAGS="$TARGET_CFLAGS $skip_linkflags"
+  TARGET_CPPFLAGS="$TARGET_CPPFLAGS $skip_linkflags"
+  TARGET_CCASFLAGS="$TARGET_CCASFLAGS $skip_linkflags"
+  TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_little_endian"
 fi
 
 AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [
-- 
1.9.1


[-- Attachment #3: 0002-configure-try-to-force-o32-ABI-on-MIPS.patch --]
[-- Type: text/x-patch, Size: 2195 bytes --]

From b609d424889ffdb3cc9191384296980e02514abb Mon Sep 17 00:00:00 2001
From: Andrei Borzenkov <arvidjaar@gmail.com>
Date: Sun, 20 Sep 2015 07:42:12 +0300
Subject: [PATCH 2/2] configure: try to force o32 ABI on MIPS

GRUB expects o32 ABI, in particular used assembly is valid only in this mode.
Some systems (e.g. GNU Guix) default to using newer n64 or n32 ABI. Try to
find suitable options to force o32.

For GCC this is simply -mabi=32. While clang supports this option as well,
o32 ABI is valid for MIPS target and n32/64 ABI are valid for MIPS64 target
only, so use "-target mips/mipsel -mabi=32".

Reported-By: Mark H Weaver <mhw@netris.org>
Also-By: Mark H Weaver <mhw@netris.org>
---
 configure.ac | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/configure.ac b/configure.ac
index baf8525..d9d4222 100644
--- a/configure.ac
+++ b/configure.ac
@@ -634,6 +634,37 @@ int main (void);
   TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_little_endian"
 fi
 
+if test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ; then
+  AC_CACHE_CHECK([for options to force MIPS o32 ABI], grub_cv_target_cc_mips_o32_abi, [
+    grub_cv_target_cc_mips_o32_abi=no
+    for arg in "" "-mabi=32" "-target $target_cpu -mabi=32" ; do
+      if test x"$grub_cv_target_cc_mips_o32_abi" != xno ; then
+        break
+      fi
+      CFLAGS="$TARGET_CFLAGS $arg -Werror"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#if !defined(_ABIO32) || !defined(_MIPS_SIM) || (_MIPS_SIM != _ABIO32)
+#error not o32 ABI
+#endif
+asm (".globl start; start:");
+asm (".globl _start; _start:");
+asm (".globl __start; __start:");
+void __main (void);
+void __main (void) {}
+int main (void);
+]], [[]])],
+		        [grub_cv_target_cc_mips_o32_abi="$arg"], [])
+    done
+  ])
+
+  if test x"$grub_cv_target_cc_mips_o32_abi" = xno ; then
+    AC_MSG_ERROR([could not force MIPS o32 ABI])
+  fi
+
+  TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_mips_o32_abi"
+  TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_mips_o32_abi"
+fi
+
 AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [
 test_program=
 case "x$target_cpu-$platform" in
-- 
1.9.1


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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-09-20  4:44                       ` Andrei Borzenkov
@ 2015-09-21 16:09                         ` Mark H Weaver
  2015-09-21 17:56                           ` Andrei Borzenkov
  0 siblings, 1 reply; 29+ messages in thread
From: Mark H Weaver @ 2015-09-21 16:09 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: The development of GNU GRUB

Andrei Borzenkov <arvidjaar@gmail.com> writes:

> 14.09.2015 02:37, Mark H Weaver пишет:
>>
>> 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'
>
> Oh, well ... let's try once more.

Your newest patches work for me with both GCC and Clang.  I think they
are ready to push.

     Thanks!
       Mark


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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-09-21 16:09                         ` Mark H Weaver
@ 2015-09-21 17:56                           ` Andrei Borzenkov
  2015-09-22 15:03                             ` Mark H Weaver
  0 siblings, 1 reply; 29+ messages in thread
From: Andrei Borzenkov @ 2015-09-21 17:56 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: The development of GNU GRUB

Did you also test cross-compile (building for BE MIPS in your case)?

Отправлено с iPhone

> 21 сент. 2015 г., в 18:09, Mark H Weaver <mhw@netris.org> написал(а):
> 
> Andrei Borzenkov <arvidjaar@gmail.com> writes:
> 
>> 14.09.2015 02:37, Mark H Weaver пишет:
>>> 
>>> 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'
>> 
>> Oh, well ... let's try once more.
> 
> Your newest patches work for me with both GCC and Clang.  I think they
> are ready to push.
> 
>     Thanks!
>       Mark


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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-09-21 17:56                           ` Andrei Borzenkov
@ 2015-09-22 15:03                             ` Mark H Weaver
  2015-09-22 17:26                               ` Andrei Borzenkov
  0 siblings, 1 reply; 29+ messages in thread
From: Mark H Weaver @ 2015-09-22 15:03 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: The development of GNU GRUB

Andrei Borzenkov <arvidjaar@gmail.com> writes:
> Did you also test cross-compile

No.  My Yeeloong 8101B (based on the Loongson 2F processor) is my
(relatively) high security machine, and I prefer to avoid running any
code on it that was not built natively on it from source code.  That's
also the reason I have not yet tried booting GRUB compiled with clang: I
have not yet compiled clang on my Yeeloong, as it would take a long time
to do so.

I tested building grub with clang on a different machine (the Lemote
Yeeloong 8133 laptop based on the Loongson 3A), but cannot run it there
because that machine is not supported by GRUB afaict.

> (building for BE MIPS in your case)?

The Loongson 2F does not support big-endian mode.

     Thanks,
       Mark


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

* Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-09-22 15:03                             ` Mark H Weaver
@ 2015-09-22 17:26                               ` Andrei Borzenkov
  0 siblings, 0 replies; 29+ messages in thread
From: Andrei Borzenkov @ 2015-09-22 17:26 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: The development of GNU GRUB



Отправлено с iPhone

> 22 сент. 2015 г., в 17:03, Mark H Weaver <mhw@netris.org> написал(а):
> 
> Andrei Borzenkov <arvidjaar@gmail.com> writes:
>> Did you also test cross-compile
> 
> No.  My Yeeloong 8101B (based on the Loongson 2F processor) is my
> (relatively) high security machine, and I prefer to avoid running any
> code on it that was not built natively on it from source code.  That's
> also the reason I have not yet tried booting GRUB compiled with clang: I
> have not yet compiled clang on my Yeeloong, as it would take a long time
> to do so.
> 
> I tested building grub with clang on a different machine (the Lemote
> Yeeloong 8133 laptop based on the Loongson 3A), but cannot run it there
> because that machine is not supported by GRUB afaict.
> 
>> (building for BE MIPS in your case)?
> 
> The Loongson 2F does not support big-endian mode.
> 

I do not mean building for your system, but testing building for BE MIPS on native MIPS toolkit. 


>     Thanks,
>       Mark


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

* Re: [PATCH v2] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-09-13  6:32           ` Andrei Borzenkov
@ 2015-10-09 21:14             ` Vladimir 'φ-coder/phcoder' Serbinenko
  2015-10-10  0:28               ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 29+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2015-10-09 21:14 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 1932 bytes --]

On 13.09.2015 08:32, Andrei Borzenkov wrote:
> 08.09.2015 20:11, Vladimir 'φ-coder/phcoder' Serbinenko пишет:
>> On 23.08.2015 23:50, Mark H Weaver wrote:
>>> Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
>>> code for the O32 ABI when targetting MIPS, since the MIPS assembly code
>>> in GRUB assumes this.
>> Could you be more precise where we assume this? Why not fix the assembly
>> instead?
> 
> If I understand it correctly, this is not only about assembly - ABIs
> differ in sizes of types as well,
Only in obscure types long double and uint128_t. We use neither.
> so we'd need to define whole new CPU
> in grub.
Nope
> Not sure if it's worth it. We can consider ourselves lucky it
> was caught that early.
The differences are:
* Use of rela instead of rel section. (I've prepared a patch)
* Register names: There is no $t5 but there is $a5. I prepared a draft,
cleaning up
* Different parameter/result passing in presence of either
  a) >4 parameters
  b) floats
  c) 64-bit integers
  d) structs
 Neither happens between C and assembly. In all we have only following
interfaces between C and assembly:
  a) Relocator call. No arguments void (*) (void);
  b) void grub_main(void);
  c) void
grub_decompress_core (void *src, void *dst, unsigned long srcsize,
		      unsigned long dstsize);
  d) void EXPORT_FUNC(grub_arch_sync_caches) (void *address, grub_size_t
len);
  e) void grub_arch_sync_dma_caches (void *address, grub_size_t len);
  f) int grub_setjmp (grub_jmp_buf env) // grub_jmp_buf is an array, so
pointer
  g) int grub_longjmp (grub_jmp_buf env, int val)
* $gp is caller vs callee-saved. We don't use $gp in assembly except in
setjmp which is already appropriate for n32.
So, we need just few cleanups to make it work. Whether we want to
continuously maintain this compatibility is another question. I'm going
to commit the fixes




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

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

* Re: [PATCH v2] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-10-09 21:14             ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2015-10-10  0:28               ` Vladimir 'φ-coder/phcoder' Serbinenko
  2015-10-14  4:49                 ` Andrei Borzenkov
  0 siblings, 1 reply; 29+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2015-10-10  0:28 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]

On 09.10.2015 23:14, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> On 13.09.2015 08:32, Andrei Borzenkov wrote:
>> 08.09.2015 20:11, Vladimir 'φ-coder/phcoder' Serbinenko пишет:
>>> On 23.08.2015 23:50, Mark H Weaver wrote:
>>>> Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
>>>> code for the O32 ABI when targetting MIPS, since the MIPS assembly code
>>>> in GRUB assumes this.
>>> Could you be more precise where we assume this? Why not fix the assembly
>>> instead?
>>
>> If I understand it correctly, this is not only about assembly - ABIs
>> differ in sizes of types as well,
> Only in obscure types long double and uint128_t. We use neither.
Correction: I was comparing o32 to n32. We still need to ensure that
either o32 or n32 is used. It's easier to just ensure that o32 is used,
so that we have less variability in the code but can be relaxed later if
need be.
>   f) int grub_setjmp (grub_jmp_buf env) // grub_jmp_buf is an array, so
> pointer
>   g) int grub_longjmp (grub_jmp_buf env, int val)
Correction: setjmp/longjmp are not adapted to n32 but we don't use them
anyway. Probably it's time to delete the dead code after double checking
that extras don't use it either.



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

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

* Re: [PATCH v2] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-10-10  0:28               ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2015-10-14  4:49                 ` Andrei Borzenkov
  2015-10-14 12:16                   ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 29+ messages in thread
From: Andrei Borzenkov @ 2015-10-14  4:49 UTC (permalink / raw)
  To: grub-devel

10.10.2015 03:28, Vladimir 'φ-coder/phcoder' Serbinenko пишет:
> On 09.10.2015 23:14, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>> On 13.09.2015 08:32, Andrei Borzenkov wrote:
>>> 08.09.2015 20:11, Vladimir 'φ-coder/phcoder' Serbinenko пишет:
>>>> On 23.08.2015 23:50, Mark H Weaver wrote:
>>>>> Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
>>>>> code for the O32 ABI when targetting MIPS, since the MIPS assembly code
>>>>> in GRUB assumes this.
>>>> Could you be more precise where we assume this? Why not fix the assembly
>>>> instead?
>>>
>>> If I understand it correctly, this is not only about assembly - ABIs
>>> differ in sizes of types as well,
>> Only in obscure types long double and uint128_t. We use neither.
> Correction: I was comparing o32 to n32. We still need to ensure that
> either o32 or n32 is used. It's easier to just ensure that o32 is used,
> so that we have less variability in the code but can be relaxed later if
> need be.

I see that you committed my suggested patch but I find comments (and 
commit message) a bit misleading. While grub main code is fixed, the 
configure asm test not, and that was the first thing that failed.

>>    f) int grub_setjmp (grub_jmp_buf env) // grub_jmp_buf is an array, so
>> pointer
>>    g) int grub_longjmp (grub_jmp_buf env, int val)
> Correction: setjmp/longjmp are not adapted to n32 but we don't use them
> anyway. Probably it's time to delete the dead code after double checking
> that extras don't use it either.
>
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>



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

* Re: [PATCH v2] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-10-14  4:49                 ` Andrei Borzenkov
@ 2015-10-14 12:16                   ` Vladimir 'phcoder' Serbinenko
  2015-10-14 17:57                     ` Andrei Borzenkov
  0 siblings, 1 reply; 29+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2015-10-14 12:16 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 2189 bytes --]

Le 14 oct. 2015 6:50 AM, "Andrei Borzenkov" <arvidjaar@gmail.com> a écrit :
>
> 10.10.2015 03:28, Vladimir 'φ-coder/phcoder' Serbinenko пишет:
>
>> On 09.10.2015 23:14, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>>>
>>> On 13.09.2015 08:32, Andrei Borzenkov wrote:
>>>>
>>>> 08.09.2015 20:11, Vladimir 'φ-coder/phcoder' Serbinenko пишет:
>>>>>
>>>>> On 23.08.2015 23:50, Mark H Weaver wrote:
>>>>>>
>>>>>> Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
>>>>>> code for the O32 ABI when targetting MIPS, since the MIPS assembly
code
>>>>>> in GRUB assumes this.
>>>>>
>>>>> Could you be more precise where we assume this? Why not fix the
assembly
>>>>> instead?
>>>>
>>>>
>>>> If I understand it correctly, this is not only about assembly - ABIs
>>>> differ in sizes of types as well,
>>>
>>> Only in obscure types long double and uint128_t. We use neither.
>>
>> Correction: I was comparing o32 to n32. We still need to ensure that
>> either o32 or n32 is used. It's easier to just ensure that o32 is used,
>> so that we have less variability in the code but can be relaxed later if
>> need be.
>
>
> I see that you committed my suggested patch but I find comments (and
commit message) a bit misleading. While grub main code is fixed, the
configure asm test not, and that was the first thing that failed.
>
Can you please elaborate on how am test fails? The only failure I have seen
was due to usage of $t4 and I replaced it with $t0
>>>    f) int grub_setjmp (grub_jmp_buf env) // grub_jmp_buf is an array, so
>>> pointer
>>>    g) int grub_longjmp (grub_jmp_buf env, int val)
>>
>> Correction: setjmp/longjmp are not adapted to n32 but we don't use them
>> anyway. Probably it's time to delete the dead code after double checking
>> that extras don't use it either.
>>
>>
>>
>>
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> https://lists.gnu.org/mailman/listinfo/grub-devel
>>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel

[-- Attachment #2: Type: text/html, Size: 3179 bytes --]

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

* Re: [PATCH v2] Ensure that MIPS target code is compiled for the O32 ABI.
  2015-10-14 12:16                   ` Vladimir 'phcoder' Serbinenko
@ 2015-10-14 17:57                     ` Andrei Borzenkov
  0 siblings, 0 replies; 29+ messages in thread
From: Andrei Borzenkov @ 2015-10-14 17:57 UTC (permalink / raw)
  To: grub-devel

14.10.2015 15:16, Vladimir 'phcoder' Serbinenko пишет:
> Le 14 oct. 2015 6:50 AM, "Andrei Borzenkov" <arvidjaar@gmail.com> a écrit :
>>
>> 10.10.2015 03:28, Vladimir 'φ-coder/phcoder' Serbinenko пишет:
>>
>>> On 09.10.2015 23:14, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>>>>
>>>> On 13.09.2015 08:32, Andrei Borzenkov wrote:
>>>>>
>>>>> 08.09.2015 20:11, Vladimir 'φ-coder/phcoder' Serbinenko пишет:
>>>>>>
>>>>>> On 23.08.2015 23:50, Mark H Weaver wrote:
>>>>>>>
>>>>>>> Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
>>>>>>> code for the O32 ABI when targetting MIPS, since the MIPS assembly
> code
>>>>>>> in GRUB assumes this.
>>>>>>
>>>>>> Could you be more precise where we assume this? Why not fix the
> assembly
>>>>>> instead?
>>>>>
>>>>>
>>>>> If I understand it correctly, this is not only about assembly - ABIs
>>>>> differ in sizes of types as well,
>>>>
>>>> Only in obscure types long double and uint128_t. We use neither.
>>>
>>> Correction: I was comparing o32 to n32. We still need to ensure that
>>> either o32 or n32 is used. It's easier to just ensure that o32 is used,
>>> so that we have less variability in the code but can be relaxed later if
>>> need be.
>>
>>
>> I see that you committed my suggested patch but I find comments (and
> commit message) a bit misleading. While grub main code is fixed, the
> configure asm test not, and that was the first thing that failed.
>>
> Can you please elaborate on how am test fails? The only failure I have seen
> was due to usage of $t4 and I replaced it with $t0

Sorry, missed patch for asm-tests/mips.S

>>>>     f) int grub_setjmp (grub_jmp_buf env) // grub_jmp_buf is an array, so
>>>> pointer
>>>>     g) int grub_longjmp (grub_jmp_buf env, int val)
>>>
>>> Correction: setjmp/longjmp are not adapted to n32 but we don't use them
>>> anyway. Probably it's time to delete the dead code after double checking
>>> that extras don't use it either.
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Grub-devel mailing list
>>> Grub-devel@gnu.org
>>> https://lists.gnu.org/mailman/listinfo/grub-devel
>>>
>>
>>
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> https://lists.gnu.org/mailman/listinfo/grub-devel
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>



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

end of thread, other threads:[~2015-10-15 22:04 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-19 18:35 [PATCH] Ensure that MIPS target code is compiled for the O32 ABI Mark H Weaver
2015-08-21  4:05 ` Andrei Borzenkov
2015-08-22 18:04   ` Mark H Weaver
2015-08-23  9:51     ` Andrei Borzenkov
2015-08-23 17:27       ` Mark H Weaver
2015-08-24  6:50       ` [PATCH v2] " Mark H Weaver
2015-09-08 17:11         ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-09-09  1:37           ` Mark H Weaver
2015-09-13  6:32           ` Andrei Borzenkov
2015-10-09 21:14             ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-10-10  0:28               ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-10-14  4:49                 ` Andrei Borzenkov
2015-10-14 12:16                   ` Vladimir 'phcoder' Serbinenko
2015-10-14 17:57                     ` Andrei Borzenkov
2015-08-24  7:19     ` [PATCH] " Andrei Borzenkov
2015-08-24  7:57       ` Mark H Weaver
2015-08-24  8:12         ` Andrei Borzenkov
2015-08-24  9:27           ` Andrei Borzenkov
2015-08-25 18:18             ` Mark H Weaver
2015-09-11 15:06               ` Andrei Borzenkov
2015-09-13  2:41                 ` Mark H Weaver
2015-09-13  3:46                   ` Mark H Weaver
2015-09-13 14:10                   ` Andrei Borzenkov
2015-09-13 23:37                     ` Mark H Weaver
2015-09-20  4:44                       ` Andrei Borzenkov
2015-09-21 16:09                         ` Mark H Weaver
2015-09-21 17:56                           ` Andrei Borzenkov
2015-09-22 15:03                             ` Mark H Weaver
2015-09-22 17:26                               ` Andrei Borzenkov

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.