-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Map user-specified system libraries to correct variants #14355
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
Conversation
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.
Testcase?
Added test case. |
dfee207
to
b26eb22
Compare
Found that I could do this without adding a new pass over the libraries.. much cleaner. |
Normally users don't specify system libraries such as libc or compiler-rt on the command line. However, when they do it makes sense map them to correct variant. For example, linking with `-pthread` + `-lc` will now end up including `libc-mt.a` rather than `libc.a`. Fixes: #14341
|
||
def test_standard_library_mapping(self): | ||
# Test the `-l` flags on the command line get mapped the correct libraries variant | ||
self.run_process([EMBUILDER, 'build', 'libc-mt', 'libcompiler_rt-mt', 'libdlmalloc-mt']) |
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.
Why is the embuilder line needed? (auto library building should happen on line 10639?)
lgtm without line 10636
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.
Automatic building currently only works for libraries that are added automatically in system_libs.py:calculate()
.
Libraries specified on the command line are not currently auto-built. This is just how its always been as far as I cant tell. We could change that but its what this change is about.
Also, -nostdlib
essentially bypasses system_libs.py:calculate()
and doesn't do any auto-adding or auto-building of libraries.
This PR is an incremental improvement. We could integrating -l
flags with the auto-building system but that would be bigger/separate change.
Normally users don't specify system libraries such as
libc
orcompiler-rt
on the command line. However, whenthey do, it makes sense map them to correct variant.
For example, linking with
-pthread
+-lc
will nowend up including
libc-mt.a
rather thanlibc.a
.Fixes: #14341