From 441770461f5ed7a042b79a8e092c53e8ab393f3e Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 1 Oct 2024 09:57:52 -0700 Subject: [PATCH] cmd/cgo: add srcdir & trimpath docs, sort options Update the package docs: * The -srcdir docs were accidentally lost in CL 68590. * The -trimpath option was added in CL 266358 but not documented. * The options were not sorted correctly. Fixes #69730 Change-Id: I97320e0f4fb6aa47cb03d451f028d3d9d9b560f7 Reviewed-on: https://go-review.googlesource.com/c/go/+/616699 Auto-Submit: Ian Lance Taylor Reviewed-by: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Knyszek --- src/cmd/cgo/doc.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go index a2b69b20dc..9ff5fd4190 100644 --- a/src/cmd/cgo/doc.go +++ b/src/cmd/cgo/doc.go @@ -545,15 +545,6 @@ The following options are available when running cgo directly: If there are any exported functions, write the generated export declarations to file. C code can #include this to see the declarations. - -importpath string - The import path for the Go package. Optional; used for - nicer comments in the generated files. - -import_runtime_cgo - If set (which it is by default) import runtime/cgo in - generated output. - -import_syscall - If set (which it is by default) import syscall in - generated output. -gccgo Generate output for the gccgo compiler rather than the gc compiler. @@ -568,12 +559,25 @@ The following options are available when running cgo directly: Write out input file in Go syntax replacing C package names with real values. Used to generate files in the syscall package when bootstrapping a new target. + -importpath string + The import path for the Go package. Optional; used for + nicer comments in the generated files. + -import_runtime_cgo + If set (which it is by default) import runtime/cgo in + generated output. + -import_syscall + If set (which it is by default) import syscall in + generated output. -ldflags flags Flags to pass to the C linker. The cmd/go tool uses this to pass in the flags in the CGO_LDFLAGS variable. -objdir directory Put all generated files in directory. -srcdir directory + Find the Go input files, listed on the command line, + in directory. + -trimpath rewrites + Apply trims and rewrites to source file paths. */ package main -- 2.48.1