All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
@ 2018-10-13  2:50 Denys Dmytriyenko
  2018-10-13  8:17 ` Khem Raj
  0 siblings, 1 reply; 31+ messages in thread
From: Denys Dmytriyenko @ 2018-10-13  2:50 UTC (permalink / raw)
  To: meta-ti

There have been reports recently that am335x_beaglebone_config generates bad SPL.
Until that is debugged and fixed, use generic am335x_evm_config that covers all
AM335x platforms, including BeagleBone variants.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
---
 conf/machine/beaglebone.conf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/conf/machine/beaglebone.conf b/conf/machine/beaglebone.conf
index 49edfd6..2514792 100644
--- a/conf/machine/beaglebone.conf
+++ b/conf/machine/beaglebone.conf
@@ -13,7 +13,8 @@ MACHINE_GUI_CLASS = "bigscreen"
 
 SERIAL_CONSOLE = "115200 ttyS0"
 
-UBOOT_MACHINE = "am335x_boneblack_config"
+# fall back on generic am335x_evm_config for now
+#UBOOT_MACHINE = "am335x_boneblack_config"
 
 WKS_FILE = "sdimage-bootpart.wks"
 IMAGE_BOOT_FILES = "MLO u-boot.img"
-- 
2.7.4



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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-13  2:50 [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot Denys Dmytriyenko
@ 2018-10-13  8:17 ` Khem Raj
  2018-10-14 19:24   ` Denys Dmytriyenko
  0 siblings, 1 reply; 31+ messages in thread
From: Khem Raj @ 2018-10-13  8:17 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-ti

On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
>
> There have been reports recently that am335x_beaglebone_config generates bad SPL.
> Until that is debugged and fixed, use generic am335x_evm_config that covers all
> AM335x platforms, including BeagleBone variants.
>

it fails to link

| arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
fit in region `.sram'
| arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
| make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
spl/u-boot-spl] Error 1
|

> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
> ---
>  conf/machine/beaglebone.conf | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/conf/machine/beaglebone.conf b/conf/machine/beaglebone.conf
> index 49edfd6..2514792 100644
> --- a/conf/machine/beaglebone.conf
> +++ b/conf/machine/beaglebone.conf
> @@ -13,7 +13,8 @@ MACHINE_GUI_CLASS = "bigscreen"
>
>  SERIAL_CONSOLE = "115200 ttyS0"
>
> -UBOOT_MACHINE = "am335x_boneblack_config"
> +# fall back on generic am335x_evm_config for now
> +#UBOOT_MACHINE = "am335x_boneblack_config"
>
>  WKS_FILE = "sdimage-bootpart.wks"
>  IMAGE_BOOT_FILES = "MLO u-boot.img"
> --
> 2.7.4
>
> --
> _______________________________________________
> meta-ti mailing list
> meta-ti@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-ti


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-13  8:17 ` Khem Raj
@ 2018-10-14 19:24   ` Denys Dmytriyenko
  2018-10-15  5:07     ` Khem Raj
  0 siblings, 1 reply; 31+ messages in thread
From: Denys Dmytriyenko @ 2018-10-14 19:24 UTC (permalink / raw)
  To: Khem Raj; +Cc: meta-ti

On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> >
> > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > AM335x platforms, including BeagleBone variants.
> >
> 
> it fails to link
> 
> | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> fit in region `.sram'
> | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> spl/u-boot-spl] Error 1

FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as 
Linaro gcc7 - no problems.


> > Signed-off-by: Denys Dmytriyenko <denys@ti.com>
> > ---
> >  conf/machine/beaglebone.conf | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/conf/machine/beaglebone.conf b/conf/machine/beaglebone.conf
> > index 49edfd6..2514792 100644
> > --- a/conf/machine/beaglebone.conf
> > +++ b/conf/machine/beaglebone.conf
> > @@ -13,7 +13,8 @@ MACHINE_GUI_CLASS = "bigscreen"
> >
> >  SERIAL_CONSOLE = "115200 ttyS0"
> >
> > -UBOOT_MACHINE = "am335x_boneblack_config"
> > +# fall back on generic am335x_evm_config for now
> > +#UBOOT_MACHINE = "am335x_boneblack_config"
> >
> >  WKS_FILE = "sdimage-bootpart.wks"
> >  IMAGE_BOOT_FILES = "MLO u-boot.img"
> > --
> > 2.7.4
> >
> > --
> > _______________________________________________
> > meta-ti mailing list
> > meta-ti@yoctoproject.org
> > https://lists.yoctoproject.org/listinfo/meta-ti


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-14 19:24   ` Denys Dmytriyenko
@ 2018-10-15  5:07     ` Khem Raj
  2018-10-16  7:50       ` Khem Raj
  2018-10-16 16:42       ` Tom Rini
  0 siblings, 2 replies; 31+ messages in thread
From: Khem Raj @ 2018-10-15  5:07 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-ti

On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
>
> On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > >
> > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > AM335x platforms, including BeagleBone variants.
> > >
> >
> > it fails to link
> >
> > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > fit in region `.sram'
> > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > spl/u-boot-spl] Error 1
>
> FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> Linaro gcc7 - no problems.

My distro inherits poky policies, and on master it now inherits
hardening policies ( security flags) by defaults
do you happen to test poky ?
>
>
> > > Signed-off-by: Denys Dmytriyenko <denys@ti.com>
> > > ---
> > >  conf/machine/beaglebone.conf | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/conf/machine/beaglebone.conf b/conf/machine/beaglebone.conf
> > > index 49edfd6..2514792 100644
> > > --- a/conf/machine/beaglebone.conf
> > > +++ b/conf/machine/beaglebone.conf
> > > @@ -13,7 +13,8 @@ MACHINE_GUI_CLASS = "bigscreen"
> > >
> > >  SERIAL_CONSOLE = "115200 ttyS0"
> > >
> > > -UBOOT_MACHINE = "am335x_boneblack_config"
> > > +# fall back on generic am335x_evm_config for now
> > > +#UBOOT_MACHINE = "am335x_boneblack_config"
> > >
> > >  WKS_FILE = "sdimage-bootpart.wks"
> > >  IMAGE_BOOT_FILES = "MLO u-boot.img"
> > > --
> > > 2.7.4
> > >
> > > --
> > > _______________________________________________
> > > meta-ti mailing list
> > > meta-ti@yoctoproject.org
> > > https://lists.yoctoproject.org/listinfo/meta-ti


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-15  5:07     ` Khem Raj
@ 2018-10-16  7:50       ` Khem Raj
  2018-10-16 16:42       ` Tom Rini
  1 sibling, 0 replies; 31+ messages in thread
From: Khem Raj @ 2018-10-16  7:50 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-ti

On Sun, Oct 14, 2018 at 10:07 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
> >
> > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > >
> > > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > > AM335x platforms, including BeagleBone variants.
> > > >
> > >
> > > it fails to link
> > >
> > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > > fit in region `.sram'
> > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > spl/u-boot-spl] Error 1
> >
> > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> > Linaro gcc7 - no problems.
>
> My distro inherits poky policies, and on master it now inherits
> hardening policies ( security flags) by defaults
> do you happen to test poky ?

It seems I am not alone, there has been other reports of similar
issues and some combos work some dont
I have ported this patch

http://e2e.ti.com/support/processors/f/791/t/733651?PROCESSOR-SDK-AM335X-MLO-and-U-boot-issues-u-boot-spl-section-rodata-will-not-fit-in-region-sram-

and now my build problems are gone,

Added couple of other patches on top for beaglebone, and now I can
boot bbb using meta-ti BSP


> >
> >
> > > > Signed-off-by: Denys Dmytriyenko <denys@ti.com>
> > > > ---
> > > >  conf/machine/beaglebone.conf | 3 ++-
> > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/conf/machine/beaglebone.conf b/conf/machine/beaglebone.conf
> > > > index 49edfd6..2514792 100644
> > > > --- a/conf/machine/beaglebone.conf
> > > > +++ b/conf/machine/beaglebone.conf
> > > > @@ -13,7 +13,8 @@ MACHINE_GUI_CLASS = "bigscreen"
> > > >
> > > >  SERIAL_CONSOLE = "115200 ttyS0"
> > > >
> > > > -UBOOT_MACHINE = "am335x_boneblack_config"
> > > > +# fall back on generic am335x_evm_config for now
> > > > +#UBOOT_MACHINE = "am335x_boneblack_config"
> > > >
> > > >  WKS_FILE = "sdimage-bootpart.wks"
> > > >  IMAGE_BOOT_FILES = "MLO u-boot.img"
> > > > --
> > > > 2.7.4
> > > >
> > > > --
> > > > _______________________________________________
> > > > meta-ti mailing list
> > > > meta-ti@yoctoproject.org
> > > > https://lists.yoctoproject.org/listinfo/meta-ti


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-15  5:07     ` Khem Raj
  2018-10-16  7:50       ` Khem Raj
@ 2018-10-16 16:42       ` Tom Rini
  2018-10-16 18:11         ` Khem Raj
  1 sibling, 1 reply; 31+ messages in thread
From: Tom Rini @ 2018-10-16 16:42 UTC (permalink / raw)
  To: Khem Raj; +Cc: meta-ti

[-- Attachment #1: Type: text/plain, Size: 1357 bytes --]

On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
> >
> > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > >
> > > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > > AM335x platforms, including BeagleBone variants.
> > > >
> > >
> > > it fails to link
> > >
> > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > > fit in region `.sram'
> > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > spl/u-boot-spl] Error 1
> >
> > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> > Linaro gcc7 - no problems.
> 
> My distro inherits poky policies, and on master it now inherits
> hardening policies ( security flags) by defaults
> do you happen to test poky ?

I think we want to take a look at which of the security flags really
make sense to use in this context.  Thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-16 16:42       ` Tom Rini
@ 2018-10-16 18:11         ` Khem Raj
  2018-10-16 18:29           ` Denys Dmytriyenko
  2018-10-16 18:52           ` Tom Rini
  0 siblings, 2 replies; 31+ messages in thread
From: Khem Raj @ 2018-10-16 18:11 UTC (permalink / raw)
  To: Tom Rini; +Cc: meta-ti

On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com> wrote:
>
> On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > >
> > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > >
> > > > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > > > AM335x platforms, including BeagleBone variants.
> > > > >
> > > >
> > > > it fails to link
> > > >
> > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > > > fit in region `.sram'
> > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > > > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > spl/u-boot-spl] Error 1
> > >
> > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> > > Linaro gcc7 - no problems.
> >
> > My distro inherits poky policies, and on master it now inherits
> > hardening policies ( security flags) by defaults
> > do you happen to test poky ?
>
> I think we want to take a look at which of the security flags really
> make sense to use in this context.  Thanks!
>

there could be more to it, since the distro uses thumb2 ISA by
default, I am not sure
if u-boot overrides that and builds using arm mode ISA always but
something to consider, I saw several reports about u-boot overflowing
sram sections and most of
the solutions were "oh it works for me" or at the best your toolchain
is different then mine. here is mine use it and move on.

> --
> Tom


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-16 18:11         ` Khem Raj
@ 2018-10-16 18:29           ` Denys Dmytriyenko
  2018-10-16 18:38             ` Denys Dmytriyenko
  2018-10-16 18:50             ` Khem Raj
  2018-10-16 18:52           ` Tom Rini
  1 sibling, 2 replies; 31+ messages in thread
From: Denys Dmytriyenko @ 2018-10-16 18:29 UTC (permalink / raw)
  To: Khem Raj; +Cc: meta-ti, Tom Rini

On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com> wrote:
> >
> > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > >
> > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > >
> > > > > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > > > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > > > > AM335x platforms, including BeagleBone variants.
> > > > > >
> > > > >
> > > > > it fails to link
> > > > >
> > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > > > > fit in region `.sram'
> > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > > > > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > spl/u-boot-spl] Error 1
> > > >
> > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> > > > Linaro gcc7 - no problems.
> > >
> > > My distro inherits poky policies, and on master it now inherits
> > > hardening policies ( security flags) by defaults
> > > do you happen to test poky ?
> >
> > I think we want to take a look at which of the security flags really
> > make sense to use in this context.  Thanks!
> >
> 
> there could be more to it, since the distro uses thumb2 ISA by
> default, I am not sure
> if u-boot overrides that and builds using arm mode ISA always but
> something to consider, I saw several reports about u-boot overflowing
> sram sections and most of
> the solutions were "oh it works for me" or at the best your toolchain
> is different then mine. here is mine use it and move on.

Khem,

Well, FWIW, Tom and I are very familiar with this issue. As a matter of fact, 
I first encountered it almost 2 years ago and had to prove there's such an 
issue, because everyone was saying it works for them, something must be wrong 
with my OE builds... :)

While .sram region is very limited, the issue is exacerbated by the fact that 
all debug symbols from macros like __FILE__ are ended up in that section as 
well. So, the longer your build path, the larger the section becomes. Once I 
had instructions to reproduce the failure here internally with a series of 
long-named nested directories like aaaaaa and bbbbbb, Nishanth started this 
thread on U-boot mailing list:
https://lists.denx.de/pipermail/u-boot/2017-March/285031.html

We've had the corresponding bug open internally all this time, while adding 
workarounds to limit .sram section size by other means, like disabling some 
options to reduce the code size. Your patch is one of those workarounds...

But we've been patiently waiting for the following feature to come into gcc to 
fix the issue properly:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268

Since it's now part of gcc8, we should be able to use it. Not sure how to keep 
gcc7 backward compatibility though...

-- 
Denys


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-16 18:29           ` Denys Dmytriyenko
@ 2018-10-16 18:38             ` Denys Dmytriyenko
  2018-10-16 18:59               ` Tom Rini
  2018-10-16 18:50             ` Khem Raj
  1 sibling, 1 reply; 31+ messages in thread
From: Denys Dmytriyenko @ 2018-10-16 18:38 UTC (permalink / raw)
  To: Khem Raj; +Cc: meta-ti, Tom Rini

On Tue, Oct 16, 2018 at 02:29:00PM -0400, Denys Dmytriyenko wrote:
> On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > >
> > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > >
> > > > > > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > > > > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > >
> > > > > >
> > > > > > it fails to link
> > > > > >
> > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > > > > > fit in region `.sram'
> > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > > > > > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > spl/u-boot-spl] Error 1
> > > > >
> > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> > > > > Linaro gcc7 - no problems.
> > > >
> > > > My distro inherits poky policies, and on master it now inherits
> > > > hardening policies ( security flags) by defaults
> > > > do you happen to test poky ?
> > >
> > > I think we want to take a look at which of the security flags really
> > > make sense to use in this context.  Thanks!
> > >
> > 
> > there could be more to it, since the distro uses thumb2 ISA by
> > default, I am not sure
> > if u-boot overrides that and builds using arm mode ISA always but
> > something to consider, I saw several reports about u-boot overflowing
> > sram sections and most of
> > the solutions were "oh it works for me" or at the best your toolchain
> > is different then mine. here is mine use it and move on.
> 
> Khem,
> 
> Well, FWIW, Tom and I are very familiar with this issue. As a matter of fact, 
> I first encountered it almost 2 years ago and had to prove there's such an 
> issue, because everyone was saying it works for them, something must be wrong 
> with my OE builds... :)
> 
> While .sram region is very limited, the issue is exacerbated by the fact that 
> all debug symbols from macros like __FILE__ are ended up in that section as 
> well. So, the longer your build path, the larger the section becomes. Once I 
> had instructions to reproduce the failure here internally with a series of 
> long-named nested directories like aaaaaa and bbbbbb, Nishanth started this 
> thread on U-boot mailing list:
> https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> 
> We've had the corresponding bug open internally all this time, while adding 
> workarounds to limit .sram section size by other means, like disabling some 
> options to reduce the code size. Your patch is one of those workarounds...
> 
> But we've been patiently waiting for the following feature to come into gcc to 
> fix the issue properly:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> 
> Since it's now part of gcc8, we should be able to use it. Not sure how to keep 
> gcc7 backward compatibility though...

BTW, there were few attempts to "fix" it in U-boot as well, such as [1], but I 
don't believe they got accepted. Tom?

[1] https://patchwork.ozlabs.org/cover/825356/

-- 
Denys


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-16 18:29           ` Denys Dmytriyenko
  2018-10-16 18:38             ` Denys Dmytriyenko
@ 2018-10-16 18:50             ` Khem Raj
  2018-10-16 19:00               ` Denys Dmytriyenko
  1 sibling, 1 reply; 31+ messages in thread
From: Khem Raj @ 2018-10-16 18:50 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-ti, Tom Rini

On Tue, Oct 16, 2018 at 11:29 AM Denys Dmytriyenko <denys@ti.com> wrote:
>
> On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > >
> > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > >
> > > > > > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > > > > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > >
> > > > > >
> > > > > > it fails to link
> > > > > >
> > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > > > > > fit in region `.sram'
> > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > > > > > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > spl/u-boot-spl] Error 1
> > > > >
> > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> > > > > Linaro gcc7 - no problems.
> > > >
> > > > My distro inherits poky policies, and on master it now inherits
> > > > hardening policies ( security flags) by defaults
> > > > do you happen to test poky ?
> > >
> > > I think we want to take a look at which of the security flags really
> > > make sense to use in this context.  Thanks!
> > >
> >
> > there could be more to it, since the distro uses thumb2 ISA by
> > default, I am not sure
> > if u-boot overrides that and builds using arm mode ISA always but
> > something to consider, I saw several reports about u-boot overflowing
> > sram sections and most of
> > the solutions were "oh it works for me" or at the best your toolchain
> > is different then mine. here is mine use it and move on.
>
> Khem,
>
> Well, FWIW, Tom and I are very familiar with this issue. As a matter of fact,
> I first encountered it almost 2 years ago and had to prove there's such an
> issue, because everyone was saying it works for them, something must be wrong
> with my OE builds... :)
>
> While .sram region is very limited, the issue is exacerbated by the fact that
> all debug symbols from macros like __FILE__ are ended up in that section as
> well. So, the longer your build path, the larger the section becomes. Once I
> had instructions to reproduce the failure here internally with a series of
> long-named nested directories like aaaaaa and bbbbbb, Nishanth started this
> thread on U-boot mailing list:
> https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
>
> We've had the corresponding bug open internally all this time, while adding
> workarounds to limit .sram section size by other means, like disabling some
> options to reduce the code size. Your patch is one of those workarounds...
>
> But we've been patiently waiting for the following feature to come into gcc to
> fix the issue properly:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
>
> Since it's now part of gcc8, we should be able to use it. Not sure how to keep
> gcc7 backward compatibility though...

dumping absolute file name strings into SPL seems a waste of space to
me, but I will leave that out for now. Moreover it exposes build paths
into binaries that user may not be interested to share

-ffile-prefix-map has been in OE toolchains since gcc6 and I think we
are already using it for kernel builds. We can probably enhance uboot
recipes in OE-Core to
use this option if compiler supports it. That solves my problem.


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-16 18:11         ` Khem Raj
  2018-10-16 18:29           ` Denys Dmytriyenko
@ 2018-10-16 18:52           ` Tom Rini
  1 sibling, 0 replies; 31+ messages in thread
From: Tom Rini @ 2018-10-16 18:52 UTC (permalink / raw)
  To: Khem Raj; +Cc: meta-ti

[-- Attachment #1: Type: text/plain, Size: 2414 bytes --]

On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com> wrote:
> >
> > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > >
> > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > >
> > > > > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > > > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > > > > AM335x platforms, including BeagleBone variants.
> > > > > >
> > > > >
> > > > > it fails to link
> > > > >
> > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > > > > fit in region `.sram'
> > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > > > > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > spl/u-boot-spl] Error 1
> > > >
> > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> > > > Linaro gcc7 - no problems.
> > >
> > > My distro inherits poky policies, and on master it now inherits
> > > hardening policies ( security flags) by defaults
> > > do you happen to test poky ?
> >
> > I think we want to take a look at which of the security flags really
> > make sense to use in this context.  Thanks!
> 
> there could be more to it, since the distro uses thumb2 ISA by
> default, I am not sure
> if u-boot overrides that and builds using arm mode ISA always but
> something to consider, I saw several reports about u-boot overflowing
> sram sections and most of
> the solutions were "oh it works for me" or at the best your toolchain
> is different then mine. here is mine use it and move on.

Yes, we enforce an ISA in U-Boot, depending on how things are configured
and have been doing thumb2 for a long time on these targets.  But, if we
have some issues here, I'd really like to root cause them.  I'm honestly
surprised the security flags are even being passed, but I guess they end
up put into TOOLCHAIN_OPTIONS not CFLAGS directly?  And what/when/how do
we reliably get an overflow?  Thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-16 18:38             ` Denys Dmytriyenko
@ 2018-10-16 18:59               ` Tom Rini
       [not found]                 ` <9e7016817d464dd8bfb1210b8e9e6cf5@SOC-EX01V.e01.socionext.com>
  0 siblings, 1 reply; 31+ messages in thread
From: Tom Rini @ 2018-10-16 18:59 UTC (permalink / raw)
  To: Denys Dmytriyenko, Masahiro Yamada; +Cc: meta-ti

[-- Attachment #1: Type: text/plain, Size: 3997 bytes --]

On Tue, Oct 16, 2018 at 02:38:28PM -0400, Denys Dmytriyenko wrote:
> On Tue, Oct 16, 2018 at 02:29:00PM -0400, Denys Dmytriyenko wrote:
> > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > >
> > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > > >
> > > > > > > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > > > > > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > >
> > > > > > >
> > > > > > > it fails to link
> > > > > > >
> > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > > > > > > fit in region `.sram'
> > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > > > > > > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > spl/u-boot-spl] Error 1
> > > > > >
> > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> > > > > > Linaro gcc7 - no problems.
> > > > >
> > > > > My distro inherits poky policies, and on master it now inherits
> > > > > hardening policies ( security flags) by defaults
> > > > > do you happen to test poky ?
> > > >
> > > > I think we want to take a look at which of the security flags really
> > > > make sense to use in this context.  Thanks!
> > > >
> > > 
> > > there could be more to it, since the distro uses thumb2 ISA by
> > > default, I am not sure
> > > if u-boot overrides that and builds using arm mode ISA always but
> > > something to consider, I saw several reports about u-boot overflowing
> > > sram sections and most of
> > > the solutions were "oh it works for me" or at the best your toolchain
> > > is different then mine. here is mine use it and move on.
> > 
> > Khem,
> > 
> > Well, FWIW, Tom and I are very familiar with this issue. As a matter of fact, 
> > I first encountered it almost 2 years ago and had to prove there's such an 
> > issue, because everyone was saying it works for them, something must be wrong 
> > with my OE builds... :)
> > 
> > While .sram region is very limited, the issue is exacerbated by the fact that 
> > all debug symbols from macros like __FILE__ are ended up in that section as 
> > well. So, the longer your build path, the larger the section becomes. Once I 
> > had instructions to reproduce the failure here internally with a series of 
> > long-named nested directories like aaaaaa and bbbbbb, Nishanth started this 
> > thread on U-boot mailing list:
> > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > 
> > We've had the corresponding bug open internally all this time, while adding 
> > workarounds to limit .sram section size by other means, like disabling some 
> > options to reduce the code size. Your patch is one of those workarounds...
> > 
> > But we've been patiently waiting for the following feature to come into gcc to 
> > fix the issue properly:
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > 
> > Since it's now part of gcc8, we should be able to use it. Not sure how to keep 
> > gcc7 backward compatibility though...
> 
> BTW, there were few attempts to "fix" it in U-boot as well, such as [1], but I 
> don't believe they got accepted. Tom?
> 
> [1] https://patchwork.ozlabs.org/cover/825356/

I think the end result was waiting on the kernel community to agree on a
path forward for Kbuild and then bring that back.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-16 18:50             ` Khem Raj
@ 2018-10-16 19:00               ` Denys Dmytriyenko
  2018-10-16 19:20                 ` Khem Raj
  0 siblings, 1 reply; 31+ messages in thread
From: Denys Dmytriyenko @ 2018-10-16 19:00 UTC (permalink / raw)
  To: Khem Raj; +Cc: meta-ti, Tom Rini

On Tue, Oct 16, 2018 at 11:50:36AM -0700, Khem Raj wrote:
> On Tue, Oct 16, 2018 at 11:29 AM Denys Dmytriyenko <denys@ti.com> wrote:
> >
> > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > >
> > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > > >
> > > > > > > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > > > > > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > >
> > > > > > >
> > > > > > > it fails to link
> > > > > > >
> > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > > > > > > fit in region `.sram'
> > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > > > > > > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > spl/u-boot-spl] Error 1
> > > > > >
> > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> > > > > > Linaro gcc7 - no problems.
> > > > >
> > > > > My distro inherits poky policies, and on master it now inherits
> > > > > hardening policies ( security flags) by defaults
> > > > > do you happen to test poky ?
> > > >
> > > > I think we want to take a look at which of the security flags really
> > > > make sense to use in this context.  Thanks!
> > > >
> > >
> > > there could be more to it, since the distro uses thumb2 ISA by
> > > default, I am not sure
> > > if u-boot overrides that and builds using arm mode ISA always but
> > > something to consider, I saw several reports about u-boot overflowing
> > > sram sections and most of
> > > the solutions were "oh it works for me" or at the best your toolchain
> > > is different then mine. here is mine use it and move on.
> >
> > Khem,
> >
> > Well, FWIW, Tom and I are very familiar with this issue. As a matter of fact,
> > I first encountered it almost 2 years ago and had to prove there's such an
> > issue, because everyone was saying it works for them, something must be wrong
> > with my OE builds... :)
> >
> > While .sram region is very limited, the issue is exacerbated by the fact that
> > all debug symbols from macros like __FILE__ are ended up in that section as
> > well. So, the longer your build path, the larger the section becomes. Once I
> > had instructions to reproduce the failure here internally with a series of
> > long-named nested directories like aaaaaa and bbbbbb, Nishanth started this
> > thread on U-boot mailing list:
> > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> >
> > We've had the corresponding bug open internally all this time, while adding
> > workarounds to limit .sram section size by other means, like disabling some
> > options to reduce the code size. Your patch is one of those workarounds...
> >
> > But we've been patiently waiting for the following feature to come into gcc to
> > fix the issue properly:
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> >
> > Since it's now part of gcc8, we should be able to use it. Not sure how to keep
> > gcc7 backward compatibility though...
> 
> dumping absolute file name strings into SPL seems a waste of space to
> me, but I will leave that out for now. Moreover it exposes build paths
> into binaries that user may not be interested to share
> 
> -ffile-prefix-map has been in OE toolchains since gcc6 and I think we
> are already using it for kernel builds. We can probably enhance uboot
> recipes in OE-Core to
> use this option if compiler supports it. That solves my problem.

Yeah, extending that from kernel to u-boot would be nice.
Unfortunately, our products use Linaro gcc7 on rocko for now. Planning to 
migrate to gcc8 on thud soon...

-- 
Denys


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-16 19:00               ` Denys Dmytriyenko
@ 2018-10-16 19:20                 ` Khem Raj
  2018-10-16 21:19                   ` Khem Raj
  0 siblings, 1 reply; 31+ messages in thread
From: Khem Raj @ 2018-10-16 19:20 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-ti, Tom Rini

On Tue, Oct 16, 2018 at 12:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
>
> On Tue, Oct 16, 2018 at 11:50:36AM -0700, Khem Raj wrote:
> > On Tue, Oct 16, 2018 at 11:29 AM Denys Dmytriyenko <denys@ti.com> wrote:
> > >
> > > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com> wrote:
> > > > >
> > > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > >
> > > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > > > >
> > > > > > > > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > > > > > > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > > >
> > > > > > > >
> > > > > > > > it fails to link
> > > > > > > >
> > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > > > > > > > fit in region `.sram'
> > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > > > > > > > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > > spl/u-boot-spl] Error 1
> > > > > > >
> > > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> > > > > > > Linaro gcc7 - no problems.
> > > > > >
> > > > > > My distro inherits poky policies, and on master it now inherits
> > > > > > hardening policies ( security flags) by defaults
> > > > > > do you happen to test poky ?
> > > > >
> > > > > I think we want to take a look at which of the security flags really
> > > > > make sense to use in this context.  Thanks!
> > > > >
> > > >
> > > > there could be more to it, since the distro uses thumb2 ISA by
> > > > default, I am not sure
> > > > if u-boot overrides that and builds using arm mode ISA always but
> > > > something to consider, I saw several reports about u-boot overflowing
> > > > sram sections and most of
> > > > the solutions were "oh it works for me" or at the best your toolchain
> > > > is different then mine. here is mine use it and move on.
> > >
> > > Khem,
> > >
> > > Well, FWIW, Tom and I are very familiar with this issue. As a matter of fact,
> > > I first encountered it almost 2 years ago and had to prove there's such an
> > > issue, because everyone was saying it works for them, something must be wrong
> > > with my OE builds... :)
> > >
> > > While .sram region is very limited, the issue is exacerbated by the fact that
> > > all debug symbols from macros like __FILE__ are ended up in that section as
> > > well. So, the longer your build path, the larger the section becomes. Once I
> > > had instructions to reproduce the failure here internally with a series of
> > > long-named nested directories like aaaaaa and bbbbbb, Nishanth started this
> > > thread on U-boot mailing list:
> > > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > >
> > > We've had the corresponding bug open internally all this time, while adding
> > > workarounds to limit .sram section size by other means, like disabling some
> > > options to reduce the code size. Your patch is one of those workarounds...
> > >
> > > But we've been patiently waiting for the following feature to come into gcc to
> > > fix the issue properly:
> > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > >
> > > Since it's now part of gcc8, we should be able to use it. Not sure how to keep
> > > gcc7 backward compatibility though...
> >
> > dumping absolute file name strings into SPL seems a waste of space to
> > me, but I will leave that out for now. Moreover it exposes build paths
> > into binaries that user may not be interested to share
> >
> > -ffile-prefix-map has been in OE toolchains since gcc6 and I think we
> > are already using it for kernel builds. We can probably enhance uboot
> > recipes in OE-Core to
> > use this option if compiler supports it. That solves my problem.
>
> Yeah, extending that from kernel to u-boot would be nice.
> Unfortunately, our products use Linaro gcc7 on rocko for now. Planning to
> migrate to gcc8 on thud soon...

we can check for the option before using it so atleast it will not
break older toolchains more than what they are already broken.


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-16 19:20                 ` Khem Raj
@ 2018-10-16 21:19                   ` Khem Raj
  2018-10-17  0:26                     ` Denys Dmytriyenko
  2018-10-17  2:26                     ` Denys Dmytriyenko
  0 siblings, 2 replies; 31+ messages in thread
From: Khem Raj @ 2018-10-16 21:19 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-ti, Tom Rini

On Tue, Oct 16, 2018 at 12:20 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> On Tue, Oct 16, 2018 at 12:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> >
> > On Tue, Oct 16, 2018 at 11:50:36AM -0700, Khem Raj wrote:
> > > On Tue, Oct 16, 2018 at 11:29 AM Denys Dmytriyenko <denys@ti.com> wrote:
> > > >
> > > > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com> wrote:
> > > > > >
> > > > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > > >
> > > > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > > > > >
> > > > > > > > > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > > > > > > > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > it fails to link
> > > > > > > > >
> > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > > > > > > > > fit in region `.sram'
> > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > > > > > > > > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > > > spl/u-boot-spl] Error 1
> > > > > > > >
> > > > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> > > > > > > > Linaro gcc7 - no problems.
> > > > > > >
> > > > > > > My distro inherits poky policies, and on master it now inherits
> > > > > > > hardening policies ( security flags) by defaults
> > > > > > > do you happen to test poky ?
> > > > > >
> > > > > > I think we want to take a look at which of the security flags really
> > > > > > make sense to use in this context.  Thanks!
> > > > > >
> > > > >
> > > > > there could be more to it, since the distro uses thumb2 ISA by
> > > > > default, I am not sure
> > > > > if u-boot overrides that and builds using arm mode ISA always but
> > > > > something to consider, I saw several reports about u-boot overflowing
> > > > > sram sections and most of
> > > > > the solutions were "oh it works for me" or at the best your toolchain
> > > > > is different then mine. here is mine use it and move on.
> > > >
> > > > Khem,
> > > >
> > > > Well, FWIW, Tom and I are very familiar with this issue. As a matter of fact,
> > > > I first encountered it almost 2 years ago and had to prove there's such an
> > > > issue, because everyone was saying it works for them, something must be wrong
> > > > with my OE builds... :)
> > > >
> > > > While .sram region is very limited, the issue is exacerbated by the fact that
> > > > all debug symbols from macros like __FILE__ are ended up in that section as
> > > > well. So, the longer your build path, the larger the section becomes. Once I
> > > > had instructions to reproduce the failure here internally with a series of
> > > > long-named nested directories like aaaaaa and bbbbbb, Nishanth started this
> > > > thread on U-boot mailing list:
> > > > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > > >
> > > > We've had the corresponding bug open internally all this time, while adding
> > > > workarounds to limit .sram section size by other means, like disabling some
> > > > options to reduce the code size. Your patch is one of those workarounds...
> > > >
> > > > But we've been patiently waiting for the following feature to come into gcc to
> > > > fix the issue properly:
> > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > > >
> > > > Since it's now part of gcc8, we should be able to use it. Not sure how to keep
> > > > gcc7 backward compatibility though...
> > >
> > > dumping absolute file name strings into SPL seems a waste of space to
> > > me, but I will leave that out for now. Moreover it exposes build paths
> > > into binaries that user may not be interested to share
> > >
> > > -ffile-prefix-map has been in OE toolchains since gcc6 and I think we
> > > are already using it for kernel builds. We can probably enhance uboot
> > > recipes in OE-Core to
> > > use this option if compiler supports it. That solves my problem.
> >
> > Yeah, extending that from kernel to u-boot would be nice.
> > Unfortunately, our products use Linaro gcc7 on rocko for now. Planning to
> > migrate to gcc8 on thud soon...
>
> we can check for the option before using it so atleast it will not
> break older toolchains more than what they are already broken.

I added -ffile-prefix-map locally just with this option added it did
not fix the problem.


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-16 21:19                   ` Khem Raj
@ 2018-10-17  0:26                     ` Denys Dmytriyenko
  2018-10-17  0:37                       ` Denys Dmytriyenko
  2018-10-17  2:26                     ` Denys Dmytriyenko
  1 sibling, 1 reply; 31+ messages in thread
From: Denys Dmytriyenko @ 2018-10-17  0:26 UTC (permalink / raw)
  To: Khem Raj; +Cc: meta-ti, Tom Rini

On Tue, Oct 16, 2018 at 02:19:36PM -0700, Khem Raj wrote:
> On Tue, Oct 16, 2018 at 12:20 PM Khem Raj <raj.khem@gmail.com> wrote:
> >
> > On Tue, Oct 16, 2018 at 12:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > >
> > > On Tue, Oct 16, 2018 at 11:50:36AM -0700, Khem Raj wrote:
> > > > On Tue, Oct 16, 2018 at 11:29 AM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > >
> > > > > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > > > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com> wrote:
> > > > > > >
> > > > > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > > > >
> > > > > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > > > > > >
> > > > > > > > > > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > > > > > > > > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > > > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > it fails to link
> > > > > > > > > >
> > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > > > > > > > > > fit in region `.sram'
> > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > > > > > > > > > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > > > > spl/u-boot-spl] Error 1
> > > > > > > > >
> > > > > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> > > > > > > > > Linaro gcc7 - no problems.
> > > > > > > >
> > > > > > > > My distro inherits poky policies, and on master it now inherits
> > > > > > > > hardening policies ( security flags) by defaults
> > > > > > > > do you happen to test poky ?
> > > > > > >
> > > > > > > I think we want to take a look at which of the security flags really
> > > > > > > make sense to use in this context.  Thanks!
> > > > > > >
> > > > > >
> > > > > > there could be more to it, since the distro uses thumb2 ISA by
> > > > > > default, I am not sure
> > > > > > if u-boot overrides that and builds using arm mode ISA always but
> > > > > > something to consider, I saw several reports about u-boot overflowing
> > > > > > sram sections and most of
> > > > > > the solutions were "oh it works for me" or at the best your toolchain
> > > > > > is different then mine. here is mine use it and move on.
> > > > >
> > > > > Khem,
> > > > >
> > > > > Well, FWIW, Tom and I are very familiar with this issue. As a matter of fact,
> > > > > I first encountered it almost 2 years ago and had to prove there's such an
> > > > > issue, because everyone was saying it works for them, something must be wrong
> > > > > with my OE builds... :)
> > > > >
> > > > > While .sram region is very limited, the issue is exacerbated by the fact that
> > > > > all debug symbols from macros like __FILE__ are ended up in that section as
> > > > > well. So, the longer your build path, the larger the section becomes. Once I
> > > > > had instructions to reproduce the failure here internally with a series of
> > > > > long-named nested directories like aaaaaa and bbbbbb, Nishanth started this
> > > > > thread on U-boot mailing list:
> > > > > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > > > >
> > > > > We've had the corresponding bug open internally all this time, while adding
> > > > > workarounds to limit .sram section size by other means, like disabling some
> > > > > options to reduce the code size. Your patch is one of those workarounds...
> > > > >
> > > > > But we've been patiently waiting for the following feature to come into gcc to
> > > > > fix the issue properly:
> > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > > > >
> > > > > Since it's now part of gcc8, we should be able to use it. Not sure how to keep
> > > > > gcc7 backward compatibility though...
> > > >
> > > > dumping absolute file name strings into SPL seems a waste of space to
> > > > me, but I will leave that out for now. Moreover it exposes build paths
> > > > into binaries that user may not be interested to share
> > > >
> > > > -ffile-prefix-map has been in OE toolchains since gcc6 and I think we
> > > > are already using it for kernel builds. We can probably enhance uboot
> > > > recipes in OE-Core to
> > > > use this option if compiler supports it. That solves my problem.
> > >
> > > Yeah, extending that from kernel to u-boot would be nice.
> > > Unfortunately, our products use Linaro gcc7 on rocko for now. Planning to
> > > migrate to gcc8 on thud soon...
> >
> > we can check for the option before using it so atleast it will not
> > break older toolchains more than what they are already broken.
> 
> I added -ffile-prefix-map locally just with this option added it did
> not fix the problem.

So, I tried Poky and I do see it overflow by 5-6 KB, which is quite a lot. 
Though disabling security flags just for u-boot didn't change it a bit. 
Something else is going on. I'm now rebuilding Poky with security flags 
disabled globally...


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-17  0:26                     ` Denys Dmytriyenko
@ 2018-10-17  0:37                       ` Denys Dmytriyenko
  2018-10-17  1:42                         ` Khem Raj
  0 siblings, 1 reply; 31+ messages in thread
From: Denys Dmytriyenko @ 2018-10-17  0:37 UTC (permalink / raw)
  To: Khem Raj; +Cc: meta-ti, Tom Rini

On Tue, Oct 16, 2018 at 08:26:45PM -0400, Denys Dmytriyenko wrote:
> On Tue, Oct 16, 2018 at 02:19:36PM -0700, Khem Raj wrote:
> > On Tue, Oct 16, 2018 at 12:20 PM Khem Raj <raj.khem@gmail.com> wrote:
> > >
> > > On Tue, Oct 16, 2018 at 12:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > >
> > > > On Tue, Oct 16, 2018 at 11:50:36AM -0700, Khem Raj wrote:
> > > > > On Tue, Oct 16, 2018 at 11:29 AM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > >
> > > > > > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > > > > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com> wrote:
> > > > > > > >
> > > > > > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > > > > >
> > > > > > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > > > > > > > > > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > > > > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > it fails to link
> > > > > > > > > > >
> > > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > > > > > > > > > > fit in region `.sram'
> > > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > > > > > > > > > > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > > > > > spl/u-boot-spl] Error 1
> > > > > > > > > >
> > > > > > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> > > > > > > > > > Linaro gcc7 - no problems.
> > > > > > > > >
> > > > > > > > > My distro inherits poky policies, and on master it now inherits
> > > > > > > > > hardening policies ( security flags) by defaults
> > > > > > > > > do you happen to test poky ?
> > > > > > > >
> > > > > > > > I think we want to take a look at which of the security flags really
> > > > > > > > make sense to use in this context.  Thanks!
> > > > > > > >
> > > > > > >
> > > > > > > there could be more to it, since the distro uses thumb2 ISA by
> > > > > > > default, I am not sure
> > > > > > > if u-boot overrides that and builds using arm mode ISA always but
> > > > > > > something to consider, I saw several reports about u-boot overflowing
> > > > > > > sram sections and most of
> > > > > > > the solutions were "oh it works for me" or at the best your toolchain
> > > > > > > is different then mine. here is mine use it and move on.
> > > > > >
> > > > > > Khem,
> > > > > >
> > > > > > Well, FWIW, Tom and I are very familiar with this issue. As a matter of fact,
> > > > > > I first encountered it almost 2 years ago and had to prove there's such an
> > > > > > issue, because everyone was saying it works for them, something must be wrong
> > > > > > with my OE builds... :)
> > > > > >
> > > > > > While .sram region is very limited, the issue is exacerbated by the fact that
> > > > > > all debug symbols from macros like __FILE__ are ended up in that section as
> > > > > > well. So, the longer your build path, the larger the section becomes. Once I
> > > > > > had instructions to reproduce the failure here internally with a series of
> > > > > > long-named nested directories like aaaaaa and bbbbbb, Nishanth started this
> > > > > > thread on U-boot mailing list:
> > > > > > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > > > > >
> > > > > > We've had the corresponding bug open internally all this time, while adding
> > > > > > workarounds to limit .sram section size by other means, like disabling some
> > > > > > options to reduce the code size. Your patch is one of those workarounds...
> > > > > >
> > > > > > But we've been patiently waiting for the following feature to come into gcc to
> > > > > > fix the issue properly:
> > > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > > > > >
> > > > > > Since it's now part of gcc8, we should be able to use it. Not sure how to keep
> > > > > > gcc7 backward compatibility though...
> > > > >
> > > > > dumping absolute file name strings into SPL seems a waste of space to
> > > > > me, but I will leave that out for now. Moreover it exposes build paths
> > > > > into binaries that user may not be interested to share
> > > > >
> > > > > -ffile-prefix-map has been in OE toolchains since gcc6 and I think we
> > > > > are already using it for kernel builds. We can probably enhance uboot
> > > > > recipes in OE-Core to
> > > > > use this option if compiler supports it. That solves my problem.
> > > >
> > > > Yeah, extending that from kernel to u-boot would be nice.
> > > > Unfortunately, our products use Linaro gcc7 on rocko for now. Planning to
> > > > migrate to gcc8 on thud soon...
> > >
> > > we can check for the option before using it so atleast it will not
> > > break older toolchains more than what they are already broken.
> > 
> > I added -ffile-prefix-map locally just with this option added it did
> > not fix the problem.
> 
> So, I tried Poky and I do see it overflow by 5-6 KB, which is quite a lot. 
> Though disabling security flags just for u-boot didn't change it a bit. 
> Something else is going on. I'm now rebuilding Poky with security flags 
> disabled globally...

Hmm, disabling security flags globally and rebuilding toolchain and then 
u-boot "fixes" it. Wonder what would cause the same code to change by 6KB.


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-17  0:37                       ` Denys Dmytriyenko
@ 2018-10-17  1:42                         ` Khem Raj
  2018-10-17  1:58                           ` Denys Dmytriyenko
  0 siblings, 1 reply; 31+ messages in thread
From: Khem Raj @ 2018-10-17  1:42 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-ti, Tom Rini

On Tue, Oct 16, 2018 at 5:37 PM Denys Dmytriyenko <denys@ti.com> wrote:
>
> On Tue, Oct 16, 2018 at 08:26:45PM -0400, Denys Dmytriyenko wrote:
> > On Tue, Oct 16, 2018 at 02:19:36PM -0700, Khem Raj wrote:
> > > On Tue, Oct 16, 2018 at 12:20 PM Khem Raj <raj.khem@gmail.com> wrote:
> > > >
> > > > On Tue, Oct 16, 2018 at 12:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > >
> > > > > On Tue, Oct 16, 2018 at 11:50:36AM -0700, Khem Raj wrote:
> > > > > > On Tue, Oct 16, 2018 at 11:29 AM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > >
> > > > > > > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > > > > > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com> wrote:
> > > > > > > > >
> > > > > > > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > > > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > > > > > >
> > > > > > > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > > > > > > > > > > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > > > > > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > it fails to link
> > > > > > > > > > > >
> > > > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > > > > > > > > > > > fit in region `.sram'
> > > > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > > > > > > > > > > > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > > > > > > spl/u-boot-spl] Error 1
> > > > > > > > > > >
> > > > > > > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> > > > > > > > > > > Linaro gcc7 - no problems.
> > > > > > > > > >
> > > > > > > > > > My distro inherits poky policies, and on master it now inherits
> > > > > > > > > > hardening policies ( security flags) by defaults
> > > > > > > > > > do you happen to test poky ?
> > > > > > > > >
> > > > > > > > > I think we want to take a look at which of the security flags really
> > > > > > > > > make sense to use in this context.  Thanks!
> > > > > > > > >
> > > > > > > >
> > > > > > > > there could be more to it, since the distro uses thumb2 ISA by
> > > > > > > > default, I am not sure
> > > > > > > > if u-boot overrides that and builds using arm mode ISA always but
> > > > > > > > something to consider, I saw several reports about u-boot overflowing
> > > > > > > > sram sections and most of
> > > > > > > > the solutions were "oh it works for me" or at the best your toolchain
> > > > > > > > is different then mine. here is mine use it and move on.
> > > > > > >
> > > > > > > Khem,
> > > > > > >
> > > > > > > Well, FWIW, Tom and I are very familiar with this issue. As a matter of fact,
> > > > > > > I first encountered it almost 2 years ago and had to prove there's such an
> > > > > > > issue, because everyone was saying it works for them, something must be wrong
> > > > > > > with my OE builds... :)
> > > > > > >
> > > > > > > While .sram region is very limited, the issue is exacerbated by the fact that
> > > > > > > all debug symbols from macros like __FILE__ are ended up in that section as
> > > > > > > well. So, the longer your build path, the larger the section becomes. Once I
> > > > > > > had instructions to reproduce the failure here internally with a series of
> > > > > > > long-named nested directories like aaaaaa and bbbbbb, Nishanth started this
> > > > > > > thread on U-boot mailing list:
> > > > > > > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > > > > > >
> > > > > > > We've had the corresponding bug open internally all this time, while adding
> > > > > > > workarounds to limit .sram section size by other means, like disabling some
> > > > > > > options to reduce the code size. Your patch is one of those workarounds...
> > > > > > >
> > > > > > > But we've been patiently waiting for the following feature to come into gcc to
> > > > > > > fix the issue properly:
> > > > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > > > > > >
> > > > > > > Since it's now part of gcc8, we should be able to use it. Not sure how to keep
> > > > > > > gcc7 backward compatibility though...
> > > > > >
> > > > > > dumping absolute file name strings into SPL seems a waste of space to
> > > > > > me, but I will leave that out for now. Moreover it exposes build paths
> > > > > > into binaries that user may not be interested to share
> > > > > >
> > > > > > -ffile-prefix-map has been in OE toolchains since gcc6 and I think we
> > > > > > are already using it for kernel builds. We can probably enhance uboot
> > > > > > recipes in OE-Core to
> > > > > > use this option if compiler supports it. That solves my problem.
> > > > >
> > > > > Yeah, extending that from kernel to u-boot would be nice.
> > > > > Unfortunately, our products use Linaro gcc7 on rocko for now. Planning to
> > > > > migrate to gcc8 on thud soon...
> > > >
> > > > we can check for the option before using it so atleast it will not
> > > > break older toolchains more than what they are already broken.
> > >
> > > I added -ffile-prefix-map locally just with this option added it did
> > > not fix the problem.
> >
> > So, I tried Poky and I do see it overflow by 5-6 KB, which is quite a lot.
> > Though disabling security flags just for u-boot didn't change it a bit.
> > Something else is going on. I'm now rebuilding Poky with security flags
> > disabled globally...
>
> Hmm, disabling security flags globally and rebuilding toolchain and then
> u-boot "fixes" it. Wonder what would cause the same code to change by 6KB.

security flags also enable PIE in gcc by default. secondly it also
enable ssp can you try setting

SECURITY_LDFLAGS = ""
SECURITY_STACK_PROTECTOR = ""

in uboot recipe and see if that helps.

If it does not then add

SECURITY_CFLAGS = "${SECURITY_NOPIE_CFLAGS}"

and see if that helps


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-17  1:42                         ` Khem Raj
@ 2018-10-17  1:58                           ` Denys Dmytriyenko
  0 siblings, 0 replies; 31+ messages in thread
From: Denys Dmytriyenko @ 2018-10-17  1:58 UTC (permalink / raw)
  To: Khem Raj; +Cc: meta-ti, Tom Rini

On Tue, Oct 16, 2018 at 06:42:10PM -0700, Khem Raj wrote:
> On Tue, Oct 16, 2018 at 5:37 PM Denys Dmytriyenko <denys@ti.com> wrote:
> >
> > On Tue, Oct 16, 2018 at 08:26:45PM -0400, Denys Dmytriyenko wrote:
> > > On Tue, Oct 16, 2018 at 02:19:36PM -0700, Khem Raj wrote:
> > > > On Tue, Oct 16, 2018 at 12:20 PM Khem Raj <raj.khem@gmail.com> wrote:
> > > > >
> > > > > On Tue, Oct 16, 2018 at 12:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > >
> > > > > > On Tue, Oct 16, 2018 at 11:50:36AM -0700, Khem Raj wrote:
> > > > > > > On Tue, Oct 16, 2018 at 11:29 AM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > > >
> > > > > > > > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > > > > > > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com> wrote:
> > > > > > > > > >
> > > > > > > > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > > > > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > > > > > > > > > > > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > > > > > > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > it fails to link
> > > > > > > > > > > > >
> > > > > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > > > > > > > > > > > > fit in region `.sram'
> > > > > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > > > > > > > > > > > > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > > > > > > > spl/u-boot-spl] Error 1
> > > > > > > > > > > >
> > > > > > > > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> > > > > > > > > > > > Linaro gcc7 - no problems.
> > > > > > > > > > >
> > > > > > > > > > > My distro inherits poky policies, and on master it now inherits
> > > > > > > > > > > hardening policies ( security flags) by defaults
> > > > > > > > > > > do you happen to test poky ?
> > > > > > > > > >
> > > > > > > > > > I think we want to take a look at which of the security flags really
> > > > > > > > > > make sense to use in this context.  Thanks!
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > there could be more to it, since the distro uses thumb2 ISA by
> > > > > > > > > default, I am not sure
> > > > > > > > > if u-boot overrides that and builds using arm mode ISA always but
> > > > > > > > > something to consider, I saw several reports about u-boot overflowing
> > > > > > > > > sram sections and most of
> > > > > > > > > the solutions were "oh it works for me" or at the best your toolchain
> > > > > > > > > is different then mine. here is mine use it and move on.
> > > > > > > >
> > > > > > > > Khem,
> > > > > > > >
> > > > > > > > Well, FWIW, Tom and I are very familiar with this issue. As a matter of fact,
> > > > > > > > I first encountered it almost 2 years ago and had to prove there's such an
> > > > > > > > issue, because everyone was saying it works for them, something must be wrong
> > > > > > > > with my OE builds... :)
> > > > > > > >
> > > > > > > > While .sram region is very limited, the issue is exacerbated by the fact that
> > > > > > > > all debug symbols from macros like __FILE__ are ended up in that section as
> > > > > > > > well. So, the longer your build path, the larger the section becomes. Once I
> > > > > > > > had instructions to reproduce the failure here internally with a series of
> > > > > > > > long-named nested directories like aaaaaa and bbbbbb, Nishanth started this
> > > > > > > > thread on U-boot mailing list:
> > > > > > > > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > > > > > > >
> > > > > > > > We've had the corresponding bug open internally all this time, while adding
> > > > > > > > workarounds to limit .sram section size by other means, like disabling some
> > > > > > > > options to reduce the code size. Your patch is one of those workarounds...
> > > > > > > >
> > > > > > > > But we've been patiently waiting for the following feature to come into gcc to
> > > > > > > > fix the issue properly:
> > > > > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > > > > > > >
> > > > > > > > Since it's now part of gcc8, we should be able to use it. Not sure how to keep
> > > > > > > > gcc7 backward compatibility though...
> > > > > > >
> > > > > > > dumping absolute file name strings into SPL seems a waste of space to
> > > > > > > me, but I will leave that out for now. Moreover it exposes build paths
> > > > > > > into binaries that user may not be interested to share
> > > > > > >
> > > > > > > -ffile-prefix-map has been in OE toolchains since gcc6 and I think we
> > > > > > > are already using it for kernel builds. We can probably enhance uboot
> > > > > > > recipes in OE-Core to
> > > > > > > use this option if compiler supports it. That solves my problem.
> > > > > >
> > > > > > Yeah, extending that from kernel to u-boot would be nice.
> > > > > > Unfortunately, our products use Linaro gcc7 on rocko for now. Planning to
> > > > > > migrate to gcc8 on thud soon...
> > > > >
> > > > > we can check for the option before using it so atleast it will not
> > > > > break older toolchains more than what they are already broken.
> > > >
> > > > I added -ffile-prefix-map locally just with this option added it did
> > > > not fix the problem.
> > >
> > > So, I tried Poky and I do see it overflow by 5-6 KB, which is quite a lot.
> > > Though disabling security flags just for u-boot didn't change it a bit.
> > > Something else is going on. I'm now rebuilding Poky with security flags
> > > disabled globally...
> >
> > Hmm, disabling security flags globally and rebuilding toolchain and then
> > u-boot "fixes" it. Wonder what would cause the same code to change by 6KB.
> 
> security flags also enable PIE in gcc by default. secondly it also
> enable ssp can you try setting
> 
> SECURITY_LDFLAGS = ""
> SECURITY_STACK_PROTECTOR = ""
> 
> in uboot recipe and see if that helps.
> 
> If it does not then add
> 
> SECURITY_CFLAGS = "${SECURITY_NOPIE_CFLAGS}"
> 
> and see if that helps

Neither seem to help.


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-16 21:19                   ` Khem Raj
  2018-10-17  0:26                     ` Denys Dmytriyenko
@ 2018-10-17  2:26                     ` Denys Dmytriyenko
  1 sibling, 0 replies; 31+ messages in thread
From: Denys Dmytriyenko @ 2018-10-17  2:26 UTC (permalink / raw)
  To: Khem Raj; +Cc: meta-ti, Tom Rini

On Tue, Oct 16, 2018 at 02:19:36PM -0700, Khem Raj wrote:
> On Tue, Oct 16, 2018 at 12:20 PM Khem Raj <raj.khem@gmail.com> wrote:
> >
> > On Tue, Oct 16, 2018 at 12:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > >
> > > On Tue, Oct 16, 2018 at 11:50:36AM -0700, Khem Raj wrote:
> > > > On Tue, Oct 16, 2018 at 11:29 AM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > >
> > > > > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > > > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com> wrote:
> > > > > > >
> > > > > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > > > >
> > > > > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > > > > > >
> > > > > > > > > > > There have been reports recently that am335x_beaglebone_config generates bad SPL.
> > > > > > > > > > > Until that is debugged and fixed, use generic am335x_evm_config that covers all
> > > > > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > it fails to link
> > > > > > > > > >
> > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not
> > > > > > > > > > fit in region `.sram'
> > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
> > > > > > > > > > | make[2]: *** [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-staging/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > > > > spl/u-boot-spl] Error 1
> > > > > > > > >
> > > > > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core, as well as
> > > > > > > > > Linaro gcc7 - no problems.
> > > > > > > >
> > > > > > > > My distro inherits poky policies, and on master it now inherits
> > > > > > > > hardening policies ( security flags) by defaults
> > > > > > > > do you happen to test poky ?
> > > > > > >
> > > > > > > I think we want to take a look at which of the security flags really
> > > > > > > make sense to use in this context.  Thanks!
> > > > > > >
> > > > > >
> > > > > > there could be more to it, since the distro uses thumb2 ISA by
> > > > > > default, I am not sure
> > > > > > if u-boot overrides that and builds using arm mode ISA always but
> > > > > > something to consider, I saw several reports about u-boot overflowing
> > > > > > sram sections and most of
> > > > > > the solutions were "oh it works for me" or at the best your toolchain
> > > > > > is different then mine. here is mine use it and move on.
> > > > >
> > > > > Khem,
> > > > >
> > > > > Well, FWIW, Tom and I are very familiar with this issue. As a matter of fact,
> > > > > I first encountered it almost 2 years ago and had to prove there's such an
> > > > > issue, because everyone was saying it works for them, something must be wrong
> > > > > with my OE builds... :)
> > > > >
> > > > > While .sram region is very limited, the issue is exacerbated by the fact that
> > > > > all debug symbols from macros like __FILE__ are ended up in that section as
> > > > > well. So, the longer your build path, the larger the section becomes. Once I
> > > > > had instructions to reproduce the failure here internally with a series of
> > > > > long-named nested directories like aaaaaa and bbbbbb, Nishanth started this
> > > > > thread on U-boot mailing list:
> > > > > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > > > >
> > > > > We've had the corresponding bug open internally all this time, while adding
> > > > > workarounds to limit .sram section size by other means, like disabling some
> > > > > options to reduce the code size. Your patch is one of those workarounds...
> > > > >
> > > > > But we've been patiently waiting for the following feature to come into gcc to
> > > > > fix the issue properly:
> > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > > > >
> > > > > Since it's now part of gcc8, we should be able to use it. Not sure how to keep
> > > > > gcc7 backward compatibility though...
> > > >
> > > > dumping absolute file name strings into SPL seems a waste of space to
> > > > me, but I will leave that out for now. Moreover it exposes build paths
> > > > into binaries that user may not be interested to share
> > > >
> > > > -ffile-prefix-map has been in OE toolchains since gcc6 and I think we
> > > > are already using it for kernel builds. We can probably enhance uboot
> > > > recipes in OE-Core to
> > > > use this option if compiler supports it. That solves my problem.
> > >
> > > Yeah, extending that from kernel to u-boot would be nice.
> > > Unfortunately, our products use Linaro gcc7 on rocko for now. Planning to
> > > migrate to gcc8 on thud soon...
> >
> > we can check for the option before using it so atleast it will not
> > break older toolchains more than what they are already broken.
> 
> I added -ffile-prefix-map locally just with this option added it did
> not fix the problem.

I also tried adding -ffile-prefix-map locally and it only shaved off less than 
500 bytes. Still wondering what those extra 5KB of code are...


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
       [not found]                 ` <9e7016817d464dd8bfb1210b8e9e6cf5@SOC-EX01V.e01.socionext.com>
@ 2018-10-17  2:55                   ` Tom Rini
  2018-10-17  4:06                   ` Khem Raj
  1 sibling, 0 replies; 31+ messages in thread
From: Tom Rini @ 2018-10-17  2:55 UTC (permalink / raw)
  To: yamada.masahiro; +Cc: meta-ti

On Wed, Oct 17, 2018 at 02:39:15AM +0000, yamada.masahiro@socionext.com wrote:

> Hi.
> 
> > -----Original Message-----
> > From: Tom Rini [mailto:trini@konsulko.com]
> > Sent: Wednesday, October 17, 2018 3:59 AM
> > To: Denys Dmytriyenko <denys@ti.com>; Yamada, Masahiro/山田 真弘
> > <yamada.masahiro@socionext.com>
> > Cc: Khem Raj <raj.khem@gmail.com>; meta-ti@yoctoproject.org
> > Subject: Re: [meta-ti] [PATCH] beaglebone.conf: temporarily use generic
> > am335x_evm_config for U-boot
> > 
> > On Tue, Oct 16, 2018 at 02:38:28PM -0400, Denys Dmytriyenko wrote:
> > > On Tue, Oct 16, 2018 at 02:29:00PM -0400, Denys Dmytriyenko wrote:
> > > > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com> wrote:
> > > > > >
> > > > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <denys@ti.com>
> > wrote:
> > > > > > > >
> > > > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <denys@ti.com>
> > wrote:
> > > > > > > > > >
> > > > > > > > > > There have been reports recently that am335x_beaglebone_config
> > generates bad SPL.
> > > > > > > > > > Until that is debugged and fixed, use generic am335x_evm_config
> > that covers all
> > > > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > it fails to link
> > > > > > > > >
> > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata'
> > will not
> > > > > > > > > fit in region `.sram'
> > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed
> > by 5772 bytes
> > > > > > > > > | make[2]: ***
> > [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-stag
> > ing/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > > > spl/u-boot-spl] Error 1
> > > > > > > >
> > > > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from oe-core,
> > as well as
> > > > > > > > Linaro gcc7 - no problems.
> > > > > > >
> > > > > > > My distro inherits poky policies, and on master it now inherits
> > > > > > > hardening policies ( security flags) by defaults
> > > > > > > do you happen to test poky ?
> > > > > >
> > > > > > I think we want to take a look at which of the security flags really
> > > > > > make sense to use in this context.  Thanks!
> > > > > >
> > > > >
> > > > > there could be more to it, since the distro uses thumb2 ISA by
> > > > > default, I am not sure
> > > > > if u-boot overrides that and builds using arm mode ISA always but
> > > > > something to consider, I saw several reports about u-boot overflowing
> > > > > sram sections and most of
> > > > > the solutions were "oh it works for me" or at the best your toolchain
> > > > > is different then mine. here is mine use it and move on.
> > > >
> > > > Khem,
> > > >
> > > > Well, FWIW, Tom and I are very familiar with this issue. As a matter
> > of fact,
> > > > I first encountered it almost 2 years ago and had to prove there's such
> > an
> > > > issue, because everyone was saying it works for them, something must
> > be wrong
> > > > with my OE builds... :)
> > > >
> > > > While .sram region is very limited, the issue is exacerbated by the
> > fact that
> > > > all debug symbols from macros like __FILE__ are ended up in that section
> > as
> > > > well. So, the longer your build path, the larger the section becomes.
> > Once I
> > > > had instructions to reproduce the failure here internally with a series
> > of
> > > > long-named nested directories like aaaaaa and bbbbbb, Nishanth started
> > this
> > > > thread on U-boot mailing list:
> > > > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > > >
> > > > We've had the corresponding bug open internally all this time, while
> > adding
> > > > workarounds to limit .sram section size by other means, like disabling
> > some
> > > > options to reduce the code size. Your patch is one of those workarounds...
> > > >
> > > > But we've been patiently waiting for the following feature to come into
> > gcc to
> > > > fix the issue properly:
> > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > > >
> > > > Since it's now part of gcc8, we should be able to use it. Not sure how
> > to keep
> > > > gcc7 backward compatibility though...
> > >
> > > BTW, there were few attempts to "fix" it in U-boot as well, such as [1],
> > but I
> > > don't believe they got accepted. Tom?
> > >
> > > [1] https://patchwork.ozlabs.org/cover/825356/
> > 
> > I think the end result was waiting on the kernel community to agree on a
> > path forward for Kbuild and then bring that back.
> 
> 
> 
> U-Boot now supports -fmacro-prefix-map, so GCC 8 is OK.
> (see commit 1eb2e71ed)
> 
> For GCC 7 or older, sorry, I have no idea what to do.
> My patch set [1] was an ugly hack,
> and wrong in the first place.
> 
> What I can suggest is, please use GCC 8.

Ah yes, thanks!

-- 
Tom


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
       [not found]                 ` <9e7016817d464dd8bfb1210b8e9e6cf5@SOC-EX01V.e01.socionext.com>
  2018-10-17  2:55                   ` Tom Rini
@ 2018-10-17  4:06                   ` Khem Raj
  2018-10-17  4:37                     ` Denys Dmytriyenko
  2018-10-17 11:26                     ` Tom Rini
  1 sibling, 2 replies; 31+ messages in thread
From: Khem Raj @ 2018-10-17  4:06 UTC (permalink / raw)
  To: yamada.masahiro; +Cc: meta-ti, trini

[-- Attachment #1: Type: text/plain, Size: 5767 bytes --]

On Tue, Oct 16, 2018 at 7:39 PM <yamada.masahiro@socionext.com> wrote:

> Hi.
>
> > -----Original Message-----
> > From: Tom Rini [mailto:trini@konsulko.com]
> > Sent: Wednesday, October 17, 2018 3:59 AM
> > To: Denys Dmytriyenko <denys@ti.com>; Yamada, Masahiro/山田 真弘
> > <yamada.masahiro@socionext.com>
> > Cc: Khem Raj <raj.khem@gmail.com>; meta-ti@yoctoproject.org
> > Subject: Re: [meta-ti] [PATCH] beaglebone.conf: temporarily use generic
> > am335x_evm_config for U-boot
> >
> > On Tue, Oct 16, 2018 at 02:38:28PM -0400, Denys Dmytriyenko wrote:
> > > On Tue, Oct 16, 2018 at 02:29:00PM -0400, Denys Dmytriyenko wrote:
> > > > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com>
> wrote:
> > > > > >
> > > > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <
> denys@ti.com>
> > wrote:
> > > > > > > >
> > > > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <
> denys@ti.com>
> > wrote:
> > > > > > > > > >
> > > > > > > > > > There have been reports recently that
> am335x_beaglebone_config
> > generates bad SPL.
> > > > > > > > > > Until that is debugged and fixed, use generic
> am335x_evm_config
> > that covers all
> > > > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > it fails to link
> > > > > > > > >
> > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section
> `.rodata'
> > will not
> > > > > > > > > fit in region `.sram'
> > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed
> > by 5772 bytes
> > > > > > > > > | make[2]: ***
> > [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-stag
> > ing/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > > > spl/u-boot-spl] Error 1
> > > > > > > >
> > > > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from
> oe-core,
> > as well as
> > > > > > > > Linaro gcc7 - no problems.
> > > > > > >
> > > > > > > My distro inherits poky policies, and on master it now inherits
> > > > > > > hardening policies ( security flags) by defaults
> > > > > > > do you happen to test poky ?
> > > > > >
> > > > > > I think we want to take a look at which of the security flags
> really
> > > > > > make sense to use in this context.  Thanks!
> > > > > >
> > > > >
> > > > > there could be more to it, since the distro uses thumb2 ISA by
> > > > > default, I am not sure
> > > > > if u-boot overrides that and builds using arm mode ISA always but
> > > > > something to consider, I saw several reports about u-boot
> overflowing
> > > > > sram sections and most of
> > > > > the solutions were "oh it works for me" or at the best your
> toolchain
> > > > > is different then mine. here is mine use it and move on.
> > > >
> > > > Khem,
> > > >
> > > > Well, FWIW, Tom and I are very familiar with this issue. As a matter
> > of fact,
> > > > I first encountered it almost 2 years ago and had to prove there's
> such
> > an
> > > > issue, because everyone was saying it works for them, something must
> > be wrong
> > > > with my OE builds... :)
> > > >
> > > > While .sram region is very limited, the issue is exacerbated by the
> > fact that
> > > > all debug symbols from macros like __FILE__ are ended up in that
> section
> > as
> > > > well. So, the longer your build path, the larger the section becomes.
> > Once I
> > > > had instructions to reproduce the failure here internally with a
> series
> > of
> > > > long-named nested directories like aaaaaa and bbbbbb, Nishanth
> started
> > this
> > > > thread on U-boot mailing list:
> > > > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > > >
> > > > We've had the corresponding bug open internally all this time, while
> > adding
> > > > workarounds to limit .sram section size by other means, like
> disabling
> > some
> > > > options to reduce the code size. Your patch is one of those
> workarounds...
> > > >
> > > > But we've been patiently waiting for the following feature to come
> into
> > gcc to
> > > > fix the issue properly:
> > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > > >
> > > > Since it's now part of gcc8, we should be able to use it. Not sure
> how
> > to keep
> > > > gcc7 backward compatibility though...
> > >
> > > BTW, there were few attempts to "fix" it in U-boot as well, such as
> [1],
> > but I
> > > don't believe they got accepted. Tom?
> > >
> > > [1] https://patchwork.ozlabs.org/cover/825356/
> >
> > I think the end result was waiting on the kernel community to agree on a
> > path forward for Kbuild and then bring that back.
>
>
>
> U-Boot now supports -fmacro-prefix-map, so GCC 8 is OK.
> (see commit 1eb2e71ed)
>
> For GCC 7 or older, sorry, I have no idea what to do.
> My patch set [1] was an ugly hack,
> and wrong in the first place.
>
> What I can suggest is, please use GCC 8.


Yeah I saw that but this patch is not their in 2018.01 release that TI fork
is based on regardless I backported this patch to this version it did not
bring the size below mark
I think it’s because we are using hardened toolchain and that enalbles
extra options to enable pie and ssp since these options get added to CC
they get passed into uboot straight

I think we should just disable security flags for u boot in OE and may be
uboot make system should append fno-pie fno-stack-protector to nullify
these options

>
>
> Thanks.
>
>

[-- Attachment #2: Type: text/html, Size: 8390 bytes --]

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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-17  4:06                   ` Khem Raj
@ 2018-10-17  4:37                     ` Denys Dmytriyenko
  2018-10-17  6:55                       ` Khem Raj
  2018-10-17 11:26                     ` Tom Rini
  1 sibling, 1 reply; 31+ messages in thread
From: Denys Dmytriyenko @ 2018-10-17  4:37 UTC (permalink / raw)
  To: Khem Raj; +Cc: meta-ti, yamada.masahiro, trini

On Tue, Oct 16, 2018 at 09:06:27PM -0700, Khem Raj wrote:
> On Tue, Oct 16, 2018 at 7:39 PM <yamada.masahiro@socionext.com> wrote:
> 
> > Hi.
> >
> > > -----Original Message-----
> > > From: Tom Rini [mailto:trini@konsulko.com]
> > > Sent: Wednesday, October 17, 2018 3:59 AM
> > > To: Denys Dmytriyenko <denys@ti.com>; Yamada, Masahiro/山田 真弘
> > > <yamada.masahiro@socionext.com>
> > > Cc: Khem Raj <raj.khem@gmail.com>; meta-ti@yoctoproject.org
> > > Subject: Re: [meta-ti] [PATCH] beaglebone.conf: temporarily use generic
> > > am335x_evm_config for U-boot
> > >
> > > On Tue, Oct 16, 2018 at 02:38:28PM -0400, Denys Dmytriyenko wrote:
> > > > On Tue, Oct 16, 2018 at 02:29:00PM -0400, Denys Dmytriyenko wrote:
> > > > > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > > > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com>
> > wrote:
> > > > > > >
> > > > > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <
> > denys@ti.com>
> > > wrote:
> > > > > > > > >
> > > > > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <
> > denys@ti.com>
> > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > There have been reports recently that
> > am335x_beaglebone_config
> > > generates bad SPL.
> > > > > > > > > > > Until that is debugged and fixed, use generic
> > am335x_evm_config
> > > that covers all
> > > > > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > it fails to link
> > > > > > > > > >
> > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section
> > `.rodata'
> > > will not
> > > > > > > > > > fit in region `.sram'
> > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed
> > > by 5772 bytes
> > > > > > > > > > | make[2]: ***
> > > [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-stag
> > > ing/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > > > > spl/u-boot-spl] Error 1
> > > > > > > > >
> > > > > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from
> > oe-core,
> > > as well as
> > > > > > > > > Linaro gcc7 - no problems.
> > > > > > > >
> > > > > > > > My distro inherits poky policies, and on master it now inherits
> > > > > > > > hardening policies ( security flags) by defaults
> > > > > > > > do you happen to test poky ?
> > > > > > >
> > > > > > > I think we want to take a look at which of the security flags
> > really
> > > > > > > make sense to use in this context.  Thanks!
> > > > > > >
> > > > > >
> > > > > > there could be more to it, since the distro uses thumb2 ISA by
> > > > > > default, I am not sure
> > > > > > if u-boot overrides that and builds using arm mode ISA always but
> > > > > > something to consider, I saw several reports about u-boot
> > overflowing
> > > > > > sram sections and most of
> > > > > > the solutions were "oh it works for me" or at the best your
> > toolchain
> > > > > > is different then mine. here is mine use it and move on.
> > > > >
> > > > > Khem,
> > > > >
> > > > > Well, FWIW, Tom and I are very familiar with this issue. As a matter
> > > of fact,
> > > > > I first encountered it almost 2 years ago and had to prove there's
> > such
> > > an
> > > > > issue, because everyone was saying it works for them, something must
> > > be wrong
> > > > > with my OE builds... :)
> > > > >
> > > > > While .sram region is very limited, the issue is exacerbated by the
> > > fact that
> > > > > all debug symbols from macros like __FILE__ are ended up in that
> > section
> > > as
> > > > > well. So, the longer your build path, the larger the section becomes.
> > > Once I
> > > > > had instructions to reproduce the failure here internally with a
> > series
> > > of
> > > > > long-named nested directories like aaaaaa and bbbbbb, Nishanth
> > started
> > > this
> > > > > thread on U-boot mailing list:
> > > > > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > > > >
> > > > > We've had the corresponding bug open internally all this time, while
> > > adding
> > > > > workarounds to limit .sram section size by other means, like
> > disabling
> > > some
> > > > > options to reduce the code size. Your patch is one of those
> > workarounds...
> > > > >
> > > > > But we've been patiently waiting for the following feature to come
> > into
> > > gcc to
> > > > > fix the issue properly:
> > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > > > >
> > > > > Since it's now part of gcc8, we should be able to use it. Not sure
> > how
> > > to keep
> > > > > gcc7 backward compatibility though...
> > > >
> > > > BTW, there were few attempts to "fix" it in U-boot as well, such as
> > [1],
> > > but I
> > > > don't believe they got accepted. Tom?
> > > >
> > > > [1] https://patchwork.ozlabs.org/cover/825356/
> > >
> > > I think the end result was waiting on the kernel community to agree on a
> > > path forward for Kbuild and then bring that back.
> >
> >
> >
> > U-Boot now supports -fmacro-prefix-map, so GCC 8 is OK.
> > (see commit 1eb2e71ed)
> >
> > For GCC 7 or older, sorry, I have no idea what to do.
> > My patch set [1] was an ugly hack,
> > and wrong in the first place.
> >
> > What I can suggest is, please use GCC 8.
> 
> 
> Yeah I saw that but this patch is not their in 2018.01 release that TI fork
> is based on regardless I backported this patch to this version it did not
> bring the size below mark
> I think it’s because we are using hardened toolchain and that enalbles
> extra options to enable pie and ssp since these options get added to CC
> they get passed into uboot straight
> 
> I think we should just disable security flags for u boot in OE and may be
> uboot make system should append fno-pie fno-stack-protector to nullify
> these options

FWIW, as I mentioned earlier, just adding no-security flags to the recipe 
didn't really work. I'm open to more suggestions.

-- 
Denys


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-17  4:37                     ` Denys Dmytriyenko
@ 2018-10-17  6:55                       ` Khem Raj
  2018-10-17 17:50                         ` Denys Dmytriyenko
  0 siblings, 1 reply; 31+ messages in thread
From: Khem Raj @ 2018-10-17  6:55 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-ti, Masahiro Yamada, Tom Rini

try setting #GCCPIE = "" in local.conf
On Tue, Oct 16, 2018 at 9:37 PM Denys Dmytriyenko <denys@ti.com> wrote:
>
> On Tue, Oct 16, 2018 at 09:06:27PM -0700, Khem Raj wrote:
> > On Tue, Oct 16, 2018 at 7:39 PM <yamada.masahiro@socionext.com> wrote:
> >
> > > Hi.
> > >
> > > > -----Original Message-----
> > > > From: Tom Rini [mailto:trini@konsulko.com]
> > > > Sent: Wednesday, October 17, 2018 3:59 AM
> > > > To: Denys Dmytriyenko <denys@ti.com>; Yamada, Masahiro/山田 真弘
> > > > <yamada.masahiro@socionext.com>
> > > > Cc: Khem Raj <raj.khem@gmail.com>; meta-ti@yoctoproject.org
> > > > Subject: Re: [meta-ti] [PATCH] beaglebone.conf: temporarily use generic
> > > > am335x_evm_config for U-boot
> > > >
> > > > On Tue, Oct 16, 2018 at 02:38:28PM -0400, Denys Dmytriyenko wrote:
> > > > > On Tue, Oct 16, 2018 at 02:29:00PM -0400, Denys Dmytriyenko wrote:
> > > > > > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > > > > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com>
> > > wrote:
> > > > > > > >
> > > > > > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <
> > > denys@ti.com>
> > > > wrote:
> > > > > > > > > >
> > > > > > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <
> > > denys@ti.com>
> > > > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > There have been reports recently that
> > > am335x_beaglebone_config
> > > > generates bad SPL.
> > > > > > > > > > > > Until that is debugged and fixed, use generic
> > > am335x_evm_config
> > > > that covers all
> > > > > > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > it fails to link
> > > > > > > > > > >
> > > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section
> > > `.rodata'
> > > > will not
> > > > > > > > > > > fit in region `.sram'
> > > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed
> > > > by 5772 bytes
> > > > > > > > > > > | make[2]: ***
> > > > [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-stag
> > > > ing/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > > > > > spl/u-boot-spl] Error 1
> > > > > > > > > >
> > > > > > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from
> > > oe-core,
> > > > as well as
> > > > > > > > > > Linaro gcc7 - no problems.
> > > > > > > > >
> > > > > > > > > My distro inherits poky policies, and on master it now inherits
> > > > > > > > > hardening policies ( security flags) by defaults
> > > > > > > > > do you happen to test poky ?
> > > > > > > >
> > > > > > > > I think we want to take a look at which of the security flags
> > > really
> > > > > > > > make sense to use in this context.  Thanks!
> > > > > > > >
> > > > > > >
> > > > > > > there could be more to it, since the distro uses thumb2 ISA by
> > > > > > > default, I am not sure
> > > > > > > if u-boot overrides that and builds using arm mode ISA always but
> > > > > > > something to consider, I saw several reports about u-boot
> > > overflowing
> > > > > > > sram sections and most of
> > > > > > > the solutions were "oh it works for me" or at the best your
> > > toolchain
> > > > > > > is different then mine. here is mine use it and move on.
> > > > > >
> > > > > > Khem,
> > > > > >
> > > > > > Well, FWIW, Tom and I are very familiar with this issue. As a matter
> > > > of fact,
> > > > > > I first encountered it almost 2 years ago and had to prove there's
> > > such
> > > > an
> > > > > > issue, because everyone was saying it works for them, something must
> > > > be wrong
> > > > > > with my OE builds... :)
> > > > > >
> > > > > > While .sram region is very limited, the issue is exacerbated by the
> > > > fact that
> > > > > > all debug symbols from macros like __FILE__ are ended up in that
> > > section
> > > > as
> > > > > > well. So, the longer your build path, the larger the section becomes.
> > > > Once I
> > > > > > had instructions to reproduce the failure here internally with a
> > > series
> > > > of
> > > > > > long-named nested directories like aaaaaa and bbbbbb, Nishanth
> > > started
> > > > this
> > > > > > thread on U-boot mailing list:
> > > > > > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > > > > >
> > > > > > We've had the corresponding bug open internally all this time, while
> > > > adding
> > > > > > workarounds to limit .sram section size by other means, like
> > > disabling
> > > > some
> > > > > > options to reduce the code size. Your patch is one of those
> > > workarounds...
> > > > > >
> > > > > > But we've been patiently waiting for the following feature to come
> > > into
> > > > gcc to
> > > > > > fix the issue properly:
> > > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > > > > >
> > > > > > Since it's now part of gcc8, we should be able to use it. Not sure
> > > how
> > > > to keep
> > > > > > gcc7 backward compatibility though...
> > > > >
> > > > > BTW, there were few attempts to "fix" it in U-boot as well, such as
> > > [1],
> > > > but I
> > > > > don't believe they got accepted. Tom?
> > > > >
> > > > > [1] https://patchwork.ozlabs.org/cover/825356/
> > > >
> > > > I think the end result was waiting on the kernel community to agree on a
> > > > path forward for Kbuild and then bring that back.
> > >
> > >
> > >
> > > U-Boot now supports -fmacro-prefix-map, so GCC 8 is OK.
> > > (see commit 1eb2e71ed)
> > >
> > > For GCC 7 or older, sorry, I have no idea what to do.
> > > My patch set [1] was an ugly hack,
> > > and wrong in the first place.
> > >
> > > What I can suggest is, please use GCC 8.
> >
> >
> > Yeah I saw that but this patch is not their in 2018.01 release that TI fork
> > is based on regardless I backported this patch to this version it did not
> > bring the size below mark
> > I think it’s because we are using hardened toolchain and that enalbles
> > extra options to enable pie and ssp since these options get added to CC
> > they get passed into uboot straight
> >
> > I think we should just disable security flags for u boot in OE and may be
> > uboot make system should append fno-pie fno-stack-protector to nullify
> > these options
>
> FWIW, as I mentioned earlier, just adding no-security flags to the recipe
> didn't really work. I'm open to more suggestions.
>
> --
> Denys


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-17  4:06                   ` Khem Raj
  2018-10-17  4:37                     ` Denys Dmytriyenko
@ 2018-10-17 11:26                     ` Tom Rini
  2018-10-17 15:00                       ` Khem Raj
  1 sibling, 1 reply; 31+ messages in thread
From: Tom Rini @ 2018-10-17 11:26 UTC (permalink / raw)
  To: Khem Raj; +Cc: meta-ti, yamada.masahiro

[-- Attachment #1: Type: text/plain, Size: 6221 bytes --]

On Tue, Oct 16, 2018 at 09:06:27PM -0700, Khem Raj wrote:
> On Tue, Oct 16, 2018 at 7:39 PM <yamada.masahiro@socionext.com> wrote:
> 
> > Hi.
> >
> > > -----Original Message-----
> > > From: Tom Rini [mailto:trini@konsulko.com]
> > > Sent: Wednesday, October 17, 2018 3:59 AM
> > > To: Denys Dmytriyenko <denys@ti.com>; Yamada, Masahiro/山田 真弘
> > > <yamada.masahiro@socionext.com>
> > > Cc: Khem Raj <raj.khem@gmail.com>; meta-ti@yoctoproject.org
> > > Subject: Re: [meta-ti] [PATCH] beaglebone.conf: temporarily use generic
> > > am335x_evm_config for U-boot
> > >
> > > On Tue, Oct 16, 2018 at 02:38:28PM -0400, Denys Dmytriyenko wrote:
> > > > On Tue, Oct 16, 2018 at 02:29:00PM -0400, Denys Dmytriyenko wrote:
> > > > > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > > > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com>
> > wrote:
> > > > > > >
> > > > > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <
> > denys@ti.com>
> > > wrote:
> > > > > > > > >
> > > > > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <
> > denys@ti.com>
> > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > There have been reports recently that
> > am335x_beaglebone_config
> > > generates bad SPL.
> > > > > > > > > > > Until that is debugged and fixed, use generic
> > am335x_evm_config
> > > that covers all
> > > > > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > it fails to link
> > > > > > > > > >
> > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section
> > `.rodata'
> > > will not
> > > > > > > > > > fit in region `.sram'
> > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed
> > > by 5772 bytes
> > > > > > > > > > | make[2]: ***
> > > [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-stag
> > > ing/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > > > > spl/u-boot-spl] Error 1
> > > > > > > > >
> > > > > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from
> > oe-core,
> > > as well as
> > > > > > > > > Linaro gcc7 - no problems.
> > > > > > > >
> > > > > > > > My distro inherits poky policies, and on master it now inherits
> > > > > > > > hardening policies ( security flags) by defaults
> > > > > > > > do you happen to test poky ?
> > > > > > >
> > > > > > > I think we want to take a look at which of the security flags
> > really
> > > > > > > make sense to use in this context.  Thanks!
> > > > > > >
> > > > > >
> > > > > > there could be more to it, since the distro uses thumb2 ISA by
> > > > > > default, I am not sure
> > > > > > if u-boot overrides that and builds using arm mode ISA always but
> > > > > > something to consider, I saw several reports about u-boot
> > overflowing
> > > > > > sram sections and most of
> > > > > > the solutions were "oh it works for me" or at the best your
> > toolchain
> > > > > > is different then mine. here is mine use it and move on.
> > > > >
> > > > > Khem,
> > > > >
> > > > > Well, FWIW, Tom and I are very familiar with this issue. As a matter
> > > of fact,
> > > > > I first encountered it almost 2 years ago and had to prove there's
> > such
> > > an
> > > > > issue, because everyone was saying it works for them, something must
> > > be wrong
> > > > > with my OE builds... :)
> > > > >
> > > > > While .sram region is very limited, the issue is exacerbated by the
> > > fact that
> > > > > all debug symbols from macros like __FILE__ are ended up in that
> > section
> > > as
> > > > > well. So, the longer your build path, the larger the section becomes.
> > > Once I
> > > > > had instructions to reproduce the failure here internally with a
> > series
> > > of
> > > > > long-named nested directories like aaaaaa and bbbbbb, Nishanth
> > started
> > > this
> > > > > thread on U-boot mailing list:
> > > > > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > > > >
> > > > > We've had the corresponding bug open internally all this time, while
> > > adding
> > > > > workarounds to limit .sram section size by other means, like
> > disabling
> > > some
> > > > > options to reduce the code size. Your patch is one of those
> > workarounds...
> > > > >
> > > > > But we've been patiently waiting for the following feature to come
> > into
> > > gcc to
> > > > > fix the issue properly:
> > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > > > >
> > > > > Since it's now part of gcc8, we should be able to use it. Not sure
> > how
> > > to keep
> > > > > gcc7 backward compatibility though...
> > > >
> > > > BTW, there were few attempts to "fix" it in U-boot as well, such as
> > [1],
> > > but I
> > > > don't believe they got accepted. Tom?
> > > >
> > > > [1] https://patchwork.ozlabs.org/cover/825356/
> > >
> > > I think the end result was waiting on the kernel community to agree on a
> > > path forward for Kbuild and then bring that back.
> >
> >
> >
> > U-Boot now supports -fmacro-prefix-map, so GCC 8 is OK.
> > (see commit 1eb2e71ed)
> >
> > For GCC 7 or older, sorry, I have no idea what to do.
> > My patch set [1] was an ugly hack,
> > and wrong in the first place.
> >
> > What I can suggest is, please use GCC 8.
> 
> 
> Yeah I saw that but this patch is not their in 2018.01 release that TI fork
> is based on regardless I backported this patch to this version it did not
> bring the size below mark
> I think it’s because we are using hardened toolchain and that enalbles
> extra options to enable pie and ssp since these options get added to CC
> they get passed into uboot straight
> 
> I think we should just disable security flags for u boot in OE and may be
> uboot make system should append fno-pie fno-stack-protector to nullify
> these options

OK, do you want to submit a patch for that or should I do one and just
Suggested-by you?  Thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-17 11:26                     ` Tom Rini
@ 2018-10-17 15:00                       ` Khem Raj
  2018-10-17 19:25                         ` Denys Dmytriyenko
  0 siblings, 1 reply; 31+ messages in thread
From: Khem Raj @ 2018-10-17 15:00 UTC (permalink / raw)
  To: Tom Rini; +Cc: meta-ti, yamada.masahiro

[-- Attachment #1: Type: text/plain, Size: 6869 bytes --]

On Wed, Oct 17, 2018 at 4:26 AM Tom Rini <trini@konsulko.com> wrote:

> On Tue, Oct 16, 2018 at 09:06:27PM -0700, Khem Raj wrote:
> > On Tue, Oct 16, 2018 at 7:39 PM <yamada.masahiro@socionext.com> wrote:
> >
> > > Hi.
> > >
> > > > -----Original Message-----
> > > > From: Tom Rini [mailto:trini@konsulko.com]
> > > > Sent: Wednesday, October 17, 2018 3:59 AM
> > > > To: Denys Dmytriyenko <denys@ti.com>; Yamada, Masahiro/山田 真弘
> > > > <yamada.masahiro@socionext.com>
> > > > Cc: Khem Raj <raj.khem@gmail.com>; meta-ti@yoctoproject.org
> > > > Subject: Re: [meta-ti] [PATCH] beaglebone.conf: temporarily use
> generic
> > > > am335x_evm_config for U-boot
> > > >
> > > > On Tue, Oct 16, 2018 at 02:38:28PM -0400, Denys Dmytriyenko wrote:
> > > > > On Tue, Oct 16, 2018 at 02:29:00PM -0400, Denys Dmytriyenko wrote:
> > > > > > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > > > > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com>
> > > wrote:
> > > > > > > >
> > > > > > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <
> > > denys@ti.com>
> > > > wrote:
> > > > > > > > > >
> > > > > > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <
> > > denys@ti.com>
> > > > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > There have been reports recently that
> > > am335x_beaglebone_config
> > > > generates bad SPL.
> > > > > > > > > > > > Until that is debugged and fixed, use generic
> > > am335x_evm_config
> > > > that covers all
> > > > > > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > it fails to link
> > > > > > > > > > >
> > > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section
> > > `.rodata'
> > > > will not
> > > > > > > > > > > fit in region `.sram'
> > > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram'
> overflowed
> > > > by 5772 bytes
> > > > > > > > > > > | make[2]: ***
> > > >
> [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-stag
> > > > ing/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > > > > > spl/u-boot-spl] Error 1
> > > > > > > > > >
> > > > > > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8
> from
> > > oe-core,
> > > > as well as
> > > > > > > > > > Linaro gcc7 - no problems.
> > > > > > > > >
> > > > > > > > > My distro inherits poky policies, and on master it now
> inherits
> > > > > > > > > hardening policies ( security flags) by defaults
> > > > > > > > > do you happen to test poky ?
> > > > > > > >
> > > > > > > > I think we want to take a look at which of the security flags
> > > really
> > > > > > > > make sense to use in this context.  Thanks!
> > > > > > > >
> > > > > > >
> > > > > > > there could be more to it, since the distro uses thumb2 ISA by
> > > > > > > default, I am not sure
> > > > > > > if u-boot overrides that and builds using arm mode ISA always
> but
> > > > > > > something to consider, I saw several reports about u-boot
> > > overflowing
> > > > > > > sram sections and most of
> > > > > > > the solutions were "oh it works for me" or at the best your
> > > toolchain
> > > > > > > is different then mine. here is mine use it and move on.
> > > > > >
> > > > > > Khem,
> > > > > >
> > > > > > Well, FWIW, Tom and I are very familiar with this issue. As a
> matter
> > > > of fact,
> > > > > > I first encountered it almost 2 years ago and had to prove
> there's
> > > such
> > > > an
> > > > > > issue, because everyone was saying it works for them, something
> must
> > > > be wrong
> > > > > > with my OE builds... :)
> > > > > >
> > > > > > While .sram region is very limited, the issue is exacerbated by
> the
> > > > fact that
> > > > > > all debug symbols from macros like __FILE__ are ended up in that
> > > section
> > > > as
> > > > > > well. So, the longer your build path, the larger the section
> becomes.
> > > > Once I
> > > > > > had instructions to reproduce the failure here internally with a
> > > series
> > > > of
> > > > > > long-named nested directories like aaaaaa and bbbbbb, Nishanth
> > > started
> > > > this
> > > > > > thread on U-boot mailing list:
> > > > > > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > > > > >
> > > > > > We've had the corresponding bug open internally all this time,
> while
> > > > adding
> > > > > > workarounds to limit .sram section size by other means, like
> > > disabling
> > > > some
> > > > > > options to reduce the code size. Your patch is one of those
> > > workarounds...
> > > > > >
> > > > > > But we've been patiently waiting for the following feature to
> come
> > > into
> > > > gcc to
> > > > > > fix the issue properly:
> > > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > > > > >
> > > > > > Since it's now part of gcc8, we should be able to use it. Not
> sure
> > > how
> > > > to keep
> > > > > > gcc7 backward compatibility though...
> > > > >
> > > > > BTW, there were few attempts to "fix" it in U-boot as well, such as
> > > [1],
> > > > but I
> > > > > don't believe they got accepted. Tom?
> > > > >
> > > > > [1] https://patchwork.ozlabs.org/cover/825356/
> > > >
> > > > I think the end result was waiting on the kernel community to agree
> on a
> > > > path forward for Kbuild and then bring that back.
> > >
> > >
> > >
> > > U-Boot now supports -fmacro-prefix-map, so GCC 8 is OK.
> > > (see commit 1eb2e71ed)
> > >
> > > For GCC 7 or older, sorry, I have no idea what to do.
> > > My patch set [1] was an ugly hack,
> > > and wrong in the first place.
> > >
> > > What I can suggest is, please use GCC 8.
> >
> >
> > Yeah I saw that but this patch is not their in 2018.01 release that TI
> fork
> > is based on regardless I backported this patch to this version it did not
> > bring the size below mark
> > I think it’s because we are using hardened toolchain and that enalbles
> > extra options to enable pie and ssp since these options get added to CC
> > they get passed into uboot straight
> >
> > I think we should just disable security flags for u boot in OE and may be
> > uboot make system should append fno-pie fno-stack-protector to nullify
> > these options
>
> OK, do you want to submit a patch for that or should I do one and just
> Suggested-by you?  Thanks!


This would not be acceptable change since it changes how we build gcc
itself secondly it does not happen for master uboot

However if this works then we need to understand why it increas e the size



>
> --
> Tom
>

[-- Attachment #2: Type: text/html, Size: 10549 bytes --]

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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-17  6:55                       ` Khem Raj
@ 2018-10-17 17:50                         ` Denys Dmytriyenko
  0 siblings, 0 replies; 31+ messages in thread
From: Denys Dmytriyenko @ 2018-10-17 17:50 UTC (permalink / raw)
  To: Khem Raj; +Cc: meta-ti, Masahiro Yamada, Tom Rini

On Tue, Oct 16, 2018 at 11:55:24PM -0700, Khem Raj wrote:
> try setting #GCCPIE = "" in local.conf

Yeah, it works, but obviously rebuilds the entire toolchain...


> On Tue, Oct 16, 2018 at 9:37 PM Denys Dmytriyenko <denys@ti.com> wrote:
> >
> > On Tue, Oct 16, 2018 at 09:06:27PM -0700, Khem Raj wrote:
> > > On Tue, Oct 16, 2018 at 7:39 PM <yamada.masahiro@socionext.com> wrote:
> > >
> > > > Hi.
> > > >
> > > > > -----Original Message-----
> > > > > From: Tom Rini [mailto:trini@konsulko.com]
> > > > > Sent: Wednesday, October 17, 2018 3:59 AM
> > > > > To: Denys Dmytriyenko <denys@ti.com>; Yamada, Masahiro/山田 真弘
> > > > > <yamada.masahiro@socionext.com>
> > > > > Cc: Khem Raj <raj.khem@gmail.com>; meta-ti@yoctoproject.org
> > > > > Subject: Re: [meta-ti] [PATCH] beaglebone.conf: temporarily use generic
> > > > > am335x_evm_config for U-boot
> > > > >
> > > > > On Tue, Oct 16, 2018 at 02:38:28PM -0400, Denys Dmytriyenko wrote:
> > > > > > On Tue, Oct 16, 2018 at 02:29:00PM -0400, Denys Dmytriyenko wrote:
> > > > > > > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > > > > > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com>
> > > > wrote:
> > > > > > > > >
> > > > > > > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > > > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <
> > > > denys@ti.com>
> > > > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <
> > > > denys@ti.com>
> > > > > wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > There have been reports recently that
> > > > am335x_beaglebone_config
> > > > > generates bad SPL.
> > > > > > > > > > > > > Until that is debugged and fixed, use generic
> > > > am335x_evm_config
> > > > > that covers all
> > > > > > > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > it fails to link
> > > > > > > > > > > >
> > > > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section
> > > > `.rodata'
> > > > > will not
> > > > > > > > > > > > fit in region `.sram'
> > > > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed
> > > > > by 5772 bytes
> > > > > > > > > > > > | make[2]: ***
> > > > > [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-stag
> > > > > ing/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > > > > > > spl/u-boot-spl] Error 1
> > > > > > > > > > >
> > > > > > > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8 from
> > > > oe-core,
> > > > > as well as
> > > > > > > > > > > Linaro gcc7 - no problems.
> > > > > > > > > >
> > > > > > > > > > My distro inherits poky policies, and on master it now inherits
> > > > > > > > > > hardening policies ( security flags) by defaults
> > > > > > > > > > do you happen to test poky ?
> > > > > > > > >
> > > > > > > > > I think we want to take a look at which of the security flags
> > > > really
> > > > > > > > > make sense to use in this context.  Thanks!
> > > > > > > > >
> > > > > > > >
> > > > > > > > there could be more to it, since the distro uses thumb2 ISA by
> > > > > > > > default, I am not sure
> > > > > > > > if u-boot overrides that and builds using arm mode ISA always but
> > > > > > > > something to consider, I saw several reports about u-boot
> > > > overflowing
> > > > > > > > sram sections and most of
> > > > > > > > the solutions were "oh it works for me" or at the best your
> > > > toolchain
> > > > > > > > is different then mine. here is mine use it and move on.
> > > > > > >
> > > > > > > Khem,
> > > > > > >
> > > > > > > Well, FWIW, Tom and I are very familiar with this issue. As a matter
> > > > > of fact,
> > > > > > > I first encountered it almost 2 years ago and had to prove there's
> > > > such
> > > > > an
> > > > > > > issue, because everyone was saying it works for them, something must
> > > > > be wrong
> > > > > > > with my OE builds... :)
> > > > > > >
> > > > > > > While .sram region is very limited, the issue is exacerbated by the
> > > > > fact that
> > > > > > > all debug symbols from macros like __FILE__ are ended up in that
> > > > section
> > > > > as
> > > > > > > well. So, the longer your build path, the larger the section becomes.
> > > > > Once I
> > > > > > > had instructions to reproduce the failure here internally with a
> > > > series
> > > > > of
> > > > > > > long-named nested directories like aaaaaa and bbbbbb, Nishanth
> > > > started
> > > > > this
> > > > > > > thread on U-boot mailing list:
> > > > > > > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > > > > > >
> > > > > > > We've had the corresponding bug open internally all this time, while
> > > > > adding
> > > > > > > workarounds to limit .sram section size by other means, like
> > > > disabling
> > > > > some
> > > > > > > options to reduce the code size. Your patch is one of those
> > > > workarounds...
> > > > > > >
> > > > > > > But we've been patiently waiting for the following feature to come
> > > > into
> > > > > gcc to
> > > > > > > fix the issue properly:
> > > > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > > > > > >
> > > > > > > Since it's now part of gcc8, we should be able to use it. Not sure
> > > > how
> > > > > to keep
> > > > > > > gcc7 backward compatibility though...
> > > > > >
> > > > > > BTW, there were few attempts to "fix" it in U-boot as well, such as
> > > > [1],
> > > > > but I
> > > > > > don't believe they got accepted. Tom?
> > > > > >
> > > > > > [1] https://patchwork.ozlabs.org/cover/825356/
> > > > >
> > > > > I think the end result was waiting on the kernel community to agree on a
> > > > > path forward for Kbuild and then bring that back.
> > > >
> > > >
> > > >
> > > > U-Boot now supports -fmacro-prefix-map, so GCC 8 is OK.
> > > > (see commit 1eb2e71ed)
> > > >
> > > > For GCC 7 or older, sorry, I have no idea what to do.
> > > > My patch set [1] was an ugly hack,
> > > > and wrong in the first place.
> > > >
> > > > What I can suggest is, please use GCC 8.
> > >
> > >
> > > Yeah I saw that but this patch is not their in 2018.01 release that TI fork
> > > is based on regardless I backported this patch to this version it did not
> > > bring the size below mark
> > > I think it’s because we are using hardened toolchain and that enalbles
> > > extra options to enable pie and ssp since these options get added to CC
> > > they get passed into uboot straight
> > >
> > > I think we should just disable security flags for u boot in OE and may be
> > > uboot make system should append fno-pie fno-stack-protector to nullify
> > > these options
> >
> > FWIW, as I mentioned earlier, just adding no-security flags to the recipe
> > didn't really work. I'm open to more suggestions.
> >
> > --
> > Denys


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-17 15:00                       ` Khem Raj
@ 2018-10-17 19:25                         ` Denys Dmytriyenko
  2018-10-17 19:27                           ` Khem Raj
  0 siblings, 1 reply; 31+ messages in thread
From: Denys Dmytriyenko @ 2018-10-17 19:25 UTC (permalink / raw)
  To: Khem Raj; +Cc: meta-ti, Tom Rini, yamada.masahiro

On Wed, Oct 17, 2018 at 08:00:52AM -0700, Khem Raj wrote:
> On Wed, Oct 17, 2018 at 4:26 AM Tom Rini <trini@konsulko.com> wrote:
> 
> > On Tue, Oct 16, 2018 at 09:06:27PM -0700, Khem Raj wrote:
> > > On Tue, Oct 16, 2018 at 7:39 PM <yamada.masahiro@socionext.com> wrote:
> > >
> > > > Hi.
> > > >
> > > > > -----Original Message-----
> > > > > From: Tom Rini [mailto:trini@konsulko.com]
> > > > > Sent: Wednesday, October 17, 2018 3:59 AM
> > > > > To: Denys Dmytriyenko <denys@ti.com>; Yamada, Masahiro/山田 真弘
> > > > > <yamada.masahiro@socionext.com>
> > > > > Cc: Khem Raj <raj.khem@gmail.com>; meta-ti@yoctoproject.org
> > > > > Subject: Re: [meta-ti] [PATCH] beaglebone.conf: temporarily use
> > generic
> > > > > am335x_evm_config for U-boot
> > > > >
> > > > > On Tue, Oct 16, 2018 at 02:38:28PM -0400, Denys Dmytriyenko wrote:
> > > > > > On Tue, Oct 16, 2018 at 02:29:00PM -0400, Denys Dmytriyenko wrote:
> > > > > > > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > > > > > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com>
> > > > wrote:
> > > > > > > > >
> > > > > > > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > > > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <
> > > > denys@ti.com>
> > > > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <
> > > > denys@ti.com>
> > > > > wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > There have been reports recently that
> > > > am335x_beaglebone_config
> > > > > generates bad SPL.
> > > > > > > > > > > > > Until that is debugged and fixed, use generic
> > > > am335x_evm_config
> > > > > that covers all
> > > > > > > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > it fails to link
> > > > > > > > > > > >
> > > > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section
> > > > `.rodata'
> > > > > will not
> > > > > > > > > > > > fit in region `.sram'
> > > > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram'
> > overflowed
> > > > > by 5772 bytes
> > > > > > > > > > > > | make[2]: ***
> > > > >
> > [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-stag
> > > > > ing/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > > > > > > spl/u-boot-spl] Error 1
> > > > > > > > > > >
> > > > > > > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8
> > from
> > > > oe-core,
> > > > > as well as
> > > > > > > > > > > Linaro gcc7 - no problems.
> > > > > > > > > >
> > > > > > > > > > My distro inherits poky policies, and on master it now
> > inherits
> > > > > > > > > > hardening policies ( security flags) by defaults
> > > > > > > > > > do you happen to test poky ?
> > > > > > > > >
> > > > > > > > > I think we want to take a look at which of the security flags
> > > > really
> > > > > > > > > make sense to use in this context.  Thanks!
> > > > > > > > >
> > > > > > > >
> > > > > > > > there could be more to it, since the distro uses thumb2 ISA by
> > > > > > > > default, I am not sure
> > > > > > > > if u-boot overrides that and builds using arm mode ISA always
> > but
> > > > > > > > something to consider, I saw several reports about u-boot
> > > > overflowing
> > > > > > > > sram sections and most of
> > > > > > > > the solutions were "oh it works for me" or at the best your
> > > > toolchain
> > > > > > > > is different then mine. here is mine use it and move on.
> > > > > > >
> > > > > > > Khem,
> > > > > > >
> > > > > > > Well, FWIW, Tom and I are very familiar with this issue. As a
> > matter
> > > > > of fact,
> > > > > > > I first encountered it almost 2 years ago and had to prove
> > there's
> > > > such
> > > > > an
> > > > > > > issue, because everyone was saying it works for them, something
> > must
> > > > > be wrong
> > > > > > > with my OE builds... :)
> > > > > > >
> > > > > > > While .sram region is very limited, the issue is exacerbated by
> > the
> > > > > fact that
> > > > > > > all debug symbols from macros like __FILE__ are ended up in that
> > > > section
> > > > > as
> > > > > > > well. So, the longer your build path, the larger the section
> > becomes.
> > > > > Once I
> > > > > > > had instructions to reproduce the failure here internally with a
> > > > series
> > > > > of
> > > > > > > long-named nested directories like aaaaaa and bbbbbb, Nishanth
> > > > started
> > > > > this
> > > > > > > thread on U-boot mailing list:
> > > > > > > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > > > > > >
> > > > > > > We've had the corresponding bug open internally all this time,
> > while
> > > > > adding
> > > > > > > workarounds to limit .sram section size by other means, like
> > > > disabling
> > > > > some
> > > > > > > options to reduce the code size. Your patch is one of those
> > > > workarounds...
> > > > > > >
> > > > > > > But we've been patiently waiting for the following feature to
> > come
> > > > into
> > > > > gcc to
> > > > > > > fix the issue properly:
> > > > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > > > > > >
> > > > > > > Since it's now part of gcc8, we should be able to use it. Not
> > sure
> > > > how
> > > > > to keep
> > > > > > > gcc7 backward compatibility though...
> > > > > >
> > > > > > BTW, there were few attempts to "fix" it in U-boot as well, such as
> > > > [1],
> > > > > but I
> > > > > > don't believe they got accepted. Tom?
> > > > > >
> > > > > > [1] https://patchwork.ozlabs.org/cover/825356/
> > > > >
> > > > > I think the end result was waiting on the kernel community to agree
> > on a
> > > > > path forward for Kbuild and then bring that back.
> > > >
> > > >
> > > >
> > > > U-Boot now supports -fmacro-prefix-map, so GCC 8 is OK.
> > > > (see commit 1eb2e71ed)
> > > >
> > > > For GCC 7 or older, sorry, I have no idea what to do.
> > > > My patch set [1] was an ugly hack,
> > > > and wrong in the first place.
> > > >
> > > > What I can suggest is, please use GCC 8.
> > >
> > >
> > > Yeah I saw that but this patch is not their in 2018.01 release that TI
> > fork
> > > is based on regardless I backported this patch to this version it did not
> > > bring the size below mark
> > > I think it’s because we are using hardened toolchain and that enalbles
> > > extra options to enable pie and ssp since these options get added to CC
> > > they get passed into uboot straight
> > >
> > > I think we should just disable security flags for u boot in OE and may be
> > > uboot make system should append fno-pie fno-stack-protector to nullify
> > > these options
> >
> > OK, do you want to submit a patch for that or should I do one and just
> > Suggested-by you?  Thanks!
> 
> 
> This would not be acceptable change since it changes how we build gcc
> itself secondly it does not happen for master uboot
> 
> However if this works then we need to understand why it increas e the size

Even if this change is not acceptable upstream, I would prefer it locally in 
meta-ti recipe, instead of disabling more features to free up 5-6KB in SPL.

-- 
Denys


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-17 19:25                         ` Denys Dmytriyenko
@ 2018-10-17 19:27                           ` Khem Raj
  2018-10-17 19:37                             ` Denys Dmytriyenko
  0 siblings, 1 reply; 31+ messages in thread
From: Khem Raj @ 2018-10-17 19:27 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-ti, Tom Rini, Masahiro Yamada

On Wed, Oct 17, 2018 at 12:25 PM Denys Dmytriyenko <denys@ti.com> wrote:
>
> On Wed, Oct 17, 2018 at 08:00:52AM -0700, Khem Raj wrote:
> > On Wed, Oct 17, 2018 at 4:26 AM Tom Rini <trini@konsulko.com> wrote:
> >
> > > On Tue, Oct 16, 2018 at 09:06:27PM -0700, Khem Raj wrote:
> > > > On Tue, Oct 16, 2018 at 7:39 PM <yamada.masahiro@socionext.com> wrote:
> > > >
> > > > > Hi.
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Tom Rini [mailto:trini@konsulko.com]
> > > > > > Sent: Wednesday, October 17, 2018 3:59 AM
> > > > > > To: Denys Dmytriyenko <denys@ti.com>; Yamada, Masahiro/山田 真弘
> > > > > > <yamada.masahiro@socionext.com>
> > > > > > Cc: Khem Raj <raj.khem@gmail.com>; meta-ti@yoctoproject.org
> > > > > > Subject: Re: [meta-ti] [PATCH] beaglebone.conf: temporarily use
> > > generic
> > > > > > am335x_evm_config for U-boot
> > > > > >
> > > > > > On Tue, Oct 16, 2018 at 02:38:28PM -0400, Denys Dmytriyenko wrote:
> > > > > > > On Tue, Oct 16, 2018 at 02:29:00PM -0400, Denys Dmytriyenko wrote:
> > > > > > > > On Tue, Oct 16, 2018 at 11:11:36AM -0700, Khem Raj wrote:
> > > > > > > > > On Tue, Oct 16, 2018 at 9:42 AM Tom Rini <trini@konsulko.com>
> > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > On Sun, Oct 14, 2018 at 10:07:45PM -0700, Khem Raj wrote:
> > > > > > > > > > > On Sun, Oct 14, 2018 at 12:24 PM Denys Dmytriyenko <
> > > > > denys@ti.com>
> > > > > > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > On Sat, Oct 13, 2018 at 01:17:12AM -0700, Khem Raj wrote:
> > > > > > > > > > > > > On Fri, Oct 12, 2018 at 8:00 PM Denys Dmytriyenko <
> > > > > denys@ti.com>
> > > > > > wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > There have been reports recently that
> > > > > am335x_beaglebone_config
> > > > > > generates bad SPL.
> > > > > > > > > > > > > > Until that is debugged and fixed, use generic
> > > > > am335x_evm_config
> > > > > > that covers all
> > > > > > > > > > > > > > AM335x platforms, including BeagleBone variants.
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > it fails to link
> > > > > > > > > > > > >
> > > > > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section
> > > > > `.rodata'
> > > > > > will not
> > > > > > > > > > > > > fit in region `.sram'
> > > > > > > > > > > > > | arm-yoe-linux-gnueabi-ld.bfd: region `.sram'
> > > overflowed
> > > > > > by 5772 bytes
> > > > > > > > > > > > > | make[2]: ***
> > > > > >
> > > [/mnt/a/yoe/build/tmp/work/beaglebone-yoe-linux-gnueabi/u-boot-ti-stag
> > > > > > ing/2018.01+gitAUTOINC+2cc52408bf-r24/git/scripts/Makefile.spl:349:
> > > > > > > > > > > > > spl/u-boot-spl] Error 1
> > > > > > > > > > > >
> > > > > > > > > > > > FWIW, just built u-boot-ti-staging with gcc7 and gcc8
> > > from
> > > > > oe-core,
> > > > > > as well as
> > > > > > > > > > > > Linaro gcc7 - no problems.
> > > > > > > > > > >
> > > > > > > > > > > My distro inherits poky policies, and on master it now
> > > inherits
> > > > > > > > > > > hardening policies ( security flags) by defaults
> > > > > > > > > > > do you happen to test poky ?
> > > > > > > > > >
> > > > > > > > > > I think we want to take a look at which of the security flags
> > > > > really
> > > > > > > > > > make sense to use in this context.  Thanks!
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > there could be more to it, since the distro uses thumb2 ISA by
> > > > > > > > > default, I am not sure
> > > > > > > > > if u-boot overrides that and builds using arm mode ISA always
> > > but
> > > > > > > > > something to consider, I saw several reports about u-boot
> > > > > overflowing
> > > > > > > > > sram sections and most of
> > > > > > > > > the solutions were "oh it works for me" or at the best your
> > > > > toolchain
> > > > > > > > > is different then mine. here is mine use it and move on.
> > > > > > > >
> > > > > > > > Khem,
> > > > > > > >
> > > > > > > > Well, FWIW, Tom and I are very familiar with this issue. As a
> > > matter
> > > > > > of fact,
> > > > > > > > I first encountered it almost 2 years ago and had to prove
> > > there's
> > > > > such
> > > > > > an
> > > > > > > > issue, because everyone was saying it works for them, something
> > > must
> > > > > > be wrong
> > > > > > > > with my OE builds... :)
> > > > > > > >
> > > > > > > > While .sram region is very limited, the issue is exacerbated by
> > > the
> > > > > > fact that
> > > > > > > > all debug symbols from macros like __FILE__ are ended up in that
> > > > > section
> > > > > > as
> > > > > > > > well. So, the longer your build path, the larger the section
> > > becomes.
> > > > > > Once I
> > > > > > > > had instructions to reproduce the failure here internally with a
> > > > > series
> > > > > > of
> > > > > > > > long-named nested directories like aaaaaa and bbbbbb, Nishanth
> > > > > started
> > > > > > this
> > > > > > > > thread on U-boot mailing list:
> > > > > > > > https://lists.denx.de/pipermail/u-boot/2017-March/285031.html
> > > > > > > >
> > > > > > > > We've had the corresponding bug open internally all this time,
> > > while
> > > > > > adding
> > > > > > > > workarounds to limit .sram section size by other means, like
> > > > > disabling
> > > > > > some
> > > > > > > > options to reduce the code size. Your patch is one of those
> > > > > workarounds...
> > > > > > > >
> > > > > > > > But we've been patiently waiting for the following feature to
> > > come
> > > > > into
> > > > > > gcc to
> > > > > > > > fix the issue properly:
> > > > > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
> > > > > > > >
> > > > > > > > Since it's now part of gcc8, we should be able to use it. Not
> > > sure
> > > > > how
> > > > > > to keep
> > > > > > > > gcc7 backward compatibility though...
> > > > > > >
> > > > > > > BTW, there were few attempts to "fix" it in U-boot as well, such as
> > > > > [1],
> > > > > > but I
> > > > > > > don't believe they got accepted. Tom?
> > > > > > >
> > > > > > > [1] https://patchwork.ozlabs.org/cover/825356/
> > > > > >
> > > > > > I think the end result was waiting on the kernel community to agree
> > > on a
> > > > > > path forward for Kbuild and then bring that back.
> > > > >
> > > > >
> > > > >
> > > > > U-Boot now supports -fmacro-prefix-map, so GCC 8 is OK.
> > > > > (see commit 1eb2e71ed)
> > > > >
> > > > > For GCC 7 or older, sorry, I have no idea what to do.
> > > > > My patch set [1] was an ugly hack,
> > > > > and wrong in theEven if this change is not acceptable upstream, I would prefer it locally in
meta-ti recipe, instead of disabling more features to free up 5-6KB in
SPL. first place.
> > > > >
> > > > > What I can suggest is, please use GCC 8.
> > > >
> > > >
> > > > Yeah I saw that but this patch is not their in 2018.01 release that TI
> > > fork
> > > > is based on regardless I backported this patch to this version it did not
> > > > bring the size below mark
> > > > I think it’s because we are using hardened toolchain and that enalbles
> > > > extra options to enable pie and ssp since these options get added to CC
> > > > they get passed into uboot straight
> > > >
> > > > I think we should just disable security flags for u boot in OE and may be
> > > > uboot make system should append fno-pie fno-stack-protector to nullify
> > > > these options
> > >
> > > OK, do you want to submit a patch for that or should I do one and just
> > > Suggested-by you?  Thanks!
> >
> >
> > This would not be acceptable change since it changes how we build gcc
> > itself secondly it does not happen for master uboot
> >
> > However if this works then we need to understand why it increas e the size
>
> Even if this change is not acceptable upstream, I would prefer it locally in
> meta-ti recipe, instead of disabling more features to free up 5-6KB in SPL.

this is a distro level change. meta-ti is not appropriate place to decide that

>
> --
> Denys


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-17 19:27                           ` Khem Raj
@ 2018-10-17 19:37                             ` Denys Dmytriyenko
  2018-10-17 19:46                               ` Khem Raj
  0 siblings, 1 reply; 31+ messages in thread
From: Denys Dmytriyenko @ 2018-10-17 19:37 UTC (permalink / raw)
  To: Khem Raj; +Cc: meta-ti, Tom Rini, Masahiro Yamada

On Wed, Oct 17, 2018 at 12:27:19PM -0700, Khem Raj wrote:
> On Wed, Oct 17, 2018 at 12:25 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > Yeah I saw that but this patch is not their in 2018.01 release that TI
> > > > fork
> > > > > is based on regardless I backported this patch to this version it did not
> > > > > bring the size below mark
> > > > > I think it’s because we are using hardened toolchain and that enalbles
> > > > > extra options to enable pie and ssp since these options get added to CC
> > > > > they get passed into uboot straight
> > > > >
> > > > > I think we should just disable security flags for u boot in OE and may be
> > > > > uboot make system should append fno-pie fno-stack-protector to nullify
> > > > > these options
> > > >
> > > > OK, do you want to submit a patch for that or should I do one and just
> > > > Suggested-by you?  Thanks!
> > >
> > >
> > > This would not be acceptable change since it changes how we build gcc
> > > itself secondly it does not happen for master uboot
> > >
> > > However if this works then we need to understand why it increas e the size
> >
> > Even if this change is not acceptable upstream, I would prefer it locally in
> > meta-ti recipe, instead of disabling more features to free up 5-6KB in SPL.
> 
> this is a distro level change. meta-ti is not appropriate place to decide that

Are we talking about passing fno-pie and fno-stack-protector to U-boot build 
that you suggested above? That is what I'm referring here. It can be BBB 
specific patch. That is until we figure out why it grows code so much...

-- 
Denys


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

* Re: [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot
  2018-10-17 19:37                             ` Denys Dmytriyenko
@ 2018-10-17 19:46                               ` Khem Raj
  0 siblings, 0 replies; 31+ messages in thread
From: Khem Raj @ 2018-10-17 19:46 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-ti, Tom Rini, Masahiro Yamada

On Wed, Oct 17, 2018 at 12:37 PM Denys Dmytriyenko <denys@ti.com> wrote:
>
> On Wed, Oct 17, 2018 at 12:27:19PM -0700, Khem Raj wrote:
> > On Wed, Oct 17, 2018 at 12:25 PM Denys Dmytriyenko <denys@ti.com> wrote:
> > > > > > Yeah I saw that but this patch is not their in 2018.01 release that TI
> > > > > fork
> > > > > > is based on regardless I backported this patch to this version it did not
> > > > > > bring the size below mark
> > > > > > I think it’s because we are using hardened toolchain and that enalbles
> > > > > > extra options to enable pie and ssp since these options get added to CC
> > > > > > they get passed into uboot straight
> > > > > >
> > > > > > I think we should just disable security flags for u boot in OE and may be
> > > > > > uboot make system should append fno-pie fno-stack-protector to nullify
> > > > > > these options
> > > > >
> > > > > OK, do you want to submit a patch for that or should I do one and just
> > > > > Suggested-by you?  Thanks!
> > > >
> > > >Yes, that's right.
> > > > This would not be acceptable change since it changes how we build gcc
> > > > itself secondly it does not happen for master uboot
> > > >
> > > > However if this works then we need to understand why it increas e the size
> > >
> > > Even if this change is not acceptable upstream, I would prefer it locally in
> > > meta-ti recipe, instead of disabling more features to free up 5-6KB in SPL.
> >
> > this is a distro level change. meta-ti is not appropriate place to decide that
>
> Are we talking about passing fno-pie and fno-stack-protector to U-boot build
> that you suggested above? That is what I'm referring here. It can be BBB
> specific patch. That is until we figure out why it grows code so much...
>
oh I confused it with GCCPIE

> --
> Denys


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

end of thread, other threads:[~2018-10-17 19:46 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-13  2:50 [PATCH] beaglebone.conf: temporarily use generic am335x_evm_config for U-boot Denys Dmytriyenko
2018-10-13  8:17 ` Khem Raj
2018-10-14 19:24   ` Denys Dmytriyenko
2018-10-15  5:07     ` Khem Raj
2018-10-16  7:50       ` Khem Raj
2018-10-16 16:42       ` Tom Rini
2018-10-16 18:11         ` Khem Raj
2018-10-16 18:29           ` Denys Dmytriyenko
2018-10-16 18:38             ` Denys Dmytriyenko
2018-10-16 18:59               ` Tom Rini
     [not found]                 ` <9e7016817d464dd8bfb1210b8e9e6cf5@SOC-EX01V.e01.socionext.com>
2018-10-17  2:55                   ` Tom Rini
2018-10-17  4:06                   ` Khem Raj
2018-10-17  4:37                     ` Denys Dmytriyenko
2018-10-17  6:55                       ` Khem Raj
2018-10-17 17:50                         ` Denys Dmytriyenko
2018-10-17 11:26                     ` Tom Rini
2018-10-17 15:00                       ` Khem Raj
2018-10-17 19:25                         ` Denys Dmytriyenko
2018-10-17 19:27                           ` Khem Raj
2018-10-17 19:37                             ` Denys Dmytriyenko
2018-10-17 19:46                               ` Khem Raj
2018-10-16 18:50             ` Khem Raj
2018-10-16 19:00               ` Denys Dmytriyenko
2018-10-16 19:20                 ` Khem Raj
2018-10-16 21:19                   ` Khem Raj
2018-10-17  0:26                     ` Denys Dmytriyenko
2018-10-17  0:37                       ` Denys Dmytriyenko
2018-10-17  1:42                         ` Khem Raj
2018-10-17  1:58                           ` Denys Dmytriyenko
2018-10-17  2:26                     ` Denys Dmytriyenko
2018-10-16 18:52           ` Tom Rini

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.