All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Kbuild: use -fshort-wchar globally
@ 2017-07-26 13:36 Arnd Bergmann
  2017-08-20 12:31 ` Masahiro Yamada
  2017-08-20 12:31 ` Masahiro Yamada
  0 siblings, 2 replies; 8+ messages in thread
From: Arnd Bergmann @ 2017-07-26 13:36 UTC (permalink / raw)
  To: Andrew Morton, Masahiro Yamada, Michal Marek, Boris Ostrovsky,
	Juergen Gross
  Cc: Arnd Bergmann, David Vrabel, linux-kbuild, linux-kernel, xen-devel

A previous patch added the --no-wchar-size-warning to the Makefile to
avoid this harmless warning:

arm-linux-gnueabi-ld: warning: drivers/xen/efi.o uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail

Changing kbuild to use thin archives instead of recursive linking
unfortunately brings the same warning back during the final link.

The kernel does not use wchar_t string literals at this point, and
xen does not use wchar_t at all (only efi_char16_t), so the flag
has no effect, but as pointed out by Jan Beulich, adding a wchar_t
string literal would be bad here.

Since wchar_t is always defined as u16, independent of the toolchain
default, always passing -fshort-wchar is correct and lets us
remove the Xen specific hack along with fixing the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 971a69db7dc0 ("Xen: don't warn about 2-byte wchar_t in efi")
Acked-by: David Vrabel <david.vrabel@citrix.com>
Link: https://patchwork.kernel.org/patch/9275217/
---
I submitted an earlier patch in August 2016, simply removing the
flag in xen, but there seems to be no harm in enabling it globally
---
 Makefile             | 2 +-
 drivers/xen/Makefile | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index f1533423094f..0fe63a47fd52 100644
--- a/Makefile
+++ b/Makefile
@@ -396,7 +396,7 @@ LINUXINCLUDE    := \
 KBUILD_CPPFLAGS := -D__KERNEL__
 
 KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-		   -fno-strict-aliasing -fno-common \
+		   -fno-strict-aliasing -fno-common -fshort-wchar \
 		   -Werror-implicit-function-declaration \
 		   -Wno-format-security \
 		   -std=gnu89 $(call cc-option,-fno-PIE)
diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 8feab810aed9..7f188b8d0c67 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -7,9 +7,6 @@ obj-y	+= xenbus/
 nostackp := $(call cc-option, -fno-stack-protector)
 CFLAGS_features.o			:= $(nostackp)
 
-CFLAGS_efi.o				+= -fshort-wchar
-LDFLAGS					+= $(call ld-option, --no-wchar-size-warning)
-
 dom0-$(CONFIG_ARM64) += arm-device.o
 dom0-$(CONFIG_PCI) += pci.o
 dom0-$(CONFIG_USB_SUPPORT) += dbgp.o
-- 
2.9.0

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

* Re: [PATCH v2] Kbuild: use -fshort-wchar globally
  2017-07-26 13:36 [PATCH v2] Kbuild: use -fshort-wchar globally Arnd Bergmann
  2017-08-20 12:31 ` Masahiro Yamada
@ 2017-08-20 12:31 ` Masahiro Yamada
  2017-08-20 19:22   ` Arnd Bergmann
  2017-08-20 19:22   ` Arnd Bergmann
  1 sibling, 2 replies; 8+ messages in thread
From: Masahiro Yamada @ 2017-08-20 12:31 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andrew Morton, Michal Marek, Boris Ostrovsky, Juergen Gross,
	David Vrabel, Linux Kbuild mailing list,
	Linux Kernel Mailing List, xen-devel

Hi Arnd,

This patch was picked up for linux-next
(I assume it was queued up for 4.14-rc1)
but I see this warning in Linus' tree.

If we are not comfortable with this warning in the 4.13 release,
shall I include this patch in the kbuild/fixes pull request?
(planned this week)

Please let me know your thought.


2017-07-26 22:36 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
> A previous patch added the --no-wchar-size-warning to the Makefile to
> avoid this harmless warning:

"A previous patch" sounds ambiguous.

The previous patch was applied one year ago.


If it is OK, I can reword like

Commit 971a69db7dc0 ("Xen: don't warn about 2-byte wchar_t in efi") added ...






> arm-linux-gnueabi-ld: warning: drivers/xen/efi.o uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
>
> Changing kbuild to use thin archives instead of recursive linking
> unfortunately brings the same warning back during the final link.
>
> The kernel does not use wchar_t string literals at this point, and
> xen does not use wchar_t at all (only efi_char16_t), so the flag
> has no effect, but as pointed out by Jan Beulich, adding a wchar_t
> string literal would be bad here.
>
> Since wchar_t is always defined as u16, independent of the toolchain
> default, always passing -fshort-wchar is correct and lets us
> remove the Xen specific hack along with fixing the warning.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 971a69db7dc0 ("Xen: don't warn about 2-byte wchar_t in efi")
> Acked-by: David Vrabel <david.vrabel@citrix.com>
> Link: https://patchwork.kernel.org/patch/9275217/
> ---
> I submitted an earlier patch in August 2016, simply removing the
> flag in xen, but there seems to be no harm in enabling it globally
> ---
>  Makefile             | 2 +-
>  drivers/xen/Makefile | 3 ---
>  2 files changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index f1533423094f..0fe63a47fd52 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -396,7 +396,7 @@ LINUXINCLUDE    := \
>  KBUILD_CPPFLAGS := -D__KERNEL__
>
>  KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
> -                  -fno-strict-aliasing -fno-common \
> +                  -fno-strict-aliasing -fno-common -fshort-wchar \
>                    -Werror-implicit-function-declaration \
>                    -Wno-format-security \
>                    -std=gnu89 $(call cc-option,-fno-PIE)
> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> index 8feab810aed9..7f188b8d0c67 100644
> --- a/drivers/xen/Makefile
> +++ b/drivers/xen/Makefile
> @@ -7,9 +7,6 @@ obj-y   += xenbus/
>  nostackp := $(call cc-option, -fno-stack-protector)
>  CFLAGS_features.o                      := $(nostackp)
>
> -CFLAGS_efi.o                           += -fshort-wchar
> -LDFLAGS                                        += $(call ld-option, --no-wchar-size-warning)
> -
>  dom0-$(CONFIG_ARM64) += arm-device.o
>  dom0-$(CONFIG_PCI) += pci.o
>  dom0-$(CONFIG_USB_SUPPORT) += dbgp.o
> --
> 2.9.0
>



-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH v2] Kbuild: use -fshort-wchar globally
  2017-07-26 13:36 [PATCH v2] Kbuild: use -fshort-wchar globally Arnd Bergmann
@ 2017-08-20 12:31 ` Masahiro Yamada
  2017-08-20 12:31 ` Masahiro Yamada
  1 sibling, 0 replies; 8+ messages in thread
From: Masahiro Yamada @ 2017-08-20 12:31 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Juergen Gross, Linux Kbuild mailing list,
	Linux Kernel Mailing List, Michal Marek, David Vrabel, xen-devel,
	Andrew Morton, Boris Ostrovsky

Hi Arnd,

This patch was picked up for linux-next
(I assume it was queued up for 4.14-rc1)
but I see this warning in Linus' tree.

If we are not comfortable with this warning in the 4.13 release,
shall I include this patch in the kbuild/fixes pull request?
(planned this week)

Please let me know your thought.


2017-07-26 22:36 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
> A previous patch added the --no-wchar-size-warning to the Makefile to
> avoid this harmless warning:

"A previous patch" sounds ambiguous.

The previous patch was applied one year ago.


If it is OK, I can reword like

Commit 971a69db7dc0 ("Xen: don't warn about 2-byte wchar_t in efi") added ...






> arm-linux-gnueabi-ld: warning: drivers/xen/efi.o uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
>
> Changing kbuild to use thin archives instead of recursive linking
> unfortunately brings the same warning back during the final link.
>
> The kernel does not use wchar_t string literals at this point, and
> xen does not use wchar_t at all (only efi_char16_t), so the flag
> has no effect, but as pointed out by Jan Beulich, adding a wchar_t
> string literal would be bad here.
>
> Since wchar_t is always defined as u16, independent of the toolchain
> default, always passing -fshort-wchar is correct and lets us
> remove the Xen specific hack along with fixing the warning.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 971a69db7dc0 ("Xen: don't warn about 2-byte wchar_t in efi")
> Acked-by: David Vrabel <david.vrabel@citrix.com>
> Link: https://patchwork.kernel.org/patch/9275217/
> ---
> I submitted an earlier patch in August 2016, simply removing the
> flag in xen, but there seems to be no harm in enabling it globally
> ---
>  Makefile             | 2 +-
>  drivers/xen/Makefile | 3 ---
>  2 files changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index f1533423094f..0fe63a47fd52 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -396,7 +396,7 @@ LINUXINCLUDE    := \
>  KBUILD_CPPFLAGS := -D__KERNEL__
>
>  KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
> -                  -fno-strict-aliasing -fno-common \
> +                  -fno-strict-aliasing -fno-common -fshort-wchar \
>                    -Werror-implicit-function-declaration \
>                    -Wno-format-security \
>                    -std=gnu89 $(call cc-option,-fno-PIE)
> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> index 8feab810aed9..7f188b8d0c67 100644
> --- a/drivers/xen/Makefile
> +++ b/drivers/xen/Makefile
> @@ -7,9 +7,6 @@ obj-y   += xenbus/
>  nostackp := $(call cc-option, -fno-stack-protector)
>  CFLAGS_features.o                      := $(nostackp)
>
> -CFLAGS_efi.o                           += -fshort-wchar
> -LDFLAGS                                        += $(call ld-option, --no-wchar-size-warning)
> -
>  dom0-$(CONFIG_ARM64) += arm-device.o
>  dom0-$(CONFIG_PCI) += pci.o
>  dom0-$(CONFIG_USB_SUPPORT) += dbgp.o
> --
> 2.9.0
>



-- 
Best Regards
Masahiro Yamada

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH v2] Kbuild: use -fshort-wchar globally
  2017-08-20 12:31 ` Masahiro Yamada
  2017-08-20 19:22   ` Arnd Bergmann
@ 2017-08-20 19:22   ` Arnd Bergmann
  2017-08-21  0:09     ` Masahiro Yamada
  2017-08-21  0:09     ` Masahiro Yamada
  1 sibling, 2 replies; 8+ messages in thread
From: Arnd Bergmann @ 2017-08-20 19:22 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Andrew Morton, Michal Marek, Boris Ostrovsky, Juergen Gross,
	David Vrabel, Linux Kbuild mailing list,
	Linux Kernel Mailing List, xen-devel

On Sun, Aug 20, 2017 at 2:31 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> Hi Arnd,
>
> This patch was picked up for linux-next
> (I assume it was queued up for 4.14-rc1)
> but I see this warning in Linus' tree.
>
> If we are not comfortable with this warning in the 4.13 release,
> shall I include this patch in the kbuild/fixes pull request?
> (planned this week)
>
> Please let me know your thought.

Yes, I think it would be good to have in 4.13, since it's a regression
against older kernels.

> 2017-07-26 22:36 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
>> A previous patch added the --no-wchar-size-warning to the Makefile to
>> avoid this harmless warning:
>
> "A previous patch" sounds ambiguous.
>
> The previous patch was applied one year ago.
>
>
> If it is OK, I can reword like
>
> Commit 971a69db7dc0 ("Xen: don't warn about 2-byte wchar_t in efi") added ...

Good idea, thanks!

       Arnd

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

* Re: [PATCH v2] Kbuild: use -fshort-wchar globally
  2017-08-20 12:31 ` Masahiro Yamada
@ 2017-08-20 19:22   ` Arnd Bergmann
  2017-08-20 19:22   ` Arnd Bergmann
  1 sibling, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2017-08-20 19:22 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Juergen Gross, Linux Kbuild mailing list,
	Linux Kernel Mailing List, Michal Marek, David Vrabel, xen-devel,
	Andrew Morton, Boris Ostrovsky

On Sun, Aug 20, 2017 at 2:31 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> Hi Arnd,
>
> This patch was picked up for linux-next
> (I assume it was queued up for 4.14-rc1)
> but I see this warning in Linus' tree.
>
> If we are not comfortable with this warning in the 4.13 release,
> shall I include this patch in the kbuild/fixes pull request?
> (planned this week)
>
> Please let me know your thought.

Yes, I think it would be good to have in 4.13, since it's a regression
against older kernels.

> 2017-07-26 22:36 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
>> A previous patch added the --no-wchar-size-warning to the Makefile to
>> avoid this harmless warning:
>
> "A previous patch" sounds ambiguous.
>
> The previous patch was applied one year ago.
>
>
> If it is OK, I can reword like
>
> Commit 971a69db7dc0 ("Xen: don't warn about 2-byte wchar_t in efi") added ...

Good idea, thanks!

       Arnd

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH v2] Kbuild: use -fshort-wchar globally
  2017-08-20 19:22   ` Arnd Bergmann
  2017-08-21  0:09     ` Masahiro Yamada
@ 2017-08-21  0:09     ` Masahiro Yamada
  1 sibling, 0 replies; 8+ messages in thread
From: Masahiro Yamada @ 2017-08-21  0:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andrew Morton, Michal Marek, Boris Ostrovsky, Juergen Gross,
	David Vrabel, Linux Kbuild mailing list,
	Linux Kernel Mailing List, xen-devel

2017-08-21 4:22 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
> On Sun, Aug 20, 2017 at 2:31 PM, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>> Hi Arnd,
>>
>> This patch was picked up for linux-next
>> (I assume it was queued up for 4.14-rc1)
>> but I see this warning in Linus' tree.
>>
>> If we are not comfortable with this warning in the 4.13 release,
>> shall I include this patch in the kbuild/fixes pull request?
>> (planned this week)
>>
>> Please let me know your thought.
>
> Yes, I think it would be good to have in 4.13, since it's a regression
> against older kernels.
>
>> 2017-07-26 22:36 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
>>> A previous patch added the --no-wchar-size-warning to the Makefile to
>>> avoid this harmless warning:
>>
>> "A previous patch" sounds ambiguous.
>>
>> The previous patch was applied one year ago.
>>
>>
>> If it is OK, I can reword like
>>
>> Commit 971a69db7dc0 ("Xen: don't warn about 2-byte wchar_t in efi") added ...
>
> Good idea, thanks!
>


Applied to linux-kbuild/fixes.  Thanks!



-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH v2] Kbuild: use -fshort-wchar globally
  2017-08-20 19:22   ` Arnd Bergmann
@ 2017-08-21  0:09     ` Masahiro Yamada
  2017-08-21  0:09     ` Masahiro Yamada
  1 sibling, 0 replies; 8+ messages in thread
From: Masahiro Yamada @ 2017-08-21  0:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Juergen Gross, Linux Kbuild mailing list,
	Linux Kernel Mailing List, Michal Marek, David Vrabel, xen-devel,
	Andrew Morton, Boris Ostrovsky

2017-08-21 4:22 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
> On Sun, Aug 20, 2017 at 2:31 PM, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>> Hi Arnd,
>>
>> This patch was picked up for linux-next
>> (I assume it was queued up for 4.14-rc1)
>> but I see this warning in Linus' tree.
>>
>> If we are not comfortable with this warning in the 4.13 release,
>> shall I include this patch in the kbuild/fixes pull request?
>> (planned this week)
>>
>> Please let me know your thought.
>
> Yes, I think it would be good to have in 4.13, since it's a regression
> against older kernels.
>
>> 2017-07-26 22:36 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
>>> A previous patch added the --no-wchar-size-warning to the Makefile to
>>> avoid this harmless warning:
>>
>> "A previous patch" sounds ambiguous.
>>
>> The previous patch was applied one year ago.
>>
>>
>> If it is OK, I can reword like
>>
>> Commit 971a69db7dc0 ("Xen: don't warn about 2-byte wchar_t in efi") added ...
>
> Good idea, thanks!
>


Applied to linux-kbuild/fixes.  Thanks!



-- 
Best Regards
Masahiro Yamada

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* [PATCH v2] Kbuild: use -fshort-wchar globally
@ 2017-07-26 13:36 Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2017-07-26 13:36 UTC (permalink / raw)
  To: Andrew Morton, Masahiro Yamada, Michal Marek, Boris Ostrovsky,
	Juergen Gross
  Cc: linux-kernel, xen-devel, David Vrabel, Arnd Bergmann, linux-kbuild

A previous patch added the --no-wchar-size-warning to the Makefile to
avoid this harmless warning:

arm-linux-gnueabi-ld: warning: drivers/xen/efi.o uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail

Changing kbuild to use thin archives instead of recursive linking
unfortunately brings the same warning back during the final link.

The kernel does not use wchar_t string literals at this point, and
xen does not use wchar_t at all (only efi_char16_t), so the flag
has no effect, but as pointed out by Jan Beulich, adding a wchar_t
string literal would be bad here.

Since wchar_t is always defined as u16, independent of the toolchain
default, always passing -fshort-wchar is correct and lets us
remove the Xen specific hack along with fixing the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 971a69db7dc0 ("Xen: don't warn about 2-byte wchar_t in efi")
Acked-by: David Vrabel <david.vrabel@citrix.com>
Link: https://patchwork.kernel.org/patch/9275217/
---
I submitted an earlier patch in August 2016, simply removing the
flag in xen, but there seems to be no harm in enabling it globally
---
 Makefile             | 2 +-
 drivers/xen/Makefile | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index f1533423094f..0fe63a47fd52 100644
--- a/Makefile
+++ b/Makefile
@@ -396,7 +396,7 @@ LINUXINCLUDE    := \
 KBUILD_CPPFLAGS := -D__KERNEL__
 
 KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-		   -fno-strict-aliasing -fno-common \
+		   -fno-strict-aliasing -fno-common -fshort-wchar \
 		   -Werror-implicit-function-declaration \
 		   -Wno-format-security \
 		   -std=gnu89 $(call cc-option,-fno-PIE)
diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 8feab810aed9..7f188b8d0c67 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -7,9 +7,6 @@ obj-y	+= xenbus/
 nostackp := $(call cc-option, -fno-stack-protector)
 CFLAGS_features.o			:= $(nostackp)
 
-CFLAGS_efi.o				+= -fshort-wchar
-LDFLAGS					+= $(call ld-option, --no-wchar-size-warning)
-
 dom0-$(CONFIG_ARM64) += arm-device.o
 dom0-$(CONFIG_PCI) += pci.o
 dom0-$(CONFIG_USB_SUPPORT) += dbgp.o
-- 
2.9.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2017-08-21  0:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-26 13:36 [PATCH v2] Kbuild: use -fshort-wchar globally Arnd Bergmann
2017-08-20 12:31 ` Masahiro Yamada
2017-08-20 12:31 ` Masahiro Yamada
2017-08-20 19:22   ` Arnd Bergmann
2017-08-20 19:22   ` Arnd Bergmann
2017-08-21  0:09     ` Masahiro Yamada
2017-08-21  0:09     ` Masahiro Yamada
  -- strict thread matches above, loose matches on Subject: below --
2017-07-26 13:36 Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.