Fix Unicode support on Windows, minor Windows tweaks #304
No reviewers
Labels
No labels
announcement
bug
build
CI
dependencies
documentation
duplicate
enhancement
experience feedback
feature request
github_actions
help wanted
install
invalid
Long-term
optimization
portability
question
target-specific
test issue
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-Cyan4973/xxHash!304
Loading…
Reference in a new issue
No description provided.
Delete branch "unicode-windows-fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
$(EXT)s in the Makefile, causing Clang to emitxxhsuminstead ofxxhsum.exeon Windows, as well as xxhsum's rule ignoring$(FLAGS).This should fix #293.
@ -76,20 +76,22 @@ default: lib xxhsum_and_linksall: lib xxhsum xxhsum_inlinedXXHxxhsum: xxhash.o xxhsum.o ## generate command line interface (CLI)$(CC) $(FLAGS) $^ $(LDFLAGS) -o $@$(EXT)minor : isn't this rule implied ?
nit :
.PHONY@ -76,20 +76,22 @@ default: lib xxhsum_and_linksall: lib xxhsum xxhsum_inlinedXXHxxhsum: xxhash.o xxhsum.o ## generate command line interface (CLI)$(CC) $(FLAGS) $^ $(LDFLAGS) -o $@$(EXT)Not the FLAGS/CFLAGS part. Make defines it as the following:
oof
@ -285,11 +290,11 @@ test: all namespaceTest check test-xxhsum-c c90test test-tools.PHONY: test-inlineHow will the test itself behave on systems which do not support unicode (if they exist) ?
If there are risks, and this test should rather be reserved to a few "good enough" environments, such as Windows, and I assume Linux and OS-X, then it should rather belong to
test-allcategory.make testis reserved for tests which are supposed to be "reasonably" universal@ -285,11 +290,11 @@ test: all namespaceTest check test-xxhsum-c c90test test-tools.PHONY: test-inlineFair point. I'll move it.
@ -76,20 +76,22 @@ default: lib xxhsum_and_linksall: lib xxhsum xxhsum_inlinedXXHxxhsum: xxhash.o xxhsum.o ## generate command line interface (CLI)$(CC) $(FLAGS) $^ $(LDFLAGS) -o $@$(EXT)So, for example, if you did this:
GCC would fail at the link step due to expecting 64-bit object files
Hmmmm.... some interesting errors here...
Um.....
Got classic MinGW to work by changing
_wfopen_sto_wfopeneverything is fine(It is actually an encoding issue on the terminal's side, it defaults to OEM encoding instead of UTF-8. The hash value is correct).
Classic MinGW doesn't even like Unicode text at all:
However, there is no way to tell the old MinGW from the new MinGW-w32 AFAIK, and the exe works in the correct console mode.
Will investigate more tomorrow.
Maybe we should move the Unicode to a separate file. Or generate it on the fly, like so:
Just theory-crafting here, it is untested.
We could probably get the same effect without a need for a separate file, just with some
#ifdefmacro magic.The main problem is that some programs and terminals flip out when they encounter Unicode text.
This seems to work well:
Actually this is too complex. I'm going to just check
$LANGforUTF-8and skip the test if it isn't found.That way you can see the output.
Oh, I get it why Clang is failing. It has to do with the new Makefile rules.
The
MOREFLAGS=--target=x86_64-w64-mingw32flag was being applied to the .exe but not to the object files, and Clang was trying to link MSVC object files as MinGW object files.@Cyan4973 thoughts? I believe it is ready to merge.
Great work @easyaspi314 !