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=-1.3 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, FROM_LOCAL_NOVOWEL,HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM, 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 823E122A63 for ; Thu, 28 Mar 2024 21:03:56 +0100 (CET) Received: (qmail 21638 invoked by uid 550); 28 Mar 2024 19:59:02 -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 21600 invoked from network); 28 Mar 2024 19:59:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711656222; x=1712261022; darn=lists.openwall.com; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=kF7EqSJwP1Z11NjHEvlyYmda56ph6VfrFzP0GciWsY8=; b=Qo9wcfEfsTPzp5gy+lfdUq4piGogrfkviQ2bhiB3tV6a2FkXNNaCatLfYBzjMJSxzw IOClgDu7/Ov3lfHWG6hLljkhwLF+R1uVChynyJHoWSDkeebqhz4m9b+jdxAPyTNUpkDS XJsjkFm4fMG5qJVYB9z2i241I6uIntYwqcQbN50ZEFQgWQ51rlC9XpVlcRMnxOXVveOd Q26LiKfIrVy/9ICM96r6KjyyiTi+dbV5Nhs3Ow2YtCf7LJzQJ974TH+h7bMd7DB06z6X Zfu3Nii9YPKt93N3lDKEC6SugXUC/EuMkyDqAigbwwLi30CNDgBVAu4MzPFRybjkB66R s5LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711656222; x=1712261022; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kF7EqSJwP1Z11NjHEvlyYmda56ph6VfrFzP0GciWsY8=; b=lPDiZPspce/ZHHsTTZida2qUc0Ck1oH/sd97wHUXguqCVRPaavRfx6IfuA65mrzh3c vNRbT/s9t+xjCKNmK/v0d1qoMXjBdq5HZnl8ammZdhQejWebeUhGKM2qZr4+5y8EZHTi 8JTtBg1ScE4fCWsquLEWK3uX7HlR05itaEQcgKcSrMoouVgb6HBw1NlezeetK7iSOaoC sCRlAEchl4M3Cd8x2dUUDw1nHpdYBDP0QphK7btTSVjH/0w7Txo+6gDy7KvYsa7nymAW 07kQkdFNhf9OgLSVfCV5RogQDT/C65WI69Uiw+j/ruAcbO3Pnj7FTaGAhUKUUUlfgvFL 4uBw== X-Gm-Message-State: AOJu0YwNnm02ju+MJ5EUlgINDtTMmOzP2sSSq09VFeRLP1xC4dDJz977 BAvHL5qsIAFhWNKARsoS+R24dlFXGBjQ/Amr5EDgn6Lnj7dZ9GAjNMAU/suT X-Google-Smtp-Source: AGHT+IEZ64sWi72x+Cuf5gjXOMOJbEcYsOH99xp5f4PsB5xy4PvV0V0XOYOVcWCKxcmn7jeezgwxGA== X-Received: by 2002:a05:6358:7521:b0:17e:cd08:8bc with SMTP id k33-20020a056358752100b0017ecd0808bcmr432153rwg.20.1711656221638; Thu, 28 Mar 2024 13:03:41 -0700 (PDT) From: Max Filippov To: musl@lists.openwall.com Cc: Rich Felker , Max Filippov Date: Thu, 28 Mar 2024 13:03:17 -0700 Message-Id: <20240328200319.4016902-1-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [musl] [RFC v2 0/2] xtensa FDPIC port 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. 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 F(time_t, sem_otime) F(time_t, sem_ctime) } diff --git a/src/api/unistd.c b/src/api/unistd.c index 522ccdc737cf..f0646ca909c7 100644 --- a/src/api/unistd.c +++ b/src/api/unistd.c @@ -114,7 +114,7 @@ C(_PC_REC_MIN_XFER_SIZE) C(_PC_REC_XFER_ALIGN) C(_PC_SYMLINK_MAX) C(_PC_SYNC_IO) -C(_PC_TIMESTAMP_RESOLUTION) +//C(_PC_TIMESTAMP_RESOLUTION) C(_PC_VDISABLE) C(_SC_2_C_BIND) C(_SC_2_C_DEV) @@ -235,7 +235,7 @@ C(_SC_XOPEN_REALTIME_THREADS) C(_SC_XOPEN_SHM) C(_SC_XOPEN_STREAMS) C(_SC_XOPEN_UNIX) -C(_SC_XOPEN_UUCP) +//C(_SC_XOPEN_UUCP) C(_SC_XOPEN_VERSION) C(STDERR_FILENO) C(STDIN_FILENO) --- Max Filippov (2): xtensa: add port WIP xtensa bits arch/xtensa/arch.mak | 1 + arch/xtensa/atomic_arch.h | 25 ++ arch/xtensa/bits/alltypes.h.in | 27 ++ arch/xtensa/bits/float.h | 16 + arch/xtensa/bits/ioctl.h | 219 ++++++++++++++ arch/xtensa/bits/ipcstat.h | 1 + arch/xtensa/bits/limits.h | 1 + arch/xtensa/bits/mman.h | 20 ++ arch/xtensa/bits/msg.h | 27 ++ arch/xtensa/bits/poll.h | 3 + arch/xtensa/bits/posix.h | 2 + arch/xtensa/bits/reg.h | 2 + arch/xtensa/bits/sem.h | 19 ++ arch/xtensa/bits/setjmp.h | 1 + arch/xtensa/bits/shm.h | 29 ++ arch/xtensa/bits/signal.h | 92 ++++++ arch/xtensa/bits/stat.h | 23 ++ arch/xtensa/bits/stdint.h | 20 ++ arch/xtensa/bits/syscall.h.in | 407 ++++++++++++++++++++++++++ arch/xtensa/bits/user.h | 4 + arch/xtensa/crt_arch.h | 48 +++ arch/xtensa/kstat.h | 18 ++ arch/xtensa/pthread_arch.h | 11 + arch/xtensa/reloc.h | 32 ++ arch/xtensa/syscall_arch.h | 104 +++++++ configure | 8 + crt/xtensa/crti.S | 21 ++ crt/xtensa/crtn.S | 15 + include/elf.h | 74 +++++ ldso/dlstart.c | 3 + ldso/dynlink.c | 8 +- src/internal/xtensa/syscall.s | 14 + src/ldso/xtensa/dlsym.s | 6 + src/ldso/xtensa/dlsym_time64.S | 3 + src/ldso/xtensa/tlsdesc.s | 25 ++ src/process/xtensa/vfork.s | 13 + src/setjmp/xtensa/longjmp.s | 18 ++ src/setjmp/xtensa/setjmp.s | 21 ++ src/signal/xtensa/restore.s | 10 + src/signal/xtensa/sigsetjmp.s | 22 ++ src/thread/xtensa/__set_thread_area.c | 9 + src/thread/xtensa/__unmapself.s | 9 + src/thread/xtensa/clone.S | 42 +++ src/thread/xtensa/syscall_cp.s | 34 +++ 44 files changed, 1506 insertions(+), 1 deletion(-) create mode 100644 arch/xtensa/arch.mak create mode 100644 arch/xtensa/atomic_arch.h create mode 100644 arch/xtensa/bits/alltypes.h.in create mode 100644 arch/xtensa/bits/float.h create mode 100644 arch/xtensa/bits/ioctl.h create mode 100644 arch/xtensa/bits/ipcstat.h create mode 100644 arch/xtensa/bits/limits.h create mode 100644 arch/xtensa/bits/mman.h create mode 100644 arch/xtensa/bits/msg.h create mode 100644 arch/xtensa/bits/poll.h create mode 100644 arch/xtensa/bits/posix.h create mode 100644 arch/xtensa/bits/reg.h create mode 100644 arch/xtensa/bits/sem.h create mode 100644 arch/xtensa/bits/setjmp.h create mode 100644 arch/xtensa/bits/shm.h create mode 100644 arch/xtensa/bits/signal.h create mode 100644 arch/xtensa/bits/stat.h create mode 100644 arch/xtensa/bits/stdint.h create mode 100644 arch/xtensa/bits/syscall.h.in create mode 100644 arch/xtensa/bits/user.h create mode 100644 arch/xtensa/crt_arch.h create mode 100644 arch/xtensa/kstat.h create mode 100644 arch/xtensa/pthread_arch.h create mode 100644 arch/xtensa/reloc.h create mode 100644 arch/xtensa/syscall_arch.h create mode 100644 crt/xtensa/crti.S create mode 100644 crt/xtensa/crtn.S create mode 100644 src/internal/xtensa/syscall.s create mode 100644 src/ldso/xtensa/dlsym.s create mode 100644 src/ldso/xtensa/dlsym_time64.S create mode 100644 src/ldso/xtensa/tlsdesc.s create mode 100644 src/process/xtensa/vfork.s create mode 100644 src/setjmp/xtensa/longjmp.s create mode 100644 src/setjmp/xtensa/setjmp.s create mode 100644 src/signal/xtensa/restore.s create mode 100644 src/signal/xtensa/sigsetjmp.s create mode 100644 src/thread/xtensa/__set_thread_area.c create mode 100644 src/thread/xtensa/__unmapself.s create mode 100644 src/thread/xtensa/clone.S create mode 100644 src/thread/xtensa/syscall_cp.s -- 2.39.2