- Fix copy/paste in the environmental variables.
- If vswhere exists, but doesn't find a given version, exit
detection early and don't fall back on checking the environment.
- Clean up hackish vswhere handling.
* Fix "bootstrap.bat borland" failing to find label "Test_Path"
If an override toolset is given in the `bootstrap.bat` command-line,
`bootstrap.bat` -> `src/engine/build.bat` bypasses loading
`src/engine/guess_toolset.bat` entirely. Later on the call to
`Test_Path` from `build.bat` -> `config_toolset.bat` fails to find that
label.
Fix this by making a new parameterized entry-point `test_path` inside
`guess_toolset.bat` for this caller in `config_toolset.bat`.
Fixes: #382.
* Handle spaces in C++Builder toolchain path
Nowadays a default installation goes into %PROGRAMFILES%, e.g.
"C:\Program Files (x86)\Embarcadero\Studio\20.0\Bin".
* Add "-Nd" before "/D"-options for bcc32.exe
The preprocessor of the old Borland/C++Builder compiler (bcc32.exe) by
default does not accept preprocessor statements of the form:
#if SYMBOL_NAME
where `SYMBOL_NAME` was `#define`-ed without a value. It insists on the
`#if defined(SYMBOL_NAME)` or `#ifdef SYMBOL_NAME` forms (emitting error
E2188 "expression syntax"). The workaround is to specify the `-Nd`
option before the offending `/D` options, which effectively provides a
value of "1" to the symbols being #define-ed. Apply this workaround in
the recipes of `bjam` and `b2` to satisfy the preprocessor.
The alternative here would be to migrate to the Clang-based (and much
more standard-compliant) bcc32c.exe, but that would be a more involved
change.
* Separate :Guess_Yacc logic from :Guess_Toolset in build.bat
This was an existing benign issue introduced in 00c2358, but it became
apparent after 9339693.
This avoids warnings=all and warnings-as-errors=on causing irreprerable
damage to humans. And makes it possible to have more warnings without
destorying the universe.
fixes#394
When running build.sh with the cross-cc toolset, it uses the native
compiler settings found in the BUILD_CC, BUILD_CFLAGS, and
BUILD_LDFLAGS environment variables to create executables to run on
the build system. It then sets the toolset to cc so that the
cross-compilers given as CC etc. are propagated to subprocesses.
This ensures both that the build system can build and execute its
required programs and that final executables are cross-compiled for
the target architecture.
The bug happens because exec_check replaces the shell inside
the command structure, but make1cmds retains a reference to
the old shell. The bug appears when all of the following are true:
- The action is piecemeal
- b2 is running on Windows
- SHELL is %
- The action contains elements that require a shell
- The action is split into multiple commands
In particular, this applies for gcc.archive with a large
number of object files.
Instead of attempting to reuse the same shell, we make
a new copy in every iteration of the loop. The shell
and target lists are usually short and the cost of copying
them is insignificant compared to the other work done by the loop.
In addition, the optimization is rarely triggered because
piecemeal actions that require splitting are relatively rare.
As listed in issue #367, PTH is/was an undocumented experimental feature of
clang that is considered 'failed' and is currently being removed from
the next version of clang. Additionally, there is a bug in the
implementation of PTH in clang that results in severe miscompilation of
code using about 1/3 of the available tokens.
This patch replaces PTH with PCH, which completely subsumes PTH's
functionality. Additionally, PCH mode on clang should now be faster as a
result.
For edification: The difference between PTH and PCH is which step the
compiler stops to save to the binary file. PTH was intended to execute
after the preprocessor has executed and commits the token list to the
binary file. PCH will go through semantic analysis and commit the AST
to the binary file.
Currently the same data is read twice.
The first time a buffer is filled by `PeekNamedPipe` and second time it is
overwritten with the same content by `ReadFile`.
It looks like the OS has the internal buffer around 4KB and with any buffer
over this size `read_pipe` will end the reading loop after first try despite
that reading a pipe may pump a new data and it can be read immediately.
This is allocating space for `nel` objects of type `ITEM*` so it should use `sizeof(ITEM*)` not `sizeof(ITEM**)`.
In practice the values are the same, but using the correct type is better anyway, and now matches the same calculation in the `memset` call in the following statement.
local-visibility is intended to be used by libraries or targets that require
a particular visibility mode. It is not propagated to dependencies. It is
equivalent to the previous visibility feature.
The new visibility feature is a composite propagated feature, so it can be
specified by users and higher level targets as a requirement. This feature is
translated to local-visibility.