Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
Summary: Linking against mingw32 libbzip2 fails
https://bugzilla.redhat.com/show_bug.cgi?id=811909
Summary: Linking against mingw32 libbzip2 fails Product: Fedora Version: 16 Platform: Unspecified OS/Version: Unspecified Status: NEW Severity: unspecified Priority: unspecified Component: mingw32-bzip2 AssignedTo: rjones@redhat.com ReportedBy: yeti@physics.muni.cz QAContact: extras-qa@fedoraproject.org CC: lfarkas@lfarkas.org, rjones@redhat.com, amorilia@users.sourceforge.net, fedora-mingw@lists.fedoraproject.org Classification: Fedora Story Points: --- Type: Bug Regression: --- Mount Type: --- Documentation: ---
Description of problem: Linking against the MinGW port of bzip2 fails. For start, code generated by standard configure tests such as
AC_CHECK_LIB(bz2, BZ2_bzopen, ...)
fails.
Version-Release number of selected component (if applicable): mingw32-bzip2-1.0.5-9.fc15
How reproducible: Always.
Steps to Reproduce: 1. Create the following C code (essentially what configure creates as conftest.c), calling it conftest.c:
char BZ2_bzopen (); int main () { return BZ2_bzopen (); return 0; }
2. Run i686-pc-mingw32-gcc -o conftest.exe -g -O2 conftestc.c -lbz2
Actual results: /home/yeti/tmp/ccEfyAbq.o: In function `main': /home/yeti/xxx/conftest.c:5: undefined reference to `_BZ2_bzopen' collect2: ld returned 1 exit status
Expected results: It links and creates conftest.exe.
Additional info: According to i686-pc-mingw32-nm, symbols in libbz2.dll.a bear extensions such as @8, @10, etc., so BZ2_bzopen is there as _BZ2_bzopen@8.
Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=811909
--- Comment #1 from David Nečas yeti@physics.muni.cz 2012-04-12 08:40:30 EDT --- Created attachment 577056 --> https://bugzilla.redhat.com/attachment.cgi?id=577056 possible patch
A patch is attached that appears to fix the library for me by removing the WINAPI trickery in the header (apparently intended for native Win32). I do not understand the Win32 stuff enough to say this is the right fix though.
Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=811909
--- Comment #2 from Kevin Kofler kevin@tigcc.ticalc.org 2012-04-12 11:04:59 EDT --- That's not the correct solution. It will make the functions use the cdecl calling convention instead of stdcall upstream uses and thus make the bzip2 DLL we ship binary-incompatible with the upstream one.
Renaming the DLL's symbols to remove the default stdcall mangling (those @8 etc. suffixes) is also binary-incompatible.
Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=811909
--- Comment #3 from David Nečas yeti@physics.muni.cz 2012-04-12 12:18:48 EDT --- I see. So does the configure test (and possibly linking) of every cross-compiled program using bzip2 need to be changed and how? Or are there other options?
Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=811909
H. Peter Anvin, Intel h.peter.anvin@intel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |h.peter.anvin@intel.com
--- Comment #4 from H. Peter Anvin, Intel h.peter.anvin@intel.com 2012-04-12 12:35:23 EDT --- This is a general and very serious braindamage in autoconf: compiling test programs without including the necessary header files does not work in general. It might have been expected to work that way 20+ years ago, but today it's just broken.
Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=811909
David Nečas yeti@physics.muni.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CLOSED Resolution| |NOTABUG Last Closed| |2012-04-12 15:17:16
--- Comment #5 from David Nečas yeti@physics.muni.cz 2012-04-12 15:17:16 EDT --- So, there is no bug in mingw32-bzip2. I may still want a cdecl version of it but that not relevant to this bug report. Thanks for your time.
Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=811909
--- Comment #6 from Fedora Update System updates@fedoraproject.org 2012-04-25 11:58:13 EDT --- mingw-bzip2-1.0.6-1.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/mingw-bzip2-1.0.6-1.fc17
Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=811909
--- Comment #7 from Fedora Update System updates@fedoraproject.org 2012-05-04 18:54:54 EDT --- mingw-bzip2-1.0.6-1.fc17, mingw-boost-1.48.0-8.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.