From: Ian Lance Taylor Date: Tue, 1 Oct 2024 16:57:52 +0000 (-0700) Subject: cmd/cgo: add srcdir & trimpath docs, sort options X-Git-Tag: go1.24rc1~779 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=441770461f5ed7a042b79a8e092c53e8ab393f3e;p=gostls13.git 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 --- 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