@@ -94,36 +94,6 @@ fn main() {
9494 . include ( "vendor/slang/external" )
9595 . include ( dst. join ( "include" ) ) ;
9696
97- // Linux: we try static linking of libstdc++ to avoid issues on older distros.
98- if target_os == "linux" {
99- // Determine the C++ compiler to use. Respect the CXX environment variable if set.
100- let compiler = std:: env:: var ( "CXX" ) . unwrap_or_else ( |_| "g++" . to_string ( ) ) ;
101- // We search for the static libstdc++ file using g++
102- let output = std:: process:: Command :: new ( & compiler)
103- . args ( & [ "-print-file-name=libstdc++.a" ] )
104- . output ( )
105- . expect ( "Failed to run g++" ) ;
106-
107- if output. status . success ( ) {
108- let path_str = std:: str:: from_utf8 ( & output. stdout ) . unwrap ( ) . trim ( ) ;
109- let path = std:: path:: Path :: new ( path_str) ;
110-
111- if path. is_absolute ( ) && path. exists ( ) {
112- if let Some ( parent) = path. parent ( ) {
113- // Add the directory containing libstdc++.a to the link search path
114- println ! ( "cargo:rustc-link-search=native={}" , parent. display( ) ) ;
115- }
116-
117- bridge_build. cpp_set_stdlib ( None ) ;
118- println ! ( "cargo:rustc-link-lib=static=stdc++" ) ;
119- } else {
120- println ! (
121- "cargo:warning=Could not find static libstdc++.a, falling back to dynamic linking"
122- ) ;
123- }
124- }
125- }
126-
12797 // Apply common defines and flags to the bridge build as well
12898 for ( def, value) in common_cxx_defines. iter ( ) {
12999 bridge_build. define ( def, * value) ;
0 commit comments