Re: [PATCH 2/2] mingw: enable DEP and ASLR
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Apr 30, 2019, 22:59 UTC
- Message-ID
- <9ec02c05-daf9-ffe3-ef64-2c550e29f5b7@kdbg.org>
- In-Reply-To
- <nycvar.QRO.7.76.6.1904301838400.45@tvgsbejvaqbjf.bet>
Am 01.05.19 um 00:41 schrieb Johannes Schindelin:
Show 32 quoted lines
> On Tue, 30 Apr 2019, Johannes Sixt wrote: >> Am 29.04.19 um 23:56 schrieb İsmail Dönmez via GitGitGadget: >>> diff --git a/config.mak.uname b/config.mak.uname >>> index e7c7d14e5f..a9edcc5f0b 100644 >>> --- a/config.mak.uname >>> +++ b/config.mak.uname >>> @@ -570,6 +570,12 @@ else >>> ifeq ($(shell expr "$(uname_R)" : '2\.'),2) >>> # MSys2 >>> prefix = /usr/ >>> + # Enable DEP >>> + BASIC_LDFLAGS += -Wl,--nxcompat >>> + # Enable ASLR (unless debugging) >>> + ifneq (,$(findstring -O,$(CFLAGS))) >>> + BASIC_LDFLAGS += -Wl,--dynamicbase >>> + endif >>> ifeq (MINGW32,$(MSYSTEM)) >>> prefix = /mingw32 >>> HOST_CPU = i686 >>> >> >> I'm a bit concerned that this breaks my debug sessions where I use -O0. >> But I'll test without -O0 before I really complain. > > Weird. Jameson Miller also mentioned this very concern in an internal > review. > > I guess I'll do something like > > ifneq (,$(findstring -O,$(filter-out -O0,$(CFLAGS)))) > > Does that work for you?
That could work. I'm a bit distracted at the moment, so it may take some time until I can test.
-- Hannes