This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gold work on mingw/mingw64 support
- From: Vladimir Simonov <sv at sw dot ru>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 18 Apr 2011 19:28:15 +0400
- Subject: Re: gold work on mingw/mingw64 support
- References: <4D1CC5CB.5030700@sw.ru> <mcrd3oj12so.fsf@google.com> <4D234F4B.2010600@sw.ru> <mcr7hekr2q8.fsf@google.com> <4D24613E.1050807@sw.ru> <mcripuj5opn.fsf@google.com> <4DA56C18.5010001@sw.ru>
On 04/13/2011 01:25 PM, Vladimir Simonov wrote:
On 04/12/2011 10:06 PM, Ian Lance Taylor wrote:
I decided to go a different route. It seems that mmap could in general
fail for a file which can nevertheless be read. So I decided to go
ahead and change gold to handle the case of mmap failing. This then
turns the mingw32 code into a matter of supporting systems which don't
provide mmap by providing a stub mmap which always fails.
I committed the appended patch. Let me know if you find problems with
it. This patch also cleans up mremap a bit even on systems which
provide mmap.
Ian
Thank you. I'll check the patch in couple days and report.
Sorry for delay.
I've downloaded binutils-2.21.51
[binutils]$ grep 201104 binutils-2.21.51/ -r
binutils-2.21.51/bfd/version.h:#define BFD_VERSION_DATE 20110416
It contains your changes related to bool map_is_allocated_;
It is still having the problems I've mentioned earlier(in my patches):
build/binutils-2.21.51/gold/descriptors.cc:136: error: 'F_SETFD' was not declared in this
scope
build/binutils-2.21.51/gold/descriptors.cc:136: error: 'fcntl' was not declared in this scope
build/binutils-2.21.51/gold/output.cc:4552: error: 'S_ISLNK' was not declared in this scope
Chunks fixing the issues are attached.
I'll let you know about new gold work in a day or so.
Best regards
Vladimir Simonov
diff -ruN binutils-2.21.orig/gold/descriptors.cc binutils-2.21/gold/descriptors.cc
--- binutils-2.21.orig/gold/descriptors.cc 2010-07-14 14:38:59.000000000 +0400
+++ binutils-2.21/gold/descriptors.cc 2011-01-05 14:38:46.982679800 +0300
@@ -44,6 +44,17 @@
#define O_CLOEXEC 0
#endif
+namespace
+{
+void
+set_close_on_exec(int fd)
+{
+#ifdef F_SETFD
+ fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif
+}
+}
+
namespace gold
{
@@ -133,7 +144,7 @@
if (O_CLOEXEC == 0
&& parameters->options_valid()
&& parameters->options().has_plugins())
- fcntl(new_descriptor, F_SETFD, FD_CLOEXEC);
+ set_close_on_exec(new_descriptor);
{
Hold_optional_lock hl(this->lock_);
diff -ruN binutils-2.21.orig/gold/output.cc binutils-2.21/gold/output.cc
--- binutils-2.21.orig/gold/output.cc 2010-11-18 11:24:22.000000000 +0300
+++ binutils-2.21/gold/output.cc 2011-01-05 13:44:47.659661600 +0300
@@ -57,6 +52,10 @@
}
#endif // !defined(HAVE_POSIX_FALLOCATE)
+#ifndef S_ISLNK
+# define S_ISLNK(x) (0)
+#endif
+
namespace gold
{