Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmd/internal/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var SizeFormat string
var SizeLevel string
var ForceRebuild bool
var PrintCommands bool
var PrintDebug bool
var OptLevel optlevel.Level

type ltoFlag struct {
Expand Down Expand Up @@ -139,6 +140,7 @@ func AddOptLevelFlags(fs *flag.FlagSet) {
func AddBuildFlags(fs *flag.FlagSet) {
fs.BoolVar(&ForceRebuild, "a", false, "Force rebuilding of packages that are already up-to-date")
fs.BoolVar(&PrintCommands, "x", false, "Print the commands")
fs.BoolVar(&PrintDebug, "debug", false, "Print debug information")
AddOptLevelFlags(fs)
AddLTOFlag(fs)
AddGlobalDCEFlag(fs)
Expand Down Expand Up @@ -266,6 +268,7 @@ func UpdateConfig(conf *build.Config) error {
conf.CompilerHash = compilerhash.Value()
conf.Tags = Tags
conf.Verbose = Verbose
conf.PrintDebug = PrintDebug
conf.PrintCommands = PrintCommands
conf.OptLevel = OptLevel
conf.Target = Target
Expand Down
5 changes: 3 additions & 2 deletions internal/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ type Config struct {
AbiMode AbiMode
GenExpect bool // only valid for ModeCmpTest
Verbose bool
PrintDebug bool
PrintCommands bool
GenLL bool // generate pkg .ll files
CheckLLFiles bool // check .ll files valid
Expand Down Expand Up @@ -281,7 +282,7 @@ func Do(args []string, conf *Config) ([]Package, error) {
cl.EnableExportRename(true)
}

verbose := conf.Verbose
verbose := conf.PrintDebug
patterns := args
tags := "llgo,math_big_pure_go,purego"
if conf.AbiMode == cabi.ModeAllFunc {
Expand Down Expand Up @@ -647,7 +648,7 @@ func (c *context) linker() *clang.Cmd {

// shouldPrintCommands reports whether command tracing should be enabled.
func (c *context) shouldPrintCommands(verbose bool) bool {
return c.buildConf.PrintCommands || c.buildConf.Verbose || verbose
return c.buildConf.PrintCommands || c.buildConf.PrintDebug || verbose
}

func (c *context) hasAltPkg(pkgPath string) bool {
Expand Down
6 changes: 3 additions & 3 deletions test/buildcache/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ echo "Snapshots directory: $SNAPSHOTS_DIR"
echo "Build temp directory: $BUILD_TEMP_DIR"

# Run native tests
run_test_suite "native" "llgo build -o $BUILD_TEMP_DIR/buildcache.out -v ." ""
run_test_suite "native" "llgo build -o $BUILD_TEMP_DIR/buildcache.out -debug ." ""

# Run WASM tests - always use iwasm from llgo cache directory
# Determine cache directory based on platform
Expand Down Expand Up @@ -311,7 +311,7 @@ if [ -n "$LLGO_IWASM" ] && [ -f "$LLGO_IWASM" ]; then
echo ""
echo -e "${BLUE}Using iwasm: $LLGO_IWASM${NC}"
run_test_suite "wasm" \
"GOOS=wasip1 GOARCH=wasm llgo build -o $BUILD_TEMP_DIR/buildcache.wasm -tags=nogc -v ." \
"GOOS=wasip1 GOARCH=wasm llgo build -o $BUILD_TEMP_DIR/buildcache.wasm -tags=nogc -debug ." \
"$BUILD_TEMP_DIR/buildcache.wasm" \
"$LLGO_IWASM --stack-size=819200000 --heap-size=800000000 $BUILD_TEMP_DIR/buildcache.wasm"
else
Expand All @@ -327,7 +327,7 @@ fi
echo ""
echo -e "${BLUE}Running ESP32-C3 tests...${NC}"
run_test_suite "esp32c3" \
"llgo build -target=esp32c3 -o $BUILD_TEMP_DIR/buildcache.elf -v ." \
"llgo build -target=esp32c3 -o $BUILD_TEMP_DIR/buildcache.elf -debug ." \
"$BUILD_TEMP_DIR/buildcache.elf"

# ===========================================================
Expand Down
Loading