Age | Commit message (Collapse) | Author |
|
As part of https://github.com/mono/mono/pull/19912 we moved the locale files to the mono/culture/ subdirectory.
|
|
|
|
* [loader] Add append option to loader hook installation functions
Fixes https://github.com/dotnet/runtime/issues/34273
While this specific issue only affects the preload hook, I've added the append option to all the installation functions since this seems like a generally useful capability, both for internal use and embedders.
@BrzVlad tested locally and confirmed this patch solves the problem.
* Update callers in pedump and monodis
Co-authored-by: CoffeeFlux <CoffeeFlux@users.noreply.github.com>
Co-authored-by: Ryan Lucia <rylucia@microsoft.com>
|
|
Kind of a silly warning.
mono/sgen/sgen-protocol-def.h:102:1: warning: adding 'unsigned long' to
a string does not append to the string [-Wstring-plus-int]
BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_block_alloc, TYPE_POINTER, addr, TYPE_SIZE, size)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/sgen/sgen-grep-binprot.c:394:2: note: expanded from macro
'BEGIN_PROTOCOL_ENTRY_HEAVY2'
BEGIN_PROTOCOL_ENTRY2 (method,t1,f1,t2,f2)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/sgen/sgen-grep-binprot.c:291:26:
note: BEGIN_PROTOCOL_ENTRY3 (binary_protocol_world_stopping,
TYPE_INT, generation, TYPE_LONGLONG, timestamp, TYPE_POINTER, thread)exp
mono/sgen/sgen-protocol-def.h:102:1: note: use array indexing to
silence this warning
|
|
This allows us to consume it in the dotnet/runtime build.
|
|
* [cross] support arm-linux-gnueabihf cross compiling with netcore
Some notes on usage:
```console
$ sudo apt install g{++,cc}-gnu-linux-gnueabihf python3-pip
$ ./autogen.sh --disable-boehm --target=arm-linux-gnueabihf \
--with-cross-offsets=arm-linux-gnueabihf-cross-offsets.h \
--with-core=only \
CFLAGS="-O0 -ggdb3 -fno-omit-frame-pointer" \
CXXFLAGS="-O0 -ggdb3 -fno-omit-frame-pointer"
$ make -C tools/offsets-tool-py/
$ python3 tools/offsets-tool-py/offsets-tool.py \
--targetdir=/home/lewurm/work/mono \
--abi=arm-linux-gnueabihf \
--monodir=/home/lewurm/work/mono \
--outfile=arm-linux-gnueabihf-cross-offsets.h \
--libclang=/usr/lib/x86_64-linux-gnu/libclang-7.so.1 \
--sysroot=/usr/arm-linux-gnueabihf \
--netcore
```
* better include path guessing
|
|
#18524) (#18525)
Fixes #18524
The `tt.xml` and `tt_RU.xml` files were added in CLDR 34: http://cldr.unicode.org/index/downloads/cldr-34
Upgrading to v34 (or the latest v36) introduced a larger number of new cultures. I went with the smallest change possible to have Tatar added.
|
|
* Fix byte/string incompatiblity in Python 3
|
|
(#18272)
* [loader] Rename assembly name check strictness flag
* [loader] Add predicate for assembly name matching on netcore
* [loader] Enable LoadInDefaultContext test
* Make mono_assembly_names_equal external, change flags in domain search
* Move ifdef inside mono_loader_get_strict_assembly_name_check
* Fix pedump
* No reason to make this external
* Feedback
|
|
|
|
Move MonoError from managed wrappers to native wrappers.
Move MonoError from managed wrappers (ilgen) to native wrappers (C preprocessor).
Alternative to https://github.com/mono/mono/pull/15869.
Which says: Previously, we would emit a call to memset
since the struct is large (> 100 bytes). Only the error code
field needs to be initialized.
Which that PR and this PR both fix, in different ways.
In the past:
- This did not work due to a possible dependency on precise GC,
interacting with what gets zeroed or not here.
That is why I put it on the managed side.
We'll see if that reproduces.
(https://github.com/mono/mono/pull/11294/files#diff-efe0070415f3f0c0f24ed0221aa1962aR339
external/coreclr/tests/src/CoreMangLib/cti/system/weakreference/weakreferenceisaliveb.exe.)
- Some indication that embedding API should expose MonoError
and not set_pending_exception. This does not seem relevant
presently, and the code seems better structured and
more efficient this way. It can revisited if/when new public API
is the dominant concern, or do it this way for these functions,
and another way for actual public functions.
(https://github.com/mono/mono/pull/11294#issuecomment-432443485)
|
|
Some of the includes already were unconditional, including both on Win32 and Unix.
It is part of ANSI C 89, albeit in a reduced form compared to typical Unix (no sigaction).
Remove configuration of MSG_NOSIGNAL which has no other uses.
Preserve configuration of signal.h temporarily due to other uses of ifdef HAVE_SIGNAL_H.
i.e. LLVM?
|
|
* [wasm] Bump emscripten to 1.38.48.
* Remove generated python cache files.
|
|
|
|
* [offfsets-tool] Embed a copy of the clang bindings, the version in PIP doesn't work with newer clang versions.
* [wasm] Bump emscripten version to 1.38.47.
|
|
* 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.
|
|
[offsets-tool] install clang python package into a virtualenv
So it doesn't mess with the Python installation of the user.
/cc @mandel-macaque
|
|
Because the system location isn't world writeable on Catalina.
|
|
|
|
string does not append to the string (#16288)
|
|
compatible with old size.(#16218)
There is an incompatibility here.
If Mono hands off an InternalError and it is accessed
like an ExternalError, like memset(sizeof()), bad.
Hopefully nobody does that.
There is also compatability -- embedders can continue to embed MonoError
in their own data. Its size and hopefully alignment is unchanged.
|
|
(#16094)
* [metadata] Create strongly typed versions of mono_assembly_request_prepare
Addresses the family of issues similar to Coverity #1443346.
This came up as part of the Coverity review, and Coverity notices that this is
writting beyond the end of the structure. While this is correct, this requires
that the idiom be properly followed - that is, that the structure being passed
is of the given size.
Replaced instead with a method that eliminates the room for error with methods
that will initialize the whole structure, and the actual size computation is
done inside the method with the proper type sizes.
While I used methods, I feel that this should use macros.
|
|
* Make mono_assembly_request_prepare take an ALC
* Typo
* Fix pedump
* Use default ALC
* Make v1 preload hook external-only
* Convert pedump and monodis
* fixup: use default ALC in netcore preload hook
trusted platform assemblies should be loaded into the default ALC
|
|
|
|
* [merp] Use a separate program as the hang supervisor.
Fixes https://github.com/mono/mono/issues/15646
macOS does not like signals being sent from the forked supervisor process, possibly towards anywhere but definitely when sent to the parent process. The following message is currently spewed after the supervisor process attempting to send a SIGSEGV to a hanged Mono process:
"The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec()."
We follow that direction and introduce a new binary that, when available in the mono executable's binary directory, is used to abort the parent process for us.
|
|
The meat of this PR is what the title suggests, and with this commit all the basic ALC functionality should be working properly. Probably worth checking if this makes any new tests pass.
Additionally, this PR includes a second commit that switches over the search hook to use loaded_assemblies from the ALCs. This may break some existing tests due to remaining unimplemented ALC behavior, notably the native loading mechanism needed for Openssl in some of the cryptography tests. My inclination is to include the commit regardless and just disable the failing tests so that any future ALC work can watch for regressions in the loader, but I would appreciate input from steveisok on how important those tests are. I've not disabled anything yet in order to see exactly what new failures are introduced.
|
|
Previously, we would emit a call to memset since the struct is large (> 100 bytes). Only the error code field needs to be initialized.
|
|
[android] switch to python offset tool
And drop C# tool.
Fixes https://github.com/mono/mono/issues/9621
|
|
The C# version doesn't work on 64bit. It would require to update its dependencies, but Zoltan already added a Python version for WebAssembly which works fine.
Some notes:
* changed the semantics of `--xcode-path` in order to match the output of `xcode-select -p`
* switched to python3/pip3
* removed hack for arm64_32, it works properly now because the Python version uses stock `clang`
* removed some leftover usages of `XCODE32_DIR`.
Manually verified by comparing output with the C# version.
This will unblock the iOS team when building on Catalina/Xcode11, as they can't consume SDK archives there. See https://github.com/xamarin/xamarin-macios/pull/6603#issuecomment-512803082
Contributes to https://github.com/mono/mono/issues/9621
|
|
hook (#15743)
* Add a temporary mono_domain_ambient_alc function
Just use this to mark places where we need to pass through an ALC
* [runtime] Mark mono_assembly_loaded_full external only.
Runtime should use mono_assembly_loaded_internal.
* [loader] Add mono_install_assembly_search_hook_v2
Use it to install mono_domain_assembly_search and
mono_domain_assembly_postload_search.
The principal difference is that we can pass an assembly load context to the
hook. But also we cleanup the "requesting assembly" hack for
mono_domain_assembly_postload_search.
* [domain] Comments and mono_assembly_get_alc ()
* [debugger] Comment on suspicious loader lock
|
|
(#15527)
Implement a couple of things:
1. Add a `MonoAssemblyLoadContext` opaque struct
2. On netcore Mono, use it to keep track of which `MonoImage`s are loaded. (Addresses part of #13891)
In a bit more detail:
- Add a `MonoLoadedImages` struct to hold the hash tables that we use for checking if a `MonoImage` is already loaded
- Add an opaque `MonoAssemblyLoadContext` typedef
- (Framework Mono) Add a `get_global_loaded_images()` function to get the shared `MonoLoadedImages`
- (netcore Mono) Add a `MonoAssemblyLoadContext` struct that owns a `MonoLoadedImages` and add a `default_alc` member to `MonoDomain
- Pass a `MonoAssemblyLoadContext*` to most `MonoImage`-loading functions - on Framework Mono its usually NULL and we fall back to the global loaded images, on netcore Mono it's usually `domain->default_alc->loaded_images`
- (netcore Mono) Create a default Assembly Load Context when a `MonoDomain` is created
- Add a `MonoAssemblyLoadContext*` field to `MonoAssemblyLoadRequest` and pass an ALC in a few places.
---
Remaining work:
(netcore Mono) There are still places where a `MonoAssemblyLoadRequest` or a `MonoAssemblyOpenRequest` has a `NULL` ALC - those will need to be tracked down and fixed.
(netcore Mono) Eventually `MonoAssemblyLoadContext` should keep track of the loaded `MonoAssembly`s, not just images. One goal on netcore Mono is to ifdef out `MonoDomain:domain_assemblies`.
---
* [loader] Add a MonoLoadedImages struct to own the MonoImage sharing
Initially, there's just a single global set of loaded images.
Once we have AssemblyLoadContext support, each ALC will have a separate set.
NOTE:
- Some of the existing Mono API is difficult to support with this design
since it assumes each MonoImage is loaded at most once.
* [loader] Add a MonoAssemblyLoadContext member to MonoImage for netcore
* [loader] Unregister image from its owner when closing
* [loader] Pass MonoLoadedImages to register_image
* [domain] Add mono_domain_default_alc and mono_alc_get_loaded_images
* [loader] Add an AssemblyLoadContext argument to mono_image_loaded_internal
* [metadata] Add mono_image_get_alc ()
* [loader] Pass MonoAssemblyLoadContext to mono_image_open_from_data_internal
* [loader] Pass MonoAssemblyLoadContext to mono_image_open_from_module_handle
* [loaded] Pass MonoLoadedImages to mono_image_open_a_lot_parameterized
* [loader] Pass MonoAssemblyLoadContext to mono_image_open_a_lot
* [runtime] Mark mono_image_open_full external only
Runtime should use mono_image_open_a_lot.
* [runtime] Mark mono_image_loaded_by_guid external only
Also mark mono_image_loaded_by_guid_full external only
Runtime will need some (as yet unwritten) mechanism that takes a MonoAssemblyLoadContext as an argument.
* [domain] Create a default ALC for each MonoDomain
* [netcore] Pass default ALC in mono_core_preload_hook
If the assembly name matches a trusted platform assembly, open it in the default ALC of the root domain
* [mini] Open main assembly in default ALC in the root domain
* [netcore] Don't define get_global_loaded_images()
Every assembly load request should come from an assembly load context. Each ALC has a set of loaded images. So we should never need a global list.
With this PR, we no longer share MonoImages across distinct ALCs. So in principle, each ALC can open the same assembly but resolve its references in different ways.
Fixes part of https://github.com/mono/mono/issues/13891
* [runtime] Mark mono_pe_file_open external only
* [loader] Pass MonoAssemblyLoadContext to mono_image_open_raw and mono_image_open_metadata_only
* [loader] Pass MonoAssemblyLoadContext to do_mono_image_open and set MonoImage:alc
* [loader] Add version 2 of assembly preload hook
Pass MonoAssemblyLoadContext through the preload hook. This is used in mono_assembly_request_byname_nosearch which, in turn, is called by load_reference_by_aname_default_asmctx which is used to resolve references from one assembly to another.
* [netcore] Pass native ALC ptr to AssemblyLoadContext.InternalLoadFile
* [netcore] Implement AssemblyLoadContext.InternalInitializeNativeALC
also implement mono_domain_create_individual_alc ()
* [netcore] Pass ALC to System.Reflection.Assembly.InternalLoad
Pass the domain default ALC to mono_assembly_load ()
Also pass MonoAssemblyLoadContext to mono_assembly_load_full_gac_base_default ()
* [loader] Implement MONO_LOADED_IMAGES_ASSEMBLY properly
Store the MonoLoadedImages for netmodules in the MonoImage for the main image of an assembly. This is also used by SRE - the dummy module of the AssemblyBuilder has the loaded_images that contains the ModuleBuilders.
* [loader] Use global_loaded_images for netmodules with framework Mono
The new stuff is only for ALC support in netcore
* [loader] Drop netmodule support in MonoAssemblyLoadContext
netmodules are not supported in netcore
* [loader] Spin out image hashing out of image.c
Move MonoLoadedImages support code to loaded-images.c loaded-images-global.c and loaded-images-netcore.c
Also spin out assembly-load-context.c for MonoAssemblyLoadContext functions
* Move ALC icall to assembly-load-context.c
* formatting fix
* [msvc] Add new files to .filters
* update comments
* [image] Change mono_loaded_images_remove_image to decrement the refcount
Decrement the refcount and remove the image from the loaded images hashes in
one place. Change mono_loaded_images_remove_image to return TRUE if the rest
of image unloading should proceed or not.
* [loader] Drop unused argument to mono_alc_init
|
|
Android NDK r20 contains a header file (`ioctl.h`) with this code:
int ioctl(int __fd, int __request, ...);
#if !defined(BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD)
/* enable_if(1) just exists to break overloading ties. */
int ioctl(int __fd, unsigned __request, ...) __overloadable __enable_if(1, "") __RENAME(ioctl);
#endif
The `_RENAME` macro is defined as `__asm__(x)` and serves the purpose of
replacing an existing symbol with the new one, decorated with the keyword.
Unfortunately, Mono's `offsets-tool` doesn't parse the header properly as
`CppSharp` doesn't understand `__asm__`:
Processing triple: armv7-none-linux-androideabi
Error parsing '/Users/rodo/git/xa2/external/mono/mono/metadata/metadata-cross-helpers.c'
/Users/rodo/android-toolchain/ndk/sysroot/usr/include/bits/ioctl.h(60,5): error: conflicting types for 'ioctl'
Error parsing '/Users/rodo/git/xa2/external/mono/mono/mini/mini-cross-helpers.c'
/Users/rodo/android-toolchain/ndk/sysroot/usr/include/bits/ioctl.h(60,5): error: conflicting types for 'ioctl'
make: *** [/Users/rodo/git/xa2/external/mono/sdks/builds/android-cross-arm-release/armv7-linux-android.h] Error 1
The workaround, implemented in this commit, is to define the
`BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD` macro thus removing the "conflicting"
declaration from the picture, which changes nothing from the offset tool's point
of view and lets us process the headers in NDK r20 properly.
|
|
* [runtime] Add a python version of the offsets tool.
This version only depends on python and libclang. It currently only
works on osx.
* [runtime] Add a dummy structure needed by the python version of the offsets tool.
* [offsets-tool-py] Change some argument names for compatibility.
* [wasm] Use the python offsets tool on osx, the c# version is 32 bit, and the 64 bit version doesn't work.
* [wasm] Fix the ordering of mono libraries on the link line.
|
|
(#13916)
This reverts commit a56573fb7c61adc4a0629a540d0ba093c1f951d8.
|
|
Create a new data structure: MonoImageStorage.
It is an object that will have the responsibility for the raw data of a
MonoImage. It has a string key and a refcount that is used to share a
MonoImageStorage between multiple MonoImage objects.
The reason we need this is because the current MonoAssembly/MonoImage design is
broken for multiple domains and (more evidently) it will be broken when we add
AssemblyLoadContext support. The issue is that a MonoImage may be shared
between multiple domains (or ALCs), but it has a 'references' field which
points to a single other MonoAssembly.
This is a problem because the references of an image may be resolved
differently in different domains (or ALCs).
The eventual solution will be to stop sharing MonoImages based on path name (or
in the case of in-memory images based on a name made up from the address of the
byte blob).
However we still don't want to open the same data more than once (if we're on a
config where we don't have mmap, we malloc some memory and dump the data in
there - we don't want to do that multiple times for the same file).
So the solution is to create this MonoImageStorage object and make it possible
to share it based on path name, but don't give it any responsibilities except
for owning the memory. It doesn't know anything about metadata or assemblies
or any of that stuff - it just owns a chunk of memory and knows when and how to
free it.
This commit just adds the MonoImageStorage object and wires it up in MonoImage
loading. There should be no observable behavioral changes from this commit.
|
|
|
|
|
|
They can be used with native line endings.
We now have a shared folder with the dotnet repos and they have CRLF normalization enabled.
This difference leads to conflicts while applying changes from the dotnet repos to mono.
|
|
(#13197)
* [nuget-hash-extractor] Make the order for denied lists deterministic and
.. stable. We were not sorting the list of assemblies with the same
version, causing irrelevant changes in updates.
* Update denied assembly list to fix order
.. to be deterministic. Generated with the updated
nuget-hash-extractor.cs .
* [nuget-hash-extractor] Make the order of assemblies deterministic
The .nupkgs were being processed in arbitrary order, causing unncessary
diffs when updating them which required manual work to check and fix
them.
|
|
.. to the list of denied assemblies. Added `4.3.4`.
Prompted by issue #12603 .
|
|
.. to the list of denied assemblies. Added:
- `4.5.0`
- `4.5.1`
Fixes issue #12603 .
|
|
* [ios] add crosswatch64_32 target
* fix gnu triple for wasm
|
|
|
|
The latest Android NDK releases no longer ship with per-platform C headers.
Instead they ship with a set of unified headers and require the presence of the
`__ANDROID_API__` macro in order to select the target platform.
The AOT offset dumper doesn't support this new layout and this commit changes
that by adding support for the unified headers (without removing support for the
older NDKs) thus fixing the following error when trying to dump the offsets with
newer NDK:
Processing triple: aarch64-v8a-linux-android
Error parsing '[...]/mono/mono/metadata/metadata-cross-helpers.c'
[...]/mono/mono/metadata/metadata-cross-helpers.c(5,10): fatal: 'stdio.h' file not found
Error parsing '[...]/mono/mono/mini/mini-cross-helpers.c'
[...]/mono/mono/mini/mini-cross-helpers.c(7,10): fatal: 'stdio.h' file not found
|
|
Fixes https://github.com/mono/mono/issues/11317
(I guess I need to update culture-info-tables.h via make but it doesn't work on Windows, I have to switch to macOS).
|
|
GC mode transition to first. (#11121)
mono_class_init_internal is what mono_class_init was.
mono_class_init *adds* missing GC mode transitions and calls mono_class_init_internal.
Replace mono_class_init with mono_class_init_internal.
|
|
Try to make all entry points into the loader look more uniform by taking a request
struct instead of a big pile of arguments. Where it makes sense, make the
structs subtypes of each other so that more general arguments are shared.
- Pass assembly load arguments in a struct
- Pass assembly open arguments in a struct
- Push MonoAssemblyOpenRequest creation to some callers
- Drop is_private argument to try_load_from
It's been dead code for ten years since c9e8bac0c3522a05bd08985a76d923b1bbd83b79
- Get rid of mono_assembly_open_a_lot
- Drop dead static function
- Replace mono_assembly_load_full_nosearch by mono_assembly_request_byname_nosearch
- replace mono_assembly_load_full_internal by mono_assembly_request_byname
- Make mono_assembly_request_byname the internal API
pass a no_postload_search flag in MonoAssemblyByNameRequest, usually FALSE.
Pass TRUE in the one caller of the old mono_assembly_request_byname_nosearch.
- Pass the requesting assembly via MonoAssemblyByNameRequest
- Prepare loader Requests with an initialization function
|
|
This is an alternative or precursor to https://github.com/mono/mono/pull/10212.
- Removes the dependency of some ABIs passing a pointer and a pointer in a struct the same.
- Therefore gives all platforms the same type safety.
- *If* we move to C++, allows us to have member functions in coop handles.
- Having the coop signatures available in C can provide benefits, though we should
probably generate them from reading metadata -- though they won't match w/o more changes,
since we mixup types in several places, like IntPtr vs. pointers.
JIT now traffics in old type-unsafe handles, and wrappers are generated with C preprocessor to trivially convert.
This way the JIT doesn't have to pass structs by value here, which was tried/failed.
The C preprocessor machinery can/should be extended for additional gains.
In particular driving managed/native coop icall transitions from 3+ per call to 1 (like https://github.com/mono/mono/pull/10212).
That will require better verification of the signatures in icall-def.h, either automated and en masses or gradually manually. Embedders will likely do something else, or at least have to independently invent similar.
Whereever a native function was exposed via multiple managed names, wrappers are reused.
|
|
machinery (#11080)
|
|
|