Alex Ionescu wrote:
Not all of them can be agnostic -- for example MSVC
doesn't generate
those warnings, and warnings that MSVC generates are only for MSVC.
I believe Marc referred to these elements in general, not just related to
warnings.
For example the linker flags -nostartfiles, -nostdlib, -lgcc, which we have
in "ntoskrnl.rbuild" and other files at the moment, won't obviously work
with the MS Linker.
From what I saw, -lgcc is often just used for __divdi3,
so that 64-bit
division works. MSVC doesn't need any additional libraries for
that, so we
could just leave this flag out for it.
But the other flags probably need an equivalent for MSVC.
The most universal method for solving this might be an XML syntax like:
<linkerflags>
<nostartfiles />
<nostdlib />
<64bitDivision />
</linkerflags>
Then rbuild could process these tags and decide itself, if the target build
tool needs a special flag for this function or not.
An easier method might be a linkerflags tag for every build tool like this:
<linkerflags tool="ld">-nostdlib -nostartfiles -lgcc</linkerflags>
<linkerflags tool="msvc">-whatsoever</linkerflags>
We definitely need one of these methods if we want to be compatible with GCC
and MSVC (and ready for possible other build tools in the future).
Best regards,
Colin