-
Notifications
You must be signed in to change notification settings - Fork 213
hbmk2 (mingw): Prevent (null) DLL name in generated import libraries #400
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
base: master
Are you sure you want to change the base?
hbmk2 (mingw): Prevent (null) DLL name in generated import libraries #400
Conversation
|
Hello Eric! |
|
Hello Aleksander, Here is a concrete reproduction outline and the underlying mechanism. Summary of the issueOn MinGW (both 32-bit and 64-bit), hbmk2 can generate an import library via This does not appear with MSVC because it uses Minimal reproduction steps (works on mingw32 and mingw64)The core is: make hbmk2 go down the A) Prepare a DLL and a broken
|
|
As far as I worked with multiple build systems: in my opinion we shouldn't defensively add
|
022d1ab to
faf688c
Compare
import libraries generated from .def files on the dlltool path. This is opt-in only (no behavior change unless HBMK_IMPLIBDLLMAP is set), and fixes cases where a .def lacks a LIBRARY directive and dlltool would otherwise produce an import library referencing (null).dll.
faf688c to
88e73a6
Compare
|
Hello Aleksander, I reworked the solution to address the root cause while keeping hbmk2 behavior stable by default. Problem: In MinGW import-lib generation ( Why prior fixes were controversial: Unconditionally passing New approach (this PR): Add an opt-in environment variable Safety / compatibility:
Repro: Use any Usage example:
Also updated ChangeLog.txt to reflect the final implementation: opt-in HBMK_IMPLIBDLLMAP DEF-DLL mapping for dlltool import-lib generation (no default behavior change). I tested this is Mingw, Mingw64 and MSVC64 |
2026-01-16 01:40 UTC-0800 Eric Lendvai (harbour.wiki)
Harden MinGW dlltool path in win_implib_def() to avoid creating
import libraries with embedded DLL name (null) when the source .def
contains LIBRARY (null) or lacks a LIBRARY line.
+ Sanitize .def to ensure LIBRARY ""
+ Always pass -D "" to dlltool
+ Scoped to MinGW flow; MSVC unaffected
Fixes executables importing (null).dll (observed with libcurl and
other dependencies built via hbmk2).