From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29664 invoked by alias); 6 Oct 2013 17:33:03 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 29588 invoked by uid 89); 6 Oct 2013 17:33:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: wmh1.mail.saunalahti.fi Received: from wmh1.mail.saunalahti.fi (HELO wmh1.mail.saunalahti.fi) (62.142.5.133) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sun, 06 Oct 2013 17:33:00 +0000 Received: from [192.168.0.13] (dsl-kmibrasgw1-54f8de-25.dhcp.inet.fi [84.248.222.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: karuottu) by wmh1.mail.saunalahti.fi (Postfix) with ESMTPSA id 8EFA81FC1E0 for ; Sun, 6 Oct 2013 20:32:56 +0300 (EEST) Message-ID: <52519EC3.90805@wippies.com> Date: Sun, 06 Oct 2013 17:33:00 -0000 From: Kai Ruottu User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: Re: build libgcc for i486 with msoft-float failed References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00003.txt.bz2 6.10.2013 9:02, Reid M kirjoitti: > I was trying to build cross gcc and libgcc based on gcc-4.8 for target > i486 without floating point support. For me there is always FP support, either using the FPU ("487") or via the soft-float package... > > I build libgcc with option "-D_SOFT_FLOAT -march=i486 -msoft-float > -mno-sse -Wa,-march=i486" but I met following errors: > > 1. compilation error in file "crtprec.c" : used inline assembly which > contains float-point instruction > ../../../gcc-4.8/libgcc/config/i386/crtprec.c: Assembler messages: > ../../../gcc-4.8/libgcc/config/i386/crtprec.c:40: Error: `fstcw' is > not supported on `i486' > ../../../gcc-4.8/libgcc/config/i386/crtprec.c:45: Error: `fldcw' is > not supported on `i486' Maybe the compile option : -mno-fp-ret-in-387 Do not use the FPU registers for return values of functions. The usual calling convention has functions return values of types float and double in an FPU register, even if there is no FPU. The idea is that the operating system should emulate an FPU. The option ‘-mno-fp-ret-in-387’ causes such values to be returned in ordinary CPU registers instead. would correct this... > > 2. After I comment out the inline assembly to avoid error 1, I could > get a libgcc for i486 version. There's some undefined soft-float > function as the following. The source code of corresponding function > are existed in libgcc but they aren't included in libgcc.a. > out/target/product/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(time.o): > In function `clock_now': > /home/reid/android/android-4.2.1_r1/bionic/libc/unistd/time.c:53: > undefined reference to `__floatsidf' > /home/reid/android/android-4.2.1_r1/bionic/libc/unistd/time.c:53: > undefined reference to `__floatsidf' > /home/reid/android/android-4.2.1_r1/bionic/libc/unistd/time.c:53: > undefined reference to `__muldf3' > /home/reid/android/android-4.2.1_r1/bionic/libc/unistd/time.c:53: > undefined reference to `__adddf3' > /home/reid/android/android-4.2.1_r1/bionic/libc/unistd/time.c:53: > undefined reference to `__fixdfsi' > /home/reid/android/android-4.2.1_r1/bionic/libc/unistd/time.c:53: > undefined reference to `__floatsidf' > /home/reid/android/android-4.2.1_r1/bionic/libc/unistd/time.c:53: > undefined reference to `__floatsidf' > /home/reid/android/android-4.2.1_r1/bionic/libc/unistd/time.c:53: > undefined reference to `__muldf3' > /home/reid/android/android-4.2.1_r1/bionic/libc/unistd/time.c:53: > undefined reference to `__adddf3' > /home/reid/android/android-4.2.1_r1/bionic/libc/unistd/time.c:53: > undefined reference to `__fixdfsi > > My gcc version is 4.8 and configuration is > ============================================ > ./gcc-4.8/configure --target=i486-linux-android --disable-multilib > --disable-nls --disable-shared --disable-threads --enable-visibility > --disable-decimal-float --disable-bootstrap --enable-languages=c,c++ > ============================================ There comes the assumption with i386 and i486SX and told in the '-mno-fp-ret-in-387' description : "The idea is that the operating system should emulate an FPU." So : Are you really sure that you will need soft-float support in libgcc ? Ie Android/Linux for i486 doesn't include the usual "i387-emulator" in its kernel? For MS/PC-DOS and DJGPP there was that "TSR-program" working as the i387-emulator, Windoze, Linux, *BSD etc. should include their own equivalents... > > Could anybody shed some light on how to build libgcc for target i486 > without floating point support? If Android/Linux for i486 doesn't include any i387/487-emulator, then you should study its config settings for GCC. Maybe there then already is a special target name for the i486SX CPU without the FPU used with Android. Or someone like you should add it... Adding '-mno-fp-ret-in-387' to the '-march=i486 -msoft-float -mno-sse' "default compile options" for this new special target name would be one task, another including the usual 'fp-bit.c/dp-bit.c' soft-float routines into the produced 'libgcc'...