diff mbox

[U-Boot] buildman: arm: undefined reference to `__aeabi_ldivmod'

Message ID 56E6FF76.6040706@wwwdotorg.org
State Not Applicable
Headers show

Commit Message

Stephen Warren March 14, 2016, 6:14 p.m. UTC
On 03/14/2016 11:32 AM, Jagan Teki wrote:
> Hi Simon,
>
> On 12 March 2016 at 06:02, Simon Glass <sjg@chromium.org> wrote:
>> +Stephen
>>
>> Hi Jagan,
>>
>> On 11 March 2016 at 01:00, Jagan Teki <jagannadh.teki@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> Did anyone encounter this issue? please let me know for any inputs.
>>>
>>>         arm:  +   venice2
>>> +drivers/mtd/spi-nor/built-in.o: In function `spi_nor_write':
>>> +build/../drivers/mtd/spi-nor/spi-nor.c:585: undefined reference to
>>> `__aeabi_ldivmod'
>>> +arm-unknown-linux-gnueabi-ld.bfd: BFD (GNU Binutils) 2.24 assertion
>>> fail /home/tony/buildall/src/binutils/bfd/elf32-arm.c:7696
>>> +arm-unknown-linux-gnueabi-ld.bfd: error: required section '.rel.plt'
>>> not found in the linker script
>>> +arm-unknown-linux-gnueabi-ld.bfd: final link failed: Invalid operation
>>> +make[1]: *** [u-boot] Error 1
>>> +make: *** [sub-make] Error 2
>>
>> Are you using 64-bit division? Tegra uses the private libgcc. This
>> patch might help:
>
> Yes, I'm using 64-bit.
>
>> http://patchwork.ozlabs.org/patch/592628/
>
> Still the same issue.

If I start with v2016.03, and apply the following patch, I can reproduce 
this issue when building venice2 (a 32-bit Tegra build) but not 
p2371-2180 (a 64-bit Tegra build):


However, if I apply the patch Simon mentioned above, the problem is 
fixed. Are you sure you applied that patch correctly?

Comments

Jagan Teki March 16, 2016, 2:27 p.m. UTC | #1
On 14 March 2016 at 23:44, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 03/14/2016 11:32 AM, Jagan Teki wrote:
>>
>> Hi Simon,
>>
>> On 12 March 2016 at 06:02, Simon Glass <sjg@chromium.org> wrote:
>>>
>>> +Stephen
>>>
>>> Hi Jagan,
>>>
>>> On 11 March 2016 at 01:00, Jagan Teki <jagannadh.teki@gmail.com> wrote:
>>>>
>>>>
>>>> Hi,
>>>>
>>>> Did anyone encounter this issue? please let me know for any inputs.
>>>>
>>>>         arm:  +   venice2
>>>> +drivers/mtd/spi-nor/built-in.o: In function `spi_nor_write':
>>>> +build/../drivers/mtd/spi-nor/spi-nor.c:585: undefined reference to
>>>> `__aeabi_ldivmod'
>>>> +arm-unknown-linux-gnueabi-ld.bfd: BFD (GNU Binutils) 2.24 assertion
>>>> fail /home/tony/buildall/src/binutils/bfd/elf32-arm.c:7696
>>>> +arm-unknown-linux-gnueabi-ld.bfd: error: required section '.rel.plt'
>>>> not found in the linker script
>>>> +arm-unknown-linux-gnueabi-ld.bfd: final link failed: Invalid operation
>>>> +make[1]: *** [u-boot] Error 1
>>>> +make: *** [sub-make] Error 2
>>>
>>>
>>> Are you using 64-bit division? Tegra uses the private libgcc. This
>>> patch might help:
>>
>>
>> Yes, I'm using 64-bit.
>>
>>> http://patchwork.ozlabs.org/patch/592628/
>>
>>
>> Still the same issue.
>
>
> If I start with v2016.03, and apply the following patch, I can reproduce
> this issue when building venice2 (a 32-bit Tegra build) but not p2371-2180
> (a 64-bit Tegra build):
>
> diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c
> index ac274e17e8bd..9b1a4112a0b1 100644
> --- a/arch/arm/mach-tegra/board2.c
> +++ b/arch/arm/mach-tegra/board2.c
> @@ -235,9 +235,13 @@ __weak void pin_mux_mmc(void)
>  {
>  }
>
> +uint64_t a = 200;
> +uint64_t b = 5;
> +
>  /* this is a weak define that we are overriding */
>  int board_mmc_init(bd_t *bd)
>  {
> +       printf("a/b = %llu\n", a / b);
>         debug("%s called\n", __func__);
>
>         /* Enable muxes, etc. for SDMMC controllers */
>
> However, if I apply the patch Simon mentioned above, the problem is fixed.
> Are you sure you applied that patch correctly?

Yeah, I tried this on latest as well, same issue.
Stephen Warren March 16, 2016, 3:34 p.m. UTC | #2
On 03/16/2016 08:27 AM, Jagan Teki wrote:
> On 14 March 2016 at 23:44, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> On 03/14/2016 11:32 AM, Jagan Teki wrote:
>>>
>>> Hi Simon,
>>>
>>> On 12 March 2016 at 06:02, Simon Glass <sjg@chromium.org> wrote:
>>>>
>>>> +Stephen
>>>>
>>>> Hi Jagan,
>>>>
>>>> On 11 March 2016 at 01:00, Jagan Teki <jagannadh.teki@gmail.com> wrote:
>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> Did anyone encounter this issue? please let me know for any inputs.
>>>>>
>>>>>          arm:  +   venice2
>>>>> +drivers/mtd/spi-nor/built-in.o: In function `spi_nor_write':
>>>>> +build/../drivers/mtd/spi-nor/spi-nor.c:585: undefined reference to
>>>>> `__aeabi_ldivmod'
>>>>> +arm-unknown-linux-gnueabi-ld.bfd: BFD (GNU Binutils) 2.24 assertion
>>>>> fail /home/tony/buildall/src/binutils/bfd/elf32-arm.c:7696
>>>>> +arm-unknown-linux-gnueabi-ld.bfd: error: required section '.rel.plt'
>>>>> not found in the linker script
>>>>> +arm-unknown-linux-gnueabi-ld.bfd: final link failed: Invalid operation
>>>>> +make[1]: *** [u-boot] Error 1
>>>>> +make: *** [sub-make] Error 2
>>>>
>>>>
>>>> Are you using 64-bit division? Tegra uses the private libgcc. This
>>>> patch might help:
>>>
>>> Yes, I'm using 64-bit.
>>>
>>>> http://patchwork.ozlabs.org/patch/592628/
>>>
>>> Still the same issue.
...
>> However, if I apply the patch Simon mentioned above, the problem is fixed.
>> Are you sure you applied that patch correctly?
>
> Yeah, I tried this on latest as well, same issue.

Perhaps you could share the local patches that are triggering the problem?
Jagan Teki March 17, 2016, 5:48 a.m. UTC | #3
On 16 March 2016 at 21:04, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 03/16/2016 08:27 AM, Jagan Teki wrote:
>>
>> On 14 March 2016 at 23:44, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>
>>> On 03/14/2016 11:32 AM, Jagan Teki wrote:
>>>>
>>>>
>>>> Hi Simon,
>>>>
>>>> On 12 March 2016 at 06:02, Simon Glass <sjg@chromium.org> wrote:
>>>>>
>>>>>
>>>>> +Stephen
>>>>>
>>>>> Hi Jagan,
>>>>>
>>>>> On 11 March 2016 at 01:00, Jagan Teki <jagannadh.teki@gmail.com> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Did anyone encounter this issue? please let me know for any inputs.
>>>>>>
>>>>>>          arm:  +   venice2
>>>>>> +drivers/mtd/spi-nor/built-in.o: In function `spi_nor_write':
>>>>>> +build/../drivers/mtd/spi-nor/spi-nor.c:585: undefined reference to
>>>>>> `__aeabi_ldivmod'
>>>>>> +arm-unknown-linux-gnueabi-ld.bfd: BFD (GNU Binutils) 2.24 assertion
>>>>>> fail /home/tony/buildall/src/binutils/bfd/elf32-arm.c:7696
>>>>>> +arm-unknown-linux-gnueabi-ld.bfd: error: required section '.rel.plt'
>>>>>> not found in the linker script
>>>>>> +arm-unknown-linux-gnueabi-ld.bfd: final link failed: Invalid
>>>>>> operation
>>>>>> +make[1]: *** [u-boot] Error 1
>>>>>> +make: *** [sub-make] Error 2
>>>>>
>>>>>
>>>>>
>>>>> Are you using 64-bit division? Tegra uses the private libgcc. This
>>>>> patch might help:
>>>>
>>>>
>>>> Yes, I'm using 64-bit.
>>>>
>>>>> http://patchwork.ozlabs.org/patch/592628/
>>>>
>>>>
>>>> Still the same issue.
>
> ...
>>>
>>> However, if I apply the patch Simon mentioned above, the problem is
>>> fixed.
>>> Are you sure you applied that patch correctly?
>>
>>
>> Yeah, I tried this on latest as well, same issue.
>
>
> Perhaps you could share the local patches that are triggering the problem?

54: config: Enable SPI-NOR framework
       arm:  +   chromebook_jerry
+drivers/mtd/spi-nor/built-in.o: In function `spi_nor_write':
+build/../drivers/mtd/spi-nor/spi-nor.c:585: undefined reference to
`__aeabi_ldivmod'
+arm-unknown-linux-gnueabi-ld.bfd: BFD (GNU Binutils) 2.24 assertion
fail /home/tony/buildall/src/binutils/bfd/elf32-arm.c:7696
+arm-unknown-linux-gnueabi-ld.bfd: error: required section '.rel.plt'
not found in the linker script
+arm-unknown-linux-gnueabi-ld.bfd: final link failed: Invalid operation
+make[1]: *** [u-boot] Error 1
+make: *** [sub-make] Error 2

This is the spi-nor.c file
http://git.denx.de/?p=u-boot/u-boot-spi.git;a=blob;f=drivers/mtd/spi-nor/spi-nor.c;h=6166b62e595c6620bd3407788d705168e0bd6b2c;hb=refs/heads/spi-nor-test
Stephen Warren March 17, 2016, 4:18 p.m. UTC | #4
On 03/16/2016 11:48 PM, Jagan Teki wrote:
> On 16 March 2016 at 21:04, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> On 03/16/2016 08:27 AM, Jagan Teki wrote:
>>> On 14 March 2016 at 23:44, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>> On 03/14/2016 11:32 AM, Jagan Teki wrote:
>>>>> On 12 March 2016 at 06:02, Simon Glass <sjg@chromium.org> wrote:
>>>>>> On 11 March 2016 at 01:00, Jagan Teki <jagannadh.teki@gmail.com> wrote:
>>>>>>> Did anyone encounter this issue? please let me know for any inputs.
>>>>>>>
>>>>>>>           arm:  +   venice2
>>>>>>> +drivers/mtd/spi-nor/built-in.o: In function `spi_nor_write':
>>>>>>> +build/../drivers/mtd/spi-nor/spi-nor.c:585: undefined reference to
>>>>>>> `__aeabi_ldivmod'
>>>>>>> +arm-unknown-linux-gnueabi-ld.bfd: BFD (GNU Binutils) 2.24 assertion
>>>>>>> fail /home/tony/buildall/src/binutils/bfd/elf32-arm.c:7696
>>>>>>> +arm-unknown-linux-gnueabi-ld.bfd: error: required section '.rel.plt'
>>>>>>> not found in the linker script
>>>>>>> +arm-unknown-linux-gnueabi-ld.bfd: final link failed: Invalid
>>>>>>> operation
>>>>>>> +make[1]: *** [u-boot] Error 1
>>>>>>> +make: *** [sub-make] Error 2
>>>>>>
>>>>>> Are you using 64-bit division? Tegra uses the private libgcc. This
>>>>>> patch might help:
>>>>>
>>>>> Yes, I'm using 64-bit.
>>>>>
>>>>>> http://patchwork.ozlabs.org/patch/592628/
...
>> Perhaps you could share the local patches that are triggering the problem?
...
> This is the spi-nor.c file
> http://git.denx.de/?p=u-boot/u-boot-spi.git;a=blob;f=drivers/mtd/spi-nor/spi-nor.c;h=6166b62e595c6620bd3407788d705168e0bd6b2c;hb=refs/heads/spi-nor-test

I can reproduce this when building venice2 in u-boot-spi/spi-nor-test, 
and indeed the patch that Simon linked to doesn't help. That's because 
Simon's patch implements __aeabi_uldivmod whereas the linker failure is 
due to __aeabi_ldivmod (without the u).

Simon, is it easy for you to bring in __aeabi_ldivmod from the same place?

FWIW, I hacked _uldivmod.S to provide a dummy symbol for __aeabi_ldivmod 
and the link succeeded, so I think that's currently the only missing 
symbol. I only tested the venice2 build though.
Simon Glass May 1, 2016, 11:12 p.m. UTC | #5
Hi,

On 17 March 2016 at 10:18, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 03/16/2016 11:48 PM, Jagan Teki wrote:
>>
>> On 16 March 2016 at 21:04, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>
>>> On 03/16/2016 08:27 AM, Jagan Teki wrote:
>>>>
>>>> On 14 March 2016 at 23:44, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>>>
>>>>> On 03/14/2016 11:32 AM, Jagan Teki wrote:
>>>>>>
>>>>>> On 12 March 2016 at 06:02, Simon Glass <sjg@chromium.org> wrote:
>>>>>>>
>>>>>>> On 11 March 2016 at 01:00, Jagan Teki <jagannadh.teki@gmail.com>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Did anyone encounter this issue? please let me know for any inputs.
>>>>>>>>
>>>>>>>>           arm:  +   venice2
>>>>>>>> +drivers/mtd/spi-nor/built-in.o: In function `spi_nor_write':
>>>>>>>> +build/../drivers/mtd/spi-nor/spi-nor.c:585: undefined reference to
>>>>>>>> `__aeabi_ldivmod'
>>>>>>>> +arm-unknown-linux-gnueabi-ld.bfd: BFD (GNU Binutils) 2.24 assertion
>>>>>>>> fail /home/tony/buildall/src/binutils/bfd/elf32-arm.c:7696
>>>>>>>> +arm-unknown-linux-gnueabi-ld.bfd: error: required section
>>>>>>>> '.rel.plt'
>>>>>>>> not found in the linker script
>>>>>>>> +arm-unknown-linux-gnueabi-ld.bfd: final link failed: Invalid
>>>>>>>> operation
>>>>>>>> +make[1]: *** [u-boot] Error 1
>>>>>>>> +make: *** [sub-make] Error 2
>>>>>>>
>>>>>>>
>>>>>>> Are you using 64-bit division? Tegra uses the private libgcc. This
>>>>>>> patch might help:
>>>>>>
>>>>>>
>>>>>> Yes, I'm using 64-bit.
>>>>>>
>>>>>>> http://patchwork.ozlabs.org/patch/592628/
>
> ...
>>>
>>> Perhaps you could share the local patches that are triggering the
>>> problem?
>
> ...
>>
>> This is the spi-nor.c file
>>
>> http://git.denx.de/?p=u-boot/u-boot-spi.git;a=blob;f=drivers/mtd/spi-nor/spi-nor.c;h=6166b62e595c6620bd3407788d705168e0bd6b2c;hb=refs/heads/spi-nor-test
>
>
> I can reproduce this when building venice2 in u-boot-spi/spi-nor-test, and
> indeed the patch that Simon linked to doesn't help. That's because Simon's
> patch implements __aeabi_uldivmod whereas the linker failure is due to
> __aeabi_ldivmod (without the u).
>
> Simon, is it easy for you to bring in __aeabi_ldivmod from the same place?
>
> FWIW, I hacked _uldivmod.S to provide a dummy symbol for __aeabi_ldivmod and
> the link succeeded, so I think that's currently the only missing symbol. I
> only tested the venice2 build though.

Not that I can see, sorry.

I suppose it is possible to fix up the sign but I don't have code to do it.

Regards,
Simon
diff mbox

Patch

diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c
index ac274e17e8bd..9b1a4112a0b1 100644
--- a/arch/arm/mach-tegra/board2.c
+++ b/arch/arm/mach-tegra/board2.c
@@ -235,9 +235,13 @@  __weak void pin_mux_mmc(void)
  {
  }

+uint64_t a = 200;
+uint64_t b = 5;
+
  /* this is a weak define that we are overriding */
  int board_mmc_init(bd_t *bd)
  {
+	printf("a/b = %llu\n", a / b);
  	debug("%s called\n", __func__);

  	/* Enable muxes, etc. for SDMMC controllers */