Skip to content
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

Fix GNU import library for i386 architecture #13

Merged
merged 1 commit into from
Jan 12, 2025

Conversation

kleisauke
Copy link
Contributor

For example, without this, attempting to use the generated import library results in the following errors:

/data/mxe/usr/bin/i686-w64-mingw32-ld: /data/mxe/usr/i686-w64-mingw32/lib/librav1e.dll.a(librav1e_dll_a_s00000.o):(.idata$7+0x0): undefined reference to `_head_librav1e_dll'
/data/mxe/usr/bin/i686-w64-mingw32-ld: /data/mxe/usr/i686-w64-mingw32/lib/librav1e.dll.a(librav1e_dll_a_s00001.o):(.idata$7+0x0): undefined reference to `_head_librav1e_dll'
/data/mxe/usr/bin/i686-w64-mingw32-ld: /data/mxe/usr/i686-w64-mingw32/lib/librav1e.dll.a(librav1e_dll_a_s00002.o):(.idata$7+0x0): undefined reference to `_head_librav1e_dll'
/data/mxe/usr/bin/i686-w64-mingw32-ld: /data/mxe/usr/i686-w64-mingw32/lib/librav1e.dll.a(librav1e_dll_a_s00003.o):(.idata$7+0x0): undefined reference to `_head_librav1e_dll'
/data/mxe/usr/bin/i686-w64-mingw32-ld: /data/mxe/usr/i686-w64-mingw32/lib/librav1e.dll.a(librav1e_dll_a_s00007.o):(.idata$7+0x0): undefined reference to `_head_librav1e_dll'
/data/mxe/usr/bin/i686-w64-mingw32-ld: /data/mxe/usr/i686-w64-mingw32/lib/librav1e.dll.a(librav1e_dll_a_s00011.o):(.idata$7+0x0): more undefined references to `_head_librav1e_dll' follow

and the same for *_iname symbol:

/data/mxe/usr/bin/i686-w64-mingw32-ld: /data/mxe/usr/i686-w64-mingw32/lib/librav1e.dll.a(librav1e_dll_a_h.o):fake:(.idata$2+0xc): undefined reference to `librav1e_dll_iname'

BTW, did you see https://github.com/rust-lang/ar_archive_writer? Rust uses it to generate MSVC/LLVM-style DLL import libraries for any raw-dylib functions.
https://github.com/rust-lang/rust/blob/1.84.0/compiler/rustc_codegen_ssa/src/back/archive.rs#L61-L132

Though, it will still fallback to dlltool from GNU Binutils for the *-windows-gnu targets.

@messense
Copy link
Owner

Not sure why but CI is failing on macOS.

@kleisauke
Copy link
Contributor Author

I've updated the PR to address another minor compat issue when linking against the generated import library with LLVM.

Not sure why but CI is failing on macOS.

It looks like the CI only test the MSVC-style (aka. "short") import library, so the test failures are unrelated.

@messense messense merged commit 33096c7 into messense:main Jan 12, 2025
5 of 6 checks passed
@kleisauke kleisauke deleted the fix-gnu-i386 branch January 12, 2025 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants