Skip to contentSkip to conversation

ARM: fix broken build of ARM

PATCH New Stefano Babic 4 participants 14 messages Jan 27, 2011 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: fix broken build of ARM

Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks ARM boards because for ARM the -pie option is used for partial linking together with -r option.

The patch adds the -pie option to link u-boot.bin only.

CC Jason Liu <[email protected]>
CC lool at dooz.org
CC Wolfgang Denk <[email protected]>
CC Albert Aribaud <[email protected]>
---
 arch/arm/config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/config.mk +1 -1
index 4e165bf..a6a4742 100644
@@ -67,5 +67,5 @@ LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds
 
 # needed for relocation
 ifndef CONFIG_NAND_SPL
-PLATFORM_LDFLAGS += -pie
+LDFLAGS_u-boot += -pie
 endif
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 ARM: fix broken build of ARM

Hello,

Am 27.01.2011 17:03, schrieb Stefano Babic:

Quoted 5 lines

Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks ARM boards because for ARM the -pie option is used for partial linking together with -r option.

The patch adds the -pie option to link u-boot.bin only.

Using native compilation with gcc 4.5.2 and binutils 2.21 this patch will result in an unusable u-boot. It halts here after DRAM: ... just like it was before some relocation fixes (regarding binutils).

Regards,

Alexander

#2 lore raw

PATCH 1/1 ARM: fix broken build of ARM

Hi Alexander,

Le 27/01/2011 20:42, Alexander Holler a ?crit :

Quoted 7 lines

Hello,

Am 27.01.2011 17:03, schrieb Stefano Babic:

Quoted 4 lines

Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks ARM boards because for ARM the -pie option is used for partial linking together with -r option.

Quoted 5 lines
Quoted 1 line

The patch adds the -pie option to link u-boot.bin only.

Using native compilation with gcc 4.5.2 and binutils 2.21 this patch will result in an unusable u-boot. It halts here after DRAM: ... just like it was before some relocation fixes (regarding binutils).

Which board do you compile?

Quoted 3 lines

Regards,

Alexander

Amicalement,

Signature · 1 line
Albert.
#3 lore raw

PATCH 1/1 ARM: fix broken build of ARM

Am 27.01.2011 21:20, schrieb Albert ARIBAUD:

Quoted 10 lines

Hi Alexander,

Le 27/01/2011 20:42, Alexander Holler a ?crit :

Quoted 7 lines

Hello,

Am 27.01.2011 17:03, schrieb Stefano Babic:

Quoted 4 lines

Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks ARM boards because for ARM the -pie option is used for partial linking together with -r option.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

The patch adds the -pie option to link u-boot.bin only.

Using native compilation with gcc 4.5.2 and binutils 2.21 this patch will result in an unusable u-boot. It halts here after DRAM: ... just like it was before some relocation fixes (regarding binutils).

Which board do you compile?

Upps, sorry, that one was on a BeagleBoard (armv7, omap3).

Regards,

Alexander

#4 lore raw

PATCH 1/1 ARM: fix broken build of ARM

Le 27/01/2011 21:55, Alexander Holler a ?crit :

Quoted 13 lines

Am 27.01.2011 21:20, schrieb Albert ARIBAUD:

Quoted 12 lines

Hi Alexander,

Le 27/01/2011 20:42, Alexander Holler a ?crit :

Quoted 9 lines

Hello,

Am 27.01.2011 17:03, schrieb Stefano Babic:

Quoted 5 lines

Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks ARM boards because for ARM the -pie option is used for partial linking together with -r option.

The patch adds the -pie option to link u-boot.bin only.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Using native compilation with gcc 4.5.2 and binutils 2.21 this patch will result in an unusable u-boot. It halts here after DRAM: ... just like it was before some relocation fixes (regarding binutils).

Which board do you compile?

Upps, sorry, that one was on a BeagleBoard (armv7, omap3).

I've just tried the following to compare make logs of before commit 8aba9dceebb14144e07d19593111ee3a999c37fc on the one hand and after this commit and with the proposed fix on the other hand:

git checkout 8aba9dceebb14144e07d19593111ee3a999c37fc^

(that's the commit just before the one which split LD_FLAGS)

make distclean ; make edminiv2_config; make > ~/old.txt 2>&1

git checkout 8aba9dceebb14144e07d19593111ee3a999c37fc

(that's the commit which split LD_FLAGS)

(replace "PLATFORM_LDFLAGS += -pie" with "LDFLAGS_u-boot += -pie" in arch/arm/config.mk)

make distclean ; make edminiv2_config; make > ~/new.txt 2>&1

(and finally)

kdiff3 ~/old.txt ~/new.txt

The only difference I see between the make logs is the relative location of the -pie option in the final ld invocation: in the 'old' case options go

	...  -Bstatic -T u-boot.lds  -pie -Ttext ...

whereas in the 'new' case, they go

	... -pie -Bstatic -T u-boot.lds  -Ttext ...

So I think the binary should be pretty much the same in the 'old' and 'new' cases, and that should be irrespective of the tool chain.

Alexander, can you run the same test with your BeagleBoard and let me know of any differences?

Quoted 3 lines

Regards,

Alexander

Amicalement,

Signature · 1 line
Albert.
#5 lore raw

PATCH 1/1 ARM: fix broken build of ARM

Dear Albert ARIBAUD,

Quoted 6 lines · In message <[email protected]> you wrote:

So I think the binary should be pretty much the same in the 'old' and 'new' cases, and that should be irrespective of the tool chain.

Alexander, can you run the same test with your BeagleBoard and let me know of any differences?

Also running a diff over the System.map and u-boot.map files is usually a good and easy test that images are identical.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"More software projects have gone awry for lack of calendar time than
for all other causes combined."
                         - Fred Brooks, Jr., _The Mythical Man Month_
#6 lore raw

PATCH 1/1 ARM: fix broken build of ARM

Le 27/01/2011 22:14, Wolfgang Denk a ?crit :

Quoted 4 lines

Dear Albert ARIBAUD,

Quoted 1 line · In message<[email protected]> you wrote:
Quoted 8 lines
Quoted 5 lines

So I think the binary should be pretty much the same in the 'old' and 'new' cases, and that should be irrespective of the tool chain.

Alexander, can you run the same test with your BeagleBoard and let me know of any differences?

Also running a diff over the System.map and u-boot.map files is usually a good and easy test that images are identical.

Indeed -- my goal was to compare the build processes more than their products.

Quoted 3 lines

Best regards,

Wolfgang Denk

Amicalement,

Signature · 1 line
Albert.
#7 lore raw

PATCH 1/1 ARM: fix broken build of ARM

In reply to Albert ARIBAUD

Am 27.01.2011 22:10, schrieb Albert ARIBAUD:

Quoted 18 lines

Le 27/01/2011 21:55, Alexander Holler a ?crit :

Quoted 17 lines

Am 27.01.2011 21:20, schrieb Albert ARIBAUD:

Quoted 16 lines

Hi Alexander,

Le 27/01/2011 20:42, Alexander Holler a ?crit :

Quoted 12 lines

Hello,

Am 27.01.2011 17:03, schrieb Stefano Babic:

Quoted 5 lines

Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks ARM boards because for ARM the -pie option is used for partial linking together with -r option.

The patch adds the -pie option to link u-boot.bin only.

Using native compilation with gcc 4.5.2 and binutils 2.21 this patch will result in an unusable u-boot. It halts here after DRAM: ... just like it was before some relocation fixes (regarding binutils).

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Which board do you compile?

Upps, sorry, that one was on a BeagleBoard (armv7, omap3).

I've just tried the following to compare make logs of before commit 8aba9dceebb14144e07d19593111ee3a999c37fc on the one hand and after this commit and with the proposed fix on the other hand:

Oh, it seems I've got misunderstood, the patch from Stefano Babic breaks u-boot here and not the commit 8aba9dceebb14144e07d19593111ee3a999c37fc.

Regards,

Alexander

#8 lore raw

PATCH 1/1 ARM: fix broken build of ARM

Le 27/01/2011 22:32, Alexander Holler a ?crit :

Quoted 21 lines

Am 27.01.2011 22:10, schrieb Albert ARIBAUD:

Quoted 20 lines

Le 27/01/2011 21:55, Alexander Holler a ?crit :

Quoted 19 lines

Am 27.01.2011 21:20, schrieb Albert ARIBAUD:

Quoted 17 lines

Hi Alexander,

Le 27/01/2011 20:42, Alexander Holler a ?crit :

Quoted 7 lines

Hello,

Am 27.01.2011 17:03, schrieb Stefano Babic:

Quoted 4 lines

Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks ARM boards because for ARM the -pie option is used for partial linking together with -r option.

Quoted 5 lines
Quoted 1 line

The patch adds the -pie option to link u-boot.bin only.

Using native compilation with gcc 4.5.2 and binutils 2.21 this patch will result in an unusable u-boot. It halts here after DRAM: ... just like it was before some relocation fixes (regarding binutils).

Which board do you compile?

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Upps, sorry, that one was on a BeagleBoard (armv7, omap3).

I've just tried the following to compare make logs of before commit 8aba9dceebb14144e07d19593111ee3a999c37fc on the one hand and after this commit and with the proposed fix on the other hand:

Oh, it seems I've got misunderstood, the patch from Stefano Babic breaks u-boot here and not the commit 8aba9dceebb14144e07d19593111ee3a999c37fc.

I think I understood you: what I do is compile without commit 8aba9dce on the one hand, and with it _plus Stefano's patch_ on the other hand, in order to see how things compiled before we split LDFLAGS (8aba9dce^) with how things compile if we split LDFLAGS (8aba9dce) with -pie in the right place (Stefano's patch).

Can you try that?

Quoted 3 lines

Regards,

Alexander

Amicalement,

Signature · 1 line
Albert.
#9 lore raw

PATCH 1/1 ARM: fix broken build of ARM

Am 27.01.2011 22:40, schrieb Albert ARIBAUD:

Quoted 31 lines

Le 27/01/2011 22:32, Alexander Holler a ?crit :

Quoted 21 lines

Am 27.01.2011 22:10, schrieb Albert ARIBAUD:

Quoted 20 lines

Le 27/01/2011 21:55, Alexander Holler a ?crit :

Quoted 19 lines

Am 27.01.2011 21:20, schrieb Albert ARIBAUD:

Quoted 17 lines

Hi Alexander,

Le 27/01/2011 20:42, Alexander Holler a ?crit :

Quoted 7 lines

Hello,

Am 27.01.2011 17:03, schrieb Stefano Babic:

Quoted 4 lines

Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks ARM boards because for ARM the -pie option is used for partial linking together with -r option.

Quoted 5 lines
Quoted 1 line

The patch adds the -pie option to link u-boot.bin only.

Using native compilation with gcc 4.5.2 and binutils 2.21 this patch will result in an unusable u-boot. It halts here after DRAM: ... just like it was before some relocation fixes (regarding binutils).

Which board do you compile?

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Upps, sorry, that one was on a BeagleBoard (armv7, omap3).

I've just tried the following to compare make logs of before commit 8aba9dceebb14144e07d19593111ee3a999c37fc on the one hand and after this commit and with the proposed fix on the other hand:

Oh, it seems I've got misunderstood, the patch from Stefano Babic breaks u-boot here and not the commit 8aba9dceebb14144e07d19593111ee3a999c37fc.

Quoted 7 lines

I think I understood you: what I do is compile without commit 8aba9dce on the one hand, and with it _plus Stefano's patch_ on the other hand, in order to see how things compiled before we split LDFLAGS (8aba9dce^) with how things compile if we split LDFLAGS (8aba9dce) with -pie in the right place (Stefano's patch).

Can you try that?

Sorry, again. While hunting another problem I've applied Stefano's patch but haven't had 8aba9dceebb14144e07d19593111ee3a999c37fc (I was on the wrong branch here).
I've now rebased to the master (which includes the above commit) and applied Stefano's patch and it works.

Sorry for the noise.

Regards,

Alexander

#10 lore raw

PATCH 1/1 ARM: fix broken build of ARM

Le 27/01/2011 23:19, Alexander Holler a ?crit :

Quoted 4 lines

I've now rebased to the master (which includes the above commit) and applied Stefano's patch and it works.

Sorry for the noise.

No problems. You can add your Tested-by: to Stefano's first post in this thread. :)

Quoted 3 lines

Regards,

Alexander

Amicalement,

Signature · 1 line
Albert.
#11 lore raw

PATCH 1/1 ARM: fix broken build of ARM

In reply to Alexander Holler
Quoted 7 lines · Alexander Holler

Sorry, again. While hunting another problem I've applied Stefano's patch but haven't had 8aba9dceebb14144e07d19593111ee3a999c37fc (I was on the wrong branch here).
I've now rebased to the master (which includes the above commit) and applied Stefano's patch and it works.

Sorry for the noise.

Thanks for testing. I tested again on a ARM11 board, and I have not seen any problems. However, I tested with an older gcc version, and I could not exclude issues with gcc 4.5

Regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#12 lore raw

PATCH 1/1 ARM: fix broken build of ARM

In reply to Stefano Babic

Am 27.01.2011 17:03, schrieb Stefano Babic:

Quoted 11 lines

Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks ARM boards because for ARM the -pie option is used for partial linking together with -r option.

The patch adds the -pie option to link u-boot.bin only.

CC Jason Liu<[email protected]>
CC lool at dooz.org
CC Wolfgang Denk<[email protected]>
CC Albert Aribaud<[email protected]>

Regards,

Alexander

#13 lore raw

PATCH 1/1 ARM: fix broken build of ARM

Le 27/01/2011 23:44, Alexander Holler a ?crit :

Quoted 15 lines

Am 27.01.2011 17:03, schrieb Stefano Babic:

Quoted 11 lines

Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks ARM boards because for ARM the -pie option is used for partial linking together with -r option.

The patch adds the -pie option to link u-boot.bin only.

CC Jason Liu<[email protected]>
CC lool at dooz.org
CC Wolfgang Denk<[email protected]>
CC Albert Aribaud<[email protected]>
Quoted 7 lines

Regards,

Alexander
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Applied to u-boot-arm as this is a fix.

Amicalement,

Signature · 1 line
Albert.