From: Hongliang Wang <wanghongliang@loongson.cn>
To: musl@lists.openwall.com
Subject: Re: [musl] add loongarch64 port v9.
Date: Mon, 20 Nov 2023 14:11:56 +0800 [thread overview]
Message-ID: <2a8d55b0-add3-4d90-1119-4e5c28b6626e@loongson.cn> (raw)
In-Reply-To: <ef67369e-f3e4-aa4b-1c9f-d16cafbc8b80@loongson.cn>
Hi, Rich
The patch for modify musl dynamic linker has been merged to gcc,
and also backported to gcc-12 and gcc-13.
The 0001-add-loongarch64-port-v8.patch is still as the latest patch.
Thank you very much.
Hongliang Wang.
在 2023/11/18 下午12:19, Jingyun Hua 写道:
> Hi,Rich
>
> I'm sorry for wasting everyone's time with my suggestion about the wrong
> dynamic connector name, and thank you for always taking the time to
> review the code for the musl LoongArch port.
>
> I carefully looked at the musl code and documentation again, LoongArch
> should follow the musl style and use naming consistent with other archs
> naming.
>
> and I saw that gcc also submitted a modification for this:
> https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637113.html
>
> This may be a good solution. After waiting for the modifications of gcc
> to be merged, we can add "-sp" to __loongarch_single_float based on the
> musl v8 patch, and at the same time, gcc will backport the
> modifications to gcc-12 and gcc-13.
>
> Thank you very much.
>
> Regards,
> Jingyun Hua
>
> On 11/18/23 1:25 AM, Rich Felker wrote:
>> On Fri, Nov 17, 2023 at 03:20:58PM +0800, Hongliang Wang wrote:
>>>
>>>
>>> 在 2023/11/17 上午12:10, Rich Felker 写道:
>>>> On Thu, Nov 16, 2023 at 10:54:44AM +0800, Hongliang Wang wrote:
>>>>> Hi,
>>>>>
>>>>> Thank you for your suggestion, I have modified the dynamic linker
>>>>> name according to the basic ABI types are specified in the ABI
>>>>> document of the LoongArch, and post
>>>>> 0001-add-loongarch64-port-v9.patch,
>>>>> as shown in the attachment.
>>>>>
>>>>> Based on 0001-add-loongarch64-port-v8.patch,the modifications for
>>>>> 0001-add-loongarch64-port-v9.patch are as follows:
>>>>>
>>>>> ---
>>>>> arch/loongarch64/reloc.h | 10 ++++++----
>>>>> configure | 4 +++-
>>>>> 2 files changed, 9 insertions(+), 5 deletions(-)
>>>>>
>>>>> diff --git a/arch/loongarch64/reloc.h b/arch/loongarch64/reloc.h
>>>>> index a4482b48..6907de8e 100644
>>>>> --- a/arch/loongarch64/reloc.h
>>>>> +++ b/arch/loongarch64/reloc.h
>>>>> @@ -1,7 +1,9 @@
>>>>> -#ifdef __loongarch_soft_float
>>>>> -#define FP_SUFFIX "-sf"
>>>>> -#else
>>>>> -#define FP_SUFFIX ""
>>>>> +#if defined __loongarch_double_float
>>>>> +#define FP_SUFFIX "-lp64d"
>>>>> +#elif defined __loongarch_single_float
>>>>> +#define FP_SUFFIX "-lp64f"
>>>>> +#elif defined __loongarch_soft_float
>>>>> +#define FP_SUFFIX "-lp64s"
>>>>> #endif
>>>>>
>>>>> #define LDSO_ARCH "loongarch64" FP_SUFFIX
>>>>> diff --git a/configure b/configure
>>>>> index 55d179f1..93b06287 100755
>>>>> --- a/configure
>>>>> +++ b/configure
>>>>> @@ -673,7 +673,9 @@ trycppif __AARCH64EB__ "$t" &&
>>>>> SUBARCH=${SUBARCH}_be
>>>>> fi
>>>>>
>>>>> if test "$ARCH" = "loongarch64" ; then
>>>>> -trycppif __loongarch_soft_float "$t" && SUBARCH=${SUBARCH}-sf
>>>>> +trycppif __loongarch_double_float "$t" && SUBARCH=${SUBARCH}-lp64d
>>>>> +trycppif __loongarch_single_float "$t" && SUBARCH=${SUBARCH}-lp64f
>>>>> +trycppif __loongarch_soft_float "$t" && SUBARCH=${SUBARCH}-lp64s
>>>>> printf "checking whether compiler support FCSRs... "
>>>>> echo "__asm__(\"movfcsr2gr \$t0,\$fcsr0\");" > "$tmpc"
>>>>> if $CC -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
>>>>> --
>>>>>
>>>>> Please review again, and point them out if any questions need to be
>>>>> modified, thanks.
>>>>
>>>> Why are you changing the ABI name for the existing one to something
>>>> different rather than just adding the missing ones, and doing it with
>>>> a name that's less descriptive ("-sf" is widely recognized as a
>>>> softfloat suffix, -lp64s not so much) and adding a redundant "lp64"
>>>> part to each one that does not seem to be part of distinguishing the
>>>> float ABI?
>>>>
>>>> Rich
>>>>
>>> We change the ABI name based on the LoongArch ELF ABI specification,
>>> which can be seen:
>>> https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html
>>>
>>> (Table 7. Base ABI Types.)
>>> The specification defines lp64d, lp64s, lp64f:
>>> lp64d indicates uses 64-bit FPRs, d indicates double float.
>>> lp64s indicates uses 32-bit FPRs, s indicates single float.
>>> lp64f indicates uses no FPRs, f indicates soft float.
>>>
>>> The specification does not define sf, so I removed it.
>>> The define in musl is also consistent with gcc.
>>
>> Please use naming consistent with what we do for other archs in musl
>> for a proposal to be included in musl. This means:
>>
>> - Subarch should be empty for the default (I assume that means
>> hardware floating point with full double precision) ABI that you
>> expect most Linux-compatible systems to be using.
>>
>> - Don't include extraneous stuff like "lp64" that's universal to the
>> architecture in the subarch name. There isn't a need to align these
>> names with anything outside of musl.
>>
>> Please stick with what has already been approved, with changes
>> well-motivated -- in this case, that means just proposing a name for
>> the single-precision subarch. My preference would be to use "-sp" like
>> we did for riscv64.
>>
>> The reason this has taken so long to get merged is that *every* time I
>> set aside some time to apply it, there are new gratuitous changes,
>> many of which seem to be motivated by style musl does not follow. I'd
>> like to merge precisely what I reviewed last time, with the gratuitous
>> changes I found reverted, plus the new subarch/ldso name for single
>> precision. Does this sound good?
>>
>> Rich
>>
>
next prev parent reply other threads:[~2023-11-20 6:12 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-18 1:28 [musl] add loongarch64 port v7 王洪亮
2023-04-18 9:38 ` Szabolcs Nagy
2023-04-18 10:47 ` Szabolcs Nagy
2023-04-18 11:32 ` 王洪亮
2023-05-10 3:36 ` 王洪亮
2023-06-01 12:44 ` wanghongliang
2023-06-25 3:43 ` Hongliang Wang
2023-07-19 6:55 ` Hongliang Wang
2023-08-05 6:18 ` 翟小娟
2023-08-05 15:43 ` Rich Felker
2023-08-13 1:41 ` Rich Felker
2023-08-15 9:24 ` Hongliang Wang
2023-08-15 9:32 ` alice
2023-08-25 9:27 ` 翟小娟
[not found] ` <99d954ca-faee-2cac-97af-7fc2ecdb9a89@loongson.cn>
2023-09-20 7:45 ` Jianmin Lv
2023-09-20 13:16 ` Szabolcs Nagy
2023-09-22 1:37 ` Hongliang Wang
2023-09-26 3:28 ` [musl] add loongarch64 port v8 Hongliang Wang
2023-10-08 3:05 ` 花静云
2023-11-09 13:15 ` Jingyun Hua
2023-11-14 13:16 ` Jingyun Hua
2023-11-16 2:54 ` [musl] add loongarch64 port v9 Hongliang Wang
2023-11-16 16:10 ` Rich Felker
2023-11-17 7:20 ` Hongliang Wang
2023-11-17 17:25 ` Rich Felker
2023-11-18 4:19 ` Jingyun Hua
2023-11-20 6:11 ` Hongliang Wang [this message]
2023-12-08 8:23 ` [musl] Re:[musl] add loongarch64 port v8 Hongliang Wang
2023-12-18 7:44 ` Jingyun Hua
2024-01-29 1:26 ` [musl] " Hongliang Wang
2024-01-29 3:14 ` Rich Felker
2024-01-29 7:37 ` Hongliang Wang
2023-11-16 16:44 ` [musl] add loongarch64 port v9 Szabolcs Nagy
2023-11-16 17:18 ` Szabolcs Nagy
2023-11-17 7:19 ` Hongliang Wang
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=2a8d55b0-add3-4d90-1119-4e5c28b6626e@loongson.cn \
--to=wanghongliang@loongson.cn \
--cc=musl@lists.openwall.com \
/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).