Mingw-packages: libwinpthread-1.dll under mingw-w64-winpthreads-git is missing /dynamicbase after built with --dynamicbase

Created on 7 Sep 2020  路  8Comments  路  Source: msys2/MINGW-packages

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"

Most helpful comment

PKGBUILD of mingw-w64-crt, mingw-w64-winpthreads, mingw-w64-winstorecompat packages has !buildflags option. Is it related to this issue?

All 8 comments

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 !buildflags option. 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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Alex-Gamper picture Alex-Gamper  路  8Comments

dgbustos picture dgbustos  路  5Comments

WilliamKappler picture WilliamKappler  路  4Comments

MenaceInc picture MenaceInc  路  6Comments

jagannatharjun picture jagannatharjun  路  3Comments