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.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL 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 EE37623A51 for ; Fri, 29 Mar 2024 00:01:11 +0100 (CET) Received: (qmail 29903 invoked by uid 550); 28 Mar 2024 22:56:16 -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 29871 invoked from network); 28 Mar 2024 22:56:15 -0000 Date: Thu, 28 Mar 2024 19:01:16 -0400 From: Rich Felker To: Max Filippov Cc: musl@lists.openwall.com Message-ID: <20240328230116.GM4163@brightrain.aerifal.cx> References: <20240328200319.4016902-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240328200319.4016902-1-jcmvbkbc@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [RFC v2 0/2] xtensa FDPIC port On Thu, Mar 28, 2024 at 01:03:17PM -0700, Max Filippov wrote: > Hello, > > this is the second RFC version of the xtensa FDPIC port for musl. > There are two patches: the first adds the port and will likely not > change in the future versions. The second adds two bits of > xtensa-specific GOT initialization for compatibility with the current > binutils/gcc and will go away once binutils and gcc are changed to do > local references differently. > > The following binutils and gcc branches can be used to build the > xtensa-linux-muslfdpic toolchain: > > https://github.com/jcmvbkbc/binutils-gdb-xtensa xtensa-2.42-fdpic-musl > https://github.com/jcmvbkbc/gcc-xtensa xtensa-14-9655-fdpic-musl > > I've tested this version with libc-test using QEMU linux-user and full > system emulation. The results in the linux-user are the following: > > FAIL src/functional/dlopen.exe [status 1] > FAIL src/functional/pthread_robust-static.exe [timed out] > FAIL src/functional/pthread_robust.exe [timed out] > FAIL src/functional/strptime-static.exe [status 1] > FAIL src/functional/strptime.exe [status 1] > FAIL src/math/acoshl.exe [status 1] > FAIL src/math/asinhl.exe [status 1] > FAIL src/math/erfcl.exe [status 1] > FAIL src/math/fma.exe [status 1] > FAIL src/math/fmal.exe [status 1] > FAIL src/math/lgammal.exe [status 1] > FAIL src/math/tgammal.exe [status 1] > FAIL src/regression/pthread-robust-detach-static.exe [status 1] > FAIL src/regression/pthread-robust-detach.exe [status 1] > > functional/dlopen fails with the > src/functional/dlopen.c:39: dlsym main failed: (null) > There's no failure in the dlsym call, but the pointers don't match. Is this something related to canonical function descriptors? Is it musl's fault or a bug in the tooling? I suspect the latter. > functional/ and regression/ pthread-related failures are expected > because the robust list functions are not available in the linux-user > mode. These particular tests pass in full system emulation. > > math tests fail with ULP differences. > > I have also added the following changes to the abi tests to fix the > build: > > diff --git a/src/api/sys_sem.c b/src/api/sys_sem.c > index a473cad0a2aa..bd4df9a4fe70 100644 > --- a/src/api/sys_sem.c > +++ b/src/api/sys_sem.c > @@ -18,7 +18,11 @@ C(SETALL) > { > struct semid_ds x; > F(struct ipc_perm,sem_perm) > +#ifdef __xtensa__ > +F(unsigned long, sem_nsems) > +#else > F(unsigned short, sem_nsems) > +#endif This is invalid and indicates an error in the port; the whole point of the tests is to catch that so it can be fixed. POSIX requires sem_nsems to have type unsigned short. I believe Linux has this wrong on some (most? all?) archs and we just fix it by replacing the rest with padding. Rich