The tool pkgdata uses snprintf() to build the strings of the commands that
will execute later during the install process. But the maximum size of this
buffers is not enough when there is a long path.
This has caused issues on some CI systems that use very long paths, causing
the install process to produce a wrong result.
The maximum path on Linux is 4096 (defined as PATH_MAX at <linux/limits.h>)
So the size of SMALL_BUFFER_MAX_SIZE should be 4096 to avoid errors related
to truncated paths.
1. double size one stack buffer
2. add pragma to ignore some theorical case because the array are in
same length but some fields are shorter than the other.
ICU-21589 wrap with defined(__GNUC__)
ICU-21589 avoid clang
This is the normal standard way in C, C++ as well as Java and there's no
longer any reason for ICU to be different. The various internal macros
providing custom boolean constants can all be deleted and code as well
as documentation can be updated to use lowercase true/false everywhere.
This also changes the pkgdata tool command line options to decouple the
ARM/ARM64 flags from the UWP flag, and adds a generic architecture
option (-a) for passing in the value of the linker "/MACHINE:" argument
on the command line. (Ex: -a ARM64).
Additionally this change also adds another option to pkgdata (-b) to
set /DYNAMICBASE on the data DLL, which is required for the ARM64 builds.
Both of these changes also work towards future work in order to enable
full ARM64 desktop builds without UWP.
This change also removes a number of ifdefs/forks in the ICU code based
on U_PLATFORM_HAS_WINUWP_API, and changes them to use ICU_DATA_DIR_WINDOWS
instead. This is needed to unblock the usage of the data DLL in the
UWP scenario, but also helps to further reduce the divergence of the UWP
projects from regular Windows builds.
Related tickets:
ICU4C: Remove fixed DLL base addresses when building Windows DLLs
https://unicode-org.atlassian.net/browse/ICU-20768
Add support to generate ICU data DLL for Windows arm64
https://unicode-org.atlassian.net/browse/ICU-20670
- added PKGDATA_TRAILING_SPACE to all of the pkgdataMakefile.in file.
- NOTE: Users who create their own pkgdata.inc / icupkg.inc files may need
to recreate this PKGDATA_TRAILING_SPACE behavior.
- used the above variable, normally undefined, in mh-* files that need a trailing space
- Also, fixed use of system() in pkgdata.cpp per ICU-20538
This was causing pkgdata to return a zero status even on clang
failure, masking this issue.
* ICU-13138 do not create symlink to Static ICU Data binary
For builds using mingw-w64 and MSVC with Static layout,
ICU installation folder contains '.dll' file, which is
a symbolic link to '.a' or '.lib' Data binary.
This have no sense anyway, since it can't be used as
binary with shared layout.
* ICU-13138 mingw: add lib prefix to Static Data binary name
For builds using mingw-w64 with Static layout, missing 'lib'
prefix in ICU Data binary name leads to Stubdata binary use
during ICU extras, samples and tests build. ICU Stubdata
binary also substitutes Data in installation directory.
The above leads to runtime errors of ICU tools, tests and
ICU-based software.
Thus need to add 'lib' prefix to ICU Data binary name during
Pkgdata run.
Task-number: ICU-13138
Task-number: ICU-13187