mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: 王洪亮 <wanghongliang@loongson.cn>
Cc: Rich Felker <dalias@libc.org>, musl@lists.openwall.com
Subject: Re: [musl] add loongarch64 port v6.
Date: Tue, 4 Apr 2023 19:06:35 +0200	[thread overview]
Message-ID: <20230404170635.GJ3630668@port70.net> (raw)
In-Reply-To: <fde95bef-50c7-8723-3905-df834723b0cc@loongson.cn>

* 王洪亮 <wanghongliang@loongson.cn> [2023-04-04 17:46:36 +0800]:
> 在 2023/4/3 下午11:44, Szabolcs Nagy 写道:
> > i was asking because of this glibc patch:
> > https://sourceware.org/pipermail/libc-alpha/2023-April/146897.html
> > 
> > i dont understand that change (loongarch is in glibc since 2.36 release).
> 
> Based on the v6 patch,I Modified the member names of struct sigcontext to
> maintain
> consistency with kernel and glibc. As shown in

(1) if _XOPEN_SOURCE && !_GNU_SOURCE && !_BSD_SOURCE mcontext_t fields
need not be accessible and must be in the impl reserved namespace
(no glibc or linux api compat requirement, only posix namespace req).

(2) otherwise musl mcontext_t fields must match glibc.
(ucontext and mcontext_t must use the same api across libcs).

i think it does not matter if the fields are different from the linux
uapi sigcontext fields. glibc used to include linux asm/sigcontext.h
to define mcontext_t so the fields were the same, but that polluted
the namespace and got fixed a while ago:
https://sourceware.org/bugzilla/show_bug.cgi?id=21457
since then mcontext_t is not the same as struct sigcontext, but
even before that they should not have been used interchangably
in c apis (the c abi must match though).

so i would not change the glibc code to match linux. and update the
musl patch to match current glibc api. the only wart i see is that
all targets currently have an uc_flags field in ucontext, loongarch
has an __uc_flags, but i think that's fine if there is no portable
use of this field. you may want to look into that, but it can be
fixed with a #define uc_flags __uc_flags if needed.

the glibc loongarch maintainers can break their api (and c++ abi) if
they wish to make it consistent with linux uapi, but i don't think
that's very useful. i'd wait for the glibc patch to be resolved and
fix musl patches accordingly. the v6 patches currently violate both
(1) and (2) requirements.

  reply	other threads:[~2023-04-04 17:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-03  8:15 [musl] add loongarch64 port v5 王洪亮
2022-09-06  1:51 ` [musl] " 王洪亮
2022-09-06  5:12   ` WANG Xuerui
2022-10-08  1:44     ` 王洪亮
2022-10-12  8:22 ` [musl] " WANG Xuerui
2022-11-15  7:17   ` [musl] add loongarch64 port v6 王洪亮
2022-12-19  6:32     ` 王洪亮
2023-01-09  9:46       ` 王洪亮
2023-01-29  1:15         ` 王洪亮
2023-01-29  8:52           ` Ariadne Conill
2023-01-29 17:04             ` Rich Felker
2023-01-30  1:27               ` 王洪亮
2023-02-16 23:13                 ` Rich Felker
2023-02-17  7:06                   ` 王洪亮
2023-03-17  8:41                     ` 王洪亮
2023-04-03 13:35                       ` Szabolcs Nagy
2023-04-03 14:42                         ` Rich Felker
2023-04-03 15:44                           ` Szabolcs Nagy
2023-04-04  9:46                             ` 王洪亮
2023-04-04 17:06                               ` Szabolcs Nagy [this message]
2023-04-11 10:00                                 ` 王洪亮
2023-04-12  2:21                                 ` 王洪亮
2022-10-12 18:20 ` [musl] add loongarch64 port v5 Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230404170635.GJ3630668@port70.net \
    --to=nsz@port70.net \
    --cc=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    --cc=wanghongliang@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).