Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-02Fix pseudo-ttys for kernel versions >= 5.13 (#21203) (#21204)csanchezdll
2021-03-08Add support for Apple Silicon on Xamarin.Mac SDK (#20597)mathieubourgeois
This PR implements changes that lets us build Xamarin.iOS/Xamarin.Mac SDKs so that it is possible for a Xamarin.Mac project to target x86_64+arm64 (i.e. Apple Silicon). Most of the changes are related to the mac Sdk build, but there are some extra changes as well : - Fix configure to not automatically target iOS when targeting aarch64 - Necessary to compile a cross-compiler targetting macOS arm64 - Fix aot compiler to target macOS arm64 when running on x64 (missing arch parameters) - Support offset tool for aarch64 - Necessary to compile macOS arm64 cross-compiler - Fix pthread_jit_write_protect_np and preadv usage - Missing define meant the function wasn't found (at least on Xcode 12.2) - Restrict usage to macOS - Fix crash on launch on iOS/tvOS arm64 caused by invalidly setting `MAP_JIT` on those platforms even though it's not a valid option. - Adapt macOS SDK - Build libraries for x64+arm64 and lipo them together - Create a aarch64 cross-compiler for macOS, similar to the iOS Sdk The arm64 support will only work with Xcode 12.2. To support in Xamarin.Mac, it also doesn't work if built from stable branches (because the rest of the arm64 support hasn't made it to the latest stable branch from what I can figure out) Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2020-08-31Ignore EINVAL errors on ioctl TIOCMGET/TIOCMSET so (#20219)csanchezdll
pseudo-ttys are usable. (#20218)
2019-12-10[support] Remove some dead code (#16674)Nikolay Sivov
Both 'ptv' and 'tv' are unused since select() was replaced with poll() in 57b521e.
2019-11-12Move zlib to its own directory, and re-enable subdir-objectsJo Shields
This has the following benefits: * Clearer structure for mirroring * Slight build time improvement on bundled zlib use (as it only builds once) * Removes pages of subdir-objects spew from autogen
2019-10-09[Mono.Posix] Add support for memfd_create() and file sealing (#17225)Steffen Kieß
* [Mono.Posix] Add support for memfd_create() and file sealing Add the linux syscall memfd_create() and add support for file sealing with fcntl(). * Bump API snapshot submodule
2019-10-08[support] Make sure map-impl.h ends up in the tarballAlexander Köplinger
2019-10-08Clean up map.c /map.h (#16746)Steffen Kieß
* [Mono.Posix] Move Mono_Posix_{From,To}MremapFlags() to support/sys-mman.c Since b522eab5ff5466debaacf9e971e26cfc464ebba5 Mono_Posix_FromMremapFlags() and Mono_Posix_ToMremapFlags() contain manual changes for NetBSD. Move the functions from support/map.c to support/sys-mman.c so that they won't be overwritten when create-native-map is rerun. * [Mono.Posix] Fix prototypes in support/stdio.c In ed892ccf27849c082ce6ca46fa8b96d86ca7c329 wrapper functions for several stdio functions were added, but the prototypes in map.h were manually written, not using create-native-map. This commit changes the prototypes so that they match the output of create-native-map. * [Mono.Posix] Undefine HAVE_STRUCT_SOCKADDR_IN6 in support/map.c on MSVC In 22b6b9581418260397b701c17b16c3eb55136de7 a manual change to support/map.c was added to prevent Mono_Posix_FromSockaddrIn6() and Mono_Posix_ToSockaddrIn6() from being built for windows even if HAVE_STRUCT_SOCKADDR_IN6 is defined. Instead undefine it in a header file to avoid manual changes to map.c. With this commit map.c, map.h and NativeConvert.generated.cs contain no manual changes anymore.
2019-10-03Optional only build MSVC runtime using make file system on Windows. (#16915)Johan Lorensson
* Build MSVC only runtime using make file system. Add a new option to only build MSVC version of mono runtime and native tools, --enable-msvc-only. In the past, --enable-msvc build both mingw as well as MSVC runtime, this commit adds an option to only build MSVC version of runtime and native tools using make file system. Commit updates all native make file making sure mingw/gcc builds are not done if --enable-msvc-only has been used. It also makes sure we build and use MSVC based tools as part of build and tests. Result will be a build without any mingw/gcc artifacts, but where all existing make files still works with the MSVC build artifacts. This commits is also preparing to switch the .NETCore build over to use MSVC build runtime in order to get LLVM support, something that is currently only supported on Windows MSVC build. * Add link to mono-sgen.exe and clean windows binaries. * Fix failures in mono/tests test-aot on Windows. * Add fullaot-mixed tests on Windows x64. * Run msbuild in parallel. * Default to x64 mingw host on cygwin build.
2019-08-31Follow convention -- "static inline" is only for .h files, "static" is for ↵Jay Krell
.c. (#15502) inlining is up to the compiler to decide. It is used in .h files for linkage/dedup, not to affect codegen.
2019-08-30[Mono.Posix] Add FcntlCommand.F_OFD_{GETLK,SETLK,SETLKW} (#16571)Steffen Kieß
Add F_OFD_GETLK, F_OFD_SETLK and F_OFD_SETLKW to FcntlCommand. These commmands are similar to F_GETLK, F_SETLK and F_SETLKW but operate on a per-open-file-description lock instead of a per-process lock and avoid the problem that the locks are released when close(dup(fd)) is called. See https://lwn.net/Articles/586904/ for more information. This commit also reruns create-native-map but keeps manual changes from ed892ccf27849c082ce6ca46fa8b96d86ca7c329, b522eab5ff5466debaacf9e971e26cfc464ebba5 and 22b6b9581418260397b701c17b16c3eb55136de7. In [create-native-map.diff.txt](https://github.com/mono/mono/files/3557077/create-native-map.diff.txt) you can see the difference between the commited `map.[ch]` and the one `create-native-map.exe` wants to create: - Manually inserted changes for NetBSD (`MAYMOVE` is turned into a negated `FIXED`) - `Mono_Posix_ToSockaddrIn6()` and friends get skipped for `HOST_WIN32` (not sure why, when `sockaddr_in6` exists then `Mono_Posix_ToSockaddrIn6()` should work) - At the bottom of `map.h` some functions are reordered and the parameters change (`const char*` vs. `char*`) Running create-native-map.exe also moved some O_NOATIME-related stuff (from 8b9033e4d24115190c06f775d18ef3a40cbca876) to the correct position and added it to Mono_Posix_ToOpenFlags(), which I kept in the commit.
2019-08-20Fix minizip compile on Haiku (#16301)Calvin Buckley
it doesn't have f*64 funcs, it seems
2019-08-14Fix linking of OS-provided zlib (#16177)Jo Shields
* Fix linking of OS-provided zlib This is a reduced version of https://github.com/mono/mono/pull/16091 without the Z_PREFIX stuff * Get rid of HAVE_ZLIB, be explicit about HAVE_SYS_ZLIB vs HAVE_STATIC_ZLIB * Proposed fixes from Alex
2019-07-31[zlib] Fix typo in readme and remove deleted file from msvc projectsAlexander Köplinger
2019-07-31Update zlib from 1.2.5 to 1.2.11. (#15480)Jay Krell
Circa 2010 to circa 2017. Retrieved with apt-get source zlib on WSL Ubuntu 18.04.2 LTS. This matches Debian or Ubuntu (they differ by one commit, and one of them restores a dummy function for compat). --- * [minizip] Ensure we don't ever accidentally change calling convention Make sure we always #define ZCALLBACK to empty so we don't change the calling convention on windows by including a header which defines 'CALLBACK'. This will keep things as cdecl as required by the c# pinvokes. * Update zlib readme. * Update zlib from 1.2.5 to 1.2.11. * [zlib] Small fix for Visual C++. see https://github.com/madler/zlib/pull/435/files#diff-0558e84b0c24a83ca790dcb05cd26212R1087 and https://github.com/madler/zlib/pull/435/files#diff-0558e84b0c24a83ca790dcb05cd26212R1104 * Add gzguts.h to Makefiles. * Add .h files to Visual Studio project files just for GUI purposes.
2019-07-31Add O_NOATIME to OpenFlags (#8993)turbo
O_NOATIME (Linux > 2.6.8): Do not update the file last access time (st_atime in the inode) when the file is read(2). Programs that merely index the existence of a file (backup programs e.g.) can reduce disk load using this flag.
2019-07-17configure/makefile To support updating zlib to 1.2.11. (#15697)Jay Krell
2019-07-06Cleanup zlib-helper.c allocations -- move integer overflow checks into ↵Jay Krell
calloc. (#15505)
2019-06-26CreateNLSocket and CloseNLSocket should return gpointer (#15408)Ryan Lucia
In managed, these functions are used as `static external IntPtr`. This means that previously on arm64 the top bits of the return value were garbage. A comparison with 64-bit -1 like in LinuxNetworkChange.EnsureSocket would never be true, which was causing us to hit other assertions in the runtime. Co-authored-by: Aleksey Kliger <alklig@microsoft.com>
2019-04-03Rename cabs/cimag/creal to mono_cabs/mono_cimag/mono_creal without macro to ↵Jay Krell
rename. (#13663) Also make cimag/creal macros for guaranteed inlining -- instead of passing structs by value. And add spaces before parens to follow coding convention (which is designed to ease low tech searches for entire words). This was agreed to when the code was first ported to C++ but got dropped. The compromise though was to put the defines relatively late to limit their impact.
2019-03-31[sdks,mac] Remove dependency on MXE in favor of MinGWMarek Habersack
It turns out that homebrew now has a package for the MinGW gcc-based windows cross compiler which is awesome as it allows us to skip building MXE and use the latest version of the GCC suite pre-packaged for Mac. This commit removes almost all traces of MXE (except for `mxe.mk` itself, because I don't know if any bot or external tool, whatever, use targets in it) and adds the following brew packages to SDK bot provisioning as well as to the `provision-mxe` target of Mono SDKs: * mingw-w64 * xamarin/xamarin-android-windeps/mingw-zlib The latter package builds a Windows version of zlib using MinGW and it comes from Xamarin's own homebrew tap at https://github.com/xamarin/homebrew-xamarin-android-windeps/blob/f4cc90845ff1953800d8d71035566a12d9b7aa24/mingw-zlib.rb Additionally, this commit adds a new `configure` flag: `--with-static-zlib=PATH` which allows one to specify the static zlib archive to use when linking Mono. The static archive supersedes the otherwise indicated or detected zlib. This is the recommended mode of operation for MinGW builds as it avoids problems with `zlib.dll` versions on the target machine.
2019-01-21[tvOS] cleanup defines for tvOS (#12539)Bernhard Urban
Fixes https://github.com/mono/mono/issues/11697
2019-01-17[System.IO.Compression]: Correctly handle exceptions in inner stream. #12205.Martin Baulig
DeflateStream now correctly handles exceptions thrown by it's inner stream and rethrows them after returning from native code.
2018-11-13[ci] Add targets to bundle tests and add a script to run them in HelixAlexander Köplinger
The test-bundle target copies all assets needed for test execution to a specified directory. We upload this directory to Helix and use it to run our mainline tests.
2018-09-11Merge pull request #10428 from jaykrell/mono_pages_not_faultedmonojenkins
Remove unused mono_pages_not_faulted, autoconf for mlock instead of mincore.
2018-09-06Fix DeflateStream handling of zero-length reads from underlying stream.Filip Navara
2018-09-03Use AC_CHECK_FUNCS(mincore mlock munlock).Jay Krell
2018-09-02Replace check for mincore with check for mlock.Jay Krell
2018-08-31Merge pull request #10240 from frebib/fix-strerror_rmonojenkins
[runtime] Use AC_FUNC_STRERROR_R() in Mono.Posix Hopefully this is less of a disaster than #9691 Inspired by https://github.com/mono/mono/commit/3b3b48dbb4cdbda44ffa2f10e74f819acb78bd96 Fixes https://github.com/mono/mono/issues/9532 Signed-off-by: Joe Groocock <me@frebib.net> <!-- Thank you for your Pull Request! If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed. Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number -->
2018-08-27[runtime] Use AC_FUNC_STRERROR_R() in Mono.PosixJoe Groocock
Inspired by https://github.com/mono/mono/commit/3b3b48dbb4cdbda44ffa2f10e74f819acb78bd96 Fixes https://github.com/mono/mono/issues/9532 Signed-off-by: Joe Groocock <me@frebib.net>
2018-08-09[cxx] Port complex math to small portable C and C++. (#9821)Jay Krell
* [cxx] Port complex math to small portable C and C++ with the only dependency being hypot and non-complex math, and small preexisting code we already had for msvc. I.e. we already had two versions, with varying portability. Use one of them, adding about three lines to it. There was some debate back and forth about macros/renames here. This version significantly reduces line damage and is much easier to read. Doing the rename as a separate step may still be advisable, to erase any doubt as to portable semantics, i.e. namespace isolation. Mono style divergence is also left unfixed to avoid further line damage. i.e. consider `double_complex` => `MonoComplex`. `mono_double_complex_` => `mono_complex_`.
2018-05-24Prune unused incorrect looking zip code. (#8752)Jay Krell
Not sure what is happening here. Is the type incorrect throughout, or being passed to wrong function?
2018-04-13[runtime] Get rid of the GLIB_LIBS autoconf define, it prevents automake ↵Zoltan Varga
from detecting the dependency on libeglib.la. (#8184) * [runtime] Get rid of the GLIB_LIBS autoconf define, it prevents automake from detecting the dependency on libeglib.la. Fixes #8175. * [runtime] Link eglib against -lm to avoid duplication. * [runtime] Remove a few extra -lm options. * [runtime] More GLIB_LIBS fixes.
2018-03-29add some OpenBSD patches (#7699)thfrwn
add some OpenBSD patches Hi, A few trivial additions of OpenBSD to ifdefs, plus the change of the abort signal to SIGUSR1 which fixes the SIGABRT problem (other compilation problems remain). SIGTTIN is broadcast to the process group which leads to the SIGABRT (at least on OpenBSD).
2018-03-29check for iconv only once (#7873)Ludovic Henry
It is enough to check for iconv dependencies once in the eglib/configure - just use the generated libtool library file to automatically add additional dependencies (if any). While here, make sue libeglib.a has libraries returned by LTLIBTOOL as a libtool dependency.
2018-03-16[sdks] Fix concurrent building of MonoAotOffsetsDumper.exe + Simplify ↵Ludovic Henry
building of support library (#7652) * [sdks] Simply building of support library * [sdks] Fix concurrent building of MonoAotOffsetsDumper.exe * [sdks] Cleanup of some targets
2018-02-15Remove GetNLSocket which is unused and produces a warning because it is ↵jaykrell
unprototyped. (#6691)
2018-02-06[Mono.Posix] Fix the Android xattr check to not disable it on all other ↵Rodrigo Kumpera
platforms.
2018-02-05Support IBM AIX on POWER (#6677)Calvin
* Get autotools scripts for Mono and Boehm to recognize i PASE is most similar to AIX, and perhaps I assume other commercial Unices, as well as PowerPC Linux, so grab variables from them as needed. With this, we get glib failing to build due to missing mkdtemp. * Use better cpp definition to grab more of what we want * Fix random and 64-bit file offset support * Set TARGET on IBM i on POWER * Add hack to gfile-unix.c to work around flawed AIX header From comment: /* HACK: the preprocessor will not give us mkdtemp no matter what and Mono (for good reason) does "-Werror-implicit-function-declaration" so we error out; instead declare mkdtemp here; the linker will find mkdtemp anwyays. libuv has had similar issues, but they just ignore the compiler warning instead of failing on it. See: github.com/libuv/libuv/pull/740 */ * Work around missing definition on AIX/PASE * Fix conflicting definition from due too AIX headers * Initial work to get JIT working on AIX * uncertain about NIP; is IAR the right register? need review from PPC asm people * needs calling convention work; AIX does NOT use ELF * Fix lack of casting on sigcontext macros, fix errnos for AIX * AIX doesn't distinguish between ENOTEMPTY and EEXIST without a define. Handle this case with a conditional cpp directive.. * When ctx is a void pointer, dereferencing as a struct will fail. Handle this case with a cast. * Handle regular AIX as well as PASE * Implement stack boundaries check for AIX, volume info func * vol info should be like other Unix, just needs to bridge ifdef * highly uncertain for the bounds checking, needs further review * Fix typo in mono/utils/mono-threads-aix.c * In boehm-gc.c, don't use pthread_getattr_np on AIX even if available It's not available on IBM i, and even if available, toolchains for AIX may "helpfully" swap out system headers with variants that remove functions like pthread_getattr_np. * Don't use "-export-dynamic" on non-GNU ld IBM ld considers "-e" to be a flag for setting the entry point. Detect non-GNU ld, and offer equivalents when possible. The makefile in mini had to be changed as a result due to hardcoded flags. * Use pthread-stop-world.c on AIX Remove an ifdef that gated this off to AIX. It seems the old AIX specific files shouldn't be used, and that the changelog for libgc says pthread should work fine on AIX instead; yet it was blocked. Restore this, as it compiles and seems to let mono-boehm link fine. * AIX workarounds for some of support dir * fstab on AIX is there, but defines a struct more like other platforms' checklist struct. * AIX, like macOS and some BSDs, doesn't define some serial types. * psignal is another victim of GNU; even then it isn't in PASE headers anyways * More support workarounds for AIX headers * Replacement function body for syslog2 on vsyslog-less platforms AIX lacks vsyslog; detect in autoconf and act appropriately. * Final support hacks for AIX * Fix problematic stack management on AIX this gets us past ifdefs, after much handwringing * get the right end of the stack; r1/stack pointer is on the wrong end and ustk is just plain broken * AIX doesn't seem to like the semantics of the mmap call valloc does here; either we're allocating into an area we shouldn't be or we're not passing the right flags. Until then, learn to live without the stack guard? * Disable Boehm GC on AIX Focus on getting SGen working, and avoid legacy debugging nonsense * Remove AIX ifdef-undef and replace with s/hz/uhz * Don't use sigaltstack on AIX due to bugginess with guard sections The valloc call on AIX has issues after issuing mprotect; don't do do it. I believe it fails because we aren't issuing the right flags on AIX, or because we're allocating inside of an already allocated area. * Perform a 64-bit build on AIX We still crash at the same place, but probably for the best that we switch to 64-bit. (Maybe we could make it configurable?) * Fix func descriptor ifdef, add initial (likely wrong) defs for AIX * AIX doesn't define __powerpc64__ or __ppc64__ when compiling as 64-bit. Use an alternate ifdef, and shuffle around that ifdef anyways, as it could lead to wrong results on other platforms too. * AIX likely needs special definitions, especially on 32-bit. The calling convention is closest to PPC64BE Linux, but not exactly. * Fix stack size on AIX Ruby dealt with this before: https://github.com/ruby/ruby/commit/a2594be783c727c6034308f5294333752c3845bb * Set up initial PPC hwcap for AIX, fix ftnptr ifdefs, tweak AIX defs * Fix hwcap to use better values on PPC AIX Still needs more adjustment though * Fix alignment issue on AIX, tweak mini-ppc values just a bit more * On AIX, doubles are always aligned by 4 if they're in structs. Since we need to have them aligned by 8 on 64-bit, this is bad, so change the type on AIX. * We can use this definition on AIX Now we can bootstrap Mono! * Shuffle MonoArray ifdef per suggestion of @vargaz * Fix System.Decimal division on big endian systems Before, we got non-sensical overflow on things like `(Decimal)Int32.MaxValue / 1000`; now they get the same value, comparing this POWER6 running AIX to my server's output running OpenBSD/amd64. * Fix dynamically linked build of Mono on AIX nm wasn't seeing 64-bit symbools as it defaults to 32-bit mode, also never try to use GNU nm * Fix PPC64 define in mono-config Interestingly, there was an AIX define already present, and that definition is present in AIX's passed includes, so continue to use it. * Don't use __thread even if detected on AIX tl;dr: The assembler gets angry with __thread and minimal-toc, and changing options to replace minimal-toc causes linker issues; this TLS option isn't important anyways if we have pthread instead, like before when we were using Perzl's old GCC without __thread. * Get lib.a(lib.o) type archives working with P/Invoke for AIX AIX libraries are very, very strange compared to other Unices. I'm not entirely sure if this is correct or optimal; it may need to special case further. For now, it's enough to get gacutil up and running. Some resources I found useful for this charade: <http://stromberg.dnsalias.org/~dstromberg/AIX-shared-libs.html> Also set libc and libintl to their proper values. * Scheduling priority hack for i PASE doesn't accept anything other than SCHED_OTHER, and the funcs for getting min/max don't work either. AIX suffers, but only a little bit. * Final polish on request Remove Boehm changes if we don't use Boehm, tweak some defines, remove some externs, tweak autoconf file * Be aware of ERESTART, on OSes that use it Instead of EINTR/EAGAIN, AIX uses ERESTART. Handle this, so things like xsp are less chatty when performing async IO.
2018-01-04Adds support for nanosecond resolution file information where available ↵Miguel de Icaza
(Fixes: 6283) (#6307) * Adds support for nanosecond resolution file information where available. This patch adds support to the runtime to use the nanosecond information available on Mac and Linux on `struct stat`. `stat.st_Xtimespec` strucutre on OSX, and `stat.st_Xtime` and `stat.st_Xtim.tv_nsec` pair on Linux. Additionally, this adds support in `Mono.Posix` for MacOS nanosecond stat data, it already had Linux support before. * Use ULL here to prevent the computation from overflowing
2017-12-06Compile on amd64 Haiku (#4473)Calvin
* Compile on amd64 Haiku Use sigcontext (somewhat like win32, or x86) on Haiku amd64. On amd64, Haiku doesn't have issues with marshalling 64-bit values, but it currently does have issues with SGen either causing a stall or a core dump. As such, while it can compile the stdlib (further than x86 got), it's still a work in progress. * Use set_real_time_clock for sys-time.c on Haiku * Get mono-boehm compiling on Haiku again It still doesn't work. Initialization will call GC_mark_from, which will cause a segmentation fault as it decrements pointers. (Mono will enter an infinite loop in mono_get_hazardous_pointer as a result.) For now, mono-sgen will continue to be used by default.
2017-11-10Include <config.h> in C files that include mono headersAleksey Kliger
Any translation unit that includes a Mono header should include <config.h> first to ensure that all of our configuration defines are available. In particular, config.h defines MONO_INSIDE_RUNTIME which, in mono-publib.h causes MONO_RT_EXTERNAL_ONLY to be defined to an attribute that causes a compilation error if you use a function that is internally deprecated for the runtime. Also change a couple of places that used non-_checked functions.
2017-10-31[android] Fix compilation with recent ndk and sdk target < 16.Rodrigo Kumpera
2017-10-27Bugfix: 1.5 stop bits for serial port should set the posix stop bit flag (#5873)robotrovsky
1.5 stop bits have not been handled at all. According to this documentation of the 8250 UART: http://stanislavs.org/helppc/8250.html a set bit 2 in the LCR register means stop bits = 1.5 for 5 bit words or 2 for 6, 7 or 8 bit words. That is the reason why pyserial also sets the bit: https://github.com/pyserial/pyserial/blob/92d101613be41ecb2f2054c3f43a006fbe6f9966/serial/serialposix.py#L377
2017-10-19[runtime] Rename atomic functions from the win32 style naming to ↵Johan Lorensson
mono_atomic_<op>_<type>, with a consistent signature on all platforms, including Windows implementation. (#5767) * [runtime] Rename atomic functions from the win32 style naming to mono_atomic_<op>_<type>, with a consistent signature on all platforms. This fixes a large number of warnings on windows. * Add Windows implementaiton of mono_atomic_*. * Windows implementation of mono_atomic_* inline functions. * Changed naming typo in mono_atomic_xchg_i32Add and mono_atomic_xchg_i32Add64. * Fixed some additional signed/unsigned/volatile warnings when using mono_atomic_* * Fixed some smaller additionl warnings. * Fix Interlocked* to mono_atomic_* name change in signal.c * Additional name adjustment of atomics. Aligning more towards C11/C++11 standard namings: mono_atomic_xchg_add_i32|i64 -> mono_atomic_fetch_add_i32|i64 Changed from mono_atomic_add to mono_atomic_fetch_add in cases when return type is not used. Also includes small mingw build fix on Windows. * Aligned loads with C++11 implementation using explicit compiler barrier. On x86/x64 Windows, reading a properly aligned 8,16,32 bit volatile variable (using /volatile:ms extension) should have acquire semantics. On x64 this also includes 64-bit properly aligned volatile variables. The C++11 implementation does however include an explicit _ReadWriteBarrier in its sequentially consistent implementation to instruct compiler to not reorder load/stores. Since compiler supports two modes of volatile behavior (ms/iso) this additional barrier is probably there for consistency, independent of the behavior of volatile keyword. NOTE, the x86/x64 CPU architecture has strong guarantees regarding load/store of memory operations, so issuing a CPU memory barrier for loads should not be needed (and is not done in C++11 atomics implementation). This commit also adds a couple of optimizations for 32-bit loads and for x64, 64-bits loads. The C++11 implementation uses the same pattern loading them as 8 and 16 bits variables, so no need for Interlocked* calls to load 32-bit and for x64 64-bit variables.
2017-10-03Prepare Mono for Android NDK with unified headers (#5680)Marek Habersack
Up until NDK release 14 Android SDK included a separate set of C header files for each supported platform. NDK 14 introduced a new set of those headers (they are NOT the same as the old ones) which unifies support for all of the platforms so that bug fixes are available for all the API levels without having to backport etc. With NDK 15 the unified headers become the default ones (including when creating standalone toolchains) and with NDK 16 (in beta currently) the old per-platform headers are removed. Unfortunately, the new headers introduce breaking changes which made it impossible to build Mono with NDK configured to use them. This commit makes a handful of changes to Mono which make it build with unified headers.
2017-08-28remove redundant duplicate word 'not'HinTak
Found a consecutive 'not' pair while searching the code for somethng else.
2017-08-15[runtime] Use HOST_ defines instead of PLATFORM_ defines. (#5362)Zoltan Varga
2017-06-27Fix various compiler warnings (#5064)cherusker
* Fix compiler warnings (w32) - add explicit (long long (unsigned)) type casts - change %ld to %lld once, to match the general style of these logging messages * Fix compiler warnings (threadpool) - add explicit (void *) type casts * Fix compiler warnings (boehm) - add an explicit (long) type cast; the values are defined as gint64, an upgrade to at least "%ld" seems like a good idea - about dropping const: const does not seem to be necessary as g_getenv() returns pointers to freshly allocated buffers whenever called. const might have been used to protect the return value of g_getenv() on unix systems with earlier versions of Mono (as a comment in gmisc-unix.c suggests). keeping const here causes a compiler warning, as the const qualifier gets dropped when *env is being used with g_free(). that led to the decision to drop the qualifier altogether. * Fix compiler warnings (sgen) - specify the arguments (void) to avoid -Wstrict-prototypes warnings * Fix compiler warnings (misc - metadata) - specify the arguments (void) to avoid -Wstrict-prototypes warnings * Fix compiler warnings (misc) - specify the arguments (void) to avoid -Wstrict-prototypes warnings - add an explicit (void *) type cast; changing the return type to char* might be more usable and could be discussed - ret is not being used and can be removed; fixes a -Wunused-but-set-variable warning * Fix compiler warnings (mini) - specify the arguments (void) to avoid -Wstrict-prototypes warnings * [fixup!] Correct indentation * [fixup!] Correct (void *) - use GUINT_TO_POINTER and MONO_NATIVE_THREAD_ID_TO_UINT instead of (void *) to cast mono_native_thread_id_get () to %p * [fixup!] Correct indentation of boehm-gc.c and add FIXME * include <inttypes.h> and test the G_GINT64_FORMAT macro * [fixup!] Use G_G*_FORMAT and PRIx32 macros instead of type casts wherever possible
2017-04-26Define HAVE_STRUCT_SOCKADDR_IN6 on Windows (#4755)Joshua Peterson
This enables IPv6 support on Windows.