From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9099 invoked from network); 11 Jan 2022 01:21:06 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 11 Jan 2022 01:21:06 -0000 Received: (qmail 31921 invoked by uid 550); 11 Jan 2022 01:21:04 -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 17557 invoked from network); 11 Jan 2022 00:43:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1641861816; bh=2SQkbaDqErJCAL1G7WuJqGfBP3AG+t9THZVq086exAc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=d+G8WIDD0d5/AssPw54l7FfxezbSxn/6G6hVgBZMTkHeNs7MyEh3u/wu4UOElRg59 FCAwcTrSiPf+jUD0hcNGcyYyJwgZ8YSGyK0ZrnoXPoX4xFkCizaQLUaJHJlBY8TLvz Hwd2fx4wZdEwYxst9LNCox30fpFFjSpsY9eg5QdPVUn1ZSn0Txf2VdeKRx5OaEMmb7 1vAReEJWApEdnThYvhaZUj6Zi0tra7XCdvE81dAx6tNJbZbPwcoJHoezJRBtTNk/FD D+6dkFiwvE1hXr6qpa6T2bwGGCmL1VAZg4rMvZmpOw6JQxRPSErztPJ35DV7q6XVMz 5pPZDGKJBk1LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=2SQkbaDqErJCAL1G7WuJqGfBP3AG+t9THZVq086exAc=; b=XpOKSWVO2kNKrAoY4Hze77Xip6mjuIARDSJgdnoys9UBPFMmk+dfz1WLQFztmCkKhk 1lIduemRJvAEr3qjua0urC7+qwAPombOledMP7NUx0xN/6rPe1vjxlcSKNWtk1iNu0ra dUY4QyD95EcL/hg95c6bZlBAGk/7XiUGY0zSKEfFYoPDvMv8a8In04EuxxofUICTmEfm DsKt3lwZD4MwGgn3zgzWsxCURD7j6MxxONTTeh50gZzyArywO3CUx4MLnt5EdBa/+Bcu wZFtMj8p06hlu1+k5zItS9rRoiCQ8/8GjIVFqJKDa+aj6vpctCynHlQ4B59yfcXQFy9I 96xg== X-Gm-Message-State: AOAM530hrpyjTgKKveoMlctRZMXEUyv8HH962YkloEYUEHQB8U7gQwGJ vSpegWrOSg3kdONWA8zEG1/hU/fGi//u9stylUriJLnTXeOq3/q1d9Gg2yRE0pNUjw8RhqS/UGX rcVW1yZ2TS/QOb468xMf4NDpVYQofpaRUeXY= X-Received: by 2002:adf:eed1:: with SMTP id a17mr1640733wrp.306.1641861815785; Mon, 10 Jan 2022 16:43:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRUzur0DdgBpr0iwwefqCfhU3aYywtJpD1lAON5jBxo807eJoJCZxKKZ+E3hch8xz3C9yewA== X-Received: by 2002:adf:eed1:: with SMTP id a17mr1640723wrp.306.1641861815599; Mon, 10 Jan 2022 16:43:35 -0800 (PST) Message-ID: <26cd3ebc-5d14-2403-e06b-c8ad3b31d65a@canonical.com> Date: Tue, 11 Jan 2022 01:43:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Content-Language: en-US To: Rich Felker Cc: musl@lists.openwall.com, =?UTF-8?Q?Milan_P=2e_Stani=c4=87?= References: <20220111002518.178068-1-heinrich.schuchardt@canonical.com> <20220111003600.GU7074@brightrain.aerifal.cx> From: Heinrich Schuchardt In-Reply-To: <20220111003600.GU7074@brightrain.aerifal.cx> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [musl] [PATCH 1/1] honor __WCHAR_TYPE__ on x86_64, arm, arm64, riscv64 On 1/11/22 01:36, Rich Felker wrote: > On Tue, Jan 11, 2022 at 01:25:18AM +0100, Heinrich Schuchardt wrote: >> Some programs like U-Boot are compiled with GCC option -fshort-wchar. >> In this case wchar_t must be a 16 bit type. > > This is not something you can just change with an option. The wchar_t > type is an ABI contract with the library functions that take (or take > pointers to) wchar_t. > > Can you explain how this actually comes up in the applications so we > can look into getting them fixed? See https://gitlab.alpinelinux.org/alpine/aports/-/issues/13411 Best regards Heinrich > >> Signed-off-by: Heinrich Schuchardt >> --- >> arch/aarch64/bits/alltypes.h.in | 5 +++++ >> arch/arm/bits/alltypes.h.in | 4 ++++ >> arch/riscv64/bits/alltypes.h.in | 4 ++++ >> arch/x86_64/bits/alltypes.h.in | 4 ++++ >> 4 files changed, 17 insertions(+) >> >> diff --git a/arch/aarch64/bits/alltypes.h.in b/arch/aarch64/bits/alltypes.h.in >> index c547ca0b..c0263348 100644 >> --- a/arch/aarch64/bits/alltypes.h.in >> +++ b/arch/aarch64/bits/alltypes.h.in >> @@ -11,8 +11,13 @@ >> #define __LONG_MAX 0x7fffffffffffffffL >> >> #ifndef __cplusplus >> +#ifdef __WCHAR_TYPE__ >> +TYPEDEF __WCHAR_TYPE__ wchar_t; >> +#else >> TYPEDEF unsigned wchar_t; >> #endif >> +#endif >> + >> TYPEDEF unsigned wint_t; >> >> TYPEDEF int blksize_t; >> diff --git a/arch/arm/bits/alltypes.h.in b/arch/arm/bits/alltypes.h.in >> index d62bd7bd..9596466b 100644 >> --- a/arch/arm/bits/alltypes.h.in >> +++ b/arch/arm/bits/alltypes.h.in >> @@ -12,8 +12,12 @@ >> #define __LONG_MAX 0x7fffffffL >> >> #ifndef __cplusplus >> +#ifdef __WCHAR_TYPE__ >> +TYPEDEF __WCHAR_TYPE__ wchar_t; >> +#else >> TYPEDEF unsigned wchar_t; >> #endif >> +#endif >> >> TYPEDEF float float_t; >> TYPEDEF double double_t; >> diff --git a/arch/riscv64/bits/alltypes.h.in b/arch/riscv64/bits/alltypes.h.in >> index 4579d174..f8f8b7e5 100644 >> --- a/arch/riscv64/bits/alltypes.h.in >> +++ b/arch/riscv64/bits/alltypes.h.in >> @@ -6,8 +6,12 @@ >> #define __LONG_MAX 0x7fffffffffffffffL >> >> #ifndef __cplusplus >> +#ifdef __WCHAR_TYPE__ >> +TYPEDEF __WCHAR_TYPE__ wchar_t; >> +#else >> TYPEDEF int wchar_t; >> #endif >> +#endif >> >> TYPEDEF int blksize_t; >> TYPEDEF unsigned int nlink_t; >> diff --git a/arch/x86_64/bits/alltypes.h.in b/arch/x86_64/bits/alltypes.h.in >> index 5cd8a299..748ff632 100644 >> --- a/arch/x86_64/bits/alltypes.h.in >> +++ b/arch/x86_64/bits/alltypes.h.in >> @@ -6,8 +6,12 @@ >> #define __LONG_MAX 0x7fffffffffffffffL >> >> #ifndef __cplusplus >> +#ifdef __WCHAR_TYPE__ >> +TYPEDEF __WCHAR_TYPE__ wchar_t; >> +#else >> TYPEDEF int wchar_t; >> #endif >> +#endif >> >> #if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 2 >> TYPEDEF long double float_t; >> -- >> 2.33.1