ICU-21628 MinGW/Windows incorrect build#1733
ICU-21628 MinGW/Windows incorrect build#1733LiteratimBi wants to merge 1 commit intounicode-org:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
|
Thank you very much for creating this PR, signing the CLA, and also for filing a ticket! :) To be honest, I'm not super familiar with MinGW and its conventions, so I would love if someone else with MinGW experience and expertise could help take a look at these changes. Recently, there have been other pull-requests from a number of people that also made changes to the ICU MinGW build/config: @longnguyen2004 @autoantwort @pchemguy. (I'm mentioning them here, in case they are interested in taking a look). I don't know if any of them would have time or not -- but if so, it would be great if they might be able to take a look at the changes in this pull request (since it also changes the MinGW build as well). Also, I think this change will conflict with some of the changes in PR #1732. Regarding this:
FWIW, I think the PR #1732 was also trying to fix this as well maybe. |
icu4c/source/data/Makefile.in
Outdated
| @@ -198,7 +198,7 @@ ifneq ($(ENABLE_STATIC),) | |||
| ifeq ($(PKGDATA_MODE),dll) | |||
| # For MinGW, do we want the DLL to go in the bin location? | |||
There was a problem hiding this comment.
I wonder if it might be worth updating this comment. Maybe it should say something that for static builds, it is put in the libdir.
| DATA_STUBNAME = dt | ||
| COMMON_STUBNAME = uc | ||
| I18N_STUBNAME = in | ||
| LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) |
There was a problem hiding this comment.
Have you tested the static mingw build?
There was a problem hiding this comment.
It even fixes the static build. Awesome :)
|
Hello @LiteratimBi, and thanks for making this PR! EDIT:
There's an extra |
According to size, libicudt69.dll is pre-build wrapper and liblibicudt69.dll is the correct datastub Are you shure that you using correct branch (git checkout mingw-make)? Mine bindir looks so: |
|
I merged your branch on top of main. I'll try doing a build without it and see what happens. |
|
Hmm, maybe I did something wrong. I'll do some more investigation. |
|
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
|
I'm still getting |
| } else { | ||
| sprintf(libFileNames[LIB_FILE], "%s%s%s", | ||
| (strstr(libName, "icudt") ? "lib" : ""), | ||
| pkgDataFlags[LIBPREFIX], | ||
| sprintf(libFileNames[LIB_FILE], "%s%s", | ||
| (strstr(libName, "libicudt") ? "" : pkgDataFlags[LIBPREFIX]), | ||
| libName); |
There was a problem hiding this comment.
Also add the same check to the #else case, since it fixes the problem for cross-compiling.
pkgdata --verbose output:
LD_LIBRARY_PATH=/home/KurumiGaming/icu/icu4c/source/build-native/stubdata:/home/KurumiGaming/icu/icu4c/source/build-native/tools/ctestfw:/home/KurumiGaming/icu/icu4c/source/build-native/lib:$LD_LIBRARY_PATH /home/KurumiGaming/icu/icu4c/source/build-native/bin/pkgdata -O ../data/icupkg.inc -q -c -s /home/KurumiGaming/icu/icu4c/source/build-cross-shared/data/out/build/icudt69l -d ../lib -e icudt69 -T ./out/tmp -p icudt69l -m dll -r 69 -L libicudt ./out/tmp/icudata.lst -v
# pkgdata: Reading ./out/tmp/icudata.lst..
# Reading options file ../data/icupkg.inc
...
# Writing package file ./out/tmp/icudt69l.dat ..
# libFileName[LIB_FILE] = liblibicudt
# libFileName[LIB_FILE_VERSION] = liblibicudt69.dll
...
...which indicates that it uses the #else case.
This is just a small part of a more general problem. As it is right now, pkgdata is really only suitable for native builds, since the platform-specific bits are being added in using macros, not by checking the host triplet.
There was a problem hiding this comment.
This is just a small part of a more general problem. As it is right now, pkgdata is really only suitable for native builds, since the platform-specific bits are being added in using macros, not by checking the host triplet.
Yeah this is a real problem. I build icu with vcpkg, but vcpkg sets --with-cross-build= when building mingw on windows because host-triplet=x64-windows and target-triplet=x64-mingw-static. And with --with-cross-build= the build fails because of the problem you described
There was a problem hiding this comment.
We can handle that on vcpkg, by not requiring the host dependency on Windows triplets. But the problem with pkgdata not suitable for cross compiling is still there, and needs to be fixed in the future.
There was a problem hiding this comment.
Yeah I know and I have done that locally. I only wanted to highlight that this is even a problem when you cross build from windows to mingw
Did you also get this problem with #1735? |
|
It seems to be less intrusive than this PR, I'll do a build today and see if it works |
Do you already have results? :) |
|
Oh sorry, I forgot to comment on this one :) |
|
Jenkins, test this. |
|
@longnguyen2004 when I understand the last comments on the other pr correctly this pr has less problems than the other pr right? |
Yes that's correct, but this PR is also changing a lot of other things that I don't fully understand, so I say we should explore other approaches first, like fixing up pkgdata by itself, before settling on this. |
Imho this should be merged anyway because it fixes the icu static mingw builds that are currently broken and does not build at all. |
|
@LiteratimBi Can you apply my suggestion in #1733 (comment) before moving on? This is a workaround for the cross compiling problem I had before. |
|
Seems like @LiteratimBi does not respond anymore |
|
@longnguyen2004 @autoantwort do you want to make a new PR? |
Checklist
Mingw* configuration/build/setup has some pitfalls:
1. pkgdata utility produces incorrect datastub filenames when LIBPREFIX is set.
With
LIBPREFIX=libcreateFileNames (from tools/pkgdata/pkgdata.cpp:926) produces liblibicu* names
2. Less important, also pkgdata utility:
--help option message contains incorrect prefixes/suffixes (from tools/pkgdata/pkgtypes.h:139)
defined at struct modes (from tools/pkgdata/pkgdata.cpp:134)
3. Default build PKGDATA_MODE (= dll ) with ENABLE_STATIC
Makefile puts libicudtXX.a static library to bindir (data/Makefile.in:201 install-local target)
4. Platform-dependant definitions of linker flags are inconsistent (example)
ICU Issue link: https://unicode-org.atlassian.net/browse/ICU-21628