EnglishFrenchSpanish

Ad


OnWorks favicon

bear - Online in the Cloud

Run bear in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command bear that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


bear - build ear

SYNOPSIS


bear [options] [build commands]

DESCRIPTION


Bear is a tool to generate compilation database for clang tooling.

The JSON compilation database (http://clang.llvm.org/docs/JSONCompilationDatabase.html) is
used in clang project to provide information how a single compilation unit was processed.
When that is available then it is easy to re-run the compilation with different programs.

Bear execs the original build command and intercept the exec calls. To achieve that Bear
uses the LD_PRELOAD or DYLD_INSERT_LIBRARIES mechanisms provided by the dynamic linker.
There is a library which defines the exec methods and used in every child processes of the
build command. The executable itself sets the environment up to child processes and
writes the output file.

OPTIONS


-o output, --cdb output
Specify output file. Default value provided.

-a, --append
Use previously generated output file and append the new entries to it. This way
you can run bear continuously during work, and it keeps the compilation database up
to date. File deletion and addition are both considered. But build process change
(modifying compiler flags) will cause duplicate entries.

-v, --verbose
Make bear more verbose.

-l library
Specify the preloaded library location. Default value provided. (This option
mainly for development purposes.)

-n Disable filter. The output is also a JSON formated file. But the result is not a
compilation database. It contains all available information of the exec calls.
(This option mainly for development purposes.)

OUTPUT


There are two version of output formats. One is defined by the clang tooling. This goes
like this:

[
{ "directory": "/home/user/llvm/build",
"command": "clang++ -Irelative -c -o file.o file.cc",
"file": "file.cc" },
...
]

To achieve this bear has to run some filtering and formating. Build tools exec many
commands during the build process. Bear has to find was that a compiler call, and what
was the source file? The other output format is generated by the -n flag. (This output is
not formalized, it's used to debug bear itself.)

EXIT STATUS


Bear exit status is the exit status of the build command. Except when bear crashes, then
it sets to non zero.

ENVIRONMENT


BEAR_OUTPUT
The place of the temporary files where client shall report exec calls. Value set by
bear, overrides previous value for child processes.

LD_PRELOAD
Used by the dynamic loader on Linux, FreeBSD and other UNIX OS. Value set by bear,
overrides previous value for child processes.

DYLD_INSERT_LIBRARIES
Used by the dynamic loader on OS X. Value set by bear, overrides previous value
for child processes.

DYLD_FORCE_FLAT_NAMESPACE
Used by the dynamic loader on OS X. Value set by bear, overrides previous value
for child processes.

Use bear online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

Linux commands

Ad