Using the latest msys (20200903)
Built mingw-w64-winpthreads-git for both x86 & x64, verified --dynamicbase appears in LDFLAGS.
/dynamicbase is missing from libwinpthread-1.dll (x64 & x86)
makepkg_mingw64.conf:
LDFLAGS="-pipe -Wl,--dynamicbase,--high-entropy-va,--nxcompat"
Confirmed, seems like it ignores system LDFLAGS.
Try LDFLAGS='-Wl,--dynamicbase'?
@lhmouse I've used makepkg-mingw with those flags:
$ grep LDFLAGS /etc/makepkg_mingw64.conf
LDFLAGS="-pipe -Wl,--dynamicbase,--high-entropy-va,--nxcompat"
#LDFLAGS="-pipe"
I didn't use makepkg-mingw, but ran make LDFLAGS='-Wl,--dynamicbase' directly in BASH. The flag was passed to libtool, which passes it to GCC after -L./fakelib -g -O2 -no-pthread. It wasn't ignored.
PKGBUILD of mingw-w64-crt, mingw-w64-winpthreads, mingw-w64-winstorecompat packages has !buildflags option. Is it related to this issue?
PKGBUILD of mingw-w64-crt, mingw-w64-winpthreads, mingw-w64-winstorecompat packages has
!buildflagsoption. Is it related to this issue?
Confirming changing to buildflags fixes the issue, should this become a PR?
Should buildflags be enabled for other mingw-w64 packages? I am wondering why buildflags option was disabled at first place @Alexpux
In principle the CRT is built prior to other packages, so host flags generally shouldn't be involved.
_FORTIFY_SOURCE is a good example, because it depends on the GCC library libssp-?.dll, which in turn depends on the CRT. If you built the CRT with _FORTIFY_SOURCE you would end up in circular dependencies. Maybe that's the reason.
Most helpful comment
PKGBUILD of mingw-w64-crt, mingw-w64-winpthreads, mingw-w64-winstorecompat packages has
!buildflagsoption. Is it related to this issue?