U-Boot-V2: ARM: Makefile cleaup
Menon
PATCH 1/2 U-Boot-V2: ARM: Makefile cleaup
Does the following:
* Remove duplicated global flags -Wall, -nostdinc, -fno-common
* Introduce -ffixed-r8 for CFLAGS
* Add AFLAGS
arch/arm/Makefile +5 -4
@@ -1,6 +1,6 @@ -CPPFLAGS += -fno-builtin -ffreestanding -nostdinc -Wall \ - -pipe -D __ARM__ -fno-strict-aliasing +CPPFLAGS += -fno-builtin -ffreestanding\ + -pipe -D__ARM__ machine-$(CONFIG_ARCH_IMX) := imx
@@ -19,8 +19,9 @@ TEXT_BASE = $(CONFIG_TEXT_BASE) -CPPFLAGS += -mabi=apcs-gnu -DTEXT_BASE=$(TEXT_BASE) -P -CFLAGS := -fno-common -msoft-float -Os +CPPFLAGS += -ffixed-r8 -mabi=apcs-gnu -DTEXT_BASE=$(TEXT_BASE) -P +CFLAGS += -msoft-float -Os +AFLAGS += -msoft-float -Os ifeq ($(incdir-y),) incdir-y := $(machine-y)
PATCH 1/2 U-Boot-V2: ARM: Makefile cleaup
Quoted 3 lines · Nishanth
Does the following:
* Remove duplicated global flags -Wall, -nostdinc, -fno-common
* Introduce -ffixed-r8 for CFLAGS
Why? U-Boot v1 uses to keep a pointer to global data here, but in v2 there is no global data anymore.
Sascha
Signature · 4 lines
Pengutronix e.K. - Linux Solutions for Science and Industry ----------------------------------------------------------- Kontakt-Informationen finden Sie im Header dieser Mail oder auf der Webseite -> http://www.pengutronix.de/impressum/ <-
Menon
PATCH 1/2 U-Boot-V2: ARM: Makefile cleaup
Sascha,
Quoted 11 lines
-----Original Message-----
From: Sascha Hauer [mailto:s.hauer at pengutronix.de]
Sent: Monday, May 12, 2008 8:22 AM
To: Menon, Nishanth
Cc: u-boot-users at lists.sourceforge.net
Subject: Re: [Patch 1/2] U-Boot-V2: ARM:MakefilecleaupQuoted 1 line
* Introduce -ffixed-r8 for CFLAGS
Why? U-Boot v1 uses to keep a pointer to global data here, but in v2 there is no global data anymore.
Yes, you are right. I missed the fact that fixed r8 does not make sense anymore. Is the rest of the patch fine? Regards,
Nishanth Menon
Menon
PATCH 1/2 U-Boot-V2: ARM: Makefile cleaup
In reply to Sascha HauerQuoted 15 lines
-----Original Message-----
From: Menon, Nishanth
Sent: Monday, May 12, 2008 8:25 AM
To: 'Sascha Hauer'
Cc: u-boot-users at lists.sourceforge.net
Subject: RE: [Patch 1/2] U-Boot-V2: ARM:MakefilecleaupSascha,
Quoted 7 lines
-----Original Message-----
From: Sascha Hauer [mailto:s.hauer at pengutronix.de]
Sent: Monday, May 12, 2008 8:22 AM
To: Menon, Nishanth
Cc: u-boot-users at lists.sourceforge.net
Subject: Re: [Patch 1/2] U-Boot-V2: ARM:Makefilecleaup
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
* Introduce -ffixed-r8 for CFLAGS
Why? U-Boot v1 uses to keep a pointer to global data here, but in v2 there is no global data anymore.
Yes, you are right. I missed the fact that fixed r8 does not make sense anymore. Is the rest of the patch fine?
Regards,
Nishanth Menon
Rev 2 of the patch.
arch/arm/Makefile +4 -3
@@ -1,6 +1,6 @@ -CPPFLAGS += -fno-builtin -ffreestanding -nostdinc -Wall \ - -pipe -D __ARM__ -fno-strict-aliasing +CPPFLAGS += -fno-builtin -ffreestanding\ + -pipe -D__ARM__ machine-$(CONFIG_ARCH_IMX) := imx
@@ -20,7 +20,8 @@ TEXT_BASE = $(CONFIG_TEXT_BASE) CPPFLAGS += -mabi=apcs-gnu -DTEXT_BASE=$(TEXT_BASE) -P -CFLAGS := -fno-common -msoft-float -Os +CFLAGS += -msoft-float -Os +AFLAGS += -msoft-float -Os ifeq ($(incdir-y),) incdir-y := $(machine-y)
PATCH 1/2 U-Boot-V2: ARM: Makefile cleaup
In reply to MenonQuoted 21 lines · Nishanth
Does the following:
* Remove duplicated global flags -Wall, -nostdinc, -fno-common
* Introduce -ffixed-r8 for CFLAGS
* Add AFLAGSSigned-off-by Nishanth Menon <[email protected]>Index: u-boot-v2.git/arch/arm/Makefile
===================================================================arch/arm/Makefile +2
-2@@ -1,6 +1,6 @@ -CPPFLAGS += -fno-builtin -ffreestanding -nostdinc -Wall \ - -pipe -D __ARM__ -fno-strict-aliasing +CPPFLAGS += -fno-builtin -ffreestanding\ + -pipe -D__ARM__ machine-$(CONFIG_ARCH_IMX) := imx
arch/arm/Makefile line 24
Quoted 8 lines
arch/arm/Makefile +3
-2@@ -19,8 +19,9 @@ TEXT_BASE = $(CONFIG_TEXT_BASE) -CPPFLAGS += -mabi=apcs-gnu -DTEXT_BASE=$(TEXT_BASE) -P -CFLAGS := -fno-common -msoft-float -Os +CPPFLAGS += -ffixed-r8 -mabi=apcs-gnu -DTEXT_BASE=$(TEXT_BASE) -P +CFLAGS += -msoft-float -Os +AFLAGS += -msoft-float -Os
Assemblers don't know about soft-float and size optimisation. This patch only works because AFLAGS is unused. Besides, you shouldn't use floating point througout U-Boot anyway.
Sascha
Signature · 4 lines
Pengutronix e.K. - Linux Solutions for Science and Industry ----------------------------------------------------------- Kontakt-Informationen finden Sie im Header dieser Mail oder auf der Webseite -> http://www.pengutronix.de/impressum/ <-
Menon
PATCH 1/2 U-Boot-V2: ARM: Makefile cleaup
Sascha,
Quoted 7 lines
-----Original Message-----
From: Sascha Hauer [mailto:s.hauer at pengutronix.de]
Sent: Monday, May 12, 2008 8:44 AM
To: Menon, Nishanth
Cc: u-boot-users at lists.sourceforge.net
Subject: Re: [Patch 1/2] U-Boot-V2: ARM:Makefilecleaup
Quoted 5 lines
Quoted 1 line
+AFLAGS += -msoft-float -Os
Assemblers don't know about soft-float and size optimisation. This patch only works because AFLAGS is unused. Besides, you shouldn't use floating point througout U-Boot anyway.
I agree on the -Os being unused. On -msoft-float without the same in AFLAGS:
arm-none-eabi-ld: ERROR: arch/arm/mach-omap/omap3_clock.o uses hardware FP, whereas arch/arm/mach-omap/built-in.o uses software FP
arm-none-eabi-ld: failed to merge target specific data of file arch/arm/mach-omap/omap3_clock.o
make[1]: *** [arch/arm/mach-omap/built-in.o] Error 1
make: *** [arch/arm/mach-omap] Error 2
Ideally the gcc flags should be set per platform -> Linux kernel has a neat manner of doing it. We can move ahead with h/w FP as long as we allow flags to be set for platform. Currently though, if C files are compiled with -msoft-float, so should AFLAGS. Probably we need some new management of compiler flags?
Regards,
Nishanth Menon
PATCH 1/2 U-Boot-V2: ARM: Makefile cleaup
Quoted 10 lines · Nishanth
Sascha,
Quoted 9 lines
-----Original Message-----
From: Sascha Hauer [mailto:s.hauer at pengutronix.de]
Sent: Monday, May 12, 2008 8:44 AM
To: Menon, Nishanth
Cc: u-boot-users at lists.sourceforge.net
Subject: Re: [Patch 1/2] U-Boot-V2: ARM:MakefilecleaupQuoted 1 line
+AFLAGS += -msoft-float -Os
Quoted 8 lines
Quoted 3 lines
Assemblers don't know about soft-float and size optimisation. This patch only works because AFLAGS is unused. Besides, you shouldn't use floating point througout U-Boot anyway.
I agree on the -Os being unused. On -msoft-float without the same in AFLAGS:
arm-none-eabi-ld: ERROR:arch/arm/mach-omap/omap3_clock.ouses hardware FP, whereasarch/arm/mach-omap/built-in.ouses software FP
arm-none-eabi-ld: failed to merge target specific data of filearch/arm/mach-omap/omap3_clock.o
make[1]: *** [arch/arm/mach-omap/built-in.o] Error 1
make: *** [arch/arm/mach-omap] Error 2
Hm, just tried with a hardfloat toolchain, I get the same error. I'm wondering why we have a -msoft-float in CFLAGS anyway. Removing it works for hard- and softfloat toolchains and shouldn't make a difference.
Quoted 2 lines
Ideally the gcc flags should be set per platform -> Linux kernel has a neat manner of doing it. We can move ahead with h/w FP as long as we allow flags to be set for platform. Currently though, if C files are compiled with -msoft-float, so should AFLAGS. Probably we need some new management of compiler flags?
Not exactly new, because I've taken much from the linux kernel. But they sure could use a general cleanup.
Sascha
Signature · 4 lines
Pengutronix e.K. - Linux Solutions for Science and Industry ----------------------------------------------------------- Kontakt-Informationen finden Sie im Header dieser Mail oder auf der Webseite -> http://www.pengutronix.de/impressum/ <-