Message ID | 1249010753.7483898.1467378648497.JavaMail.zimbra@datacom.ind.br |
---|---|
State | Not Applicable |
Headers | show |
Hello, On Fri, 1 Jul 2016 10:10:48 -0300 (BRT), Carlos Santos wrote: > /usr/bin/make -C tools all > gcc -O2 -I/work/bcm95615x/host/usr/include -o img2srec.o img2srec.c -c > In file included from img2srec.c:55:0: > os_support.h:22:22: fatal error: compiler.h: No such file or directory What is your host gcc version ? This failure smells like building an old U-Boot, with gcc 5.x as the host gcc version. > diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk > index a2274ee..5d171dd 100644 > --- a/boot/uboot/uboot.mk > +++ b/boot/uboot/uboot.mk > @@ -92,9 +92,7 @@ endif > > UBOOT_MAKE_OPTS += \ > CROSS_COMPILE="$(TARGET_CROSS)" \ > - ARCH=$(UBOOT_ARCH) \ > - HOSTCFLAGS="$(HOST_CFLAGS)" \ > - HOSTLDFLAGS="$(HOST_LDFLAGS)" I'm not sure to see why this would fix the problem you're reporting. Thomas
> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com> > To: "Carlos Santos" <casantos@datacom.ind.br> > Cc: "buildroot" <buildroot@buildroot.org>, "Julien Boibessot" <julien.boibessot@armadeus.com> > Sent: Friday, July 1, 2016 10:18:04 AM > Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05 > Hello, > > On Fri, 1 Jul 2016 10:10:48 -0300 (BRT), Carlos Santos wrote: > >> /usr/bin/make -C tools all >> gcc -O2 -I/work/bcm95615x/host/usr/include -o img2srec.o img2srec.c -c >> In file included from img2srec.c:55:0: >> os_support.h:22:22: fatal error: compiler.h: No such file or directory > > What is your host gcc version ? This failure smells like building an > old U-Boot, with gcc 5.x as the host gcc version. The problem happens on CentOS 7 (GCC 4.8.3) and Ubuntu 16.04 (GCC 5.3.1). >> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk >> index a2274ee..5d171dd 100644 >> --- a/boot/uboot/uboot.mk >> +++ b/boot/uboot/uboot.mk >> @@ -92,9 +92,7 @@ endif >> >> UBOOT_MAKE_OPTS += \ >> CROSS_COMPILE="$(TARGET_CROSS)" \ >> - ARCH=$(UBOOT_ARCH) \ >> - HOSTCFLAGS="$(HOST_CFLAGS)" \ >> - HOSTLDFLAGS="$(HOST_LDFLAGS)" > > I'm not sure to see why this would fix the problem you're reporting. It prevents overriding HOSTCFLAGS and HOSTLDFLAGS on targets that don't need OpenSSL, so older versions of U-Boot will compile successfully. Carlos Santos (Casantos) DATACOM, P&D
Hello, On Fri, 1 Jul 2016 11:00:57 -0300 (BRT), Carlos Santos wrote: > > What is your host gcc version ? This failure smells like building an > > old U-Boot, with gcc 5.x as the host gcc version. > > The problem happens on CentOS 7 (GCC 4.8.3) and Ubuntu 16.04 (GCC 5.3.1). I think the failure with GCC 5.3.x is normal, but I don't understand why it would fail with gcc 4.8. > >> UBOOT_MAKE_OPTS += \ > >> CROSS_COMPILE="$(TARGET_CROSS)" \ > >> - ARCH=$(UBOOT_ARCH) \ > >> - HOSTCFLAGS="$(HOST_CFLAGS)" \ > >> - HOSTLDFLAGS="$(HOST_LDFLAGS)" > > > > I'm not sure to see why this would fix the problem you're reporting. > > It prevents overriding HOSTCFLAGS and HOSTLDFLAGS on targets that don't need OpenSSL, so older versions of U-Boot will compile successfully. Yes, but I don't understand why not setting HOSTCFLAGS/HOSTLDFLAGS fixes the build issue you mentioned. Thomas
> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com> > To: "Carlos Santos" <casantos@datacom.ind.br> > Cc: "buildroot" <buildroot@buildroot.org>, "Julien Boibessot" <julien.boibessot@armadeus.com> > Sent: Friday, July 1, 2016 11:15:56 AM > Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05 > Hello, > > On Fri, 1 Jul 2016 11:00:57 -0300 (BRT), Carlos Santos wrote: > >> > What is your host gcc version ? This failure smells like building an >> > old U-Boot, with gcc 5.x as the host gcc version. >> >> The problem happens on CentOS 7 (GCC 4.8.3) and Ubuntu 16.04 (GCC 5.3.1). > > I think the failure with GCC 5.3.x is normal, but I don't understand > why it would fail with gcc 4.8. > >> >> UBOOT_MAKE_OPTS += \ >> >> CROSS_COMPILE="$(TARGET_CROSS)" \ >> >> - ARCH=$(UBOOT_ARCH) \ >> >> - HOSTCFLAGS="$(HOST_CFLAGS)" \ >> >> - HOSTLDFLAGS="$(HOST_LDFLAGS)" >> > >> > I'm not sure to see why this would fix the problem you're reporting. >> >> It prevents overriding HOSTCFLAGS and HOSTLDFLAGS on targets that don't need >> OpenSSL, so older versions of U-Boot will compile successfully. > > Yes, but I don't understand why not setting HOSTCFLAGS/HOSTLDFLAGS > fixes the build issue you mentioned. > Without setting HOSTCFLAGS/HOSTLDFLAGS the command line is this gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -idirafter /work/bcm95615x/build/uboot-2012.10/include -idirafter /work/bcm95615x/build/uboot-2012.10/include2 -idirafter /work/bcm95615x/build/uboot-2012.10/include -I /work/bcm95615x/build/uboot-2012.10/lib/libfdt -I /work/bcm95615x/build/uboot-2012.10/tools -DCONFIG_SYS_TEXT_BASE=0x80800000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -pedantic -o img2srec.o img2srec.c -c Setting HOSTCFLAGS/HOSTLDFLAGS the command line becomes gcc -O2 -I/work/bcm95615x/host/usr/include -o img2srec.o img2srec.c -c Because the value of HOSTCFLAGS set in U-Boot's config.mk is overwritten. Carlos Santos (Casantos) DATACOM, P&D
Carlos, You are probably missing "include/linux/compiler-gcc5.h". This one may work for you: https://github.com/altera-opensource/u-boot-socfpga /commit/d3c9a256d6445129d01d1ea779d2587523190427 S.
On 01-07-16 17:28, Carlos Santos wrote: >> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com> >> To: "Carlos Santos" <casantos@datacom.ind.br> >> Cc: "buildroot" <buildroot@buildroot.org>, "Julien Boibessot" <julien.boibessot@armadeus.com> >> Sent: Friday, July 1, 2016 11:15:56 AM >> Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05 > >> Hello, >> >> On Fri, 1 Jul 2016 11:00:57 -0300 (BRT), Carlos Santos wrote: >> >>>> What is your host gcc version ? This failure smells like building an >>>> old U-Boot, with gcc 5.x as the host gcc version. >>> >>> The problem happens on CentOS 7 (GCC 4.8.3) and Ubuntu 16.04 (GCC 5.3.1). >> >> I think the failure with GCC 5.3.x is normal, but I don't understand >> why it would fail with gcc 4.8. >> >>>>> UBOOT_MAKE_OPTS += \ >>>>> CROSS_COMPILE="$(TARGET_CROSS)" \ >>>>> - ARCH=$(UBOOT_ARCH) \ >>>>> - HOSTCFLAGS="$(HOST_CFLAGS)" \ >>>>> - HOSTLDFLAGS="$(HOST_LDFLAGS)" >>>> >>>> I'm not sure to see why this would fix the problem you're reporting. >>> >>> It prevents overriding HOSTCFLAGS and HOSTLDFLAGS on targets that don't need >>> OpenSSL, so older versions of U-Boot will compile successfully. >> >> Yes, but I don't understand why not setting HOSTCFLAGS/HOSTLDFLAGS >> fixes the build issue you mentioned. >> > > Without setting HOSTCFLAGS/HOSTLDFLAGS the command line is this > > gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -idirafter /work/bcm95615x/build/uboot-2012.10/include -idirafter /work/bcm95615x/build/uboot-2012.10/include2 -idirafter /work/bcm95615x/build/uboot-2012.10/include -I /work/bcm95615x/build/uboot-2012.10/lib/libfdt -I /work/bcm95615x/build/uboot-2012.10/tools -DCONFIG_SYS_TEXT_BASE=0x80800000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -pedantic -o img2srec.o img2srec.c -c > > Setting HOSTCFLAGS/HOSTLDFLAGS the command line becomes > > gcc -O2 -I/work/bcm95615x/host/usr/include -o img2srec.o img2srec.c -c > > Because the value of HOSTCFLAGS set in U-Boot's config.mk is overwritten. How about leaving HOSTCFLAGS alone, and instead setting HOSTCC="$(HOSTCC) $(HOST_CFLAGS)". HOSTLDFLAGS can probably be overridden. Regards, Arnout
Hello, On Sat, 2 Jul 2016 12:47:14 +0200, Arnout Vandecappelle wrote: > > Because the value of HOSTCFLAGS set in U-Boot's config.mk is overwritten. > > How about leaving HOSTCFLAGS alone, and instead setting > HOSTCC="$(HOSTCC) $(HOST_CFLAGS)". HOSTLDFLAGS can probably be overridden. Good point, that's possibly an alternate solution. I sent a patch implementing a different solution, but Carlos, if you can try Arnout's suggestion, it would be good. Thanks, Thomas
> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com> > To: "Arnout Vandecappelle" <arnout@mind.be> > Cc: "Carlos Santos" <casantos@datacom.ind.br>, "Julien Boibessot" <julien.boibessot@armadeus.com>, "buildroot" > <buildroot@buildroot.org> > Sent: Saturday, July 2, 2016 7:56:25 AM > Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05 > Hello, > > On Sat, 2 Jul 2016 12:47:14 +0200, Arnout Vandecappelle wrote: > >> > Because the value of HOSTCFLAGS set in U-Boot's config.mk is overwritten. >> >> How about leaving HOSTCFLAGS alone, and instead setting >> HOSTCC="$(HOSTCC) $(HOST_CFLAGS)". HOSTLDFLAGS can probably be overridden. > > Good point, that's possibly an alternate solution. I sent a patch > implementing a different solution, but Carlos, if you can try Arnout's > suggestion, it would be good. Yes, it works, but this reminds me that HOSTCC is not passed when building buildroot, so the command line for version 2015.01 becomes cc -Wp,-MD,tools/.img2srec.d -O2 -I/work/freescale_imx28evk/host/usr/include -include ./include/libfdt_env.h -idirafterinclude -idirafter./arch/arm/include -I./lib/libfdt -I./tools -DCONFIG_SYS_TEXT_BASE=0x40002000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -D_GNU_SOURCE -pedantic -o tools/img2srec tools/img2srec.c This may not be a problem now but I believe that HOSTCC should always be provided. Carlos Santos (Casantos) DATACOM, P&D
Hi Carlos, On 03-07-16 18:15, Carlos Santos wrote: >> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com> >> To: "Arnout Vandecappelle" <arnout@mind.be> >> Cc: "Carlos Santos" <casantos@datacom.ind.br>, "Julien Boibessot" <julien.boibessot@armadeus.com>, "buildroot" >> <buildroot@buildroot.org> >> Sent: Saturday, July 2, 2016 7:56:25 AM >> Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05 > >> Hello, >> >> On Sat, 2 Jul 2016 12:47:14 +0200, Arnout Vandecappelle wrote: >> >>>> Because the value of HOSTCFLAGS set in U-Boot's config.mk is overwritten. >>> >>> How about leaving HOSTCFLAGS alone, and instead setting >>> HOSTCC="$(HOSTCC) $(HOST_CFLAGS)". HOSTLDFLAGS can probably be overridden. >> >> Good point, that's possibly an alternate solution. I sent a patch >> implementing a different solution, but Carlos, if you can try Arnout's >> suggestion, it would be good. > > Yes, it works, but this reminds me that HOSTCC is not passed when building buildroot, so the command line for version 2015.01 becomes > > cc -Wp,-MD,tools/.img2srec.d -O2 -I/work/freescale_imx28evk/host/usr/include -include ./include/libfdt_env.h -idirafterinclude -idirafter./arch/arm/include -I./lib/libfdt -I./tools -DCONFIG_SYS_TEXT_BASE=0x40002000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -D_GNU_SOURCE -pedantic -o tools/img2srec tools/img2srec.c > > This may not be a problem now but I believe that HOSTCC should always be provided. Care to prepare a patch then that replaces HOSTCFLAGS by HOSTCC? Regards, Arnout
> From: "Arnout Vandecappelle" <arnout@mind.be> > To: "Carlos Santos" <casantos@datacom.ind.br>, "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com> > Cc: "Julien Boibessot" <julien.boibessot@armadeus.com>, "buildroot" <buildroot@buildroot.org> > Sent: Monday, July 4, 2016 6:26:09 AM > Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05 > Hi Carlos, > > On 03-07-16 18:15, Carlos Santos wrote: >>> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com> >>> To: "Arnout Vandecappelle" <arnout@mind.be> >>> Cc: "Carlos Santos" <casantos@datacom.ind.br>, "Julien Boibessot" >>> <julien.boibessot@armadeus.com>, "buildroot" >>> <buildroot@buildroot.org> >>> Sent: Saturday, July 2, 2016 7:56:25 AM >>> Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05 >> >>> Hello, >>> >>> On Sat, 2 Jul 2016 12:47:14 +0200, Arnout Vandecappelle wrote: >>> >>>>> Because the value of HOSTCFLAGS set in U-Boot's config.mk is overwritten. >>>> >>>> How about leaving HOSTCFLAGS alone, and instead setting >>>> HOSTCC="$(HOSTCC) $(HOST_CFLAGS)". HOSTLDFLAGS can probably be overridden. >>> >>> Good point, that's possibly an alternate solution. I sent a patch >>> implementing a different solution, but Carlos, if you can try Arnout's >>> suggestion, it would be good. >> >> Yes, it works, but this reminds me that HOSTCC is not passed when building >> buildroot, so the command line for version 2015.01 becomes >> >> cc -Wp,-MD,tools/.img2srec.d -O2 -I/work/freescale_imx28evk/host/usr/include >> -include ./include/libfdt_env.h -idirafterinclude >> -idirafter./arch/arm/include -I./lib/libfdt -I./tools >> -DCONFIG_SYS_TEXT_BASE=0x40002000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES >> -D_GNU_SOURCE -pedantic -o tools/img2srec tools/img2srec.c >> >> This may not be a problem now but I believe that HOSTCC should always be >> provided. > > Care to prepare a patch then that replaces HOSTCFLAGS by HOSTCC? > Thomas already submitted a patch: http://patchwork.ozlabs.org/patch/643426/ Carlos Santos (Casantos) DATACOM, P&D
On 04-07-16 13:15, Carlos Santos wrote: >> From: "Arnout Vandecappelle" <arnout@mind.be> >> To: "Carlos Santos" <casantos@datacom.ind.br>, "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com> >> Cc: "Julien Boibessot" <julien.boibessot@armadeus.com>, "buildroot" <buildroot@buildroot.org> >> Sent: Monday, July 4, 2016 6:26:09 AM >> Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05 > >> Hi Carlos, >> >> On 03-07-16 18:15, Carlos Santos wrote: >>>> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com> >>>> To: "Arnout Vandecappelle" <arnout@mind.be> >>>> Cc: "Carlos Santos" <casantos@datacom.ind.br>, "Julien Boibessot" >>>> <julien.boibessot@armadeus.com>, "buildroot" >>>> <buildroot@buildroot.org> >>>> Sent: Saturday, July 2, 2016 7:56:25 AM >>>> Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05 >>> >>>> Hello, >>>> >>>> On Sat, 2 Jul 2016 12:47:14 +0200, Arnout Vandecappelle wrote: >>>> >>>>>> Because the value of HOSTCFLAGS set in U-Boot's config.mk is overwritten. >>>>> >>>>> How about leaving HOSTCFLAGS alone, and instead setting >>>>> HOSTCC="$(HOSTCC) $(HOST_CFLAGS)". HOSTLDFLAGS can probably be overridden. >>>> >>>> Good point, that's possibly an alternate solution. I sent a patch >>>> implementing a different solution, but Carlos, if you can try Arnout's >>>> suggestion, it would be good. >>> >>> Yes, it works, but this reminds me that HOSTCC is not passed when building >>> buildroot, so the command line for version 2015.01 becomes >>> >>> cc -Wp,-MD,tools/.img2srec.d -O2 -I/work/freescale_imx28evk/host/usr/include >>> -include ./include/libfdt_env.h -idirafterinclude >>> -idirafter./arch/arm/include -I./lib/libfdt -I./tools >>> -DCONFIG_SYS_TEXT_BASE=0x40002000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES >>> -D_GNU_SOURCE -pedantic -o tools/img2srec tools/img2srec.c >>> >>> This may not be a problem now but I believe that HOSTCC should always be >>> provided. >> >> Care to prepare a patch then that replaces HOSTCFLAGS by HOSTCC? >> > > Thomas already submitted a patch: http://patchwork.ozlabs.org/patch/643426/ Yes, but Thomas's patch still sets HOSTCFLAGS. My question was: do you care to submit an alternative (better) patch that sets HOSTCC (unconditionally) rather than changing HOSTCFLAGS? Regards, Arnout
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index a2274ee..5d171dd 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -92,9 +92,7 @@ endif UBOOT_MAKE_OPTS += \ CROSS_COMPILE="$(TARGET_CROSS)" \ - ARCH=$(UBOOT_ARCH) \ - HOSTCFLAGS="$(HOST_CFLAGS)" \ - HOSTLDFLAGS="$(HOST_LDFLAGS)" + ARCH=$(UBOOT_ARCH) ifeq ($(BR2_TARGET_UBOOT_NEEDS_DTC),y) UBOOT_DEPENDENCIES += host-dtc But this breaks the build fir the i.MX2[38] targets (freescale_imx28evk). A better workaround would be something like this: diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index a2274ee..5b7663d 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -92,9 +92,15 @@ endif UBOOT_MAKE_OPTS += \ CROSS_COMPILE="$(TARGET_CROSS)" \ - ARCH=$(UBOOT_ARCH) \ + ARCH=$(UBOOT_ARCH) + +ifeq ($(or $(BR2_TARGET_UBOOT_FORMAT_SB),$(BR2_TARGET_UBOOT_FORMAT_SD),$(BR2_TARGET_UBOOT_FORMAT_NAND)),y) +# Pass HOST_CFLAGS and HOST_LDFLAGS to the U-Boot build process so the right +# -I/-L options will be used to find OpenSSL. +UBOOT_MAKE_OPTS += \ HOSTCFLAGS="$(HOST_CFLAGS)" \ HOSTLDFLAGS="$(HOST_LDFLAGS)" +endif ifeq ($(BR2_TARGET_UBOOT_NEEDS_DTC),y) UBOOT_DEPENDENCIES += host-dtc