-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build of 0.5.1 broken with MinGW #127
Comments
Indeed. The |
AFAIK, there is no |
I'm not surprised that MinGW doesn't provide |
So the issue isn't in this project, but with incomplete POSIX emulation in MinGW. I guess there's two things we can do. Either we detect MinGW at compile time and supply a stub I'm tempted to do the second, because A fix from my side will have to wait a little bit because my availability for the next week or so is still very limited. |
In conan recipe of base64, I've proposed to always disable build of this executable: conan-io/conan-center-index#21386 |
Windows 7 x64 with SSE3 Core2Duo user here. I am glad to see that this issue has already been covered. Could someone be so kind to generate a dirty .exe and attach here as zip, while the team is looking for a general solution? |
As of v0.5.1, the `base64' demo program no longer compiled under MinGW because MinGW does not emulate the `writev(2)' system call. Fix this by detecting MinGW at compile time and optionally emulating `writev(2)' as a series of `write(2)' calls. Resolves #127.
I pushed a branch called issue127 which emulates |
As of v0.5.1, the `base64' demo program no longer compiled under MinGW because MinGW does not emulate the `writev(2)' system call. Fix this by detecting MinGW at compile time and optionally emulating `writev(2)' as a series of `write(2)' calls. Resolves #127.
@aklomp, thank you for taking a moment to revisit this issue.
Click to see details…$ w64devkit.exe
~ # cd base64
~/base64 # SSSE3_CFLAGS=-mssse3 make
cc -std=c99 -O3 -Wall -Wextra -pedantic -o bin/base64.o -c bin/base64.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -Ilib -o lib/arch/avx512/codec.o -c lib/arch/avx512/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -Ilib -o lib/arch/avx2/codec.o -c lib/arch/avx2/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -Ilib -o lib/arch/generic/codec.o -c lib/arch/generic/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -Ilib -o lib/arch/neon32/codec.o -c lib/arch/neon32/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -Ilib -o lib/arch/neon64/codec.o -c lib/arch/neon64/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -Ilib -mssse3 -o lib/arch/ssse3/codec.o -c lib/arch/ssse3/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -Ilib -o lib/arch/sse41/codec.o -c lib/arch/sse41/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -Ilib -o lib/arch/sse42/codec.o -c lib/arch/sse42/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -Ilib -o lib/arch/avx/codec.o -c lib/arch/avx/codec.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -Ilib -o lib/lib.o -c lib/lib.c
lib/lib.c:18:1: warning: 'base64_stream_encode_init' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
18 | base64_stream_encode_init (struct base64_state *state, int flags)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
lib/lib.c:31:1: warning: 'base64_stream_encode' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
31 | base64_stream_encode
| ^~~~~~~~~~~~~~~~~~~~
lib/lib.c:43:1: warning: 'base64_stream_encode_final' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
43 | base64_stream_encode_final
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
lib/lib.c:68:1: warning: 'base64_stream_decode_init' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
68 | base64_stream_decode_init (struct base64_state *state, int flags)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
lib/lib.c:81:1: warning: 'base64_stream_decode' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
81 | base64_stream_decode
| ^~~~~~~~~~~~~~~~~~~~
lib/lib.c:103:1: warning: 'base64_encode' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
103 | base64_encode
| ^~~~~~~~~~~~~
lib/lib.c:136:1: warning: 'base64_decode' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
136 | base64_decode
| ^~~~~~~~~~~~~
cc -std=c99 -O3 -Wall -Wextra -pedantic -Ilib -o lib/codec_choose.o -c lib/codec_choose.c
cc -std=c99 -O3 -Wall -Wextra -pedantic -Ilib -o lib/tables/tables.o -c lib/tables/tables.c
ld -r -o lib/libbase64.o lib/arch/avx512/codec.o lib/arch/avx2/codec.o lib/arch/generic/codec.o lib/arch/neon32/codec.o lib/arch/neon64/codec.o lib/arch/ssse3/codec.o lib/arch/sse41/codec.o lib/arch/sse42/codec.o lib/arch/avx/codec.o lib/lib.o lib/codec_choose.o lib/tables/tables.o
objcopy --keep-global-symbols=lib/exports.txt lib/libbase64.o
cc -std=c99 -O3 -Wall -Wextra -pedantic -o bin/base64 bin/base64.o lib/libbase64.o
.../w64devkit/bin/ld.exe: bin/base64.o:base64.c:(.text.startup+0x253): undefined reference to `__imp_base64_stream_decode_init'
.../w64devkit/bin/ld.exe: bin/base64.o:base64.c:(.text.startup+0x28e): undefined reference to `__imp_base64_stream_decode'
.../w64devkit/bin/ld.exe: bin/base64.o:base64.c:(.text.startup+0x347): undefined reference to `__imp_base64_stream_encode_init'
.../w64devkit/bin/ld.exe: bin/base64.o:base64.c:(.text.startup+0x353): undefined reference to `__imp_base64_stream_encode'
.../w64devkit/bin/ld.exe: bin/base64.o:base64.c:(.text.startup+0x3d2): undefined reference to `__imp_base64_stream_encode_final'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:65: bin/base64] Error 1 |
@sergeevabc Thanks for giving it a try and for posting the full compilation output. What I think is happening is that the compiler/linker is mangling the names of the functions for some reason. For example, My hypothesis: the reason that function is not found is because The real problem is probably something to do with incorrect use of |
Correct, the declaration is marked with
This builds everything as though it were a static library, which is in essence the intention when building the command line program. However, that build command isn't ideal:
I suspect |
@skeeto, thank you for stepping in. The command you provided significantly reduces the compilation log, but it still fails on my end as follows ~/base64 # make SSSE3_CFLAGS=1 CFLAGS='-Ilib -O3 -mssse3 -DBASE64_STATIC_DEFINE'
cc -Ilib -O3 -mssse3 -DBASE64_STATIC_DEFINE -o bin/base64 bin/base64.o lib/libbase64.o
…/w64devkit/bin/ld.exe: bin/base64.o:base64.c:(.text.startup+0x253): undefined reference to `__imp_base64_stream_decode_init'
…/w64devkit/bin/ld.exe: bin/base64.o:base64.c:(.text.startup+0x28e): undefined reference to `__imp_base64_stream_decode'
…/w64devkit/bin/ld.exe: bin/base64.o:base64.c:(.text.startup+0x347): undefined reference to `__imp_base64_stream_encode_init'
…/w64devkit/bin/ld.exe: bin/base64.o:base64.c:(.text.startup+0x353): undefined reference to `__imp_base64_stream_encode'
…/w64devkit/bin/ld.exe: bin/base64.o:base64.c:(.text.startup+0x3d2): undefined reference to `__imp_base64_stream_encode_final'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:65: bin/base64] Error 1 |
Perhaps it's because the function declaration is marked with It's getting late, but tomorrow I'll try to add a GitHub Actions CI build to compile the library with I also propose starting a new issue about compiling the |
@sergeevabc, because the flags changed, be sure to clean out the old build first: |
@sergeevabc It does work. The reason why it's throwing an error is because the command adds a newline, which is not part of the $ echo -n Z2l0aHVi | base64.exe -d The newline thing is a known issue, see #126. I plan to fix it soon by discarding newlines in the input. |
As of v0.5.1, the `base64' demo program no longer compiled under MinGW because MinGW does not emulate the `writev(2)' system call. Fix this by detecting MinGW at compile time and optionally emulating `writev(2)' as a series of `write(2)' calls. Resolves #127.
As of v0.5.1, the `base64' demo program no longer compiled under MinGW because MinGW does not emulate the `writev(2)' system call. Fix this by detecting MinGW at compile time and optionally emulating `writev(2)' as a series of `write(2)' calls. Resolves aklomp#127.
As of v0.5.1, the `base64' demo program no longer compiled under MinGW because MinGW does not emulate the `writev(2)' system call. Fix this by detecting MinGW at compile time and optionally emulating `writev(2)' as a series of `write(2)' calls. Resolves #127.
As of v0.5.1, the `base64' demo program no longer compiled under MinGW because MinGW does not emulate the `writev(2)' system call. Fix this by detecting MinGW at compile time and optionally emulating `writev(2)' as a series of `write(2)' calls. Resolves #127.
Build of 0.5.1 with MinGW11.0.0/GCC13 fails (it was working fine in 0.5.0):
sys/uio.h
is not provided by MinGW.The text was updated successfully, but these errors were encountered: