You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
strace confirms that it looks for both libfoo.so and libfoo.a, in that order, in each directory of the library search path, and it stops when it finds ./libfoo.so.
The text was updated successfully, but these errors were encountered:
I believe this has to do with the system linker's preference on dynamic/static libraries. Looks like we need to give it flags to override it's behavior if we've got a static library in play.
If a linker finds both a static and a dynamic version of the same library, then
the linker often chooses the dynamic version. This is surprising when a native
library is specified as being "static" in rust source. This modifies the linker
command line to obey the hints given in rust source files and instructing the
linker to prefer a particular version of a found library.
Unfortunately, this patch has no effect on osx because the linker supports
no such hint, and it also has no effect on windows because the linker apparently
just ignores it. For now this is predominately used to enable the previous patch
of linking to libstdc++ statically, but more support would need to be added for
this in the future if we wanted to officially support it.
cc #12557 (doesn't close because it doesn't support OSX and windows)
…on-remove-dot, r=y21
Remove unnecessary dot in the 'unconditional recursion' lint description
I don't think such changes should be reflected in the changelog.
changelog: none
foo.c:
bar.rs:
When I build only a static
libfoo.a
I get the expected behavior, withfoo
statically linked into the Rust crate.so
.But when I also have
libfoo.so
in the same directory,rustc
prefers that even thoughkind="static"
is set.strace
confirms that it looks for bothlibfoo.so
andlibfoo.a
, in that order, in each directory of the library search path, and it stops when it finds./libfoo.so
.The text was updated successfully, but these errors were encountered: