File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -868,7 +868,12 @@ async function buildPhp(config: BuildConfig): Promise<string> {
868
868
buildEnv . PKG_CONFIG_PATH = pkgConfigPaths . join ( ':' )
869
869
}
870
870
871
- buildEnv . LDFLAGS = libPaths . map ( path => `-L${ path } ` ) . join ( ' ' )
871
+ // Filter out libstdcxx paths on Linux to avoid linking issues
872
+ const filteredLibPaths = config . platform === 'linux'
873
+ ? libPaths . filter ( path => ! path . includes ( 'libstdcxx' ) )
874
+ : libPaths
875
+
876
+ buildEnv . LDFLAGS = filteredLibPaths . map ( path => `-L${ path } ` ) . join ( ' ' )
872
877
buildEnv . CPPFLAGS = includePaths . map ( path => `-I${ path } ` ) . join ( ' ' )
873
878
874
879
// Add macOS-specific linker flags for DNS resolver functions
@@ -896,8 +901,7 @@ async function buildPhp(config: BuildConfig): Promise<string> {
896
901
buildEnv . CXX = 'g++'
897
902
buildEnv . CFLAGS = ( buildEnv . CFLAGS || '' ) + ' -O2 -fPIC'
898
903
buildEnv . CXXFLAGS = ( buildEnv . CXXFLAGS || '' ) + ' -O2 -fPIC'
899
- // Use system libstdc++ and iconv instead of Launchpad's to avoid linking issues
900
- buildEnv . LDFLAGS = buildEnv . LDFLAGS . replace ( / - L [ ^ \s ] * l i b s t d c x x [ ^ \s ] * / g, '' )
904
+ // Use system libstdc++ instead of Launchpad's to avoid linking issues
901
905
// Set preprocessor to avoid traditional-cpp issues
902
906
buildEnv . CPP = 'gcc -E'
903
907
// Disable iconv completely on Linux due to glibc errno check failure
You can’t perform that action at this time.
0 commit comments