Emerging nsis with `emerge -av dev-util/nsis` with gcc-4.7.0 results in a compilation error towards the end of its build (building with gcc-4.5.3 succeeds), with the following final message: scons: building terminated because of errors. * ERROR: dev-util/nsis-2.46 failed (compile phase): * scons failed * * Call stack: * ebuild.sh, line 85: Called src_compile * environment, line 179: Called die * The specific snippet of code: * do_scons || die "scons failed" The most relevant snippet of the build log is: In file included from Source/script.cpp:22:0: Source/util.h: In instantiation of 'void __free_with_close::operator()(T&) [with T = int]': Source/util.h:114:32: required from 'ResourceManager<_RESOURCE, _FREE_RESOURCE>::~ResourceManager() [with _RESOURCE = int; _FREE_RESOURCE = __free_with_close]' Source/script.cpp:6460:1: required from here Source/util.h:145:1: error: 'close' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] In file included from Source/script.cpp:46:0: /usr/include/unistd.h:354:12: note: 'int close(int)' declared here, later in the translation unit I'm building with gcc-4.7.0. If I switch back to gcc-4.5.3 the applications builds successfully. I'm using i686-mingw32-4.6.3 as my cross compiler. See attachments for logs and portage info. Output of emerge -pqv as follows: steve ~ # emerge -pqv '=dev-util/nsis-2.46' [ebuild R ] dev-util/nsis-2.46 USE="bzip2 zlib -config-log -doc"
Created attachment 315727 [details] build.log for nsis-2.46, gcc-4.7.0
Created attachment 315729 [details] environment for nsis-2.46, gcc-4.7.0
Created attachment 315731 [details] emerge --info '=dev-util/nsis-2.46', for danny@nerdcruft.net
Sorry, just to clarify to gcc versions: * I'm using i686-mingw32-4.6.3 as my cross-compiler. It is working fine. * My system's gcc version x86_64-pc-linux-gnu-4.7.0 is unable to build the native components of the package, but x86_64-pc-linux-gnu-4.5.3 builds the native components successfully.
just assumption: #include <unistd.h> is missed in Source/util.h
+ 03 Mar 2013; Kacper Kowalik <xarthisius@gentoo.org> + +files/nsis-2.46-gcc47.patch, nsis-2.46.ebuild: + Fix building with gcc-4.7 wrt #421871 by Danny Robson <danny@nerdcruft.net>. + Thanks to Rion <rion4ik@gmail.com> for suggestion regarding fix