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
In order to statically link the standard C++ library, I pass -lc++_static to the linker by tweaking my .cargo/config file, like this:
[target.armv7-linux-androideabi]
linker = "arm-linux-androideabi-clang"
ar = "arm-linux-androideabi-ar"
rustflags = ["-C","link-arg=-lc++_static","-C","link-arg=-lc++abi","-C","link-arg=-landroid_support"][target.arm-linux-androideabi]
linker = "arm-linux-androideabi-clang"
ar = "arm-linux-androideabi-ar"
rustflags = ["-C","link-arg=-lc++_static","-C","link-arg=-lc++abi","-C","link-arg=-landroid_support"]
However cc-rs automatically adds -l stdc++ at the end of the arguments because of the cpp_link_stdlib() method.
For an undetermined reason, this -l stdc++ flag seems to have taken priority over -l c++_static, which means that compiled libraries now depend on c++_shared. The Android build of Parity has recently broken because of that.
Ideally there should be a way to overwrite the default value for cpp_link_stdlib() from the .cargo/config.toml, however that's not really possible.
Do you have any suggestion?
The text was updated successfully, but these errors were encountered:
Can cpp_link_stdlib(None) be used to disable passing this flag?
Yes, but this would need to be done for every single library that uses cc-rs. I don't think it's the role of each library maintainer to decide to which stdc++ to link to.
In order to statically link the standard C++ library, I pass
-lc++_static
to the linker by tweaking my.cargo/config
file, like this:However
cc-rs
automatically adds-l stdc++
at the end of the arguments because of thecpp_link_stdlib()
method.For an undetermined reason, this
-l stdc++
flag seems to have taken priority over-l c++_static
, which means that compiled libraries now depend onc++_shared
. The Android build of Parity has recently broken because of that.Ideally there should be a way to overwrite the default value for
cpp_link_stdlib()
from the.cargo/config.toml
, however that's not really possible.Do you have any suggestion?
The text was updated successfully, but these errors were encountered: