Skip to contentSkip to conversation

commit 3661261f breaks arm64

PATCH Leif Lindholm 3 participants 5 messages Jan 28, 2015

lore
Share & tools
lore
#0 lore raw

commit 3661261fe17a8fe19681073889b5b36ec1ee823d, "Always add -msoft-float to avoid compiler generating float arithmetics." breaks the arm64 build.

-msoft-float is not a valid command line option for aarch64 (as far as I can see, it is technically a target-specific option which just happens to exist for most targets - including arm).

This setting will need to be conditionalised somehow. An option that works for arm64 is -march=armv8-a+nofp+nosimd.

Would something like this be an acceptable workaround?:

configure.ac +5 -1
index a3bca06..c99e1ea 100644
@@ -678,7 +678,11 @@ fi
 # that floats are a good fit to run instead of what's written in the
 # code.
 # Given that floating point unit is disabled (if present to begin
 # with)
 # when GRUB is running which may result in various hard crashes.
-TARGET_CFLAGS="$TARGET_CFLAGS -msoft-float"
+if ( test "x$target_cpu" = xarm64 ); then
+  TARGET_CFLAGS="$TARGET_CFLAGS -march=armv8-a+nofp+nosimd"
+else
+  TARGET_CFLAGS="$TARGET_CFLAGS -msoft-float"
+fi
 

# By default, GCC 4.4 generates .eh_frame sections containing unwind

 # information in some cases where it previously did not. GRUB doesn't
 # need

/
Leif

#1 lore raw

В Wed, 28 Jan 2015 18:33:59 +0000
Leif Lindholm <[email protected]> пишет:

Quoted 18 lines

commit 3661261fe17a8fe19681073889b5b36ec1ee823d, "Always add -msoft-float to avoid compiler generating float arithmetics." breaks the arm64 build.

-msoft-float is not a valid command line option for aarch64 (as far as I can see, it is technically a target-specific option which just happens to exist for most targets - including arm).

This setting will need to be conditionalised somehow. An option that works for arm64 is -march=armv8-a+nofp+nosimd.

Would something like this be an acceptable workaround?:

configure.ac +0 -0
index a3bca06..c99e1ea 100644

configure.ac fi · line 683

Quoted 7 lines
configure.ac +1 -1
@@ -678,7 +678,11 @@ fi
 # that floats are a good fit to run instead of what's written in the
 # code.
 # Given that floating point unit is disabled (if present to begin
 # with)
 # when GRUB is running which may result in various hard crashes.
-TARGET_CFLAGS="$TARGET_CFLAGS -msoft-float"
+if ( test "x$target_cpu" = xarm64 ); then

Why subshell?

Quoted 16 lines
configure.ac +4 -0
+  TARGET_CFLAGS="$TARGET_CFLAGS -march=armv8-a+nofp+nosimd"
+else
+  TARGET_CFLAGS="$TARGET_CFLAGS -msoft-float"
+fi
 

# By default, GCC 4.4 generates .eh_frame sections containing unwind

 # information in some cases where it previously did not. GRUB doesn't
 # need

/
Leif

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#2 lore raw
Quoted 16 lines · Andrei Borzenkov

В Wed, 28 Jan 2015 18:33:59 +0000
Leif Lindholm <[email protected]> пишет:

Quoted 13 lines

commit 3661261fe17a8fe19681073889b5b36ec1ee823d, "Always add -msoft-float to avoid compiler generating float arithmetics." breaks the arm64 build.

-msoft-float is not a valid command line option for aarch64 (as far as I can see, it is technically a target-specific option which just happens to exist for most targets - including arm).

This setting will need to be conditionalised somehow. An option that works for arm64 is -march=armv8-a+nofp+nosimd.

Would something like this be an acceptable workaround?:

Quoted 14 lines

configure.ac fi · line 683

Quoted 12 lines
configure.ac +1 -1
index a3bca06..c99e1ea 100644
@@ -678,7 +678,11 @@ fi
 # that floats are a good fit to run instead of what's written in the
 # code.
 # Given that floating point unit is disabled (if present to begin
 # with)
 # when GRUB is running which may result in various hard crashes.
-TARGET_CFLAGS="$TARGET_CFLAGS -msoft-float"
+if ( test "x$target_cpu" = xarm64 ); then

Why subshell?

Brainless cargo culting to look similar to the preceding $target_cpu checker, which actually does something relevant with its subshell.

If I drop that, is that an acceptable fix?

Quoted 17 lines
Quoted 16 lines
configure.ac +4 -0
+  TARGET_CFLAGS="$TARGET_CFLAGS -march=armv8-a+nofp+nosimd"
+else
+  TARGET_CFLAGS="$TARGET_CFLAGS -msoft-float"
+fi
 

# By default, GCC 4.4 generates .eh_frame sections containing unwind

 # information in some cases where it previously did not. GRUB doesn't
 # need

/
Leif

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#3 lore raw
Quoted 33 lines · Leif Lindholm
Quoted 16 lines · Andrei Borzenkov

В Wed, 28 Jan 2015 18:33:59 +0000
Leif Lindholm <[email protected]> пишет:

Quoted 13 lines

commit 3661261fe17a8fe19681073889b5b36ec1ee823d, "Always add -msoft-float to avoid compiler generating float arithmetics." breaks the arm64 build.

-msoft-float is not a valid command line option for aarch64 (as far as I can see, it is technically a target-specific option which just happens to exist for most targets - including arm).

This setting will need to be conditionalised somehow. An option that works for arm64 is -march=armv8-a+nofp+nosimd.

Would something like this be an acceptable workaround?:

Quoted 14 lines

configure.ac fi · line 683

Quoted 12 lines
configure.ac +1 -1
index a3bca06..c99e1ea 100644
@@ -678,7 +678,11 @@ fi
 # that floats are a good fit to run instead of what's written in the
 # code.
 # Given that floating point unit is disabled (if present to begin
 # with)
 # when GRUB is running which may result in various hard crashes.
-TARGET_CFLAGS="$TARGET_CFLAGS -msoft-float"
+if ( test "x$target_cpu" = xarm64 ); then

Why subshell?

Quoted 4 lines

Brainless cargo culting to look similar to the preceding $target_cpu checker, which actually does something relevant with its subshell.

If I drop that, is that an acceptable fix?

Yes.
I probably should define guidelines for platform-specific options and clean up existing inconsistencies but it's low priority.

Quoted 22 lines
Quoted 9 lines
Quoted 9 lines
configure.ac +4 -0
+  TARGET_CFLAGS="$TARGET_CFLAGS -march=armv8-a+nofp+nosimd"
+else
+  TARGET_CFLAGS="$TARGET_CFLAGS -msoft-float"
+fi
 

# By default, GCC 4.4 generates .eh_frame sections containing unwind

 # information in some cases where it previously did not. GRUB doesn't
 # need
Quoted 8 lines
Quoted 7 lines

/
Leif

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#4 lore raw
Quoted 9 lines · Vladimir 'phcoder' Serbinenko
Quoted 6 lines
Quoted 1 line

Why subshell?

Brainless cargo culting to look similar to the preceding $target_cpu checker, which actually does something relevant with its subshell.

If I drop that, is that an acceptable fix?

Yes.
I probably should define guidelines for platform-specific options and clean up existing inconsistencies but it's low priority.

Thanks - pushed.

/
Leif