Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ include_directories("${GENERATED_INCLUDE_DIR}")
include_directories("hosts/inc")
include_directories("minipal")

if(FEATURE_INTERPRETER)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work due to the FEATURE_INTERPRETER containing generator expressions. See my other comment for a way to exclude the clrinterpreter

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove, thanks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried removing this and doing the EXCLUDE_FROM_ALL you suggested but it seems to break CI badly and the cause isn't obvious to me.

  -- Installing: D:/a/_work/1/s/artifacts/bin/coreclr/windows.x64.Release/sharedFramework/PDB/clrgcexp.pdb
  CMake Error at interpreter/cmake_install.cmake:41 (file):
    file INSTALL cannot find
    "D:/a/_work/1/s/artifacts/obj/coreclr/windows.x64.Release/interpreter/clrinterpreter.dll":
    File exists.
  Call Stack (most recent call first):
    cmake_install.cmake:107 (include)
  -- Installing: /__w/1/s/artifacts/bin/coreclr/linux.x64.Release/sharedFramework/libclrgcexp.so.dbg
  CMake Error at interpreter/cmake_install.cmake:46 (file):
    file INSTALL cannot find
    "/__w/1/s/artifacts/obj/coreclr/linux.x64.Release/interpreter/libclrinterpreter.so":
    No such file or directory.
  Call Stack (most recent call first):
    cmake_install.cmake:117 (include)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I need to make the install_clr command in the cmakelists conditional?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works for me locally, let me take a look at your change

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the error on Linux too. I was testing it on Windows before. Unfortunately, there doesn't seem to be a way to prevent the install when the FEATURE_INTERPRETER does not evaluate to 1. The. So it seems the only way we have is ifdefing out the whole body of the compiler.cpp to prevent build breaks and live with the fact that we get a crippled clrinterpreter instead of none.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll revert the two cmake changes for now then, and keep the ifdef in compiler.cpp.

add_subdirectory(interpreter)
endif()

if(CLR_CMAKE_TARGET_WIN32 AND FEATURE_EVENT_TRACE)
include_directories("${GENERATED_INCLUDE_DIR}/etw")
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ set(CORECLR_LIBRARIES
ceefgen
comfloat_wks
corguids
gcinfo
utilcode
v3binder
System.Globalization.Native-Static
Expand Down
32 changes: 23 additions & 9 deletions src/coreclr/gcinfo/arraylist.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

// Interpreter-FIXME: we get an existing implementation of ASSERTE via PCH that isn't usable
// from inside the interpreter, so we need to replace it with our own.
#undef _ASSERTE

#if defined(_DEBUG)

extern "C" void assertAbort(const char* why, const char* file, unsigned line);

#define _ASSERTE(expr) if (!(expr)) { \
assertAbort(#expr, __FILE__, __LINE__); \
}
#else // _DEBUG
#define _ASSERTE(expr) (void)0
#endif // _DEBUG

#include "gcinfohelpers.h"
#include <stdint.h>
#include <windows.h>
#include "debugmacros.h"
#include "iallocator.h"
#include "gcinfoarraylist.h"
#include "safemath.h"

inline size_t roundUp(size_t size, size_t alignment)
{
// `alignment` must be a power of two
assert(alignment != 0);
assert((alignment & (alignment - 1)) == 0);
_ASSERTE(alignment != 0);
_ASSERTE((alignment & (alignment - 1)) == 0);

return (size + (alignment - 1)) & ~(alignment - 1);
}
Expand All @@ -25,7 +39,7 @@ GcInfoArrayListBase::GcInfoArrayListBase(IAllocator* allocator)
m_lastChunkCapacity(0),
m_itemCount(0)
{
assert(m_allocator != nullptr);
_ASSERTE(m_allocator != nullptr);
}

GcInfoArrayListBase::~GcInfoArrayListBase()
Expand All @@ -42,19 +56,19 @@ void GcInfoArrayListBase::AppendNewChunk(size_t firstChunkCapacity, size_t eleme
size_t chunkCapacity = (m_firstChunk == nullptr) ? firstChunkCapacity : (m_lastChunkCapacity * GrowthFactor);

S_SIZE_T chunkSize = S_SIZE_T(roundUp(sizeof(ChunkBase), chunkAlignment)) + (S_SIZE_T(elementSize) * S_SIZE_T(chunkCapacity));
assert(!chunkSize.IsOverflow());
_ASSERTE(!chunkSize.IsOverflow());

ChunkBase* chunk = reinterpret_cast<ChunkBase*>(m_allocator->Alloc(chunkSize.Value()));
chunk->m_next = nullptr;

if (m_lastChunk != nullptr)
{
assert(m_firstChunk != nullptr);
_ASSERTE(m_firstChunk != nullptr);
m_lastChunk->m_next = chunk;
}
else
{
assert(m_lastChunk == nullptr);
_ASSERTE(m_lastChunk == nullptr);
m_firstChunk = chunk;
}

Expand All @@ -66,7 +80,7 @@ void GcInfoArrayListBase::AppendNewChunk(size_t firstChunkCapacity, size_t eleme
GcInfoArrayListBase::IteratorBase::IteratorBase(GcInfoArrayListBase* list, size_t firstChunkCapacity)
: m_list(list)
{
assert(m_list != nullptr);
_ASSERTE(m_list != nullptr);

// Note: if the list is empty, m_list->firstChunk == nullptr == m_list->lastChunk and m_lastChunkCount == 0.
// In that case, the next two lines will set m_currentChunk to nullptr and m_currentChunkCount to 0.
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/gcinfo/gcinfodumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#ifndef SOS_INCLUDE
#include "common.h"
#endif

#include "gcinfohelpers.h"
#include "gcinfodumper.h"
#include "gcinfodecoder.h"

Expand Down
Loading
Loading