From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8FFD63858D28; Sun, 4 Sep 2022 13:53:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8FFD63858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662299606; bh=twp4JUNHfJkCkf08SsXdozXyzd89iCByDScHfumqD+8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EHnvEDJu+eMv0uNSpgaut6Xh2HqlgMOg1C7excN0LMEHS/hN1H3YNmuwp9Bjl+fVx cYqT58BkODR1NQw/6lyoX2r41UEHsuHfConO4WGdzLTAd3fBU41HWhCbGJVOQ4PHE1 s+HGRV6H+hMvPmcpoJGiNjklAt+bjxqG7qwJsYDE= From: "brechtsanders at users dot sourceforge.net" To: gcc-bugs@gcc.gnu.org Subject: [Bug pch/105858] MinGW-w64 64-bit build with --libstdcxx-pch: fatal error: cannot write PCH file: required memory segment unavailable Date: Sun, 04 Sep 2022 13:53:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: pch X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: brechtsanders at users dot sourceforge.net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105858 --- Comment #5 from Brecht Sanders --- I believe this is issue is cause by the fact that mmap is missing on Window= s. In gcc/ggc-common.cc this causes use of default_gt_pch_get_address() as HOST_HOOKS_GT_PCH_GET_ADDRESS which just returns NULL resulting in "cannot write PCH file: required memory segment unavailable". Though mmap doesn't exist, it isn't that hard to emulate, as can be seen in https://github.com/alitrack/mman-win32 , so maybe some code is needed to use the Windows memory mapping mechanism. I did try to build against https://github.com/alitrack/mman-win32, but I ran into the issue that this requires linking with the library mman-win32, but passing it to LDFLAGS doesn't work as it's not near the end of the linker command and link order is important on Windows/MinGW.=