Since binutils can not add this, we re-introduce pefixup.
It searches for the exported symbol '_load_config_used',
and uses that to fill out the LOAD_CONFIG directory in the PE header
Remove RTC switch from configure.cmd, now MSVC runtime checks are
supposed to be enabled/disabled via CMake define (-DRUNTIME_CHECKS=1)
Prepare for adding more dynamic analysis options
Surprisingly this also happens to "fix" random "Invalid Opcode" exceptions in XQEMU.
(But I think it's more like a coincidence... --hbelusca)
CORE-16627 CORE-16216
The first part of PC-98 Port - https://reactos.org/wiki/PC-98
- Add FAT12 file system boot sector for NEC PC-98 series.
- Add a new build target for a PC-98 bootable floppy disk.
- Add a new sub-architecture into config.cmake.
For MSVC, marking the section as discardable will do this automatically.
For GCC, we use a linker script that places it after the .reloc section
(which should be the last "real" section, check ld --verbose output for the
default linker script).
This fixes what seems to be a regression from r55835 (!).
This prevents some errors like this one:
In file included from ../dll/win32/wldap32/ber.c:27:0:
../sdk/include/reactos/wine/debug.h:378:48: error: '__wine_dbch___default' defined but not used [-Werror=unused-const-variable=]
static struct __wine_debug_channel * const __wine_dbch___default = &__wine_dbch_##ch
^
../dll/win32/wldap32/ber.c:29:1: note: in expansion of macro 'WINE_DEFAULT_DEBUG_CHANNEL'
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
^~~~~~~~~~~~~~~~~~~~~~~~~~
Up to CMake 3.3 LINK_DEPENDS was ignored in non-Makefile generators. See also http://www.cmake.org/pipermail/cmake/2010-May/037206.html. Since CMake 3.4 it is no longer ignored, but requires CMP0005 policy to be set to NEW and it requires a full path which was already correctly used on GCC, but not on MSVC builds.
* [CMAKE] Fix for CMP0018
The new behaviour lets us explicitly disabling position independent code, avoiding the need to change undocumented variables
* LINK_DEPENDS is semicolon separated
* [CMAKE] Fix for CMP0005
it seems impossible to have cmake correct escape PROXY_CLSID_IS so move it to the header
- C4311: pointer truncation from '<pointer>' to '<integer>'
- C4312: conversion from '<integer>' to '<pointer>' of greater size
- C4133: incompatible types - from '<x> *' to '<y> *'
- C4028: formal parameter different from declaration
_IMPLICIT_LINK_DIRECTORIES
Othrewise, if you link a RC module with a static C library (as done for
fusion DLLs), you get the standard C libraries from GCC. This is not
what we want.
This might have to be done for MSVC builds. Check build.ninja to verify
this.
There is no need to compile our DLLs as shared libraries since we are
managing symbols exports and imports through spec files.
On my system, this reduces the configure-time by a factor of two.
ReactOS/Windows headers contain lots of structures whose last field is
fieldName[ANYSIZE] or fieldName[1].
Starting with GCC 4.8, gcc considers that accessing items [2], [3], ...
are undefined operation, and may optimize those accesses by removing them!
Add flag -fno-aggressive-loop-optimizations to prevent this unwanted behaviour.
MSBuild, via the VS IDE, uses response files when calling CL or LINK.
We cannot specify a custom response file on the linker command-line,
since specifying response files from within response files is forbidden.
We therefore have to pre-process, at configuration time, the linker
script so as to retrieve the custom linker options to be appended
to the linker command-line.
- Always use string pooling when building: this helps reducing the
size of the binaries due to string redundancy coming from the usage
of __FILE__ / __RELFILE__ in the debugging helper macros. Note also
that GCC builds use string pooling by default.
- Use suitable add_compile_flags() command.
- Add some explanative comments for some settings.
Some numbers (obtained with my local builds):
Before / After => Reduction
===========================
freeldr.sys : 443 KB ( 453.632 bytes) / 364 KB ( 372.736 bytes) => ~ 18%
win32k.sys : 1877 KB (1.922.048 bytes) / 1562 KB (1.599.488 bytes) => ~ 17%
ntoskrnl.exe : 2253 KB (2.307.072 bytes) / 1902 KB (1.947.136 bytes) => ~ 15.6%
kernel32.dll : 3008 KB (3.080.192 bytes) / 2906 KB (2.975.744 bytes) => ~ 3.4%
* Add an NDK header to define INIT_FUNCTION/INIT_SECTION globally
* Use _declspec(allocate(x)) and _declspec(code_seg(x)) on MSVC versions that support it
* Use INIT_FUNCTION on functions only and INIT_SECTION on data only (required by MSVC)
* Place INIT_FUNCTION before the return type (required by MSVC)
* Make sure declarations and implementations share the same modifiers (required by MSVC)
* Add a global linker option to suppress warnings about defined but unused INIT section
* Merge INIT section into .text in freeldr