diff options
author | Nathan Sidwell <nathan@acm.org> | 2020-12-17 05:57:13 -0800 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2020-12-17 05:57:13 -0800 |
commit | 096164229a4c2d1efab9f259f50be1bdcdfc8abd (patch) | |
tree | 0b12ffe2253c9c39b900696978b1b86f09927d32 /gcc | |
parent | 5357b1620c547a6f2bd81e7868c800e2eee97e51 (diff) | |
download | gcc-096164229a4c2d1efab9f259f50be1bdcdfc8abd.zip gcc-096164229a4c2d1efab9f259f50be1bdcdfc8abd.tar.gz gcc-096164229a4c2d1efab9f259f50be1bdcdfc8abd.tar.bz2 |
bootstrap: Fix some windows issues [PR 98300]
When breaking out the sample server from the gcc/cp directory, it lost
its check for mmap, and the sample resolver just assumed it was there.
Fixed thusly. The non-mapping paths in module.cc weren't (recently)
excercised, and led to a signedness warning. Finally I'd missed
c++tools's config.h.in in the gcc_update script. There I took the
opportunity of adding a 'tools' segment of the dependency lists.
PR bootstrap/98300
contrib/
* gcc_update: Add c++tools/config.h.in.
c++tools/
* configure.ac: Check for sys/mman.h.
* resolver.cc: Don't assume mmap, O_CLOEXEC are available. Use
xmalloc.
* config.h.in: Regenerated.
* configure: Regenerated.
gcc/cp/
* module.cc: Fix ::read, ::write result signedness comparisons.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/module.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index 2318489..21d04cc 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -232,6 +232,10 @@ Classes used: #define CODY_NETWORKING 0 #include "mapper-client.h" +#if 0 // 1 for testing no mmap +#define MAPPED_READING 0 +#define MAPPED_WRITING 0 +#else #if HAVE_MMAP_FILE && _POSIX_MAPPED_FILES > 0 /* mmap, munmap. */ #define MAPPED_READING 1 @@ -246,11 +250,6 @@ Classes used: #define MAPPED_READING 0 #define MAPPED_WRITING 0 #endif -#if 0 // for testing -#undef MAPPED_READING -#undef MAPPED_WRITING -#define MAPPED_READING 0 -#define MAPPED_WRITING 0 #endif #if !HOST_HAS_O_CLOEXEC @@ -1657,7 +1656,7 @@ elf_in::read (data *data, unsigned pos, unsigned length) #if MAPPED_READING data->buffer = hdr.buffer + pos; #else - if (::read (fd, data->buffer, data->size) != length) + if (::read (fd, data->buffer, data->size) != ssize_t (length)) { set_error (errno); shrink (*data); @@ -2049,7 +2048,7 @@ elf_out::write (const data &buffer) /* We should have been aligned during the first allocation. */ gcc_checking_assert (!(pos & (SECTION_ALIGN - 1))); #else - if (::write (fd, buffer.buffer, buffer.pos) != buffer.pos) + if (::write (fd, buffer.buffer, buffer.pos) != ssize_t (buffer.pos)) { set_error (errno); return 0; @@ -2064,7 +2063,7 @@ elf_out::write (const data &buffer) /* Align the section on disk, should help the necessary copies. fseeking to extend is non-portable. */ static char zero[SECTION_ALIGN]; - if (::write (fd, &zero, padding) != padding) + if (::write (fd, &zero, padding) != ssize_t (padding)) set_error (errno); #endif pos += padding; |