{"action":"created","issue":{"url":"https://api.github.com/repos/crosstool-ng/crosstool-ng/issues/132","labels_url":"https://api.github.com/repos/crosstool-ng/crosstool-ng/issues/132/labels{/name}","comments_url":"https://api.github.com/repos/crosstool-ng/crosstool-ng/issues/132/comments","events_url":"https://api.github.com/repos/crosstool-ng/crosstool-ng/issues/132/events","html_url":"https://github.com/crosstool-ng/crosstool-ng/issues/132","id":97924804,"number":132,"title":"sample x86_64-unknown-mingw32 fails to build using gcc 5.1.0 on Debian (jessie)","user":{"login":"kaikuchn","id":1019068,"avatar_url":"https://avatars.githubusercontent.com/u/1019068?v=3","gravatar_id":"","url":"https://api.github.com/users/kaikuchn","html_url":"https://github.com/kaikuchn","followers_url":"https://api.github.com/users/kaikuchn/followers","following_url":"https://api.github.com/users/kaikuchn/following{/other_user}","gists_url":"https://api.github.com/users/kaikuchn/gists{/gist_id}","starred_url":"https://api.github.com/users/kaikuchn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaikuchn/subscriptions","organizations_url":"https://api.github.com/users/kaikuchn/orgs","repos_url":"https://api.github.com/users/kaikuchn/repos","events_url":"https://api.github.com/users/kaikuchn/events{/privacy}","received_events_url":"https://api.github.com/users/kaikuchn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-07-29T12:28:58Z","updated_at":"2015-08-26T01:54:01Z","closed_at":"2015-08-26T01:54:01Z","body":"Hi there!\r\n\r\nI've downloaded and built crosstool-ng 1.21. I successfully built a few toolchains, however, now I'm trying to build the sample toolchain `x86_64-unknown-mingw32` but it fails in step `Building mingw-w64 files`. More precisely it fails during compilation of `_controlfp_s.c` claiming that the following constants are `undeclared here (not in a function)`:\r\n- `_MCW_DN`\r\n- `_MCW_EM`\r\n- `_MCW_IC`\r\n- `_MCW_RC`\r\n- `_MCW_PC`\r\n\r\nThese constants are defined in the `float.h` which is present in the `.build/src/mingw-w64-v4.0.2/mingw-w64-headers/crt` folder (which I assume is where it's looking for header files) and the `float.h` file is in fact included by `_controlfp_s.c`.\r\nThe constants definition is skipped if `__STRICT_ANSI__` is defined, however that is not the case when I look at the failing call to `x86_64-unknown-mingw32-gcc` nor is it predefined in the preprocessor which I validated by running `x86_64-unknown-mingw32-gcc -dM -E - < /dev/null`. (Also, I'm not familiar with this error message, but it seems like these constants are defined it's just that they are not valid outside of a function? They're just aliases for hex-numbers though.. [see here](https://msdn.microsoft.com/en-us/library/c9676k6h.aspx))\r\n\r\nMy guess is that this is most likely a problem with MinGW, still since this is a sample toolchain I wanted to report this and ask if anyone can give me some pointers on how to fix this.\r\n\r\nFor completeness sake here's the statement that fails:\r\n```\r\n`x86_64-unknown-mingw32-gcc -DHAVE_CONFIG_H -I. -I/home/xtool-ng/.build/src/mingw-w64-v4.0.2/mingw-w64-crt  -m64 -D__LIBMSVCRT__ -I/home/xtool-ng/.build/src/mingw-w64-v4.0.2/mingw-w64-crt/include -I/home/xtool-ng/x-tools/x86_64-unknown-mingw32/x86_64-unknown-mingw32/sysroot/include  -pipe -std=gnu99 -D_WIN32_WINNT=0x0f00 -Wall -Wextra -Wformat -Wstrict-aliasing -Wshadow -Wpacked -Winline -Wimplicit-function-declaration -Wmissing-noreturn -Wmissing-prototypes -g -O2 -MT secapi/lib64_libmsvcrt_a-_ctime64_s.o -MD -MP -MF secapi/.deps/lib64_libmsvcrt_a-_ctime64_s.Tpo -c -o secapi/lib64_libmsvcrt_a-_ctime64_s.o `test -f 'secapi/_ctime64_s.c' || echo '/home/xtool-ng/.build/src/mingw-w64-v4.0.2/mingw-w64-crt/'`\r\n```\r\nand here is the relevant error output from the build.log\r\n```\r\nERROR]    /home/xtool-ng/.build/src/mingw-w64-v4.0.2/mingw-w64-crt/secapi/_controlfp_s.c:22:38: error: '_MCW_DN' undeclared here (not in a function)\r\n[ALL  ]     static const unsigned int allflags = _MCW_DN | _MCW_EM | _MCW_IC | _MCW_RC | _MCW_PC;\r\n[ALL  ]                                          ^\r\n[ERROR]    /home/xtool-ng/.build/src/mingw-w64-v4.0.2/mingw-w64-crt/secapi/_controlfp_s.c:22:48: error: '_MCW_EM' undeclared here (not in a function)\r\n[ALL  ]     static const unsigned int allflags = _MCW_DN | _MCW_EM | _MCW_IC | _MCW_RC | _MCW_PC;\r\n[ALL  ]                                                    ^\r\n[ERROR]    /home/xtool-ng/.build/src/mingw-w64-v4.0.2/mingw-w64-crt/secapi/_controlfp_s.c:22:58: error: '_MCW_IC' undeclared here (not in a function)\r\n[ALL  ]     static const unsigned int allflags = _MCW_DN | _MCW_EM | _MCW_IC | _MCW_RC | _MCW_PC;\r\n[ALL  ]                                                              ^\r\n[ERROR]    /home/xtool-ng/.build/src/mingw-w64-v4.0.2/mingw-w64-crt/secapi/_controlfp_s.c:22:68: error: '_MCW_RC' undeclared here (not in a function)\r\n[ALL  ]     static const unsigned int allflags = _MCW_DN | _MCW_EM | _MCW_IC | _MCW_RC | _MCW_PC;\r\n[ALL  ]                                                                        ^\r\n[ERROR]    /home/xtool-ng/.build/src/mingw-w64-v4.0.2/mingw-w64-crt/secapi/_controlfp_s.c:22:78: error: '_MCW_PC' undeclared here (not in a function)\r\n[ALL  ]     static const unsigned int allflags = _MCW_DN | _MCW_EM | _MCW_IC | _MCW_RC | _MCW_PC;\r\n[ALL  ]                                                                                  ^\r\n[ALL  ]    /home/xtool-ng/.build/src/mingw-w64-v4.0.2/mingw-w64-crt/secapi/_controlfp_s.c: In function '_int_controlfp_s':\r\n[ALL  ]    /home/xtool-ng/.build/src/mingw-w64-v4.0.2/mingw-w64-crt/secapi/_controlfp_s.c:30:43: warning: implicit declaration of function '_controlfp' [-Wimplicit-function-declarat\r\nion]\r\n[ALL  ]         if (currentControl) *currentControl = _controlfp( 0, 0 );\r\n[ALL  ]                                               ^\r\n[ALL  ]    Makefile:34006: recipe for target 'secapi/lib64_libmsvcrt_a-_controlfp_s.o' failed\r\n[ERROR]    make[2]: *** [secapi/lib64_libmsvcrt_a-_controlfp_s.o] Error 1\r\n[ALL  ]    make[2]: *** Waiting for unfinished jobs....\r\n... bunch of warnings ....\r\n[ERROR]\r\n[ERROR]  >>\r\n[ERROR]  >>  Build failed in step 'Building mingw-w64 files'\r\n[ERROR]  >>        called in step '(top-level)'\r\n[ERROR]  >>\r\n[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]\r\n[ERROR]  >>        called from: do_libc[scripts/build/libc/mingw.sh@108]\r\n[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@638]\r\n[ERROR]  >>\r\n```"},"comment":{"url":"https://api.github.com/repos/crosstool-ng/crosstool-ng/issues/comments/134788922","html_url":"https://github.com/crosstool-ng/crosstool-ng/issues/132#issuecomment-134788922","issue_url":"https://api.github.com/repos/crosstool-ng/crosstool-ng/issues/132","id":134788922,"user":{"login":"bhundven","id":1155179,"avatar_url":"https://avatars.githubusercontent.com/u/1155179?v=3","gravatar_id":"","url":"https://api.github.com/users/bhundven","html_url":"https://github.com/bhundven","followers_url":"https://api.github.com/users/bhundven/followers","following_url":"https://api.github.com/users/bhundven/following{/other_user}","gists_url":"https://api.github.com/users/bhundven/gists{/gist_id}","starred_url":"https://api.github.com/users/bhundven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhundven/subscriptions","organizations_url":"https://api.github.com/users/bhundven/orgs","repos_url":"https://api.github.com/users/bhundven/repos","events_url":"https://api.github.com/users/bhundven/events{/privacy}","received_events_url":"https://api.github.com/users/bhundven/received_events","type":"User","site_admin":false},"created_at":"2015-08-26T01:54:01Z","updated_at":"2015-08-26T01:54:01Z","body":"This change has been committed. Closing this issue."}}