Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 421871 - dev-util/nsis-2.46 fails to build with gcc 4.7
Summary: dev-util/nsis-2.46 fails to build with gcc 4.7
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Cédric Krier
Depends on:
Blocks: gcc-4.7
  Show dependency tree
Reported: 2012-06-19 04:33 UTC by Danny Robson
Modified: 2013-03-03 12:10 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---

build.log for nsis-2.46, gcc-4.7.0 (build.log,94.33 KB, text/plain)
2012-06-19 04:34 UTC, Danny Robson
environment for nsis-2.46, gcc-4.7.0 (environment,9.62 KB, text/plain)
2012-06-19 04:34 UTC, Danny Robson
emerge --info '=dev-util/nsis-2.46', for (,5.57 KB, text/plain)
2012-06-19 04:36 UTC, Danny Robson

Note You need to log in before you can comment on or make changes to this bug.
Description Danny Robson 2012-06-19 04:33:52 UTC
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:
 *, 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"
Comment 1 Danny Robson 2012-06-19 04:34:29 UTC
Created attachment 315727 [details]
build.log for nsis-2.46, gcc-4.7.0
Comment 2 Danny Robson 2012-06-19 04:34:55 UTC
Created attachment 315729 [details]
environment for nsis-2.46, gcc-4.7.0
Comment 3 Danny Robson 2012-06-19 04:36:34 UTC
Created attachment 315731 [details]
emerge --info '=dev-util/nsis-2.46', for
Comment 4 Danny Robson 2012-06-19 04:59:29 UTC
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.
Comment 5 Sergey Ilinykh 2012-06-25 08:12:47 UTC
just assumption: #include <unistd.h> is missed in Source/util.h
Comment 6 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2013-03-03 12:10:43 UTC
+  03 Mar 2013; Kacper Kowalik <>
+  +files/nsis-2.46-gcc47.patch, nsis-2.46.ebuild:
+  Fix building with gcc-4.7 wrt #421871 by Danny Robson <>.
+  Thanks to Rion <> for suggestion regarding fix