Skip to content

Commit 4aad484

Browse files
Copilotluoliwoshang
andcommitted
Fix symbol extraction for static libraries by removing -D flag
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
1 parent e47e679 commit 4aad484

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • _xtool/llcppsymg/internal/symg

_xtool/llcppsymg/internal/symg/symg.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github.com/goplus/llcppg/_xtool/internal/clangtool"
1111
"github.com/goplus/llcppg/_xtool/internal/header"
1212
"github.com/goplus/llcppg/_xtool/internal/ld"
13+
"github.com/goplus/llcppg/_xtool/internal/symbol"
1314
llcppg "github.com/goplus/llcppg/config"
1415
"github.com/goplus/llgo/xtool/nm"
1516
)
@@ -117,7 +118,7 @@ func fetchSymbols(lib string, mode LibMode) ([]*nm.Symbol, error) {
117118

118119
for _, libFile := range libFiles {
119120
args := []string{"-g"}
120-
if runtime.GOOS == "linux" {
121+
if runtime.GOOS == "linux" && mode == symbol.ModeDynamic {
121122
args = append(args, "-D")
122123
}
123124

0 commit comments

Comments
 (0)