#elif U_PLATFORM_HAS_WIN32_API
/* _M_IA64 should be defined in windows.h */# ifdefined(_M_IA64)*pCPU=IMAGE_FILE_MACHINE_IA64;*pBits =64;# elif defined(_M_AMD64)// link.exe does not really care about the .obj machine type and this will// allow us to build a dll for both ARM & x64 with an amd64 built tool// ARM is same as x64 except for first 2 bytes of object file*pCPU = IMAGE_FILE_MACHINE_UNKNOWN;// *pCPU = IMAGE_FILE_MACHINE_ARMNT; // If we wanted to be explicit// *pCPU = IMAGE_FILE_MACHINE_AMD64; // We would use one of these names*pBits =64;// Doesn't seem to be used for anything interesting?# else*pCPU=IMAGE_FILE_MACHINE_I386;// We would use one of these names*pBits =32;# endif
*pIsBigEndian=FALSE;#else# error "Unknown platform for CAN_GENERATE_OBJECTS."#endif
(Thanks to Jon Kunkee for pointing out the bug here.)
The tools
pkgdata
andgenccode
on Windows currently support ARM 32-bit, but not ARM 64-bit.However, when building the data .obj files, the image file type doesn't need to be set, as the unknown type can be used:
IMAGE_FILE_MACHINE_UNKNOWN
.This is what is currently used for AMD64 (x64) architecture.
We should modify this to simply the code, which will also enable support for ARM64 as well.
From the file
pkg_genc.cpp
https://github.com/unicode-org/icu/blob/master/icu4c/source/tools/toolutil/pkg_genc.cpp#L689-L707
Here is what the current code looks like:
#elif U_PLATFORM_HAS_WIN32_API /* _M_IA64 should be defined in windows.h */ # if defined(_M_IA64) *pCPU=IMAGE_FILE_MACHINE_IA64; *pBits = 64; # elif defined(_M_AMD64) // link.exe does not really care about the .obj machine type and this will // allow us to build a dll for both ARM & x64 with an amd64 built tool // ARM is same as x64 except for first 2 bytes of object file *pCPU = IMAGE_FILE_MACHINE_UNKNOWN; // *pCPU = IMAGE_FILE_MACHINE_ARMNT; // If we wanted to be explicit // *pCPU = IMAGE_FILE_MACHINE_AMD64; // We would use one of these names *pBits = 64; // Doesn't seem to be used for anything interesting? # else *pCPU=IMAGE_FILE_MACHINE_I386; // We would use one of these names *pBits = 32; # endif *pIsBigEndian=FALSE; #else # error "Unknown platform for CAN_GENERATE_OBJECTS." #endif
(Thanks to Jon Kunkee for pointing out the bug here.)