From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15770 invoked by alias); 21 Oct 2011 02:17:19 -0000 Received: (qmail 15563 invoked by uid 22791); 21 Oct 2011 02:17:17 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qw0-f41.google.com (HELO mail-qw0-f41.google.com) (209.85.216.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 Oct 2011 02:16:59 +0000 Received: by qadc11 with SMTP id c11so977665qad.0 for ; Thu, 20 Oct 2011 19:16:58 -0700 (PDT) Received: by 10.224.205.68 with SMTP id fp4mr10717317qab.63.1319163418431; Thu, 20 Oct 2011 19:16:58 -0700 (PDT) Received: from [192.168.1.13] (204.47.255.123.static.snap.net.nz. [123.255.47.204]) by mx.google.com with ESMTPS id fz9sm13212349qab.13.2011.10.20.19.16.54 (version=SSLv3 cipher=OTHER); Thu, 20 Oct 2011 19:16:56 -0700 (PDT) Message-ID: <4EA0D614.80709@linaro.org> Date: Fri, 21 Oct 2011 02:17:00 -0000 From: Michael Hope User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 MIME-Version: 1.0 To: "Yann E. MORIN" CC: crossgcc@sourceware.org Subject: Re: [PATCH] scripts: add softfp support References: <201110192302.12549.yann.morin.1998@anciens.enib.fr> In-Reply-To: <201110192302.12549.yann.morin.1998@anciens.enib.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00060.txt.bz2 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 >> # 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 >> >> 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