Toolchain Bugs and Differences

From ReactOS Wiki
Jump to: navigation, search

C Compiler

No issues on record. There probably are some — please add them.

C++ Compiler

No issues on record. There probably are some — please add them.

Linker

LD cannot link multiple resource object files

This blocks proper support for WIDL-generated resources and requires hand-added .rgs files.

LD breaks delay imports if used together with __declspec(dllimport)

CORE-6504 [LD BUG] Delay import library combined with __declspec(dllimport) produces bogus output files

Binutils Bug 14339 – MinGW ld omits stubs when linking delay import library and using __declspec(dllimport)

LINK fails to correctly generate some C++ redirections when specified in the .def file

Such redirects are ignored by spec2def since r53197, since they would break msvcrt.dll (an assembly file with aliases is used instead).

framedyn.dll also suffers from this problem and uses a similar workaround (r60135).

Assembler

MASM crash on ALIAS

MASM has a bug in some versions that can cause it to crash when the ALIAS directive is used. This can be worked around by moving statements around in the source file or replacing aliases with jump instructions.

GAS cannot handle MSVC-style C++ mangled names

It chokes on the question marks in most directives. Quoting is supported in some places, but not enough to make it usable.

This affects framedyn, and will be an issue if we decide to use STLport and our own C++ runtime on GCC builds.

Resource Compiler

Null termination of strings

String resources are counted, not null terminated.

Windres will faithfully add a null character if it is explicitly added to the string via a \0 escape. Such a null character will be included in the string's length (FIXME: assumption, needs verification). RC on the other hand completely ignores such characters and never null-terminates strings, unless given the /n option (which then null-terminates all strings).

This difference does not generally cause issues, since resource APIs null-terminate strings appropriately. However, applications that manually parse resources can be affected (e.g. CORE-7509 – ping crashes in MSVC build).

Maximum string length

RC frequently complains about exceeded maximum lengths for string resources (warning RC4206). This has not been uniformly addressed so far.

Irregularly, this will also cause errors depending on the MSVC version in use. These have been worked around as they were discovered.

IDL Compiler

Wine relies increasingly on WIDL's enhanced feature set. Additionally, maintaining MIDL compatibility required additional work on our side.

We switched to using WIDL in both GCC and MSVC builds in r57019.

Missing ACF (Application Configuration File) support

ACF files are needed to support different memory allocation strategies for client and server interfaces.