diff options
Diffstat (limited to 'pkg/declextract/entity.go')
| -rw-r--r-- | pkg/declextract/entity.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/declextract/entity.go b/pkg/declextract/entity.go index eb3bc4d7c..d52d265f4 100644 --- a/pkg/declextract/entity.go +++ b/pkg/declextract/entity.go @@ -8,6 +8,7 @@ import ( "crypto/sha256" "encoding/json" "slices" + "strings" ) type Output struct { @@ -249,6 +250,13 @@ func (out *Output) SortAndDedup() { func (out *Output) SetSourceFile(file string, updatePath func(string) string) { for _, fn := range out.Functions { fn.File = updatePath(fn.File) + // To optimize build time kernel/sched compiles a number of source files together + // by including them into another source file. As the result static functions + // declared in one source file effectively referenced from another source file. + // In order to be able to resolve them, we pretend such functions are not static. + if strings.HasSuffix(fn.File, ".c") && fn.File != file { + fn.IsStatic = false + } } for _, ci := range out.Consts { ci.Filename = updatePath(ci.Filename) |
