diff mbox series

configure: disable arm movw/movt relocations for GCC

Message ID 20190604113916.31758-1-leif.lindholm@linaro.org
State Accepted
Commit 2d55ffecbb966d3e42023729d8bbf3c21c59e049
Headers show
Series configure: disable arm movw/movt relocations for GCC | expand

Commit Message

Leif Lindholm June 4, 2019, 11:39 a.m. UTC
When building for arm, we already disable movw/movt relocations for clang,
since they are incompatible with PE.

When building with bare metal GCC toolchains (like the one used in the
travis ci scripts), we end up with these relocations again. So add an
additional test for the '-mword-relocations' flag used by GCC.

Reported-by: Alexander Graf <agraf@csgraf.de>
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>

---

Note: unless this is added before the travis-ci set, the arm ci build
will fail when enabled.

---

 configure.ac | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.11.0


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Comments

Alexander Graf June 4, 2019, 11:49 a.m. UTC | #1
On 04.06.19 13:39, Leif Lindholm wrote:
> When building for arm, we already disable movw/movt relocations for clang,

> since they are incompatible with PE.

>

> When building with bare metal GCC toolchains (like the one used in the

> travis ci scripts), we end up with these relocations again. So add an

> additional test for the '-mword-relocations' flag used by GCC.

>

> Reported-by: Alexander Graf <agraf@csgraf.de>

> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>



Reviewed-by: Alexander Graf <agraf@csgraf.de>



Alex



_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
Daniel Kiper July 11, 2019, 12:32 p.m. UTC | #2
On Tue, Jun 04, 2019 at 01:49:51PM +0200, Alexander Graf wrote:
> On 04.06.19 13:39, Leif Lindholm wrote:
> > When building for arm, we already disable movw/movt relocations for clang,
> > since they are incompatible with PE.
> >
> > When building with bare metal GCC toolchains (like the one used in the
> > travis ci scripts), we end up with these relocations again. So add an
> > additional test for the '-mword-relocations' flag used by GCC.
> >
> > Reported-by: Alexander Graf <agraf@csgraf.de>
> > Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
>
> Reviewed-by: Alexander Graf <agraf@csgraf.de>

Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Daniel
Vladimir 'phcoder' Serbinenko July 11, 2019, 3:54 p.m. UTC | #3
LGTM

On Tue, 4 Jun 2019, 13:40 Leif Lindholm, <leif.lindholm@linaro.org> wrote:

> When building for arm, we already disable movw/movt relocations for clang,

> since they are incompatible with PE.

>

> When building with bare metal GCC toolchains (like the one used in the

> travis ci scripts), we end up with these relocations again. So add an

> additional test for the '-mword-relocations' flag used by GCC.

>

> Reported-by: Alexander Graf <agraf@csgraf.de>

> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>

> ---

>

> Note: unless this is added before the travis-ci set, the arm ci build

> will fail when enabled.

>

> ---

>

>  configure.ac | 3 ++-

>  1 file changed, 2 insertions(+), 1 deletion(-)

>

> diff --git a/configure.ac b/configure.ac

> index 08b518fcc..e7725a546 100644

> --- a/configure.ac

> +++ b/configure.ac

> @@ -1198,7 +1198,8 @@ if test "x$target_cpu" = xarm; then

>    AC_CACHE_CHECK([for options to disable movt and movw],

> grub_cv_target_cc_mno_movt, [

>      grub_cv_target_cc_mno_movt=no

>      for cand in "-mno-movt" \

> -               "-mllvm -arm-use-movt=0"; do

> +               "-mllvm -arm-use-movt=0" \

> +               "-mword-relocations"; do

>        if test x"$grub_cv_target_cc_mno_movt" != xno ; then

>          break

>        fi

> --

> 2.11.0

>

>

> _______________________________________________

> Grub-devel mailing list

> Grub-devel@gnu.org

> https://lists.gnu.org/mailman/listinfo/grub-devel

>
<div dir="auto">LGTM</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 4 Jun 2019, 13:40 Leif Lindholm, &lt;<a href="mailto:leif.lindholm@linaro.org">leif.lindholm@linaro.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When building for arm, we already disable movw/movt relocations for clang,<br>
since they are incompatible with PE.<br>
<br>
When building with bare metal GCC toolchains (like the one used in the<br>
travis ci scripts), we end up with these relocations again. So add an<br>
additional test for the &#39;-mword-relocations&#39; flag used by GCC.<br>
<br>
Reported-by: Alexander Graf &lt;<a href="mailto:agraf@csgraf.de" target="_blank" rel="noreferrer">agraf@csgraf.de</a>&gt;<br>
Signed-off-by: Leif Lindholm &lt;<a href="mailto:leif.lindholm@linaro.org" target="_blank" rel="noreferrer">leif.lindholm@linaro.org</a>&gt;<br>

---<br>
<br>
Note: unless this is added before the travis-ci set, the arm ci build<br>
will fail when enabled.<br>
<br>
---<br>
<br>
 <a href="http://configure.ac" rel="noreferrer noreferrer" target="_blank">configure.ac</a> | 3 ++-<br>
 1 file changed, 2 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/<a href="http://configure.ac" rel="noreferrer noreferrer" target="_blank">configure.ac</a> b/<a href="http://configure.ac" rel="noreferrer noreferrer" target="_blank">configure.ac</a><br>
index 08b518fcc..e7725a546 100644<br>
--- a/<a href="http://configure.ac" rel="noreferrer noreferrer" target="_blank">configure.ac</a><br>
+++ b/<a href="http://configure.ac" rel="noreferrer noreferrer" target="_blank">configure.ac</a><br>
@@ -1198,7 +1198,8 @@ if test &quot;x$target_cpu&quot; = xarm; then<br>
   AC_CACHE_CHECK([for options to disable movt and movw], grub_cv_target_cc_mno_movt, [<br>
     grub_cv_target_cc_mno_movt=no<br>
     for cand in &quot;-mno-movt&quot; \<br>
-               &quot;-mllvm -arm-use-movt=0&quot;; do<br>
+               &quot;-mllvm -arm-use-movt=0&quot; \<br>
+               &quot;-mword-relocations&quot;; do<br>
       if test x&quot;$grub_cv_target_cc_mno_movt&quot; != xno ; then<br>
         break<br>
       fi<br>
-- <br>
2.11.0<br>
<br>
<br>
_______________________________________________<br>
Grub-devel mailing list<br>
<a href="mailto:Grub-devel@gnu.org" target="_blank" rel="noreferrer">Grub-devel@gnu.org</a><br>
<a href="https://lists.gnu.org/mailman/listinfo/grub-devel" rel="noreferrer noreferrer" target="_blank">https://lists.gnu.org/mailman/listinfo/grub-devel</a><br>
</blockquote></div>
diff mbox series

Patch

diff --git a/configure.ac b/configure.ac
index 08b518fcc..e7725a546 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1198,7 +1198,8 @@  if test "x$target_cpu" = xarm; then
   AC_CACHE_CHECK([for options to disable movt and movw], grub_cv_target_cc_mno_movt, [
     grub_cv_target_cc_mno_movt=no
     for cand in "-mno-movt" \
-		"-mllvm -arm-use-movt=0"; do
+		"-mllvm -arm-use-movt=0" \
+		"-mword-relocations"; do
       if test x"$grub_cv_target_cc_mno_movt" != xno ; then
         break
       fi