@@ -516,6 +516,7 @@ function printShellEnv(manifest) {
516516 }
517517 if ( manifest . platform === 'linux' ) {
518518 console . log ( `export LD_LIBRARY_PATH="${ manifest . libDir } ${ delimiter } $LD_LIBRARY_PATH"` ) ;
519+ console . log ( `export RUSTFLAGS="${ mergeFlags ( '$RUSTFLAGS' , linuxLinkFlags ( manifest ) ) } "` ) ;
519520 }
520521 if ( manifest . platform === 'macos' ) {
521522 console . log ( `export RUSTFLAGS="${ mergeFlags ( '$RUSTFLAGS' , macosRpathFlag ( manifest ) ) } "` ) ;
@@ -544,6 +545,7 @@ function writeGitHubEnv(manifest) {
544545 entries . push (
545546 `LD_LIBRARY_PATH=${ manifest . libDir } ${ delimiter } ${ process . env . LD_LIBRARY_PATH ?? '' } `
546547 ) ;
548+ entries . push ( `RUSTFLAGS=${ mergeFlags ( process . env . RUSTFLAGS , linuxLinkFlags ( manifest ) ) } ` ) ;
547549 }
548550 if ( manifest . platform === 'macos' ) {
549551 entries . push ( `RUSTFLAGS=${ mergeFlags ( process . env . RUSTFLAGS , macosRpathFlag ( manifest ) ) } ` ) ;
@@ -561,6 +563,13 @@ function macosRpathFlag(manifest) {
561563 return `-C link-arg=-Wl,-rpath,${ manifest . libDir } ` ;
562564}
563565
566+ function linuxLinkFlags ( manifest ) {
567+ return [
568+ `-C link-arg=-Wl,-rpath,${ manifest . libDir } ` ,
569+ '-C link-arg=-Wl,--allow-shlib-undefined'
570+ ] . join ( ' ' ) ;
571+ }
572+
564573function mergeFlags ( current , next ) {
565574 return [ current , next ] . filter ( Boolean ) . join ( ' ' ) ;
566575}
0 commit comments