All of lore.kernel.org
 help / color / mirror / Atom feed
* R_ARM(_THM)_MOVT_ABS(_NC) support
@ 2015-01-31 11:35 Michael Zimmermann
  2015-01-31 11:45 ` Leif Lindholm
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Zimmermann @ 2015-01-31 11:35 UTC (permalink / raw)
  To: The development of GNU GRUB

Hi,

when compiling grub with O2 or O3 on a ARM target mkimage fails with
"error: relocation4 X is not implemented yet" for
R_ARM_THM_MOVT_ABS and R_ARM_THM_MOVW_ABS_NC (thumb)
or R_ARM_MOVW_ABS and R_ARM_MOVW_ABS_NC (arm)

Michael


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

* Re: R_ARM(_THM)_MOVT_ABS(_NC) support
  2015-01-31 11:35 R_ARM(_THM)_MOVT_ABS(_NC) support Michael Zimmermann
@ 2015-01-31 11:45 ` Leif Lindholm
  2015-01-31 12:00   ` Michael Zimmermann
  0 siblings, 1 reply; 14+ messages in thread
From: Leif Lindholm @ 2015-01-31 11:45 UTC (permalink / raw)
  To: The development of GNU GRUB

On Sat, Jan 31, 2015 at 12:35:34PM +0100, Michael Zimmermann wrote:
> when compiling grub with O2 or O3 on a ARM target mkimage fails with
> "error: relocation4 X is not implemented yet" for
> R_ARM_THM_MOVT_ABS and R_ARM_THM_MOVW_ABS_NC (thumb)
> or R_ARM_MOVW_ABS and R_ARM_MOVW_ABS_NC (arm)

To help me try to reproduce:
What are your complete config options (how are you adding the -O2/O3)?
What toolchain version (output of gcc -v)?
And (for my own curiosity) which Linux distribution?

/
    Leif


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

* Re: R_ARM(_THM)_MOVT_ABS(_NC) support
  2015-01-31 11:45 ` Leif Lindholm
@ 2015-01-31 12:00   ` Michael Zimmermann
  2015-01-31 12:01     ` Michael Zimmermann
  2015-02-01 10:51     ` Leif Lindholm
  0 siblings, 2 replies; 14+ messages in thread
From: Michael Zimmermann @ 2015-01-31 12:00 UTC (permalink / raw)
  To: The development of GNU GRUB

The configure line:
./configure --host arm-linux-gnueabihf CFLAGS='-static-libgcc
-Wl,-static' TARGET_CFLAGS='-O3'

My compiler is gcc-linaro-arm-linux-gnueabihf-4.9-2014.09 (
http://releases.linaro.org/14.09/components/toolchain/binaries )

gcc -v :
Using built-in specs.
COLLECT_GCC=./prebuilts/gcc/linux-x86/arm/arm-linux-gnueabihf-4.9/bin/arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/media/Data/repositories/git/bigG/prebuilts/gcc/linux-x86/arm/arm-linux-gnueabihf-4.9/bin/../libexec/gcc/arm-linux-gnueabihf/4.9.2/lto-wrapper
Target: arm-linux-gnueabihf
Configured with:
/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/gcc-linaro-4.9-2014.09/configure
--build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu
--target=arm-linux-gnueabihf
--prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install
--with-sysroot=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc
--enable-languages=c,c++,fortran --disable-multilib --enable-multiarch
--with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3-d16
--with-float=hard --with-pkgversion='crosstool-NG
linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09'
--with-bugurl=https://bugs.launchpad.net/gcc-linaro
--enable-__cxa_atexit --enable-libmudflap --enable-libgomp
--enable-libssp
--with-gmp=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
--with-mpfr=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
--with-mpc=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
--with-isl=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
--with-cloog=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
--with-libelf=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
--enable-threads=posix --disable-libstdcxx-pch
--enable-linker-build-id --enable-plugin --enable-gold
--with-local-prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc
--enable-c99 --enable-long-long --with-mode=thumb --disable-multilib
--with-float=hard
Thread model: posix
gcc version 4.9.2 20140904 (prerelease) (crosstool-NG
linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09)

Michael

On Sat, Jan 31, 2015 at 12:45 PM, Leif Lindholm
<leif.lindholm@linaro.org> wrote:
> On Sat, Jan 31, 2015 at 12:35:34PM +0100, Michael Zimmermann wrote:
>> when compiling grub with O2 or O3 on a ARM target mkimage fails with
>> "error: relocation4 X is not implemented yet" for
>> R_ARM_THM_MOVT_ABS and R_ARM_THM_MOVW_ABS_NC (thumb)
>> or R_ARM_MOVW_ABS and R_ARM_MOVW_ABS_NC (arm)
>
> To help me try to reproduce:
> What are your complete config options (how are you adding the -O2/O3)?
> What toolchain version (output of gcc -v)?
> And (for my own curiosity) which Linux distribution?
>
> /
>     Leif
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel


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

* Re: R_ARM(_THM)_MOVT_ABS(_NC) support
  2015-01-31 12:00   ` Michael Zimmermann
@ 2015-01-31 12:01     ` Michael Zimmermann
  2015-01-31 12:10       ` Michael Zimmermann
  2015-02-01 10:51     ` Leif Lindholm
  1 sibling, 1 reply; 14+ messages in thread
From: Michael Zimmermann @ 2015-01-31 12:01 UTC (permalink / raw)
  To: The development of GNU GRUB

I forgot the Linux distro: (it doesn't matter since I'm cross
compiling) Ubuntu 14.10

On Sat, Jan 31, 2015 at 1:00 PM, Michael Zimmermann
<sigmaepsilon92@gmail.com> wrote:
> The configure line:
> ./configure --host arm-linux-gnueabihf CFLAGS='-static-libgcc
> -Wl,-static' TARGET_CFLAGS='-O3'
>
> My compiler is gcc-linaro-arm-linux-gnueabihf-4.9-2014.09 (
> http://releases.linaro.org/14.09/components/toolchain/binaries )
>
> gcc -v :
> Using built-in specs.
> COLLECT_GCC=./prebuilts/gcc/linux-x86/arm/arm-linux-gnueabihf-4.9/bin/arm-linux-gnueabihf-gcc
> COLLECT_LTO_WRAPPER=/media/Data/repositories/git/bigG/prebuilts/gcc/linux-x86/arm/arm-linux-gnueabihf-4.9/bin/../libexec/gcc/arm-linux-gnueabihf/4.9.2/lto-wrapper
> Target: arm-linux-gnueabihf
> Configured with:
> /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/gcc-linaro-4.9-2014.09/configure
> --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu
> --target=arm-linux-gnueabihf
> --prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install
> --with-sysroot=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc
> --enable-languages=c,c++,fortran --disable-multilib --enable-multiarch
> --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3-d16
> --with-float=hard --with-pkgversion='crosstool-NG
> linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09'
> --with-bugurl=https://bugs.launchpad.net/gcc-linaro
> --enable-__cxa_atexit --enable-libmudflap --enable-libgomp
> --enable-libssp
> --with-gmp=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
> --with-mpfr=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
> --with-mpc=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
> --with-isl=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
> --with-cloog=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
> --with-libelf=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
> --enable-threads=posix --disable-libstdcxx-pch
> --enable-linker-build-id --enable-plugin --enable-gold
> --with-local-prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc
> --enable-c99 --enable-long-long --with-mode=thumb --disable-multilib
> --with-float=hard
> Thread model: posix
> gcc version 4.9.2 20140904 (prerelease) (crosstool-NG
> linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09)
>
> Michael
>
> On Sat, Jan 31, 2015 at 12:45 PM, Leif Lindholm
> <leif.lindholm@linaro.org> wrote:
>> On Sat, Jan 31, 2015 at 12:35:34PM +0100, Michael Zimmermann wrote:
>>> when compiling grub with O2 or O3 on a ARM target mkimage fails with
>>> "error: relocation4 X is not implemented yet" for
>>> R_ARM_THM_MOVT_ABS and R_ARM_THM_MOVW_ABS_NC (thumb)
>>> or R_ARM_MOVW_ABS and R_ARM_MOVW_ABS_NC (arm)
>>
>> To help me try to reproduce:
>> What are your complete config options (how are you adding the -O2/O3)?
>> What toolchain version (output of gcc -v)?
>> And (for my own curiosity) which Linux distribution?
>>
>> /
>>     Leif
>>
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> https://lists.gnu.org/mailman/listinfo/grub-devel


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

* Re: R_ARM(_THM)_MOVT_ABS(_NC) support
  2015-01-31 12:01     ` Michael Zimmermann
@ 2015-01-31 12:10       ` Michael Zimmermann
  2015-02-03 21:37         ` Leif Lindholm
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Zimmermann @ 2015-01-31 12:10 UTC (permalink / raw)
  To: The development of GNU GRUB

What I almost forgot is that you need the following patch to fix
compilation with O2/O3(it fixes warnings):

From 54fe81d049c1ea24f8dc72eff16e88bf39291c7d Mon Sep 17 00:00:00 2001
From: M1cha <sigmaepsilon92@gmail.com>
Date: Sat, 31 Jan 2015 13:08:43 +0100
Subject: [PATCH 1/1] fix compilation with O2/O3

---
 grub-core/commands/verify.c | 2 +-
 grub-core/fs/hfsplus.c      | 8 ++++----
 grub-core/gnulib/regcomp.c  | 2 +-
 grub-core/normal/main.c     | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/grub-core/commands/verify.c b/grub-core/commands/verify.c
index 6569391..9620a3b 100644
--- a/grub-core/commands/verify.c
+++ b/grub-core/commands/verify.c
@@ -454,7 +454,7 @@ grub_verify_signature_real (char *buf, grub_size_t size,
   grub_err_t err;
   grub_size_t i;
   gcry_mpi_t mpis[10];
-  grub_uint8_t type;
+  grub_uint8_t type = 0;

   err = read_packet_header (sig, &type, &len);
   if (err)
diff --git a/grub-core/fs/hfsplus.c b/grub-core/fs/hfsplus.c
index 8f07f85..f7a43f1 100644
--- a/grub-core/fs/hfsplus.c
+++ b/grub-core/fs/hfsplus.c
@@ -786,8 +786,8 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir,
   };

   struct grub_hfsplus_key_internal intern;
-  struct grub_hfsplus_btnode *node;
-  grub_disk_addr_t ptr;
+  struct grub_hfsplus_btnode *node = NULL;
+  grub_disk_addr_t ptr = 0;

   {
     struct grub_fshelp_node *fsnode;
@@ -970,8 +970,8 @@ grub_hfsplus_label (grub_device_t device, char **label)
   struct grub_hfsplus_catkey *catkey;
   int i, label_len;
   struct grub_hfsplus_key_internal intern;
-  struct grub_hfsplus_btnode *node;
-  grub_disk_addr_t ptr;
+  struct grub_hfsplus_btnode *node = NULL;
+  grub_disk_addr_t ptr = 0;

   *label = 0;

diff --git a/grub-core/gnulib/regcomp.c b/grub-core/gnulib/regcomp.c
index 596e0cf..1c36c7e 100644
--- a/grub-core/gnulib/regcomp.c
+++ b/grub-core/gnulib/regcomp.c
@@ -3143,7 +3143,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t
*dfa, re_token_t *token,

   while (1)
     {
-      bracket_elem_t start_elem, end_elem;
+      bracket_elem_t start_elem = {0}, end_elem = {0};
       unsigned char start_name_buf[BRACKET_NAME_BUF_SIZE];
       unsigned char end_name_buf[BRACKET_NAME_BUF_SIZE];
       reg_errcode_t ret;
diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
index 623b93b..78a70a8 100644
--- a/grub-core/normal/main.c
+++ b/grub-core/normal/main.c
@@ -445,7 +445,7 @@ grub_cmdline_run (int nested, int force_auth)

   while (1)
     {
-      char *line;
+      char *line = NULL;

       if (grub_normal_exit_level)
  break;
-- 
2.1.0

On Sat, Jan 31, 2015 at 1:01 PM, Michael Zimmermann
<sigmaepsilon92@gmail.com> wrote:
> I forgot the Linux distro: (it doesn't matter since I'm cross
> compiling) Ubuntu 14.10
>
> On Sat, Jan 31, 2015 at 1:00 PM, Michael Zimmermann
> <sigmaepsilon92@gmail.com> wrote:
>> The configure line:
>> ./configure --host arm-linux-gnueabihf CFLAGS='-static-libgcc
>> -Wl,-static' TARGET_CFLAGS='-O3'
>>
>> My compiler is gcc-linaro-arm-linux-gnueabihf-4.9-2014.09 (
>> http://releases.linaro.org/14.09/components/toolchain/binaries )
>>
>> gcc -v :
>> Using built-in specs.
>> COLLECT_GCC=./prebuilts/gcc/linux-x86/arm/arm-linux-gnueabihf-4.9/bin/arm-linux-gnueabihf-gcc
>> COLLECT_LTO_WRAPPER=/media/Data/repositories/git/bigG/prebuilts/gcc/linux-x86/arm/arm-linux-gnueabihf-4.9/bin/../libexec/gcc/arm-linux-gnueabihf/4.9.2/lto-wrapper
>> Target: arm-linux-gnueabihf
>> Configured with:
>> /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/gcc-linaro-4.9-2014.09/configure
>> --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu
>> --target=arm-linux-gnueabihf
>> --prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install
>> --with-sysroot=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc
>> --enable-languages=c,c++,fortran --disable-multilib --enable-multiarch
>> --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3-d16
>> --with-float=hard --with-pkgversion='crosstool-NG
>> linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09'
>> --with-bugurl=https://bugs.launchpad.net/gcc-linaro
>> --enable-__cxa_atexit --enable-libmudflap --enable-libgomp
>> --enable-libssp
>> --with-gmp=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
>> --with-mpfr=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
>> --with-mpc=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
>> --with-isl=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
>> --with-cloog=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
>> --with-libelf=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
>> --enable-threads=posix --disable-libstdcxx-pch
>> --enable-linker-build-id --enable-plugin --enable-gold
>> --with-local-prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc
>> --enable-c99 --enable-long-long --with-mode=thumb --disable-multilib
>> --with-float=hard
>> Thread model: posix
>> gcc version 4.9.2 20140904 (prerelease) (crosstool-NG
>> linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09)
>>
>> Michael
>>
>> On Sat, Jan 31, 2015 at 12:45 PM, Leif Lindholm
>> <leif.lindholm@linaro.org> wrote:
>>> On Sat, Jan 31, 2015 at 12:35:34PM +0100, Michael Zimmermann wrote:
>>>> when compiling grub with O2 or O3 on a ARM target mkimage fails with
>>>> "error: relocation4 X is not implemented yet" for
>>>> R_ARM_THM_MOVT_ABS and R_ARM_THM_MOVW_ABS_NC (thumb)
>>>> or R_ARM_MOVW_ABS and R_ARM_MOVW_ABS_NC (arm)
>>>
>>> To help me try to reproduce:
>>> What are your complete config options (how are you adding the -O2/O3)?
>>> What toolchain version (output of gcc -v)?
>>> And (for my own curiosity) which Linux distribution?
>>>
>>> /
>>>     Leif
>>>
>>> _______________________________________________
>>> Grub-devel mailing list
>>> Grub-devel@gnu.org
>>> https://lists.gnu.org/mailman/listinfo/grub-devel


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

* Re: R_ARM(_THM)_MOVT_ABS(_NC) support
  2015-01-31 12:00   ` Michael Zimmermann
  2015-01-31 12:01     ` Michael Zimmermann
@ 2015-02-01 10:51     ` Leif Lindholm
  2015-02-01 11:43       ` Michael Zimmermann
  1 sibling, 1 reply; 14+ messages in thread
From: Leif Lindholm @ 2015-02-01 10:51 UTC (permalink / raw)
  To: The development of GNU GRUB

On Sat, Jan 31, 2015 at 01:00:29PM +0100, Michael Zimmermann wrote:
> The configure line:
> ./configure --host arm-linux-gnueabihf CFLAGS='-static-libgcc
> -Wl,-static' TARGET_CFLAGS='-O3'
> 
> My compiler is gcc-linaro-arm-linux-gnueabihf-4.9-2014.09 (
> http://releases.linaro.org/14.09/components/toolchain/binaries )

Hmm, I am unable to reproduce this, using the same toolchain and those
options to configure.

How are you invoking mkimage?

(And why are you adding those additional CFLAGS.)

/
    Leif


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

* Re: R_ARM(_THM)_MOVT_ABS(_NC) support
  2015-02-01 10:51     ` Leif Lindholm
@ 2015-02-01 11:43       ` Michael Zimmermann
  2015-02-01 12:32         ` Leif Lindholm
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Zimmermann @ 2015-02-01 11:43 UTC (permalink / raw)
  To: The development of GNU GRUB

mkimage:
grub-mkimage -c load.cfg -O arm-uboot -o uboot.img -d ./grub-core -T
0x89000000 m list of modules

I add these cflags to get static tools(mkimage etc). If I remove it I
get the same result.

On Sun, Feb 1, 2015 at 11:51 AM, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Sat, Jan 31, 2015 at 01:00:29PM +0100, Michael Zimmermann wrote:
>> The configure line:
>> ./configure --host arm-linux-gnueabihf CFLAGS='-static-libgcc
>> -Wl,-static' TARGET_CFLAGS='-O3'
>>
>> My compiler is gcc-linaro-arm-linux-gnueabihf-4.9-2014.09 (
>> http://releases.linaro.org/14.09/components/toolchain/binaries )
>
> Hmm, I am unable to reproduce this, using the same toolchain and those
> options to configure.
>
> How are you invoking mkimage?
>
> (And why are you adding those additional CFLAGS.)
>
> /
>     Leif
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel


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

* Re: R_ARM(_THM)_MOVT_ABS(_NC) support
  2015-02-01 11:43       ` Michael Zimmermann
@ 2015-02-01 12:32         ` Leif Lindholm
  2015-02-01 12:36           ` Michael Zimmermann
  0 siblings, 1 reply; 14+ messages in thread
From: Leif Lindholm @ 2015-02-01 12:32 UTC (permalink / raw)
  To: The development of GNU GRUB

On Sun, Feb 01, 2015 at 12:43:40PM +0100, Michael Zimmermann wrote:
> mkimage:
> grub-mkimage -c load.cfg -O arm-uboot -o uboot.img -d ./grub-core -T
> 0x89000000 m list of modules

Ok, so that command line tells me you are not using a plain upstream
grub, but have added Ian Campbell's patches to relocate the image base
address at mkimage time:
http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00421.html
(This would have been useful to mention up front.)

Did you get this source code from somewhere, or have you applied it
yourself to a current version?

> I add these cflags to get static tools(mkimage etc). If I remove it I
> get the same result.

OK.

/
    Leif


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

* Re: R_ARM(_THM)_MOVT_ABS(_NC) support
  2015-02-01 12:32         ` Leif Lindholm
@ 2015-02-01 12:36           ` Michael Zimmermann
  2015-02-03  7:26             ` Michael Zimmermann
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Zimmermann @ 2015-02-01 12:36 UTC (permalink / raw)
  To: The development of GNU GRUB

Oh sry, I totally forgot that I picked patches for mkimage.
That's the point is where I started forking grub to add Ian's patches:
https://github.com/grub4android/grub/commits/master?page=7

On Sun, Feb 1, 2015 at 1:32 PM, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Sun, Feb 01, 2015 at 12:43:40PM +0100, Michael Zimmermann wrote:
>> mkimage:
>> grub-mkimage -c load.cfg -O arm-uboot -o uboot.img -d ./grub-core -T
>> 0x89000000 m list of modules
>
> Ok, so that command line tells me you are not using a plain upstream
> grub, but have added Ian Campbell's patches to relocate the image base
> address at mkimage time:
> http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00421.html
> (This would have been useful to mention up front.)
>
> Did you get this source code from somewhere, or have you applied it
> yourself to a current version?
>
>> I add these cflags to get static tools(mkimage etc). If I remove it I
>> get the same result.
>
> OK.
>
> /
>     Leif
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel


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

* Re: R_ARM(_THM)_MOVT_ABS(_NC) support
  2015-02-01 12:36           ` Michael Zimmermann
@ 2015-02-03  7:26             ` Michael Zimmermann
  2015-02-03 12:27               ` Leif Lindholm
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Zimmermann @ 2015-02-03  7:26 UTC (permalink / raw)
  To: The development of GNU GRUB

I reverted his commits and compiled using O3 and it worked, but: I get
the same error on runtime:

relocation 0x2f is not implemented yet
Aborted. Press any key to exit.bdev_dec_ref:242: last ref,

So I guess the upstream GRUB is affected, too the error just happens at runtime.

On Sun, Feb 1, 2015 at 1:36 PM, Michael Zimmermann
<sigmaepsilon92@gmail.com> wrote:
> Oh sry, I totally forgot that I picked patches for mkimage.
> That's the point is where I started forking grub to add Ian's patches:
> https://github.com/grub4android/grub/commits/master?page=7
>
> On Sun, Feb 1, 2015 at 1:32 PM, Leif Lindholm <leif.lindholm@linaro.org> wrote:
>> On Sun, Feb 01, 2015 at 12:43:40PM +0100, Michael Zimmermann wrote:
>>> mkimage:
>>> grub-mkimage -c load.cfg -O arm-uboot -o uboot.img -d ./grub-core -T
>>> 0x89000000 m list of modules
>>
>> Ok, so that command line tells me you are not using a plain upstream
>> grub, but have added Ian Campbell's patches to relocate the image base
>> address at mkimage time:
>> http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00421.html
>> (This would have been useful to mention up front.)
>>
>> Did you get this source code from somewhere, or have you applied it
>> yourself to a current version?
>>
>>> I add these cflags to get static tools(mkimage etc). If I remove it I
>>> get the same result.
>>
>> OK.
>>
>> /
>>     Leif
>>
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> https://lists.gnu.org/mailman/listinfo/grub-devel


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

* Re: R_ARM(_THM)_MOVT_ABS(_NC) support
  2015-02-03  7:26             ` Michael Zimmermann
@ 2015-02-03 12:27               ` Leif Lindholm
  2015-02-03 12:38                 ` Michael Zimmermann
  0 siblings, 1 reply; 14+ messages in thread
From: Leif Lindholm @ 2015-02-03 12:27 UTC (permalink / raw)
  To: The development of GNU GRUB

Hi Michael,

Sorry for delay - travelling back from FOSDEM, then catching up on
work.

On Tue, Feb 03, 2015 at 08:26:58AM +0100, Michael Zimmermann wrote:
> I reverted his commits and compiled using O3 and it worked, but: I get
> the same error on runtime:
> 
> relocation 0x2f is not implemented yet
> Aborted. Press any key to exit.bdev_dec_ref:242: last ref,
> 
> So I guess the upstream GRUB is affected, too the error just happens
> at runtime.

I had a look at your tree. There's some interesting stuff in there,
like the U-Boot framebuffer and the touchscreen support. 

However, the way the repo is currently set up makes it very difficult
for me to look at it for debugging. If you would be willing to take
the time to clean it up for easier tracking against upstream, get in
touch offline and I can provide some pointers about how to do that.
(It would make your own life easier as well.)

/
    Leif


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

* Re: R_ARM(_THM)_MOVT_ABS(_NC) support
  2015-02-03 12:27               ` Leif Lindholm
@ 2015-02-03 12:38                 ` Michael Zimmermann
  2015-02-03 13:29                   ` Leif Lindholm
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Zimmermann @ 2015-02-03 12:38 UTC (permalink / raw)
  To: The development of GNU GRUB

Hi,

I guess with "get in touch offline" you mean via IM?
What kind of setup annoys you? The repo is compile-able outside my build system.
I guess this is related to picking the new features, because the bug I
reported should be reproduce-able with the mainline branch(u should
get the error at runtime then).

Michael

On Tue, Feb 3, 2015 at 1:27 PM, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> Hi Michael,
>
> Sorry for delay - travelling back from FOSDEM, then catching up on
> work.
>
> On Tue, Feb 03, 2015 at 08:26:58AM +0100, Michael Zimmermann wrote:
>> I reverted his commits and compiled using O3 and it worked, but: I get
>> the same error on runtime:
>>
>> relocation 0x2f is not implemented yet
>> Aborted. Press any key to exit.bdev_dec_ref:242: last ref,
>>
>> So I guess the upstream GRUB is affected, too the error just happens
>> at runtime.
>
> I had a look at your tree. There's some interesting stuff in there,
> like the U-Boot framebuffer and the touchscreen support.
>
> However, the way the repo is currently set up makes it very difficult
> for me to look at it for debugging. If you would be willing to take
> the time to clean it up for easier tracking against upstream, get in
> touch offline and I can provide some pointers about how to do that.
> (It would make your own life easier as well.)
>
> /
>     Leif
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel


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

* Re: R_ARM(_THM)_MOVT_ABS(_NC) support
  2015-02-03 12:38                 ` Michael Zimmermann
@ 2015-02-03 13:29                   ` Leif Lindholm
  0 siblings, 0 replies; 14+ messages in thread
From: Leif Lindholm @ 2015-02-03 13:29 UTC (permalink / raw)
  To: The development of GNU GRUB

On Tue, Feb 03, 2015 at 01:38:06PM +0100, Michael Zimmermann wrote:
> I guess with "get in touch offline" you mean via IM?

Email is fine.
Or I'm leiflindholm on #freenode.

> What kind of setup annoys you? The repo is compile-able outside my
> build system.

The problem is that your repo was created as a checkout sometime last
summer, with some of your patches intersperesed with new merges
against newer upstream versions.

Git gives you the option for much less error-prone, and trackable,
workflows.

> I guess this is related to picking the new features, because the bug I
> reported should be reproduce-able with the mainline branch(u should
> get the error at runtime then).

I can actually reproduce the runtime error, so I will have a look at
that. However, I would still recommend reorganising your repo to
simplify collaboration.

/
    Leif


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

* Re: R_ARM(_THM)_MOVT_ABS(_NC) support
  2015-01-31 12:10       ` Michael Zimmermann
@ 2015-02-03 21:37         ` Leif Lindholm
  0 siblings, 0 replies; 14+ messages in thread
From: Leif Lindholm @ 2015-02-03 21:37 UTC (permalink / raw)
  To: The development of GNU GRUB

On Sat, Jan 31, 2015 at 01:10:02PM +0100, Michael Zimmermann wrote:
> What I almost forgot is that you need the following patch to fix
> compilation with O2/O3(it fixes warnings):

I can verify that this patch works, and makes it possible to compile
with gcc 4.9 at -O3 (so is effectively a prerequisite for the added
relocation handling patch I just sent).

The only question I would have is whether this approach is considered
OK, or whether we should try to figure out why gcc spots potential
"used uninitialised" paths in the code?

/
    Leif

> From 54fe81d049c1ea24f8dc72eff16e88bf39291c7d Mon Sep 17 00:00:00 2001
> From: M1cha <sigmaepsilon92@gmail.com>
> Date: Sat, 31 Jan 2015 13:08:43 +0100
> Subject: [PATCH 1/1] fix compilation with O2/O3
> 
> ---
>  grub-core/commands/verify.c | 2 +-
>  grub-core/fs/hfsplus.c      | 8 ++++----
>  grub-core/gnulib/regcomp.c  | 2 +-
>  grub-core/normal/main.c     | 2 +-
>  4 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/grub-core/commands/verify.c b/grub-core/commands/verify.c
> index 6569391..9620a3b 100644
> --- a/grub-core/commands/verify.c
> +++ b/grub-core/commands/verify.c
> @@ -454,7 +454,7 @@ grub_verify_signature_real (char *buf, grub_size_t size,
>    grub_err_t err;
>    grub_size_t i;
>    gcry_mpi_t mpis[10];
> -  grub_uint8_t type;
> +  grub_uint8_t type = 0;
> 
>    err = read_packet_header (sig, &type, &len);
>    if (err)
> diff --git a/grub-core/fs/hfsplus.c b/grub-core/fs/hfsplus.c
> index 8f07f85..f7a43f1 100644
> --- a/grub-core/fs/hfsplus.c
> +++ b/grub-core/fs/hfsplus.c
> @@ -786,8 +786,8 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir,
>    };
> 
>    struct grub_hfsplus_key_internal intern;
> -  struct grub_hfsplus_btnode *node;
> -  grub_disk_addr_t ptr;
> +  struct grub_hfsplus_btnode *node = NULL;
> +  grub_disk_addr_t ptr = 0;
> 
>    {
>      struct grub_fshelp_node *fsnode;
> @@ -970,8 +970,8 @@ grub_hfsplus_label (grub_device_t device, char **label)
>    struct grub_hfsplus_catkey *catkey;
>    int i, label_len;
>    struct grub_hfsplus_key_internal intern;
> -  struct grub_hfsplus_btnode *node;
> -  grub_disk_addr_t ptr;
> +  struct grub_hfsplus_btnode *node = NULL;
> +  grub_disk_addr_t ptr = 0;
> 
>    *label = 0;
> 
> diff --git a/grub-core/gnulib/regcomp.c b/grub-core/gnulib/regcomp.c
> index 596e0cf..1c36c7e 100644
> --- a/grub-core/gnulib/regcomp.c
> +++ b/grub-core/gnulib/regcomp.c
> @@ -3143,7 +3143,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t
> *dfa, re_token_t *token,
> 
>    while (1)
>      {
> -      bracket_elem_t start_elem, end_elem;
> +      bracket_elem_t start_elem = {0}, end_elem = {0};
>        unsigned char start_name_buf[BRACKET_NAME_BUF_SIZE];
>        unsigned char end_name_buf[BRACKET_NAME_BUF_SIZE];
>        reg_errcode_t ret;
> diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
> index 623b93b..78a70a8 100644
> --- a/grub-core/normal/main.c
> +++ b/grub-core/normal/main.c
> @@ -445,7 +445,7 @@ grub_cmdline_run (int nested, int force_auth)
> 
>    while (1)
>      {
> -      char *line;
> +      char *line = NULL;
> 
>        if (grub_normal_exit_level)
>   break;
> -- 
> 2.1.0
> 
> On Sat, Jan 31, 2015 at 1:01 PM, Michael Zimmermann
> <sigmaepsilon92@gmail.com> wrote:
> > I forgot the Linux distro: (it doesn't matter since I'm cross
> > compiling) Ubuntu 14.10
> >
> > On Sat, Jan 31, 2015 at 1:00 PM, Michael Zimmermann
> > <sigmaepsilon92@gmail.com> wrote:
> >> The configure line:
> >> ./configure --host arm-linux-gnueabihf CFLAGS='-static-libgcc
> >> -Wl,-static' TARGET_CFLAGS='-O3'
> >>
> >> My compiler is gcc-linaro-arm-linux-gnueabihf-4.9-2014.09 (
> >> http://releases.linaro.org/14.09/components/toolchain/binaries )
> >>
> >> gcc -v :
> >> Using built-in specs.
> >> COLLECT_GCC=./prebuilts/gcc/linux-x86/arm/arm-linux-gnueabihf-4.9/bin/arm-linux-gnueabihf-gcc
> >> COLLECT_LTO_WRAPPER=/media/Data/repositories/git/bigG/prebuilts/gcc/linux-x86/arm/arm-linux-gnueabihf-4.9/bin/../libexec/gcc/arm-linux-gnueabihf/4.9.2/lto-wrapper
> >> Target: arm-linux-gnueabihf
> >> Configured with:
> >> /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/gcc-linaro-4.9-2014.09/configure
> >> --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu
> >> --target=arm-linux-gnueabihf
> >> --prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install
> >> --with-sysroot=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc
> >> --enable-languages=c,c++,fortran --disable-multilib --enable-multiarch
> >> --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3-d16
> >> --with-float=hard --with-pkgversion='crosstool-NG
> >> linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09'
> >> --with-bugurl=https://bugs.launchpad.net/gcc-linaro
> >> --enable-__cxa_atexit --enable-libmudflap --enable-libgomp
> >> --enable-libssp
> >> --with-gmp=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
> >> --with-mpfr=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
> >> --with-mpc=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
> >> --with-isl=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
> >> --with-cloog=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
> >> --with-libelf=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static
> >> --enable-threads=posix --disable-libstdcxx-pch
> >> --enable-linker-build-id --enable-plugin --enable-gold
> >> --with-local-prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc
> >> --enable-c99 --enable-long-long --with-mode=thumb --disable-multilib
> >> --with-float=hard
> >> Thread model: posix
> >> gcc version 4.9.2 20140904 (prerelease) (crosstool-NG
> >> linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09)
> >>
> >> Michael
> >>
> >> On Sat, Jan 31, 2015 at 12:45 PM, Leif Lindholm
> >> <leif.lindholm@linaro.org> wrote:
> >>> On Sat, Jan 31, 2015 at 12:35:34PM +0100, Michael Zimmermann wrote:
> >>>> when compiling grub with O2 or O3 on a ARM target mkimage fails with
> >>>> "error: relocation4 X is not implemented yet" for
> >>>> R_ARM_THM_MOVT_ABS and R_ARM_THM_MOVW_ABS_NC (thumb)
> >>>> or R_ARM_MOVW_ABS and R_ARM_MOVW_ABS_NC (arm)
> >>>
> >>> To help me try to reproduce:
> >>> What are your complete config options (how are you adding the -O2/O3)?
> >>> What toolchain version (output of gcc -v)?
> >>> And (for my own curiosity) which Linux distribution?
> >>>
> >>> /
> >>>     Leif
> >>>
> >>> _______________________________________________
> >>> 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] 14+ messages in thread

end of thread, other threads:[~2015-02-03 21:37 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-31 11:35 R_ARM(_THM)_MOVT_ABS(_NC) support Michael Zimmermann
2015-01-31 11:45 ` Leif Lindholm
2015-01-31 12:00   ` Michael Zimmermann
2015-01-31 12:01     ` Michael Zimmermann
2015-01-31 12:10       ` Michael Zimmermann
2015-02-03 21:37         ` Leif Lindholm
2015-02-01 10:51     ` Leif Lindholm
2015-02-01 11:43       ` Michael Zimmermann
2015-02-01 12:32         ` Leif Lindholm
2015-02-01 12:36           ` Michael Zimmermann
2015-02-03  7:26             ` Michael Zimmermann
2015-02-03 12:27               ` Leif Lindholm
2015-02-03 12:38                 ` Michael Zimmermann
2015-02-03 13:29                   ` Leif Lindholm

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.