Fix Rust library filename on Windows#3
Merged
philrz merged 4 commits intobrim-suricata-5.0.3from Jan 15, 2021
Merged
Conversation
This reverts commit d0cfc20.
Moving the libs specified in LDFLAGS to LDADD put them into the correct placement on in the link command. (cherry picked from commit 10f639e)
Prior to Rust 1.44, Cargo would name static libs with the .lib extension. 1.44 changes this extension to .a when running under a GNU environment on Windows like msys to make it more similar to other unix environments. Now assume static library name to be the same on Windows and unix, but rename the .lib if found to still support older versions of Rust on Windows. (cherry picked from commit f3c59ef)
henridf
approved these changes
Jan 15, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Our Suricata build on Windows suffered some bit rot, as shown in this Action failure:
https://github.com/brimsec/build-suricata/runs/1704451655?check_suite_focus=true#step:8:1418
In
diff'ing what changed since the last successful Windows build, one thing that stood out is that the Rust version grabbed viapacman -Su mingw-w64-x86_64-rustjumped from 1.43.0 to 1.48.0. Sure enough, the releases notes for 1.44.0 describes a change as "Rustc now correctly generates static libraries on Windows GNU targets with the .a extension, rather than the previous .lib" That led me to find OISF#5623 where the Suricata maintainers adapted to that change. I cherry-picked the two commits from that PR into this branch and made a companion build-suricata/fix-build-windows-lib branch that points to it, and you can see the successful build in this Actions run:https://github.com/brimsec/build-suricata/runs/1705758315?check_suite_focus=true