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 static library command #33

Merged
merged 1 commit into from
Sep 22, 2021
Merged

Fix static library command #33

merged 1 commit into from
Sep 22, 2021

Conversation

paulhankin
Copy link

This is a fix for daedaleanai/dbt#91

Old object files can linger in an existing archive even if they're removed from the cc.Library rule, causing inconsistent or faulty builds if a lingering .o file contains symbols that are used by current files.

The solution in this CL is to simply delete any existing archive before running the ar file. There is no option to ar to always create a new archive.

I've changed the modifiers to ar: before it was "ar rv" and now it's "ar rcs".
The "v" modifier produces verbose output, and the absence of "c" causes a warning to be produced if the archive doesn't already exist. I think with the new modifiers there's no need to pipe stdout and stderr to /dev/null.
The added "s" modifier adds an index to the archive. I think this isn't necessary with gnu ar, but maybe it's helpful for other toolchains (and very unlikely to be unhelpful).

@jfrohnhofen jfrohnhofen merged commit cee63f8 into daedaleanai:master Sep 22, 2021
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