-
-
Notifications
You must be signed in to change notification settings - Fork 391
Support zig build lock glibc2.17 #3316
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,14 @@ | ||||||||
| #!/bin/bash | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have a couple of suggestions for this new script:
Suggested change
|
||||||||
| # Wrapper script for Zig compiler to filter out -lstdc++fs | ||||||||
| # Zig's libc++ already includes filesystem support | ||||||||
|
|
||||||||
| # Filter out -lstdc++fs from arguments | ||||||||
| args=() | ||||||||
| for arg in "$@"; do | ||||||||
| if [ "$arg" != "-lstdc++fs" ]; then | ||||||||
| args+=("$arg") | ||||||||
| fi | ||||||||
| done | ||||||||
|
|
||||||||
| # Call zig c++ with filtered arguments | ||||||||
| exec zig c++ "${args[@]}" | ||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's some code duplication here for setting the compiler and linker flags for different architectures. You can refactor this to be more concise and easier to maintain by determining the target architecture first and then constructing the flags. This also makes it easier to update the glibc version in the future.