There is no local wrapper function named _onexit in libmsvcrt.a
or libmingwex.a, and the declaration in headers don't include
any dllimport declaration.

This makes i386 match the other architectures, and fixes linking
to this function with lld. (GNU ld manages to resolve calls to
_onexit into __imp__onexit when there is no other version of the
function available anywhere though.)

The DATA declaration in can be traced back to the
original add of that file in 2008.

Signed-off-by: Martin Storsjö <>
 mingw-w64-crt/lib-common/ | 2 +-
 mingw-w64-crt/lib32/     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-crt/lib-common/ 
index 2359beb..1a1db2b 100644
--- a/mingw-w64-crt/lib-common/
+++ b/mingw-w64-crt/lib-common/
@@ -880,7 +880,7 @@ _msize
-_onexit F_I386(DATA)
 _osplatform DATA
diff --git a/mingw-w64-crt/lib32/ 
index 28fa000..f5e9555 100644
--- a/mingw-w64-crt/lib32/
+++ b/mingw-w64-crt/lib32/
@@ -349,7 +349,7 @@ _mkdir
-_onexit DATA
 _osver DATA

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
Mingw-w64-public mailing list

Reply via email to