-
Notifications
You must be signed in to change notification settings - Fork 97
newt/build: Workaround for whole-archive flag #598
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
base: master
Are you sure you want to change the base?
Conversation
This seems to work for arm builds and pic32 (except for Windows). Mac not tested by me. |
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.
Code not inspected, just tested to verify that it works
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.
It looks like behavior change.
pkg.whole_archive at application level turns on new behavior for all packages, before it was more selective
Flag whole-archive is not supported on Mac and it was causing CI failures. Now instead of using this flag with .a file we just pass a text file with list of all object files from package to the linker. So now it looks like this: @pkg.list instead of: --whole-archive pkg.a --no-whole-archive Passing list of object files will result in pulling unreferenced object code just like in case of whole-archive flag and should work with all compilers.
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.
Works as expected
// the file with list of all paths to object files | ||
// from the library will be created, which later | ||
// can be passed with @ to the linker. | ||
func (c *Compiler) CompileArchive(outputFile string, createList bool) error { |
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.
maybe space should be use here
Flag whole-archive is not supported on Mac and it was causing CI failures. Now instead of using this flag with .a file we just pass a text file with list of all object files from package to the linker. So now it looks like this:
@pkg.list
instead of:
--whole-archive pkg.a --no-whole-archive
Passing list of object files will result in pulling unreferenced object code just like in case of whole-archive flag and should work with all compilers.