* [PATCH] scripts: add softfp support @ 2011-10-19 2:29 Michael Hope 2011-10-19 21:02 ` Yann E. MORIN 0 siblings, 1 reply; 23+ messages in thread From: Michael Hope @ 2011-10-19 2:29 UTC (permalink / raw) To: Yann E. MORIN; +Cc: crossgcc # HG changeset patch # User Michael Hope <michael.hope@linaro.org> # Date 1318991252 -46800 # Node ID a31d097e28cd73d07a5484129929a500b4d58efa # Parent a32156bd31c0d395e8d346431b123a7d2caa14cd scripts: add softfp support ARM compilers can be built for soft float (software only, floats in core registers), hard float (uses floating point instructions, floats in FPU registers), or the half-way house softfp (uses floating point instructions, floats in core registers). Add support for softfp cross compilers to the GCC and GLIBC configuration. Needed for Ubuntu and other distros that are softfp. Signed-off-by: Michael Hope <michael.hope@linaro.org> diff -r a32156bd31c0 -r a31d097e28cd config/target.in --- a/config/target.in Sun Oct 16 17:51:42 2011 +0200 +++ b/config/target.in Wed Oct 19 15:27:32 2011 +1300 @@ -271,6 +271,22 @@ If your processor has no FPU, then you most probably want this, as it is faster than emulating the FPU in the kernel. +config ARCH_FLOAT_SOFTFP + bool + prompt "softfp" + depends on ARCH_arm + help + Emit hardware floating point opcodes but use the software + floating point calling convention. + + Architectures such as ARM use different registers for passing + floating point values depending on if they're in software mode + or hardware mode. softfp emits FPU instructions but uses the + software FP calling convention allowing softfp code to + interoperate with legacy software only code. + + If in doubt, use 'software' or 'hardware' mode instead. + endchoice config TARGET_CFLAGS diff -r a32156bd31c0 -r a31d097e28cd scripts/build/libc/glibc-eglibc.sh-common --- a/scripts/build/libc/glibc-eglibc.sh-common Sun Oct 16 17:51:42 2011 +0200 +++ b/scripts/build/libc/glibc-eglibc.sh-common Wed Oct 19 15:27:32 2011 +1300 @@ -132,9 +132,10 @@ *) extra_config+=("--disable-shared");; esac - case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in - y,) extra_config+=("--with-fp");; - ,y) extra_config+=("--without-fp");; + case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW},${CT_ARCH_FLOAT_SOFTFP}" in + y,,) extra_config+=("--with-fp");; + ,y,) extra_config+=("--without-fp");; + ,,y) extra_config+=("--with-fp");; esac if [ "${CT_LIBC_DISABLE_VERSIONING}" = "y" ]; then diff -r a32156bd31c0 -r a31d097e28cd scripts/functions --- a/scripts/functions Sun Oct 16 17:51:42 2011 +0200 +++ b/scripts/functions Wed Oct 19 15:27:32 2011 +1300 @@ -984,6 +984,7 @@ [ "${CT_ARCH_TUNE}" ] && { CT_ARCH_TUNE_CFLAG="-mtune=${CT_ARCH_TUNE}"; CT_ARCH_WITH_TUNE="--with-tune=${CT_ARCH_TUNE}"; } [ "${CT_ARCH_FPU}" ] && { CT_ARCH_FPU_CFLAG="-mfpu=${CT_ARCH_FPU}"; CT_ARCH_WITH_FPU="--with-fpu=${CT_ARCH_FPU}"; } [ "${CT_ARCH_FLOAT_SW}" ] && { CT_ARCH_FLOAT_CFLAG="-msoft-float"; CT_ARCH_WITH_FLOAT="--with-float=soft"; } + [ "${CT_ARCH_FLOAT_SOFTFP}" ] && { CT_ARCH_FLOAT_CFLAG="-mfloat-abi=softfp"; CT_ARCH_WITH_FLOAT="--with-float=softfp"; } # Build the default kernel tuple part CT_TARGET_KERNEL="${CT_KERNEL}" -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] scripts: add softfp support 2011-10-19 2:29 [PATCH] scripts: add softfp support Michael Hope @ 2011-10-19 21:02 ` Yann E. MORIN 2011-10-20 0:30 ` Michael Hope 2011-10-21 2:17 ` Michael Hope 0 siblings, 2 replies; 23+ messages in thread From: Yann E. MORIN @ 2011-10-19 21:02 UTC (permalink / raw) To: Michael Hope; +Cc: crossgcc Michael, All, On Wednesday 19 October 2011 04:29:20 Michael Hope wrote: > # HG changeset patch > # User Michael Hope <michael.hope@linaro.org> > # Date 1318991252 -46800 > # Node ID a31d097e28cd73d07a5484129929a500b4d58efa > # Parent a32156bd31c0d395e8d346431b123a7d2caa14cd > scripts: add softfp support > > ARM compilers can be built for soft float (software only, floats in > core registers), hard float (uses floating point instructions, floats > in FPU registers), or the half-way house softfp (uses floating point > instructions, floats in core registers). Feature definitely a nice addition, but too close to the release to add it now (which reminds me I should document the release plan on the website...). FYI, it's a release every three months, with about a 15-day slack before, used to stabilise the stuff. Next release is due by October the 31st, so we just entered the 15-day delay... I was thinking about cutting the release branch ahead of time, but handling both the relase and the devel at the same time is a bit complicated in my head, and does colide a bit on the schedule... I'd like to try, but this release is special: it also colides with the Prague events. Probably I'll do it for the next release (Feb`12)... > Add support for softfp cross compilers to the GCC and GLIBC > configuration. Needed for Ubuntu and other distros that are softfp. What about uClibc? How will it cope with softfp? > Signed-off-by: Michael Hope <michael.hope@linaro.org> > > diff -r a32156bd31c0 -r a31d097e28cd config/target.in > --- a/config/target.in Sun Oct 16 17:51:42 2011 +0200 > +++ b/config/target.in Wed Oct 19 15:27:32 2011 +1300 > @@ -271,6 +271,22 @@ > If your processor has no FPU, then you most probably want this, as it > is faster than emulating the FPU in the kernel. > > +config ARCH_FLOAT_SOFTFP I'm a bit reluctant at adding an architecture-specific option to this generic file. Currently, all arch options are in the related arch file. However, I agreee that there is no easy way to nicely handle that with the current infrastructure... :-/ *But* I recall a similar approach a few months back... It seemed that ARM is not the only architecture that support softfp. Seems PPC also uses it. So: > + bool > + prompt "softfp" > + depends on ARCH_arm - this arch-specific "depends on" should go away - and either we keep the option un-protected, or we hide it behind ARCH_SUPPORT_SOFTFP (or the like) which is set by archs that support it. > + help > + Emit hardware floating point opcodes but use the software > + floating point calling convention. > + > + Architectures such as ARM use different registers for passing > + floating point values depending on if they're in software mode > + or hardware mode. softfp emits FPU instructions but uses the > + software FP calling convention allowing softfp code to > + interoperate with legacy software only code. > + > + If in doubt, use 'software' or 'hardware' mode instead. > + > endchoice > > config TARGET_CFLAGS > diff -r a32156bd31c0 -r a31d097e28cd scripts/build/libc/glibc-eglibc.sh-common > --- a/scripts/build/libc/glibc-eglibc.sh-common Sun Oct 16 17:51:42 2011 +0200 > +++ b/scripts/build/libc/glibc-eglibc.sh-common Wed Oct 19 15:27:32 2011 +1300 > @@ -132,9 +132,10 @@ > *) extra_config+=("--disable-shared");; > esac > > - case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in > - y,) extra_config+=("--with-fp");; > - ,y) extra_config+=("--without-fp");; > + case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW},${CT_ARCH_FLOAT_SOFTFP}" in > + y,,) extra_config+=("--with-fp");; > + ,y,) extra_config+=("--without-fp");; > + ,,y) extra_config+=("--with-fp");; > esac Argh!... This is starting to be unreadable... :-/ config ARCH_FLOAT string default "hard" if ARCH_FLOAT_HW default "soft" if ARCH_FLOAT_SW default "softfp" if ARCH_FLOAT_SOFTFP Then: case "${CT_ARCH_FLOAT}" in hard) ...;; soft) ...;; softfp) ...;; esac I'll do it. > if [ "${CT_LIBC_DISABLE_VERSIONING}" = "y" ]; then > diff -r a32156bd31c0 -r a31d097e28cd scripts/functions > --- a/scripts/functions Sun Oct 16 17:51:42 2011 +0200 > +++ b/scripts/functions Wed Oct 19 15:27:32 2011 +1300 > @@ -984,6 +984,7 @@ > [ "${CT_ARCH_TUNE}" ] && { CT_ARCH_TUNE_CFLAG="-mtune=${CT_ARCH_TUNE}"; CT_ARCH_WITH_TUNE="--with-tune=${CT_ARCH_TUNE}"; } > [ "${CT_ARCH_FPU}" ] && { CT_ARCH_FPU_CFLAG="-mfpu=${CT_ARCH_FPU}"; CT_ARCH_WITH_FPU="--with-fpu=${CT_ARCH_FPU}"; } > [ "${CT_ARCH_FLOAT_SW}" ] && { CT_ARCH_FLOAT_CFLAG="-msoft-float"; CT_ARCH_WITH_FLOAT="--with-float=soft"; } > + [ "${CT_ARCH_FLOAT_SOFTFP}" ] && { CT_ARCH_FLOAT_CFLAG="-mfloat-abi=softfp"; CT_ARCH_WITH_FLOAT="--with-float=softfp"; } And the last time this came up, it was pointed that CT_ARCH_FLOAT_HW did force neither -hard-float not --with-float=hard I'll look at it... > # Build the default kernel tuple part > CT_TARGET_KERNEL="${CT_KERNEL}" Can we sit on this for now, and revisit after the release? Thank you! Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] scripts: add softfp support 2011-10-19 21:02 ` Yann E. MORIN @ 2011-10-20 0:30 ` Michael Hope 2011-10-21 2:17 ` Michael Hope 1 sibling, 0 replies; 23+ messages in thread From: Michael Hope @ 2011-10-20 0:30 UTC (permalink / raw) To: Yann E. MORIN; +Cc: crossgcc On Thu, Oct 20, 2011 at 10:02 AM, Yann E. MORIN <yann.morin.1998@anciens.enib.fr> wrote: > Michael, All, > > On Wednesday 19 October 2011 04:29:20 Michael Hope wrote: >> # HG changeset patch >> # User Michael Hope <michael.hope@linaro.org> >> # Date 1318991252 -46800 >> # Node ID a31d097e28cd73d07a5484129929a500b4d58efa >> # Parent a32156bd31c0d395e8d346431b123a7d2caa14cd >> scripts: add softfp support >> >> ARM compilers can be built for soft float (software only, floats in >> core registers), hard float (uses floating point instructions, floats >> in FPU registers), or the half-way house softfp (uses floating point >> instructions, floats in core registers). > > Feature definitely a nice addition, but too close to the release to > add it now (which reminds me I should document the release plan on > the website...). FYI, it's a release every three months, with about > a 15-day slack before, used to stabilise the stuff. Next release is > due by October the 31st, so we just entered the 15-day delay... > > I was thinking about cutting the release branch ahead of time, but > handling both the relase and the devel at the same time is a bit > complicated in my head, and does colide a bit on the schedule... > I'd like to try, but this release is special: it also colides with > the Prague events. Probably I'll do it for the next release (Feb`12)... All good. I'll keep it local for now. >> Add support for softfp cross compilers to the GCC and GLIBC >> configuration. Needed for Ubuntu and other distros that are softfp. > > What about uClibc? How will it cope with softfp? I'm not sure. I've had a poke about in buildroot and it has support for soft float and hard float but no softfp. It seems to tie the FPU into the calling convention like crosstool-NG currently does so hard float == has VFP. I can play with this more next week. >> Signed-off-by: Michael Hope <michael.hope@linaro.org> >> >> diff -r a32156bd31c0 -r a31d097e28cd config/target.in >> --- a/config/target.in Sun Oct 16 17:51:42 2011 +0200 >> +++ b/config/target.in Wed Oct 19 15:27:32 2011 +1300 >> @@ -271,6 +271,22 @@ >> If your processor has no FPU, then you most probably want this, as it >> is faster than emulating the FPU in the kernel. >> >> +config ARCH_FLOAT_SOFTFP > > I'm a bit reluctant at adding an architecture-specific option to this > generic file. Currently, all arch options are in the related arch file. > > However, I agreee that there is no easy way to nicely handle that with > the current infrastructure... :-/ > > *But* I recall a similar approach a few months back... It seemed that ARM > is not the only architecture that support softfp. Seems PPC also uses it. > So: > >> + bool >> + prompt "softfp" >> + depends on ARCH_arm > > - this arch-specific "depends on" should go away > - and either we keep the option un-protected, or we hide it behind > ARCH_SUPPORT_SOFTFP (or the like) which is set by archs that > support it. OK. >> + help >> + Emit hardware floating point opcodes but use the software >> + floating point calling convention. >> + >> + Architectures such as ARM use different registers for passing >> + floating point values depending on if they're in software mode >> + or hardware mode. softfp emits FPU instructions but uses the >> + software FP calling convention allowing softfp code to >> + interoperate with legacy software only code. >> + >> + If in doubt, use 'software' or 'hardware' mode instead. >> + >> endchoice >> >> config TARGET_CFLAGS >> diff -r a32156bd31c0 -r a31d097e28cd scripts/build/libc/glibc-eglibc.sh-common >> --- a/scripts/build/libc/glibc-eglibc.sh-common Sun Oct 16 17:51:42 2011 +0200 >> +++ b/scripts/build/libc/glibc-eglibc.sh-common Wed Oct 19 15:27:32 2011 +1300 >> @@ -132,9 +132,10 @@ >> *) extra_config+=("--disable-shared");; >> esac >> >> - case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in >> - y,) extra_config+=("--with-fp");; >> - ,y) extra_config+=("--without-fp");; >> + case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW},${CT_ARCH_FLOAT_SOFTFP}" in >> + y,,) extra_config+=("--with-fp");; >> + ,y,) extra_config+=("--without-fp");; >> + ,,y) extra_config+=("--with-fp");; >> esac > > Argh!... This is starting to be unreadable... :-/ > > config ARCH_FLOAT > string > default "hard" if ARCH_FLOAT_HW > default "soft" if ARCH_FLOAT_SW > default "softfp" if ARCH_FLOAT_SOFTFP > > Then: > case "${CT_ARCH_FLOAT}" in > hard) ...;; > soft) ...;; > softfp) ...;; > esac > > I'll do it. OK. >> if [ "${CT_LIBC_DISABLE_VERSIONING}" = "y" ]; then >> diff -r a32156bd31c0 -r a31d097e28cd scripts/functions >> --- a/scripts/functions Sun Oct 16 17:51:42 2011 +0200 >> +++ b/scripts/functions Wed Oct 19 15:27:32 2011 +1300 >> @@ -984,6 +984,7 @@ >> [ "${CT_ARCH_TUNE}" ] && { CT_ARCH_TUNE_CFLAG="-mtune=${CT_ARCH_TUNE}"; CT_ARCH_WITH_TUNE="--with-tune=${CT_ARCH_TUNE}"; } >> [ "${CT_ARCH_FPU}" ] && { CT_ARCH_FPU_CFLAG="-mfpu=${CT_ARCH_FPU}"; CT_ARCH_WITH_FPU="--with-fpu=${CT_ARCH_FPU}"; } >> [ "${CT_ARCH_FLOAT_SW}" ] && { CT_ARCH_FLOAT_CFLAG="-msoft-float"; CT_ARCH_WITH_FLOAT="--with-float=soft"; } >> + [ "${CT_ARCH_FLOAT_SOFTFP}" ] && { CT_ARCH_FLOAT_CFLAG="-mfloat-abi=softfp"; CT_ARCH_WITH_FLOAT="--with-float=softfp"; } > > And the last time this came up, it was pointed that CT_ARCH_FLOAT_HW did > force neither -hard-float not --with-float=hard > > I'll look at it... OK. > Can we sit on this for now, and revisit after the release? Sure. I'll keep it locally. -- Michael -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] scripts: add softfp support 2011-10-19 21:02 ` Yann E. MORIN 2011-10-20 0:30 ` Michael Hope @ 2011-10-21 2:17 ` Michael Hope 2011-11-01 23:42 ` [PATCH 0 of 4] Adding " Yann E. MORIN 1 sibling, 1 reply; 23+ messages in thread From: Michael Hope @ 2011-10-21 2:17 UTC (permalink / raw) To: Yann E. MORIN; +Cc: crossgcc On 20/10/11 10:02, Yann E. MORIN wrote: > Michael, All, > > On Wednesday 19 October 2011 04:29:20 Michael Hope wrote: >> # HG changeset patch >> # User Michael Hope<michael.hope@linaro.org> >> # Date 1318991252 -46800 >> # Node ID a31d097e28cd73d07a5484129929a500b4d58efa >> # Parent a32156bd31c0d395e8d346431b123a7d2caa14cd >> scripts: add softfp support >> >> ARM compilers can be built for soft float (software only, floats in >> core registers), hard float (uses floating point instructions, floats >> in FPU registers), or the half-way house softfp (uses floating point >> instructions, floats in core registers). > > Feature definitely a nice addition, but too close to the release to > add it now (which reminds me I should document the release plan on > the website...). FYI, it's a release every three months, with about > a 15-day slack before, used to stabilise the stuff. Next release is > due by October the 31st, so we just entered the 15-day delay... > > I was thinking about cutting the release branch ahead of time, but > handling both the relase and the devel at the same time is a bit > complicated in my head, and does colide a bit on the schedule... > I'd like to try, but this release is special: it also colides with > the Prague events. Probably I'll do it for the next release (Feb`12)... > >> Add support for softfp cross compilers to the GCC and GLIBC >> configuration. Needed for Ubuntu and other distros that are softfp. > > What about uClibc? How will it cope with softfp? > >> Signed-off-by: Michael Hope<michael.hope@linaro.org> >> >> diff -r a32156bd31c0 -r a31d097e28cd config/target.in >> --- a/config/target.in Sun Oct 16 17:51:42 2011 +0200 >> +++ b/config/target.in Wed Oct 19 15:27:32 2011 +1300 >> @@ -271,6 +271,22 @@ >> If your processor has no FPU, then you most probably want this, as it >> is faster than emulating the FPU in the kernel. >> >> +config ARCH_FLOAT_SOFTFP > > I'm a bit reluctant at adding an architecture-specific option to this > generic file. Currently, all arch options are in the related arch file. > > However, I agreee that there is no easy way to nicely handle that with > the current infrastructure... :-/ > > *But* I recall a similar approach a few months back... It seemed that ARM > is not the only architecture that support softfp. Seems PPC also uses it. > So: > >> + bool >> + prompt "softfp" >> + depends on ARCH_arm > > - this arch-specific "depends on" should go away > - and either we keep the option un-protected, or we hide it behind > ARCH_SUPPORT_SOFTFP (or the like) which is set by archs that > support it. > >> + help >> + Emit hardware floating point opcodes but use the software >> + floating point calling convention. >> + >> + Architectures such as ARM use different registers for passing >> + floating point values depending on if they're in software mode >> + or hardware mode. softfp emits FPU instructions but uses the >> + software FP calling convention allowing softfp code to >> + interoperate with legacy software only code. >> + >> + If in doubt, use 'software' or 'hardware' mode instead. >> + >> endchoice >> >> config TARGET_CFLAGS >> diff -r a32156bd31c0 -r a31d097e28cd scripts/build/libc/glibc-eglibc.sh-common >> --- a/scripts/build/libc/glibc-eglibc.sh-common Sun Oct 16 17:51:42 2011 +0200 >> +++ b/scripts/build/libc/glibc-eglibc.sh-common Wed Oct 19 15:27:32 2011 +1300 >> @@ -132,9 +132,10 @@ >> *) extra_config+=("--disable-shared");; >> esac >> >> - case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in >> - y,) extra_config+=("--with-fp");; >> - ,y) extra_config+=("--without-fp");; >> + case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW},${CT_ARCH_FLOAT_SOFTFP}" in >> + y,,) extra_config+=("--with-fp");; >> + ,y,) extra_config+=("--without-fp");; >> + ,,y) extra_config+=("--with-fp");; >> esac > > Argh!... This is starting to be unreadable... :-/ > > config ARCH_FLOAT > string > default "hard" if ARCH_FLOAT_HW > default "soft" if ARCH_FLOAT_SW > default "softfp" if ARCH_FLOAT_SOFTFP > > Then: > case "${CT_ARCH_FLOAT}" in > hard) ...;; > soft) ...;; > softfp) ...;; > esac > > I'll do it. > >> if [ "${CT_LIBC_DISABLE_VERSIONING}" = "y" ]; then >> diff -r a32156bd31c0 -r a31d097e28cd scripts/functions >> --- a/scripts/functions Sun Oct 16 17:51:42 2011 +0200 >> +++ b/scripts/functions Wed Oct 19 15:27:32 2011 +1300 >> @@ -984,6 +984,7 @@ >> [ "${CT_ARCH_TUNE}" ]&& { CT_ARCH_TUNE_CFLAG="-mtune=${CT_ARCH_TUNE}"; CT_ARCH_WITH_TUNE="--with-tune=${CT_ARCH_TUNE}"; } >> [ "${CT_ARCH_FPU}" ]&& { CT_ARCH_FPU_CFLAG="-mfpu=${CT_ARCH_FPU}"; CT_ARCH_WITH_FPU="--with-fpu=${CT_ARCH_FPU}"; } >> [ "${CT_ARCH_FLOAT_SW}" ]&& { CT_ARCH_FLOAT_CFLAG="-msoft-float"; CT_ARCH_WITH_FLOAT="--with-float=soft"; } >> + [ "${CT_ARCH_FLOAT_SOFTFP}" ]&& { CT_ARCH_FLOAT_CFLAG="-mfloat-abi=softfp"; CT_ARCH_WITH_FLOAT="--with-float=softfp"; } > > And the last time this came up, it was pointed that CT_ARCH_FLOAT_HW did > force neither -hard-float not --with-float=hard > > I'll look at it... > >> # Build the default kernel tuple part >> CT_TARGET_KERNEL="${CT_KERNEL}" > > Can we sit on this for now, and revisit after the release? I'll keep it locally. I'll stop sending new features until after the release. Here's an updated version. Still no uClibc support though... diff --git a/config/arch/arm.in b/config/arch/arm.in index 4b96335..12016fd 100644 --- a/config/arch/arm.in +++ b/config/arch/arm.in @@ -10,6 +10,7 @@ ## select ARCH_SUPPORT_CPU ## select ARCH_SUPPORT_TUNE ## select ARCH_SUPPORT_FPU +## select ARCH_SUPPORT_SOFTFP ## ## help The ARM architecture, as defined by: ## help http://www.arm.com/ diff --git a/config/target.in b/config/target.in index 8282a9d..6514e3e 100644 --- a/config/target.in +++ b/config/target.in @@ -15,6 +15,7 @@ config ARCH_SUPPORT_CPU config ARCH_SUPPORT_TUNE config ARCH_SUPPORT_FPU +config ARCH_SUPPORT_SOFTFP config ARCH_DEFAULT_HAS_MMU config ARCH_DEFAULT_BE @@ -144,6 +145,9 @@ config ARCH_SUPPORT_FPU bool +config ARCH_SUPPORT_SOFTFP + bool + config ARCH_ARCH string prompt "Architecture level" @@ -271,6 +275,22 @@ If your processor has no FPU, then you most probably want this, as it is faster than emulating the FPU in the kernel. +config ARCH_FLOAT_SOFTFP + bool + prompt "softfp" + depends on ARCH_SUPPORT_SOFTFP + help + Emit hardware floating point opcodes but use the software + floating point calling convention. + + Architectures such as ARM use different registers for passing + floating point values depending on if they're in software mode + or hardware mode. softfp emits FPU instructions but uses the + software FP calling convention allowing softfp code to + interoperate with legacy software only code. + + If in doubt, use 'software' or 'hardware' mode instead. + endchoice config TARGET_CFLAGS @@ -296,6 +316,12 @@ Leave blank if you don't know better. +config ARCH_FLOAT + string + default "hard" if ARCH_FLOAT_HW + default "soft" if ARCH_FLOAT_SW + default "softfp" if ARCH_FLOAT_SOFTFP + source "config.gen/arch.in.2" endmenu diff --git a/scripts/functions b/scripts/functions index a8696fe..2f81073 100644 --- a/scripts/functions +++ b/scripts/functions @@ -983,7 +983,12 @@ [ "${CT_ARCH_CPU}" ] && { CT_ARCH_CPU_CFLAG="-mcpu=${CT_ARCH_CPU}"; CT_ARCH_WITH_CPU="--with-cpu=${CT_ARCH_CPU}"; } [ "${CT_ARCH_TUNE}" ] && { CT_ARCH_TUNE_CFLAG="-mtune=${CT_ARCH_TUNE}"; CT_ARCH_WITH_TUNE="--with-tune=${CT_ARCH_TUNE}"; } [ "${CT_ARCH_FPU}" ] && { CT_ARCH_FPU_CFLAG="-mfpu=${CT_ARCH_FPU}"; CT_ARCH_WITH_FPU="--with-fpu=${CT_ARCH_FPU}"; } - [ "${CT_ARCH_FLOAT_SW}" ] && { CT_ARCH_FLOAT_CFLAG="-msoft-float"; CT_ARCH_WITH_FLOAT="--with-float=soft"; } + + case "${CT_ARCH_FLOAT}" in + hard) CT_ARCH_FLOAT_CFLAG="-mhard-float"; CT_ARCH_WITH_FLOAT="--with-float=hard";; + soft) CT_ARCH_FLOAT_CFLAG="-msoft-float"; CT_ARCH_WITH_FLOAT="--with-float=soft";; + softfp) CT_ARCH_FLOAT_CFLAG="-mfloat-abi=softfp"; CT_ARCH_WITH_FLOAT="--with-float=softfp";; + esac # Build the default kernel tuple part CT_TARGET_KERNEL="${CT_KERNEL}" diff --git a/scripts/build/libc/glibc-eglibc.sh-common b/scripts/build/libc/glibc-eglibc.sh-common index 66b26f6..ea0e9b3 100644 --- a/scripts/build/libc/glibc-eglibc.sh-common +++ b/scripts/build/libc/glibc-eglibc.sh-common @@ -132,9 +132,10 @@ *) extra_config+=("--disable-shared");; esac - case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in - y,) extra_config+=("--with-fp");; - ,y) extra_config+=("--without-fp");; + case "${CT_ARCH_FLOAT}" in + hard) extra_config+=("--with-fp");; + soft) extra_config+=("--without-fp");; + softfp) extra_config+=("--with-fp");; esac if [ "${CT_LIBC_DISABLE_VERSIONING}" = "y" ]; then -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 0 of 4] Adding softfp support 2011-10-21 2:17 ` Michael Hope @ 2011-11-01 23:42 ` Yann E. MORIN 2011-11-01 23:42 ` [PATCH 1 of 4] scripts: introduce float type as a string Yann E. MORIN ` (5 more replies) 0 siblings, 6 replies; 23+ messages in thread From: Yann E. MORIN @ 2011-11-01 23:42 UTC (permalink / raw) To: crossgcc; +Cc: Michael Hope Michael, All, I believe there really were four changes in your original patch, so I did split it up into the following series: [PATCH 1 of 4] scripts: introduce float type as a string [PATCH 2 of 4] scripts: use the hardfloat option to set configure and CFLAGS [PATCH 3 of 4] arch: add softfp support [PATCH 4 of 4] arch/arm: ARM supports the softfp convention I kept your SoB lines in the resulting series, as well as you as the author, because all I really did was just split the patch (plus a very light cosmetic change here and there), so you should get full credit. However, I still would like your approval before I definitely commit this series, in case you have further comments on it. Thank you again! Regards, Yann E. MORIN. -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 1 of 4] scripts: introduce float type as a string 2011-11-01 23:42 ` [PATCH 0 of 4] Adding " Yann E. MORIN @ 2011-11-01 23:42 ` Yann E. MORIN 2011-11-25 12:20 ` Morten Thunberg Svendsen 2011-11-01 23:43 ` [PATCH 3 of 4] arch: add softfp support Yann E. MORIN ` (4 subsequent siblings) 5 siblings, 1 reply; 23+ messages in thread From: Yann E. MORIN @ 2011-11-01 23:42 UTC (permalink / raw) To: crossgcc; +Cc: Michael Hope # HG changeset patch # User Michael Hope <michael.hope@linaro.org> # Date 1318991252 -46800 # Node ID 10f8a6c3847a22617bf36190e477d67aacf6a59b # Parent 3362c64f4b6ce073338ecad68526f63feb47717e scripts: introduce float type as a string With the upcoming softfp support, the case..esac test would become a bit convoluted if it were to test three different booleans. Introduce a new blind string config option that defaults to the selected floating point type used. Signed-off-by: Michael Hope <michael.hope@linaro.org> [yann.morin.1998@anciens.enib.fr: split the original patch] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> diff --git a/config/target.in b/config/target.in --- a/config/target.in +++ b/config/target.in @@ -296,6 +296,11 @@ Leave blank if you don't know better. +config ARCH_FLOAT + string + default "hard" if ARCH_FLOAT_HW + default "soft" if ARCH_FLOAT_SW + source "config.gen/arch.in.2" endmenu diff --git a/scripts/build/libc/glibc-eglibc.sh-common b/scripts/build/libc/glibc-eglibc.sh-common --- a/scripts/build/libc/glibc-eglibc.sh-common +++ b/scripts/build/libc/glibc-eglibc.sh-common @@ -132,9 +132,9 @@ *) extra_config+=("--disable-shared");; esac - case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in - y,) extra_config+=("--with-fp");; - ,y) extra_config+=("--without-fp");; + case "${CT_ARCH_FLOAT}" in + hard) extra_config+=("--with-fp");; + soft) extra_config+=("--without-fp");; esac if [ "${CT_LIBC_DISABLE_VERSIONING}" = "y" ]; then diff --git a/scripts/functions b/scripts/functions --- a/scripts/functions +++ b/scripts/functions @@ -983,7 +983,13 @@ [ "${CT_ARCH_CPU}" ] && { CT_ARCH_CPU_CFLAG="-mcpu=${CT_ARCH_CPU}"; CT_ARCH_WITH_CPU="--with-cpu=${CT_ARCH_CPU}"; } [ "${CT_ARCH_TUNE}" ] && { CT_ARCH_TUNE_CFLAG="-mtune=${CT_ARCH_TUNE}"; CT_ARCH_WITH_TUNE="--with-tune=${CT_ARCH_TUNE}"; } [ "${CT_ARCH_FPU}" ] && { CT_ARCH_FPU_CFLAG="-mfpu=${CT_ARCH_FPU}"; CT_ARCH_WITH_FPU="--with-fpu=${CT_ARCH_FPU}"; } - [ "${CT_ARCH_FLOAT_SW}" ] && { CT_ARCH_FLOAT_CFLAG="-msoft-float"; CT_ARCH_WITH_FLOAT="--with-float=soft"; } + + case "${CT_ARCH_FLOAT}" in + soft) + CT_ARCH_FLOAT_CFLAG="-msoft-float" + CT_ARCH_WITH_FLOAT="--with-float=soft" + ;; + esac # Build the default kernel tuple part CT_TARGET_KERNEL="${CT_KERNEL}" -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 1 of 4] scripts: introduce float type as a string 2011-11-01 23:42 ` [PATCH 1 of 4] scripts: introduce float type as a string Yann E. MORIN @ 2011-11-25 12:20 ` Morten Thunberg Svendsen 2011-11-25 17:13 ` Yann E. MORIN 0 siblings, 1 reply; 23+ messages in thread From: Morten Thunberg Svendsen @ 2011-11-25 12:20 UTC (permalink / raw) To: crossgcc; +Cc: Yann E. MORIN, Michael Hope Hi On Wed, Nov 2, 2011 at 00:39, Yann E. MORIN <yann.morin.1998@anciens.enib.fr> wrote: > + > + case "${CT_ARCH_FLOAT}" in > + soft) > + CT_ARCH_FLOAT_CFLAG="-msoft-float" > + CT_ARCH_WITH_FLOAT="--with-float=soft" > + ;; > + esac x86 do not support the --with-float option or the -msoft/har-float. This seems to fix it for x86 (only arm, mips, powerpc and sparc supports --with-float http://gcc.gnu.org/viewcvs/trunk/gcc/config.gcc?revision=181079&view=markup ) diff -r 258160822e35 scripts/build/arch/x86.sh --- a/scripts/build/arch/x86.sh Wed Nov 23 13:15:27 2011 +0800 +++ b/scripts/build/arch/x86.sh Fri Nov 25 13:07:05 2011 +0100 @@ -20,4 +20,16 @@ *) CT_TARGET_ARCH=i586;; esac fi + + # with-float is not possible for x86 + case "${CT_ARCH_FLOAT}" in + hard) + CT_ARCH_FLOAT_CFLAG= + CT_ARCH_WITH_FLOAT= + ;; + soft) + CT_ARCH_FLOAT_CFLAG="-msoft-float" + CT_ARCH_WITH_FLOAT= + ;; + esac } -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 1 of 4] scripts: introduce float type as a string 2011-11-25 12:20 ` Morten Thunberg Svendsen @ 2011-11-25 17:13 ` Yann E. MORIN 2011-11-25 23:23 ` [PATCH 0 of 6] Fix --with-float= for architectures that do not support it Yann E. MORIN 0 siblings, 1 reply; 23+ messages in thread From: Yann E. MORIN @ 2011-11-25 17:13 UTC (permalink / raw) To: Morten Thunberg Svendsen; +Cc: crossgcc, Michael Hope Morten, Michael, All, On Friday 25 November 2011 13:19:34 Morten Thunberg Svendsen wrote: > x86 do not support the --with-float option or the -msoft/har-float. > This seems to fix it for x86 (only arm, mips, powerpc and sparc > supports --with-float > http://gcc.gnu.org/viewcvs/trunk/gcc/config.gcc?revision=181079&view=markup > ) Ah, that's a good reference. Thanks! > diff -r 258160822e35 scripts/build/arch/x86.sh > --- a/scripts/build/arch/x86.sh Wed Nov 23 13:15:27 2011 +0800 > +++ b/scripts/build/arch/x86.sh Fri Nov 25 13:07:05 2011 +0100 > @@ -20,4 +20,16 @@ > *) CT_TARGET_ARCH=i586;; > esac > fi > + > + # with-float is not possible for x86 > + case "${CT_ARCH_FLOAT}" in > + hard) > + CT_ARCH_FLOAT_CFLAG= > + CT_ARCH_WITH_FLOAT= > + ;; > + soft) > + CT_ARCH_FLOAT_CFLAG="-msoft-float" > + CT_ARCH_WITH_FLOAT= > + ;; > + esac > } I already have a set of patches here that fixes this here. I'll update them with the info above (supported only by: arm, mips, ppc and sparc). Thank you. Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 0 of 6] Fix --with-float= for architectures that do not support it 2011-11-25 17:13 ` Yann E. MORIN @ 2011-11-25 23:23 ` Yann E. MORIN 2011-11-25 23:23 ` [PATCH 2 of 6] arch/arm: ARM supports setting the floating point type Yann E. MORIN ` (5 more replies) 0 siblings, 6 replies; 23+ messages in thread From: Yann E. MORIN @ 2011-11-25 23:23 UTC (permalink / raw) To: crossgcc; +Cc: Morten Thunberg Svendsen, Michael Hope Hello All, This patchset fixes (tries to fix) the floating point settings for architectures that do not support it. Previously, when hard-float was selected, no option was passed to ./configure, and no CFLAGS was set. Since changeset #149c33923f47, hard-float sets --with-float=hard as a configure option, and -mhard-float as a CFLAGS. This breaks architectures for which these are not valid, which are all except ARM, MIPS, PPC and SPARC; see: http://gcc.gnu.org/viewcvs/trunk/gcc/config.gcc?revision=181079&view=markup (via Morten Thunberg Svendsen <mts@doredevelopment.dk>) What this patchset does, is simply hide the floating point mode selection when the architecture does not support it. There is a drawback, though: it is no longer possible to select soft-float for the x86 architecture. On one hand, I think this is not too bad, because x86 nowadays do have an FPU; OTOH, i386 and i486 may lack an FPU, and they most likely are the kind of CPU one would find in an x86-embedded product. [PATCH 1/6] config/target: add float support selection [PATCH 2/6] arch/arm: ARM supports setting the floating point type [PATCH 3/6] arch/mips: MIPS supports setting the floating point type [PATCH 4/6] arch/powerpc: PowerPC supports setting the floating point type [PATCH 5/6] arch/sparc: Sparc supports setting the floating point type [PATCH 6/6] config/target: enforce floating point support As usual, comments welcome! :-) Regards, Yann E. MORIN. PS. I'll be without internet access until Monday evening... -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 2 of 6] arch/arm: ARM supports setting the floating point type 2011-11-25 23:23 ` [PATCH 0 of 6] Fix --with-float= for architectures that do not support it Yann E. MORIN @ 2011-11-25 23:23 ` Yann E. MORIN 2011-11-25 23:23 ` [PATCH 1 of 6] config/target: add float support selection Yann E. MORIN ` (4 subsequent siblings) 5 siblings, 0 replies; 23+ messages in thread From: Yann E. MORIN @ 2011-11-25 23:23 UTC (permalink / raw) To: crossgcc; +Cc: Morten Thunberg Svendsen, Michael Hope # HG changeset patch # User "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> # Date 1322159917 -3600 # Node ID 14ddbf5fd1ff3354b413758c2bd0e9229df002f3 # Parent 05020debc9d3a5dc733efeb6ca75084c28ecbb1d arch/arm: ARM supports setting the floating point type Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> diff --git a/config/arch/arm.in b/config/arch/arm.in --- a/config/arch/arm.in +++ b/config/arch/arm.in @@ -9,6 +9,7 @@ ## select ARCH_SUPPORT_ARCH ## select ARCH_SUPPORT_CPU ## select ARCH_SUPPORT_TUNE +## select ARCH_SUPPORT_FLOAT ## select ARCH_SUPPORT_FPU ## select ARCH_SUPPORT_SOFTFP ## -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 1 of 6] config/target: add float support selection 2011-11-25 23:23 ` [PATCH 0 of 6] Fix --with-float= for architectures that do not support it Yann E. MORIN 2011-11-25 23:23 ` [PATCH 2 of 6] arch/arm: ARM supports setting the floating point type Yann E. MORIN @ 2011-11-25 23:23 ` Yann E. MORIN 2011-11-28 12:32 ` Thomas Petazzoni 2011-11-25 23:23 ` [PATCH 3 of 6] arch/mips: MIPS supports setting the floating point type Yann E. MORIN ` (3 subsequent siblings) 5 siblings, 1 reply; 23+ messages in thread From: Yann E. MORIN @ 2011-11-25 23:23 UTC (permalink / raw) To: crossgcc; +Cc: Morten Thunberg Svendsen, Michael Hope # HG changeset patch # User "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> # Date 1322261875 -3600 # Node ID 05020debc9d3a5dc733efeb6ca75084c28ecbb1d # Parent 49af7802dcd538ec3cb64337030b03ac2c6344d2 config/target: add float support selection Changeset #149c33923f47 broke the architectures that do not support the --with-float=X ./configure flag (in gcc). For example, x86_64 does not support it. Add a new blind config option that architectures can set to tell they support floating point selection. Reported-by: Morten Thunberg Svendsen <mts@doredevelopment.dk> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> diff --git a/config/target.in b/config/target.in --- a/config/target.in +++ b/config/target.in @@ -14,6 +14,7 @@ config ARCH_SUPPORT_ABI config ARCH_SUPPORT_CPU config ARCH_SUPPORT_TUNE +config ARCH_SUPPORT_FLOAT config ARCH_SUPPORT_FPU config ARCH_SUPPORT_SOFTFP @@ -148,6 +149,9 @@ config ARCH_SUPPORT_TUNE bool +config ARCH_SUPPORT_FLOAT + bool + config ARCH_SUPPORT_FPU bool -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 1 of 6] config/target: add float support selection 2011-11-25 23:23 ` [PATCH 1 of 6] config/target: add float support selection Yann E. MORIN @ 2011-11-28 12:32 ` Thomas Petazzoni 2011-11-28 17:46 ` Yann E. MORIN 0 siblings, 1 reply; 23+ messages in thread From: Thomas Petazzoni @ 2011-11-28 12:32 UTC (permalink / raw) To: crossgcc Le Sat, 26 Nov 2011 00:22:26 +0100, "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> a écrit : > +config ARCH_SUPPORT_FLOAT > + bool > + The option name sounds a bit misleading to me. Reading this code, I would assume that the option means "does the architecture supports floating point computation ?", which of course is not what is happening here. Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 1 of 6] config/target: add float support selection 2011-11-28 12:32 ` Thomas Petazzoni @ 2011-11-28 17:46 ` Yann E. MORIN 0 siblings, 0 replies; 23+ messages in thread From: Yann E. MORIN @ 2011-11-28 17:46 UTC (permalink / raw) To: crossgcc; +Cc: Thomas Petazzoni Thomas, All, On Monday 28 November 2011 13:32:21 Thomas Petazzoni wrote: > Le Sat, 26 Nov 2011 00:22:26 +0100, > "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> a écrit : > > > +config ARCH_SUPPORT_FLOAT > > + bool > > + > > The option name sounds a bit misleading to me. Reading this code, I > would assume that the option means "does the architecture supports > floating point computation ?", which of course is not what is happening > here. Indeed, this is misleading. But I named the option as par with the others around it: ARCH_SUPPORT_CPU --> supports --with-cpu= and -mcpu= ARCH_SUPPORT_TUNE --> supports --with-tune= and -mtune= ARCH_SUPPORT_FLOAT --> supports --with-float= and -mfloat= ARCH_SUPPORT_FPU --> supports --with-fpu= and -mfpu= Of course, this does not match for the following option: ARCH_SUPPORT_SOFTFP Also, the options are not consistenly named: ARCH_SUPPORT_CPU but ARCH_SUPPORTS_64 This could probably be improved, indeed... I'll see if I can get sometime for it soonish... Thanks for the review! Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 3 of 6] arch/mips: MIPS supports setting the floating point type 2011-11-25 23:23 ` [PATCH 0 of 6] Fix --with-float= for architectures that do not support it Yann E. MORIN 2011-11-25 23:23 ` [PATCH 2 of 6] arch/arm: ARM supports setting the floating point type Yann E. MORIN 2011-11-25 23:23 ` [PATCH 1 of 6] config/target: add float support selection Yann E. MORIN @ 2011-11-25 23:23 ` Yann E. MORIN 2011-11-25 23:30 ` [PATCH 6 of 6] config/target: enforce floating point support Yann E. MORIN ` (2 subsequent siblings) 5 siblings, 0 replies; 23+ messages in thread From: Yann E. MORIN @ 2011-11-25 23:23 UTC (permalink / raw) To: crossgcc; +Cc: Morten Thunberg Svendsen, Michael Hope # HG changeset patch # User "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> # Date 1322160122 -3600 # Node ID 75cb3d431334a5ad80f2dfb6dc452f2bcc28d890 # Parent 14ddbf5fd1ff3354b413758c2bd0e9229df002f3 arch/mips: MIPS supports setting the floating point type Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> diff --git a/config/arch/mips.in b/config/arch/mips.in --- a/config/arch/mips.in +++ b/config/arch/mips.in @@ -8,6 +8,7 @@ ## select ARCH_DEFAULT_BE ## select ARCH_SUPPORT_ARCH ## select ARCH_SUPPORT_TUNE +## select ARCH_SUPPORT_FLOAT ## ## help The MIPS architecture, as defined by: ## help http://www.mips.com/ -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 6 of 6] config/target: enforce floating point support 2011-11-25 23:23 ` [PATCH 0 of 6] Fix --with-float= for architectures that do not support it Yann E. MORIN ` (2 preceding siblings ...) 2011-11-25 23:23 ` [PATCH 3 of 6] arch/mips: MIPS supports setting the floating point type Yann E. MORIN @ 2011-11-25 23:30 ` Yann E. MORIN 2011-11-25 23:30 ` [PATCH 5 of 6] arch/sparc: Sparc supports setting the floating point type Yann E. MORIN 2011-11-25 23:30 ` [PATCH 4 of 6] arch/powerpc: PowerPC " Yann E. MORIN 5 siblings, 0 replies; 23+ messages in thread From: Yann E. MORIN @ 2011-11-25 23:30 UTC (permalink / raw) To: crossgcc; +Cc: Morten Thunberg Svendsen, Michael Hope # HG changeset patch # User "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> # Date 1322261969 -3600 # Node ID 1a0567af940d9a4b4e522b182a3be5dc1295ea1d # Parent 8a0e12da93ac60d3afb7817dd90a5412cba70d8d config/target: enforce floating point support Do not prompt for the type of floating-point support, if the architecture did not explicitly stated that it did support it. Reported-by: Morten Thunberg Svendsen <mts@doredevelopment.dk> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> diff --git a/config/target.in b/config/target.in --- a/config/target.in +++ b/config/target.in @@ -260,6 +260,7 @@ choice bool prompt "Floating point:" + depends on ARCH_SUPPORT_FLOAT config ARCH_FLOAT_HW bool @@ -328,6 +329,7 @@ config ARCH_FLOAT string + default "" if ! ARCH_SUPPORT_FLOAT default "hard" if ARCH_FLOAT_HW default "soft" if ARCH_FLOAT_SW default "softfp" if ARCH_FLOAT_SOFTFP -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 5 of 6] arch/sparc: Sparc supports setting the floating point type 2011-11-25 23:23 ` [PATCH 0 of 6] Fix --with-float= for architectures that do not support it Yann E. MORIN ` (3 preceding siblings ...) 2011-11-25 23:30 ` [PATCH 6 of 6] config/target: enforce floating point support Yann E. MORIN @ 2011-11-25 23:30 ` Yann E. MORIN 2011-11-25 23:30 ` [PATCH 4 of 6] arch/powerpc: PowerPC " Yann E. MORIN 5 siblings, 0 replies; 23+ messages in thread From: Yann E. MORIN @ 2011-11-25 23:30 UTC (permalink / raw) To: crossgcc; +Cc: Morten Thunberg Svendsen, Michael Hope # HG changeset patch # User "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> # Date 1322160515 -3600 # Node ID 8a0e12da93ac60d3afb7817dd90a5412cba70d8d # Parent c1b3ac64430b6a0a1b32345fd13177caa7991290 arch/sparc: Sparc supports setting the floating point type Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> diff --git a/config/arch/sparc.in b/config/arch/sparc.in --- a/config/arch/sparc.in +++ b/config/arch/sparc.in @@ -6,6 +6,7 @@ ## select ARCH_USE_MMU ## select ARCH_SUPPORT_CPU ## select ARCH_SUPPORT_TUNE +## select ARCH_SUPPORT_FLOAT ## ## help The SUN SPARC architecture, as defined by: ## help 32 bit: http://www.sparc.org/standards/V8.pdf -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 4 of 6] arch/powerpc: PowerPC supports setting the floating point type 2011-11-25 23:23 ` [PATCH 0 of 6] Fix --with-float= for architectures that do not support it Yann E. MORIN ` (4 preceding siblings ...) 2011-11-25 23:30 ` [PATCH 5 of 6] arch/sparc: Sparc supports setting the floating point type Yann E. MORIN @ 2011-11-25 23:30 ` Yann E. MORIN 5 siblings, 0 replies; 23+ messages in thread From: Yann E. MORIN @ 2011-11-25 23:30 UTC (permalink / raw) To: crossgcc; +Cc: Morten Thunberg Svendsen, Michael Hope # HG changeset patch # User "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> # Date 1322160257 -3600 # Node ID c1b3ac64430b6a0a1b32345fd13177caa7991290 # Parent 75cb3d431334a5ad80f2dfb6dc452f2bcc28d890 arch/powerpc: PowerPC supports setting the floating point type Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> diff --git a/config/arch/powerpc.in b/config/arch/powerpc.in --- a/config/arch/powerpc.in +++ b/config/arch/powerpc.in @@ -7,6 +7,7 @@ ## select ARCH_SUPPORT_ABI ## select ARCH_SUPPORT_CPU ## select ARCH_SUPPORT_TUNE +## select ARCH_SUPPORT_FLOAT ## ## help The PowerPC architecture, as defined by: ## help http://www.ibm.com/developerworks/eserver/articles/archguide.html -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 3 of 4] arch: add softfp support 2011-11-01 23:42 ` [PATCH 0 of 4] Adding " Yann E. MORIN 2011-11-01 23:42 ` [PATCH 1 of 4] scripts: introduce float type as a string Yann E. MORIN @ 2011-11-01 23:43 ` Yann E. MORIN 2011-11-01 23:43 ` [PATCH 2 of 4] scripts: use the hardfloat option to set configure and CFLAGS Yann E. MORIN ` (3 subsequent siblings) 5 siblings, 0 replies; 23+ messages in thread From: Yann E. MORIN @ 2011-11-01 23:43 UTC (permalink / raw) To: crossgcc; +Cc: Michael Hope # HG changeset patch # User Michael Hope <michael.hope@linaro.org> # Date 1320190577 -3600 # Node ID 43fb1d340cabee3afba58bf21c49daf4482698ff # Parent a58704d1826c77882e5723f1ae61d44c12e9ba36 arch: add softfp support Some architectures support a mixed hard/soft floating point, where the compiler emits hardware floating point instructions, but passes the operands in core (aka integer) registers. For example, ARM supports this mode (to come in the next changeset). Add support for softfp cross compilers to the GCC and GLIBC configuration. Needed for Ubuntu and other distros that are softfp. Signed-off-by: Michael Hope <michael.hope@linaro.org> [yann.morin.1998@anciens.enib.fr: split the original patch] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> diff --git a/config/target.in b/config/target.in --- a/config/target.in +++ b/config/target.in @@ -15,6 +15,7 @@ config ARCH_SUPPORT_CPU config ARCH_SUPPORT_TUNE config ARCH_SUPPORT_FPU +config ARCH_SUPPORT_SOFTFP config ARCH_DEFAULT_HAS_MMU config ARCH_DEFAULT_BE @@ -144,6 +145,9 @@ config ARCH_SUPPORT_FPU bool +config ARCH_SUPPORT_SOFTFP + bool + config ARCH_ARCH string prompt "Architecture level" @@ -271,6 +275,22 @@ If your processor has no FPU, then you most probably want this, as it is faster than emulating the FPU in the kernel. +config ARCH_FLOAT_SOFTFP + bool + prompt "softfp" + depends on ARCH_SUPPORT_SOFTFP + help + Emit hardware floating point opcodes but use the software + floating point calling convention. + + Architectures such as ARM use different registers for passing + floating point values depending on if they're in software mode + or hardware mode. softfp emits FPU instructions but uses the + software FP calling convention allowing softfp code to + interoperate with legacy software only code. + + If in doubt, use 'software' or 'hardware' mode instead. + endchoice config TARGET_CFLAGS @@ -300,6 +320,7 @@ string default "hard" if ARCH_FLOAT_HW default "soft" if ARCH_FLOAT_SW + default "softfp" if ARCH_FLOAT_SOFTFP source "config.gen/arch.in.2" diff --git a/scripts/build/libc/glibc-eglibc.sh-common b/scripts/build/libc/glibc-eglibc.sh-common --- a/scripts/build/libc/glibc-eglibc.sh-common +++ b/scripts/build/libc/glibc-eglibc.sh-common @@ -135,6 +135,7 @@ case "${CT_ARCH_FLOAT}" in hard) extra_config+=("--with-fp");; soft) extra_config+=("--without-fp");; + softfp) extra_config+=("--with-fp");; esac if [ "${CT_LIBC_DISABLE_VERSIONING}" = "y" ]; then diff --git a/scripts/functions b/scripts/functions --- a/scripts/functions +++ b/scripts/functions @@ -993,6 +993,10 @@ CT_ARCH_FLOAT_CFLAG="-msoft-float" CT_ARCH_WITH_FLOAT="--with-float=soft" ;; + softfp) + CT_ARCH_FLOAT_CFLAG="-mfloat-abi=softfp" + CT_ARCH_WITH_FLOAT="--with-float=softfp" + ;; esac # Build the default kernel tuple part -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 2 of 4] scripts: use the hardfloat option to set configure and CFLAGS 2011-11-01 23:42 ` [PATCH 0 of 4] Adding " Yann E. MORIN 2011-11-01 23:42 ` [PATCH 1 of 4] scripts: introduce float type as a string Yann E. MORIN 2011-11-01 23:43 ` [PATCH 3 of 4] arch: add softfp support Yann E. MORIN @ 2011-11-01 23:43 ` Yann E. MORIN 2011-11-01 23:50 ` [PATCH 4 of 4] arch/arm: ARM supports the softfp convention Yann E. MORIN ` (2 subsequent siblings) 5 siblings, 0 replies; 23+ messages in thread From: Yann E. MORIN @ 2011-11-01 23:43 UTC (permalink / raw) To: crossgcc; +Cc: Michael Hope # HG changeset patch # User Michael Hope <michael.hope@linaro.org> # Date 1320190569 -3600 # Node ID a58704d1826c77882e5723f1ae61d44c12e9ba36 # Parent 10f8a6c3847a22617bf36190e477d67aacf6a59b scripts: use the hardfloat option to set configure and CFLAGS When hardfloat is selected, we need to pass that selection down to ./configure and in the CFLAGS. Signed-off-by: Michael Hope <michael.hope@linaro.org> [yann.morin.1998@anciens.enib.fr: split the original patch] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> diff --git a/scripts/functions b/scripts/functions --- a/scripts/functions +++ b/scripts/functions @@ -985,6 +985,10 @@ [ "${CT_ARCH_FPU}" ] && { CT_ARCH_FPU_CFLAG="-mfpu=${CT_ARCH_FPU}"; CT_ARCH_WITH_FPU="--with-fpu=${CT_ARCH_FPU}"; } case "${CT_ARCH_FLOAT}" in + hard) + CT_ARCH_FLOAT_CFLAG="-mhard-float" + CT_ARCH_WITH_FLOAT="--with-float=hard" + ;; soft) CT_ARCH_FLOAT_CFLAG="-msoft-float" CT_ARCH_WITH_FLOAT="--with-float=soft" -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 4 of 4] arch/arm: ARM supports the softfp convention 2011-11-01 23:42 ` [PATCH 0 of 4] Adding " Yann E. MORIN ` (2 preceding siblings ...) 2011-11-01 23:43 ` [PATCH 2 of 4] scripts: use the hardfloat option to set configure and CFLAGS Yann E. MORIN @ 2011-11-01 23:50 ` Yann E. MORIN 2011-11-07 20:40 ` [PATCH 0 of 4] Adding softfp support Yann E. MORIN 2011-11-09 0:48 ` Michael Hope 5 siblings, 0 replies; 23+ messages in thread From: Yann E. MORIN @ 2011-11-01 23:50 UTC (permalink / raw) To: crossgcc; +Cc: Michael Hope # HG changeset patch # User Michael Hope <michael.hope@linaro.org> # Date 1320190583 -3600 # Node ID 3eb98b84ca1e19094b717006e2a85ab6d080dace # Parent 43fb1d340cabee3afba58bf21c49daf4482698ff arch/arm: ARM supports the softfp convention ARM compilers can be built for soft float (software only, floats in core registers), hard float (uses floating point instructions, floats in FPU registers), or the half-way house softfp (uses floating point instructions, floats in core registers). Signed-off-by: Michael Hope <michael.hope@linaro.org> [yann.morin.1998@anciens.enib.fr: split the original patch] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> diff --git a/config/arch/arm.in b/config/arch/arm.in --- a/config/arch/arm.in +++ b/config/arch/arm.in @@ -10,6 +10,7 @@ ## select ARCH_SUPPORT_CPU ## select ARCH_SUPPORT_TUNE ## select ARCH_SUPPORT_FPU +## select ARCH_SUPPORT_SOFTFP ## ## help The ARM architecture, as defined by: ## help http://www.arm.com/ -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 0 of 4] Adding softfp support 2011-11-01 23:42 ` [PATCH 0 of 4] Adding " Yann E. MORIN ` (3 preceding siblings ...) 2011-11-01 23:50 ` [PATCH 4 of 4] arch/arm: ARM supports the softfp convention Yann E. MORIN @ 2011-11-07 20:40 ` Yann E. MORIN 2011-11-09 0:48 ` Michael Hope 5 siblings, 0 replies; 23+ messages in thread From: Yann E. MORIN @ 2011-11-07 20:40 UTC (permalink / raw) To: crossgcc; +Cc: Michael Hope Micael, On Wednesday 02 November 2011 00:39:33 Yann E. MORIN wrote: > I believe there really were four changes in your original patch, so I did > split it up into the following series: > > [PATCH 1 of 4] scripts: introduce float type as a string > [PATCH 2 of 4] scripts: use the hardfloat option to set configure and > CFLAGS > [PATCH 3 of 4] arch: add softfp support > [PATCH 4 of 4] arch/arm: ARM supports the softfp convention > > I kept your SoB lines in the resulting series, as well as you as the > author, because all I really did was just split the patch (plus a very > light cosmetic change here and there), so you should get full credit. > > However, I still would like your approval before I definitely commit this > series, in case you have further comments on it. Ping? Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 0 of 4] Adding softfp support 2011-11-01 23:42 ` [PATCH 0 of 4] Adding " Yann E. MORIN ` (4 preceding siblings ...) 2011-11-07 20:40 ` [PATCH 0 of 4] Adding softfp support Yann E. MORIN @ 2011-11-09 0:48 ` Michael Hope 2011-11-09 19:01 ` Yann E. MORIN 5 siblings, 1 reply; 23+ messages in thread From: Michael Hope @ 2011-11-09 0:48 UTC (permalink / raw) To: Yann E. MORIN; +Cc: crossgcc On Wed, Nov 2, 2011 at 12:39 PM, Yann E. MORIN <yann.morin.1998@anciens.enib.fr> wrote: > Michael, All, > > I believe there really were four changes in your original patch, so I did > split it up into the following series: > > [PATCH 1 of 4] scripts: introduce float type as a string > [PATCH 2 of 4] scripts: use the hardfloat option to set configure and > CFLAGS > [PATCH 3 of 4] arch: add softfp support > [PATCH 4 of 4] arch/arm: ARM supports the softfp convention > > I kept your SoB lines in the resulting series, as well as you as the > author, because all I really did was just split the patch (plus a very > light cosmetic change here and there), so you should get full credit. > > However, I still would like your approval before I definitely commit this > series, in case you have further comments on it. Sorry for the delay but I was away at Linaro Connect. These look good - I like the history you get through splitting the patches. -- Michael -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 0 of 4] Adding softfp support 2011-11-09 0:48 ` Michael Hope @ 2011-11-09 19:01 ` Yann E. MORIN 0 siblings, 0 replies; 23+ messages in thread From: Yann E. MORIN @ 2011-11-09 19:01 UTC (permalink / raw) To: crossgcc; +Cc: Michael Hope Michael, All, On Wednesday 09 November 2011 01:47:49 Michael Hope wrote: > On Wed, Nov 2, 2011 at 12:39 PM, Yann E. MORIN > <yann.morin.1998@anciens.enib.fr> wrote: > > I believe there really were four changes in your original patch, so I did > > split it up into the following series: [--SNIP--] > > However, I still would like your approval before I definitely commit this > > series, in case you have further comments on it. > > Sorry for the delay but I was away at Linaro Connect. These look good > - I like the history you get through splitting the patches. Applied as: #b5179235b925 scripts: introduce float type as a string #149c33923f47 scripts: use the hardfloat option to set configure and CFLAGS #f320e22f2cba arch: add softfp support #8f5f36b3473b arch/arm: ARM supports the softfp convention Thank you! :-) Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2011-11-28 17:46 UTC | newest] Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-10-19 2:29 [PATCH] scripts: add softfp support Michael Hope 2011-10-19 21:02 ` Yann E. MORIN 2011-10-20 0:30 ` Michael Hope 2011-10-21 2:17 ` Michael Hope 2011-11-01 23:42 ` [PATCH 0 of 4] Adding " Yann E. MORIN 2011-11-01 23:42 ` [PATCH 1 of 4] scripts: introduce float type as a string Yann E. MORIN 2011-11-25 12:20 ` Morten Thunberg Svendsen 2011-11-25 17:13 ` Yann E. MORIN 2011-11-25 23:23 ` [PATCH 0 of 6] Fix --with-float= for architectures that do not support it Yann E. MORIN 2011-11-25 23:23 ` [PATCH 2 of 6] arch/arm: ARM supports setting the floating point type Yann E. MORIN 2011-11-25 23:23 ` [PATCH 1 of 6] config/target: add float support selection Yann E. MORIN 2011-11-28 12:32 ` Thomas Petazzoni 2011-11-28 17:46 ` Yann E. MORIN 2011-11-25 23:23 ` [PATCH 3 of 6] arch/mips: MIPS supports setting the floating point type Yann E. MORIN 2011-11-25 23:30 ` [PATCH 6 of 6] config/target: enforce floating point support Yann E. MORIN 2011-11-25 23:30 ` [PATCH 5 of 6] arch/sparc: Sparc supports setting the floating point type Yann E. MORIN 2011-11-25 23:30 ` [PATCH 4 of 6] arch/powerpc: PowerPC " Yann E. MORIN 2011-11-01 23:43 ` [PATCH 3 of 4] arch: add softfp support Yann E. MORIN 2011-11-01 23:43 ` [PATCH 2 of 4] scripts: use the hardfloat option to set configure and CFLAGS Yann E. MORIN 2011-11-01 23:50 ` [PATCH 4 of 4] arch/arm: ARM supports the softfp convention Yann E. MORIN 2011-11-07 20:40 ` [PATCH 0 of 4] Adding softfp support Yann E. MORIN 2011-11-09 0:48 ` Michael Hope 2011-11-09 19:01 ` Yann E. MORIN
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).