mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] kbuild: force 16-bit wchar_t treewide
@ 2021-10-05  7:00 Ahmad Fatoum
  2021-10-05  7:08 ` Ahmad Fatoum
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2021-10-05  7:00 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

All current uses of wchar_t assume 16 bit code units. We enforce this
via -fshort-wchar on x86 and by typedefing in <linux/nls.h>.

Make wchar_t universally 16-bit to acknowledge this, a small step
towards ARM and RISC-V EFI support in barebox.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 Makefile          | 2 +-
 arch/x86/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 74e4893f02c8..cc01e5656d7c 100644
--- a/Makefile
+++ b/Makefile
@@ -438,7 +438,7 @@ LINUXINCLUDE    := -Iinclude -I$(srctree)/dts/include \
 KBUILD_CPPFLAGS        := -D__KERNEL__ -D__BAREBOX__ $(LINUXINCLUDE) -fno-builtin -ffreestanding
 
 KBUILD_CFLAGS   := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
-		   -fno-strict-aliasing -fno-common \
+		   -fno-strict-aliasing -fno-common -fshort-wchar \
                    -Werror=implicit-function-declaration -Werror=implicit-int \
                    -Os -pipe -Wmissing-prototypes -std=gnu89
 KBUILD_AFLAGS          := -D__ASSEMBLY__
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index fd871ca21419..532246647b63 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -5,7 +5,7 @@ KBUILD_CPPFLAGS += -D__X86__
 TEXT_BASE = $(CONFIG_TEXT_BASE)
 
 machine-y := efi
-KBUILD_CFLAGS += -fpic -fshort-wchar -mno-sse -mno-mmx
+KBUILD_CFLAGS += -fpic -mno-sse -mno-mmx
 ifeq ($(CONFIG_X86_32),y)
 	TARGET = efi-app-ia32
 else
-- 
2.33.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] kbuild: force 16-bit wchar_t treewide
  2021-10-05  7:00 [PATCH] kbuild: force 16-bit wchar_t treewide Ahmad Fatoum
@ 2021-10-05  7:08 ` Ahmad Fatoum
  0 siblings, 0 replies; 2+ messages in thread
From: Ahmad Fatoum @ 2021-10-05  7:08 UTC (permalink / raw)
  To: Ahmad Fatoum, barebox

On 05.10.21 09:00, Ahmad Fatoum wrote:
> All current uses of wchar_t assume 16 bit code units. We enforce this
> via -fshort-wchar on x86 and by typedefing in <linux/nls.h>.
> 
> Make wchar_t universally 16-bit to acknowledge this, a small step
> towards ARM and RISC-V EFI support in barebox.

Please dismiss. Reasoning is not sound. We have our own (two!) definitions
of wchar_t, so this would only affect host/target tool build.

Will respin later.

> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
> ---
>  Makefile          | 2 +-
>  arch/x86/Makefile | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 74e4893f02c8..cc01e5656d7c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -438,7 +438,7 @@ LINUXINCLUDE    := -Iinclude -I$(srctree)/dts/include \
>  KBUILD_CPPFLAGS        := -D__KERNEL__ -D__BAREBOX__ $(LINUXINCLUDE) -fno-builtin -ffreestanding
>  
>  KBUILD_CFLAGS   := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
> -		   -fno-strict-aliasing -fno-common \
> +		   -fno-strict-aliasing -fno-common -fshort-wchar \
>                     -Werror=implicit-function-declaration -Werror=implicit-int \
>                     -Os -pipe -Wmissing-prototypes -std=gnu89
>  KBUILD_AFLAGS          := -D__ASSEMBLY__
> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index fd871ca21419..532246647b63 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -5,7 +5,7 @@ KBUILD_CPPFLAGS += -D__X86__
>  TEXT_BASE = $(CONFIG_TEXT_BASE)
>  
>  machine-y := efi
> -KBUILD_CFLAGS += -fpic -fshort-wchar -mno-sse -mno-mmx
> +KBUILD_CFLAGS += -fpic -mno-sse -mno-mmx
>  ifeq ($(CONFIG_X86_32),y)
>  	TARGET = efi-app-ia32
>  else
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-05  7:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05  7:00 [PATCH] kbuild: force 16-bit wchar_t treewide Ahmad Fatoum
2021-10-05  7:08 ` Ahmad Fatoum

mail archive of the barebox mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://lore.barebox.org/barebox/0 barebox/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 barebox barebox/ https://lore.barebox.org/barebox \
		barebox@lists.infradead.org
	public-inbox-index barebox

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git