Skip to content
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

Compiling in a MinGW environment: MinGW CRT compilation phase fails #3

Closed
xgalaxy opened this issue Mar 18, 2018 · 8 comments
Closed

Comments

@xgalaxy
Copy link

xgalaxy commented Mar 18, 2018

I'm attempting to run the scripts in a MinGW/MSys2 environement.

The MinGW CRT compilation phase fails:
EDIT: Ignore the folder name mingw-5.0.3 as its actually a git checkout of current master.

mv -f intrincs/.deps/lib64_libkernel32_a-ilockadd64.Tpo intrincs/.deps/lib64_libkernel32_a-ilockadd64.Po
/d/mingw-bootstrap/prefix/bin/clang -DHAVE_CONFIG_H -I. -I../mingw-5.0.3/mingw-w64-crt  -m64 -I../mingw-5.0.3/mingw-w64-crt/include -D_CRTBLD -I/d/mingw-bootstrap/prefix/x86_64-w64-mingw32/include  -pipe -std=gnu99 -D_WIN32_WINNT=0x0f00 -Wall -Wextra -Wformat -Wstrict-aliasing -Wshadow -Wpacked -Winline -Wimplicit-function-declaration -Wmissing-noreturn -Wmissing-prototypes -fdwarf-exceptions -target x86_64-w64-mingw32 -MT intrincs/lib64_libkernel32_a-readgsword.o -MD -MP -MF intrincs/.deps/lib64_libkernel32_a-readgsword.Tpo -c -o intrincs/lib64_libkernel32_a-readgsword.o `test -f 'intrincs/readgsword.c' || echo '../mingw-5.0.3/mingw-w64-crt/'`intrincs/readgsword.c
/d/mingw-bootstrap/prefix/bin/clang -DHAVE_CONFIG_H -I. -I../mingw-5.0.3/mingw-w64-crt  -m64 -I../mingw-5.0.3/mingw-w64-crt/include -D_CRTBLD -I/d/mingw-bootstrap/prefix/x86_64-w64-mingw32/include  -pipe -std=gnu99 -D_WIN32_WINNT=0x0f00 -Wall -Wextra -Wformat -Wstrict-aliasing -Wshadow -Wpacked -Winline -Wimplicit-function-declaration -Wmissing-noreturn -Wmissing-prototypes -fdwarf-exceptions -target x86_64-w64-mingw32 -MT intrincs/lib64_libkernel32_a-readgsdword.o -MD -MP -MF intrincs/.deps/lib64_libkernel32_a-readgsdword.Tpo -c -o intrincs/lib64_libkernel32_a-readgsdword.o `test -f 'intrincs/readgsdword.c' || echo '../mingw-5.0.3/mingw-w64-crt/'`intrincs/readgsdword.c
../mingw-5.0.3/mingw-w64-crt/intrincs/rdtsc.c:12:18: error: definition of builtin function '__rdtsc'
unsigned __int64 __rdtsc(void)
                 ^
1 warning and 1 error generated.
make[1]: *** [Makefile:28152: intrincs/lib64_libkernel32_a-rdtsc.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 warning generated.
In file included from ../mingw-5.0.3/mingw-w64-crt/intrincs/readgsword.c:4:
In file included from D:/mingw-bootstrap/prefix/x86_64-w64-mingw32/include\intrin.h:38:
D:/mingw-bootstrap/prefix/x86_64-w64-mingw32/include\setjmp.h:185:63: warning: incompatible redeclaration of library function '_setjmp' [-Wincompatible-library-redeclaration]
  int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) _setjmp(jmp_buf _Buf, void *_Ctx);
                                                              ^
D:/mingw-bootstrap/prefix/x86_64-w64-mingw32/include\setjmp.h:185:63: note: '_setjmp' is a builtin with type 'int (_JBTYPE *)' (aka 'int (struct _SETJMP_FLOAT128 *)')
mv -f intrincs/.deps/lib64_libkernel32_a-readgsbyte.Tpo intrincs/.deps/lib64_libkernel32_a-readgsbyte.Po
In file included from ../mingw-5.0.3/mingw-w64-crt/intrincs/readgsdword.c:4:
In file included from D:/mingw-bootstrap/prefix/x86_64-w64-mingw32/include\intrin.h:38:
D:/mingw-bootstrap/prefix/x86_64-w64-mingw32/include\setjmp.h:185:63: warning: incompatible redeclaration of library function '_setjmp' [-Wincompatible-library-redeclaration]
  int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) _setjmp(jmp_buf _Buf, void *_Ctx);
                                                              ^
D:/mingw-bootstrap/prefix/x86_64-w64-mingw32/include\setjmp.h:185:63: note: '_setjmp' is a builtin with type 'int (_JBTYPE *)' (aka 'int (struct _SETJMP_FLOAT128 *)')
1 warning generated.
mv -f intrincs/.deps/lib64_libkernel32_a-readgsword.Tpo intrincs/.deps/lib64_libkernel32_a-readgsword.Po
1 warning generated.
mv -f intrincs/.deps/lib64_libkernel32_a-readgsdword.Tpo intrincs/.deps/lib64_libkernel32_a-readgsdword.Po
rm lib64/msvcr90d.def lib64/msvcr90.def lib64/msvcr100.def lib64/msvcr110.def lib64/msvcr120d.def lib64/msvcr120.def
make[1]: Leaving directory '/d/mingw-bootstrap/_mingw/_build'
make: *** [Makefile:7778: all] Error 2
@mstorsjo
Copy link
Owner

I'm attempting to run the scripts in a MinGW/MSys2 environement.

The MinGW CRT compilation phase fails:
EDIT: Ignore the folder name mingw-5.0.3 as its actually a git checkout of current master.

I would certainly say that this seems like it really isn't the current git master. There was a fix for exactly this issue, in the master branch but not in the 5.x branch; see mirror/mingw-w64@25d5148.

@xgalaxy
Copy link
Author

xgalaxy commented Mar 18, 2018

Its master from sourceforge. Is there a difference with that mirror?

@mstorsjo
Copy link
Owner

No, it should be the same as that mirror. Can you show what your copy of intrincs/rdtsc.c contains?

@xgalaxy
Copy link
Author

xgalaxy commented Mar 18, 2018

My intrincs/rdtsc.c does not contain that change. Not sure what to say. Git is telling me I am on master. I did have the 5.0.3 tag checked out and checked out master when I got that error after realizing your git hash pointed to a revision only several days old.

At any point. I ended up swapping to the Docker version of martell's branch but getting a different problem there 😄 .

I'll close this ticket.

@xgalaxy xgalaxy closed this as completed Mar 18, 2018
@RoyiAvital
Copy link

Does this version solve the AVX alignment with Windows 64?
See details in my comment here - msys2/MSYS2-packages#1209 (comment),

@mstorsjo
Copy link
Owner

mstorsjo commented Apr 8, 2018

Please don't hijack others' threads for asking unrelated questions.

As noted in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412, clang doesn't have this issue. You don't need to use the full llvm-mingw (which replaces all the components of the build chain) just to use clang, you should be able to install clang within MSYS2 while still using the rest of a normal GNU binutils based toolchain.

@RoyiAvital
Copy link

Is there a guide to install Clang on MSYS2?

Thank You.

@mstorsjo
Copy link
Owner

mstorsjo commented Apr 8, 2018

No idea, you need to ask some MSYS2 people.

Ericson2314 added a commit to Ericson2314/nixpkgs that referenced this issue Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants