From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 2C7462AFFA for ; Wed, 13 Mar 2024 15:52:10 +0100 (CET) Received: (qmail 15419 invoked by uid 550); 13 Mar 2024 14:47:55 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 15381 invoked from network); 13 Mar 2024 14:47:55 -0000 Date: Wed, 13 Mar 2024 10:52:15 -0400 From: Rich Felker To: Waldemar Brodkorb Cc: musl@lists.openwall.com Message-ID: <20240313145215.GF4163@brightrain.aerifal.cx> References: <20240312005150.GB4163@brightrain.aerifal.cx> <4f5abddd-09f9-f05f-6cc6-719fc365b449@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] loongarch64 atomics not working? On Wed, Mar 13, 2024 at 03:45:31PM +0100, Waldemar Brodkorb wrote: > Hi, > lixing wrote, > > > > > 在 2024/3/13 上午1:18, Waldemar Brodkorb 写道: > > > Hi Thorsten, > > > Thorsten Glaser wrote, > > > > > > > Waldemar Brodkorb dixit: > > > > > > > > > lixing wrote, > > > > > > We've tested static and dynamic build mksh with commit id > > > > > > cbb8a0196aab53165a35339fd91ade599d184f both works ok. > > > > That’s great to hear! > > > > > > > > > Can you check with qemu-system-loongarch64? I use gcc 13.2.0, > > > > > binutils 2.42 and Linux 6.6.18 with the defconfig provided. > > > > > Qemu is also 8.2.2. Can you provide your QEMU_EFI.fd for download? > > > > I just only use qemu user mode, but my colleague give me the address for > > download the EFI as follow > > > > https://github.com/lixianglai/LoongarchVirtFirmware. > > > > Also, can you post the qemu-system-loongarch64 startup command to me? > > > > > > Perhaps to distinguish between emulation/runtime and toolchain > > > > faults you could send each other the mksh binaries (if statically > > > > linked, otherwise probably them plus musl’s dynamic parts)? > > > > I update the static binary to my repo on github, you can download and try, > > we both tested with real hardware > > > > and qemu-loongarch64 user mode is ok.  This mksh built with gcc 13.2.1, > > binutils 2.42, linux 6.6.15 in the loongarch environment. > > > > https://github.com/lixing-star/binarys > > > > > Statically linked mksh from me is here: > > > https://debug.openadk.org/mksh > > we've tested your binary on 3c5000  is ok, but  hanged with > > qemu-loongarch64. Are you cross compiled the mksh for use? > > Yes I do. I found the reason why my mksh didn't worked. > I compiled everything with -Os and then I get the deadlock. > When I compile everything with -O2 musl mksh is working. > > So it seems some gcc problem code compiled with -Os. Let's look at the generated asm for the function using a_cas_p and see if this is a gcc bug or if the asm argument constraints as written allowed a transformation that's not actually valid. Rich