Skip to contentSkip to conversation

Xen: don't warn about 2-byte wchar_t in efi

PATCH In review Arnd Bergmann 2 participants 4 messages May 11, 2016 – May 18, 2016 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Xen: don't warn about 2-byte wchar_t in efi

The XEN UEFI code has become available on the ARM architecture recently, but now causes a link-time warning:

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

This seems harmless, because the efi code only uses 2-byte characters when interacting with EFI, so we don't pass on those strings to elsewhere in the system, and we just need to silence the warning.

It is not clear to me whether we actually need to build the file with the -fshort-wchar flag, but if we do, then we should also pass --no-wchar-size-warning to the linker, to avoid the warning.

Fixes 37060935dc04 ("ARM64: XEN: Add a function to initialize Xen specific UEFI runtime services")
---
 drivers/xen/Makefile | 1 +
 1 file changed, 1 insertion(+)
drivers/xen/Makefile +1 -0
index 415f2869054b..8feab810aed9 100644
@@ -8,6 +8,7 @@ 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
Signature · 1 line
2.7.0
#1 lore raw
Quoted 10 lines · Arnd Bergmann

The XEN UEFI code has become available on the ARM architecture recently, but now causes a link-time warning:

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

This seems harmless, because the efi code only uses 2-byte characters when interacting with EFI, so we don't pass on those strings to elsewhere in the system, and we just need to silence the warning.

Quoted 6 lines

It is not clear to me whether we actually need to build the file with the -fshort-wchar flag, but if we do, then we should also pass --no-wchar-size-warning to the linker, to avoid the warning.

Fixes 37060935dc04 ("ARM64: XEN: Add a function to initialize Xen specific UEFI runtime services")

Given that drivers/xen/efi.c doesn't actually use any wchar_t, it is not clear to me whether we need to pass -fshort-wchar either. However this patch is correct any, so I committed it to xentip.

Quoted 18 lines
 drivers/xen/Makefile | 1 +
 1 file changed, 1 insertion(+)
drivers/xen/Makefile +1 -0
index 415f2869054b..8feab810aed9 100644
@@ -8,6 +8,7 @@ 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
Signature · 1 line
2.7.0
#3 lore raw
In reply to Arnd Bergmann
Quoted 10 lines · Arnd Bergmann

The XEN UEFI code has become available on the ARM architecture recently, but now causes a link-time warning:

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

This seems harmless, because the efi code only uses 2-byte characters when interacting with EFI, so we don't pass on those strings to elsewhere in the system, and we just need to silence the warning.

Quoted 6 lines

It is not clear to me whether we actually need to build the file with the -fshort-wchar flag, but if we do, then we should also pass --no-wchar-size-warning to the linker, to avoid the warning.

Fixes 37060935dc04 ("ARM64: XEN: Add a function to initialize Xen specific UEFI runtime services")

Given that drivers/xen/efi.c doesn't actually use any wchar_t, it is not clear to me whether we need to pass -fshort-wchar either. However this patch is correct any, so I committed it to xentip.

Quoted 18 lines
 drivers/xen/Makefile | 1 +
 1 file changed, 1 insertion(+)
drivers/xen/Makefile +1 -0
index 415f2869054b..8feab810aed9 100644
@@ -8,6 +8,7 @@ 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
Signature · 1 line
2.7.0

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
In reply to Stefano Stabellini
Quoted 15 lines · On Monday 16 May 2016 12:08:17 Stefano Stabellini wrote:
Quoted 14 lines · Arnd Bergmann

The XEN UEFI code has become available on the ARM architecture recently, but now causes a link-time warning:

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

This seems harmless, because the efi code only uses 2-byte characters when interacting with EFI, so we don't pass on those strings to elsewhere in the system, and we just need to silence the warning.

It is not clear to me whether we actually need to build the file with the -fshort-wchar flag, but if we do, then we should also pass --no-wchar-size-warning to the linker, to avoid the warning.

Quoted 6 lines
Quoted 2 lines
Fixes 37060935dc04 ("ARM64: XEN: Add a function to initialize Xen specific UEFI runtime services")

Given that drivers/xen/efi.c doesn't actually use any wchar_t, it is not clear to me whether we need to pass -fshort-wchar either. However this patch is correct any, so I committed it to xentip.

Right, I was wondering about that too, but it has been this way since the code was first merged, so I couldn't figure out if removing the flag had any side-effects.

Arnd

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel