From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B730A3857C6E; Mon, 7 Mar 2022 16:59:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B730A3857C6E From: "adhemerval.zanella at linaro dot org" To: glibc-bugs@sourceware.org Subject: [Bug ports/28872] Building glibc for MIPSel single float targets Date: Mon, 07 Mar 2022 16:59:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: ports X-Bugzilla-Version: 2.30 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: adhemerval.zanella at linaro dot org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2022 16:59:47 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28872 --- Comment #23 from Adhemerval Zanella --- (In reply to Den from comment #22) > (In reply to Adhemerval Zanella from comment #21) > > What do you mean 'replaced with their logic definition' here? > I'm sorry for my English... > Just try to compile those edited files .c and you see an error. Here is t= he > test file: > $ cat asm_test.c > # if __mips_fpr =3D=3D 0 || __mips_fpr =3D=3D 64 > # define LDFPR "ldc1 " > # elif __mips_fpr =3D=3D 32 > # define LDFPR "lwc1 " > # else > # define LDFPR "l.d " > # endif >=20 > int main(){ > asm volatile ( "LDFPR $f0,($0)" );} You need to put LDFPR *outside* the string, otherwise the preprocessor won't make de substition: int main () { asm volatile (LDFPR "$f0,($0)"); } > $ mipsel-unknown-linux-uclibc-gcc asm_test.c -o asm_test.o >=20 > Error: unrecognized opcode `ldfpr $f0,($0)' >=20 > - see? - that LDFPR not changes to any either defined lwc1 or l.d . The s= ame > error appears when trying to compile the glibc with your patch applied. With the fix above: $ mips64-glibc-linux-gnu-gcc -O2 -mabi=3D32 -mfp32 -msingle-float -mhard-= float test.c -c $ mips64-glibc-linux-gnu-objdump -d test.o [...] 00000000 : 0: c4000000 lwc1 $f0,0(zero) 4: 03e00008 jr ra 8: 00000000 nop c: 00000000 nop >=20 > > Can't you use the expected compiler-flags (-O2 -mabi=3D32 -mfp32 > > -msingle-float -mhard-float) along with a recent gcc/binutils? >=20 > OK, gcc-9.2.0, binutils-2.34. > $ mipsel-unknown-linux-uclibc-gcc -Q --help=3Dtarget > I see all of these flags enabled, except -O2. And I'm getting some binari= es > provides SegFault (for a not deep test - magick, groupadd, native mipsel > gdb). These binaries are working well when they were got using soft-float. > I'm not sure well but I think using hard-float double-float could be stab= le > too, I just do not know a way how to test it; moreover, that type of > cross-compiler that uses doubles is not suitable for our goal. > To study the reason of those SegFaults deeply I need a working gdb compil= ed > using hard'n'single-float. I need it either in QEMU or for r5900's native. > Since the cross-compiler for r5900 generates the malfunction results, the= n I > need to build it statically for r6000 (MIPSII) in some QEMU mipsel target, > but I tried and realized that it builds soooo looong... > The other debug method is QEMU's gdbstub, but I have some problems > understanding how to set it up... Anyway, the searches for the SegFault > trigger is not really a glibc related problem concern. Can't you dump a corefile and analyze it on a different box? Or configure t= he box to use remote gdb? Another option would be to add a strace dump to see where it fails and add = an old printf debug ... --=20 You are receiving this mail because: You are on the CC list for the bug.=