-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link in native libraries of transitive dependencies in archive mode (#…
…3186) When linking a go_binary in one of the native archive modes, all native libraries of transitive dependencies should be included in the resulting CcInfo, not just the libraries obtained from the cdeps. This commit adds a `cc_info` field to the `GoSource` provider that includes the result of merging the `CcInfo`s of all `deps` and `cdeps` for all Go libraries, not just for those using cgo themselves.
- Loading branch information
Showing
11 changed files
with
109 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package direct_dep | ||
|
||
import ( | ||
"github.com/bazelbuild/rules_go/tests/core/cgo/transitive_dep" | ||
) | ||
|
||
func PrintGreeting() { | ||
transitive_dep.PrintGreeting() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include <stdio.h> | ||
|
||
void native_greeting(void) { | ||
printf("Hello, world!\n"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
extern void native_greeting(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package transitive_dep | ||
|
||
/* | ||
#include "tests/core/cgo/native_dep.h" | ||
*/ | ||
import "C" | ||
|
||
func PrintGreeting() { | ||
C.native_greeting(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "tests/core/cgo/use_transitive_symbol.h" | ||
|
||
int main() { | ||
PrintGreeting(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package main | ||
|
||
import "C" | ||
|
||
import ( | ||
"github.com/bazelbuild/rules_go/tests/core/cgo/direct_dep" | ||
) | ||
|
||
//export PrintGreeting | ||
func PrintGreeting() { | ||
direct_dep.PrintGreeting() | ||
} | ||
|
||
func main() {} |