Ecosyste.ms: Repos

An open API service providing repository metadata for many open source software ecosystems.

Package Usage: go: modernc.org/ccgo/v3

Command ccgo is a C compiler producing Go code. Invocation 2021-12-23: v3.13.0 add clang support. To compile the resulting Go programs the package modernc.org/libc has to be installed. CCGO_CPP selects which command is used by the C front end to obtain target configuration. Defaults to `cpp`. Ignored when --load-config <path> is used. TARGET_GOARCH selects the GOARCH of the resulting Go code. Defaults to $GOARCH or runtime.GOARCH if $GOARCH is not set. Ignored when --load-config <path> is used. TARGET_GOOS selects the GOOS of the resulting Go code. Defaults to $GOOS or runtime.GOOS if $GOOS is not set. Ignored when --load-config <path> is used. To compile for the host invoke something like To cross compile set TARGET_GOARCH and/or TARGET_GOOS, not GOARCH/GOOS. Cross compile depends on availability of C stdlib headers for the target platform as well on the set of predefined macros for the target platform. For example, to cross compile on a Linux host, targeting windows/amd64, it's necessary to have mingw64 installed in $PATH. Then invoke something like Only files with extension .c, .h or .json are recognized as input files. A .json file is interpreted as a compile database. All other command line arguments following the .json file are interpreted as items that should be found in the database and included in the output file. Each item should be on object file (.o) or static archive (.a) or a command (no extension). Command line options requiring an argument. -Dfoo Equals `#define foo 1`. -Dfoo=bar Equals `#define foo bar`. -Ipath Add path to the list of include files search path. The option is a capital letter I (India), not a lowercase letter l (Lima). -limport-path The package at <import-path> must have been produced without using the -nocapi option, ie. the package must have a proper capi_$GOOS_$GOARCH.go file. The option is a lowercase letter l (Lima), not a capital letter I (India). -Ufoo Equals `#undef foo`. -compiledb name When this option appears anywhere, most preceding options are ignored and all following command line arguments are interpreted as a command with arguments that will be executed to produce the compilation database. For example: This will execute `make -DFOO -w` and attempts to extract the compile and archive commands. Only POSIX operating systems are supported. The supported build system must output information about entering directories that is compatible with GNU make. The only compilers supported are `gcc` and `clang`. The only archiver supported is `ar`. Format specification: https://clang.llvm.org/docs/JSONCompilationDatabase.html Note: This option produces also information about libraries created with `ar cr` and include it in the json file, which is above the specification. -crt-import-path path Unless disabled by the -nostdlib option, every produced Go file imports the C runtime library. Default is `modernc.org/libc`. -export-defines "" Export C numeric/string defines as Go constants by capitalizing the first letter of the define's name. -export-defines prefix Export C numeric/string defines as Go constants by prefixing the define's name with `prefix`. Name conflicts are resolved by adding a numeric suffix. -export-enums "" Export C enum constants as Go constants by capitalizing the first letter of the enum constant name. -export-enums prefix Export C enum constants as Go constants by prefixing the enum constant name with `prefix`. Name conflicts are resolved by adding a numeric suffix. -export-externs "" Export C extern definitions as Go definitions by capitalizing the first letter of the definition name. -export-externs prefix Export C extern definitions as Go definitions by prefixing the definition name with `prefix`. Name conflicts are resolved by adding a numeric suffix. -export-fields "" Export C struct fields as Go fields by capitalizing the first letter of the field name. -export-fields prefix Export C struct fields as Go fields by prefixing the field name with `prefix`. Name conflicts are resolved by adding a numeric suffix. -export-structs "" Export tagged C struct/union types as Go types by capitalizing the first letter of the tag name. -export-structs prefix Export tagged C struct/union types as Go types by prefixing the tag name with `prefix`. Name conflicts are resolved by adding a numeric suffix. -export-typedefs "" Export C typedefs as Go types by capitalizing the first letter of the typedef name. -export-structs prefix Export C typedefs as as Go types by prefixing the typedef name with `prefix`. Name conflicts are resolved by adding a numeric suffix. -static-locals-prefix prefix Prefix C static local declarators names with 'prefix'. -host-config-cmd command This option has the same effect as setting `CCGO_CPP=command`. -host-config-opts comma-separated-list The separated items of the list are added to the invocation of the configuration command. -pkgname name Set the resulting Go package name to 'name'. Defaults to `main`. -script filename Ccgo does not yet have a concept of object files. All C files that are needed for producing the resulting Go file have to be compiled together and "linked" in memory. There are some problems with this approach, one of them is the situation when foo.c has to be compiled using, for example `-Dbar=42` and "linked" with baz.c that needs to be compiled with `-Dbar=314`. Or `bar` must not defined at all for baz.c, etc. A script in a named file is a CSV file. It is opened like this (error handling omitted): The first field of every record in the CSV file is the directory to use. The remaining fields are the arguments of the ccgo command. This way different C files can be translated using different options. The CSV file may look something like: -volatile comma-separated-list The separated items of the list are added to the list of file scope extern variables the will be accessed atomically, like if their C declarator used the 'volatile' type specifier. Currently only C scalar types of size 4 and 8 bytes are supported. Other types/sizes will ignore both the volatile specifier and the -volatile option. -save-config path This option copies every header included during compilation or compile database generation to a file under the path argument. Additionally the host configuration, ie. predefined macros, include search paths, os and architecture is stored in path/config.json. When this option is used, no Go code is generated, meaning no link phase occurs and thus the memory consumption should stay low. Passing an empty string as an argument of -save-config is the same as if the option is not present at all. Possibly useful when the option set is generated in code. This option is ignored when -compiledb <path> is used. --load-config path Note that this option must have the double dash prefix to distinguish it from -lfoo, the [traditional] short form of `-l foo`. This option configures the compiler using path/config.json. The include paths are adjusted to be relative to path. For example: Assume on machine A the default C preprocessor reports a system include search path "/usr/include". Running ccgo on A with -save-config /tmp/foo to compile foo.c that #includes <stdlib.h>, which is found in /usr/include/stdlib.h on the host results in Assume /tmp/foo from machine A will be recursively copied to machine B, that may run a different operating system and/or architecture. Let the copy be for example in /tmp/bar. Using --load-config /tmp/bar will instruct ccgo to configure its preprocessor with a system include path /tmp/bar/usr/include and thus use the original machine A stdlib.h found there. When the --load-config is used, no host configuration from a machine B cross C preprocessor/compiler is needed to transpile the foo.c source on machine B as if the compiler would be running on machine A. The particular usefulness of this mechanism is for transpiling big projects for 32 bit architectures. There the lack if ccgo having an object format and thus linking everything in RAM can need too much memory for the system to handle. The way around this is possibly to run something like on machine A, transfer path/* to machine B and run the link phase there with eg. Note that the C sources for the project must be in the same path on both machines because the compile database stores absolute paths. It might be convenient to put the sources in path/src, the config in path/config, for example, and transfer the [archive of] path/ to the same directory on the second machine. That also solves the issue when ./configure generates files and the result differs per operating system or architecture. Passing an empty string as an argument of -load-config is the same as if the option is not present at all. Possibly useful when the option set is generated in code. These command line options don't take arguments. -E When this option is present the compiler does not produce any Go files and instead prints the preprocessor output to stdout. -all-errors Normally only the first 10 or so errors are shown. With this option the compiler will show all errors. -header Using this option suppresses producing of any function definitions. This is possibly useful for producing Go files from C header files. Including function signatures with -header. -func-sig Add this option to include fucntion signature when compiling headers (using -header). -nostdinc This option disables the default C include search paths. -nostdlib This option disables importing of the runtime library by the resulting Go code. -trace-pinning This option will print the positions and names of local declarators that are being pinned. -version Ignore all other options, print version and exit. -verbose-compiledb Enable verbose output when -compiledb is present. -ignore-undefined This option tells the linker to not insist on finding definitions for declarators that are not implicitly declared and used - but not defined. This might be useful when the intent is to define the missing function in Go functions manually. Name conflict resolution for such declarator names may or may not be applied. -ignore-unsupported-alignment This option tells the compiler to not complain about alignments that Go cannot support. -trace-included-files This option outputs the path names of all included files. This option is ignored when -compiledb <path> is used. There may exist other options not listed above. Those should be considered temporary and/or unsupported and may be removed without notice. Alternatively, they may eventually get promoted to "documented" options.
197 versions
Latest release: 9 months ago
1,818 dependent packages

View more package details: https://packages.ecosyste.ms/registries/proxy.golang.org/packages/modernc.org/ccgo/v3

View more repository details: https://repos.ecosyste.ms/hosts/GitLab.com/repositories/cznic%2Fccgo

Dependent Repos 7,425

zeromike/syft Fork of anchore/syft
CLI tool and library for generating a Software Bill of Materials from container images and filesystems
  • v3.15.1 go.mod
  • v3.9.5 go.sum
  • v3.10.0 go.sum
  • v3.11.0 go.sum
  • v3.11.1 go.sum
  • v3.11.3 go.sum
  • v3.12.4 go.sum
  • v3.12.6 go.sum
  • v3.12.8 go.sum
  • v3.12.11 go.sum
  • v3.12.14 go.sum
  • v3.12.18 go.sum
  • v3.12.20 go.sum
  • v3.12.21 go.sum
  • v3.12.22 go.sum
  • v3.12.25 go.sum
  • v3.12.29 go.sum
  • v3.12.36 go.sum
  • v3.12.38 go.sum
  • v3.12.43 go.sum
  • v3.12.46 go.sum
  • v3.12.47 go.sum
  • v3.12.50 go.sum
  • v3.12.51 go.sum
  • v3.12.53 go.sum
  • v3.12.54 go.sum
  • v3.12.55 go.sum
  • v3.12.56 go.sum
  • v3.12.57 go.sum
  • v3.12.60 go.sum
  • v3.12.66 go.sum
  • v3.12.67 go.sum
  • v3.12.73 go.sum
  • v3.12.81 go.sum
  • v3.12.84 go.sum
  • v3.12.86 go.sum
  • v3.12.90 go.sum
  • v3.12.92 go.sum
  • v3.13.1 go.sum
  • v3.14.0 go.sum
  • v3.15.1 go.sum

Size: 10.4 MB - Last synced: 12 months ago - Pushed: almost 2 years ago

wiennat/rjio
  • v3.0.0-20220428102840-41399a37e894 go.sum
  • v3.0.0-20220430103911-bc99d88307be go.sum
  • v3.16.4 go.sum
  • v3.16.6 go.sum

Size: 16.3 MB - Last synced: about 1 month ago - Pushed: about 1 year ago

Team-Kujira/ibc-go Fork of cosmos/ibc-go
Interblockchain Communication Protocol (IBC) implementation in Golang.
  • v3.16.6 e2e/go.mod
  • v3.0.0-20220428102840-41399a37e894 e2e/go.sum
  • v3.0.0-20220430103911-bc99d88307be e2e/go.sum
  • v3.16.4 e2e/go.sum
  • v3.16.6 e2e/go.sum

Size: 30.2 MB - Last synced: 19 days ago - Pushed: 8 months ago

influxdata/influxdb-observability
  • v3.9.4 tests-integration/go.sum

Size: 2.21 MB - Last synced: 18 days ago - Pushed: 18 days ago

Boroda76/go_service_naked
  • v3.9.2 go.sum

Size: 791 KB - Last synced: 21 days ago - Pushed: about 1 year ago

rxrddd/austin-v2
基于kratos 的聚合消息推送平台
  • v3.9.5 go.sum
  • v3.10.0 go.sum
  • v3.11.0 go.sum
  • v3.11.1 go.sum
  • v3.11.3 go.sum
  • v3.12.4 go.sum
  • v3.12.6 go.sum
  • v3.12.8 go.sum
  • v3.12.11 go.sum
  • v3.12.14 go.sum
  • v3.12.18 go.sum
  • v3.12.20 go.sum
  • v3.12.21 go.sum
  • v3.12.22 go.sum
  • v3.12.25 go.sum
  • v3.12.29 go.sum
  • v3.12.36 go.sum
  • v3.12.38 go.sum
  • v3.12.43 go.sum
  • v3.12.46 go.sum
  • v3.12.47 go.sum
  • v3.12.50 go.sum
  • v3.12.51 go.sum
  • v3.12.53 go.sum
  • v3.12.54 go.sum
  • v3.12.55 go.sum
  • v3.12.56 go.sum
  • v3.12.57 go.sum
  • v3.12.60 go.sum
  • v3.12.66 go.sum
  • v3.12.67 go.sum
  • v3.12.73 go.sum
  • v3.12.81 go.sum
  • v3.12.84 go.sum
  • v3.12.86 go.sum
  • v3.12.90 go.sum
  • v3.12.92 go.sum
  • v3.13.1 go.sum
  • v3.15.9 go.sum
  • v3.15.10 go.sum
  • v3.15.12 go.sum
  • v3.15.14 go.sum
  • v3.15.15 go.sum
  • v3.15.16 go.sum
  • v3.15.17 go.sum
  • v3.15.18 go.sum
  • v3.15.19 go.sum
  • v3.16.2 go.sum

Size: 1.77 MB - Last synced: about 1 year ago - Pushed: about 1 year ago