1
1
mirror of https://github.com/rui314/mold.git synced 2024-11-13 09:39:13 +03:00

[Mach-O] Fix build breakage on Alpine by renaming PAGE_SIZE

PAGE_SIZE is sometimes defined by a header file as macro.
This change renames it COMMON_PAGE_SIZE.

Fixes https://github.com/rui314/mold/issues/142
This commit is contained in:
Rui Ueyama 2021-12-16 13:04:46 +09:00
parent ed9924895d
commit 6fd76f2619
2 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@
namespace mold::macho {
static constexpr i64 PAGE_SIZE = 0x4000;
static constexpr i64 COMMON_PAGE_SIZE = 0x4000;
static constexpr i64 SHA256_SIZE = 32;
template <typename E> class Chunk;

View File

@ -484,12 +484,12 @@ void OutputSegment<E>::set_offset(Context<E> &ctx, i64 fileoff, u64 vmaddr) {
vmaddr += sec.hdr.size;
}
cmd.vmsize = align_to(vmaddr - cmd.vmaddr, PAGE_SIZE);
cmd.vmsize = align_to(vmaddr - cmd.vmaddr, COMMON_PAGE_SIZE);
if (this == ctx.segments.back().get())
cmd.filesize = fileoff - cmd.fileoff;
else
cmd.filesize = align_to(fileoff - cmd.fileoff, PAGE_SIZE);
cmd.filesize = align_to(fileoff - cmd.fileoff, COMMON_PAGE_SIZE);
}
template <typename E>