-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ASLR is now enabled for GCC binaries and it breaks PCH #5719
Comments
@bustercopley fixed by 2602139 |
This did not fix the PCH issues encountered by the MAME project, as far as I can tell. This changed the ASLR/DEP build flags for binutils, but the issue remains with PCH not functioning with the mingw-w64-x86_64-gcc-9.2.0-1-any.pkg.tar.xz package. Everything works fine with gcc 9.1.0-3 x86_64 " |
Until a new release of the gcc package comes out, workarounds are to remove the ASLR flag from cc1.exe and cc1plus.exe (e.g., using setdllcharacteristics, which you might prefer to compile for yourself) or rebuild gcc from the existing PKGBUILD script (having updated your binutils). |
With the updated gcc-9.2.0-2 packages released on 20190829, this is now fixed, at least for my workload. |
The binaries in the new gcc-9.2.0-1 packages have ASLR enabled in their PE headers. This breaks using precompiled headers, as they can no longer be mapped at a predictable address. The previous package had 'good' binaries, with ASLR disabled. (This isn't a change in the package itself. I rebuilt the 9.1.0-3 package, and the resulting binaries were 'bad'.)
I raised this on the GCC bug tracker[1].
For the GCC 9.1.0-3 packages (assuming they're still in your cache):
Output:
For the GCC 9.2.0-1 packages:
Output:
Hex 160 means[2]:
0x040 (IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE) (i.e., ASLR enabled)
| 0x100 (IMAGE_DLLCHARACTERISTICS_NX_COMPAT) (i.e., DEP enabled)
| 0x020 (??)
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91440
[2] https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-image_optional_header32
The text was updated successfully, but these errors were encountered: