Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
67b110e
[release/6.0] Fixing a possible null reference error in WebSocket def…
github-actions[bot] Dec 23, 2021
3b71fd8
[release/6.0] Don't create multiple large files at the same time (#63…
jozkee Dec 31, 2021
816653e
[release/6.0] Use Ubuntu 18.04 and dotnet-buildtools-prereq docker im…
github-actions[bot] Jan 3, 2022
2282b00
[release/6.0] Add runtime-community.yml pipeline and add s390x job (#…
directhex Jan 3, 2022
6f1e03f
[release/6.0] Do not promote struct locals with holes (#62738)
github-actions[bot] Jan 3, 2022
7d82ac7
[wasm][release/6.0] Reduce number of calls to setTimer (#62705)
maraf Jan 3, 2022
bdd6647
fix issue where HTTP2 connection could be scavenged but not disposed …
github-actions[bot] Jan 3, 2022
45d1f9e
Update dependencies from https://github.com/dotnet/arcade build 20211…
dotnet-maestro[bot] Jan 3, 2022
f86caa5
[release/6.0] Fix build with Clang 13 (#63314)
janvorli Jan 4, 2022
51b6749
[release/6.0] bump sourcebuild leg timeout (#63298)
safern Jan 5, 2022
dc6a86d
Fix bug where we reference the entry #0 in the pinned plug queue (#60…
cshung Jan 6, 2022
4f01ff5
Fix named mutexes on OSX to work between arm64 and emulated x64 proce…
kouvel Jan 6, 2022
b71484c
Unify the FlushProcessWriteBuffers mechanism for macOS arm64 / x64 (#…
github-actions[bot] Jan 6, 2022
898f09a
[release/6.0] Change macOS activatin injection failure handling (#63393)
janvorli Jan 6, 2022
1c2501d
[release/6.0] Fix XXHash for stripe size (#61923)
github-actions[bot] Jan 6, 2022
25d2a1f
[release/6.0] Making user secrets optional by default (#62917)
github-actions[bot] Jan 6, 2022
201673a
[release/6.0] WinHttp: always read HTTP/2 streams to the end (#63346)
github-actions[bot] Jan 7, 2022
73f902f
[release/6.0] Fix setting timestamp on Windows on readonly files (#62…
adamsitnik Jan 7, 2022
8abc8fc
[release/6.0] Undo breaking change in 6.0 in environment variable con…
github-actions[bot] Jan 7, 2022
a8b733b
[release/6.0] Ensure UserSecretsIdAttribute is added to assembly (#63…
eerhardt Jan 7, 2022
d575a6f
[release/6.0] Add explicit null-check for tailcalls to VSD (#62769)
github-actions[bot] Jan 7, 2022
dc56b08
[release/6.0] Port test-only test fixes (#63507)
danmoseley Jan 7, 2022
abe7d08
[release/6.0] Fix System.Object serialization with custom number hand…
github-actions[bot] Jan 8, 2022
039ab90
Fix bugs with generation for ctor param default values (#62798) (#63493)
layomia Jan 8, 2022
5af5538
Suppress warnings about [Obsolete] member usage in JSON src-gen'd cod…
github-actions[bot] Jan 8, 2022
26b0a12
[release/6.0] Fix TimeSpan support in sourcegen (#62191)
github-actions[bot] Jan 8, 2022
a9723f3
Include properties on records for (de)serialization in source-gen (#6…
github-actions[bot] Jan 8, 2022
4d8bebc
[wasm] Backport build improvements, and fixes from #61581 (#62757)
radical Jan 8, 2022
dfcba66
disable tests unstable on Windows 11 (#63527)
github-actions[bot] Jan 8, 2022
a16c322
[release/6.0] Suppress SendPacketsElement_FileStreamMultiPartMixed_Mu…
github-actions[bot] Jan 8, 2022
749c02b
[release/6.0] Fix GENERIC_MATH_FEATURE by making sure we always choos…
safern Jan 10, 2022
7a26492
Fix NETStandard library using JSON source gen (#63520)
ericstj Jan 10, 2022
3f6d8fa
Make delegates unsupported by JsonSerializer (#63514)
github-actions[bot] Jan 10, 2022
04a5836
[release/6.0] 1388 xml serializer assembly load context awareness (#6…
github-actions[bot] Jan 10, 2022
7780d28
Fix custom JsonConverterFactories not working with transitive type/pr…
github-actions[bot] Jan 10, 2022
46d9a58
Merge branch 'release/6.0-maui' into merge/release/6.0-to-release/6.0…
akoeplinger Jan 12, 2022
7f6c36e
Disable GeneratePackageOnBuild
akoeplinger Jan 12, 2022
d24f93e
Update CompatibilitySuppressions.xml for System.Data.Odbc
akoeplinger Jan 12, 2022
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
Prev Previous commit
Next Next commit
[release/6.0] Fix build with Clang 13 (#63314)
* Fix clang 13 induced runtime issues (#62170)

The clang 13 optimizer started to assume that "this" pointer is always
properly aligned. That lead to elimination of some code that was actually
needed.
It also takes pointer aliasing rules more strictly in one place in jit.
That caused the optimizer to falsely assume that a callee with an argument
passed by reference is not modifying that argument and used a stale
copy of the original value at the caller site.

This change fixes both of the issues. With this fix, runtime compiled
using clang 13 seems to be fully functional.

* Fix build with clang 13 (#60328)
  • Loading branch information
janvorli authored Jan 4, 2022
commit f86caa54678535ead8e1977da37025a96e2afe8a
11 changes: 7 additions & 4 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,17 @@ if (CLR_CMAKE_HOST_UNIX)
#These seem to indicate real issues
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-invalid-offsetof>)

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wno-unused-but-set-variable)

if (CMAKE_C_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wno-unknown-warning-option)

# The -ferror-limit is helpful during the porting, it makes sure the compiler doesn't stop
# after hitting just about 20 errors.
add_compile_options(-ferror-limit=4096)

# Disabled warnings
add_compile_options(-Wno-unused-private-field)
# Explicit constructor calls are not supported by clang (this->ClassName::ClassName())
add_compile_options(-Wno-microsoft)
# There are constants of type BOOL used in a condition. But BOOL is defined as int
# and so the compiler thinks that there is a mistake.
add_compile_options(-Wno-constant-logical-operand)
Expand All @@ -363,8 +365,9 @@ if (CLR_CMAKE_HOST_UNIX)
# to a struct or a class that has virtual members or a base class. In that case, clang
# may not generate the same object layout as MSVC.
add_compile_options(-Wno-incompatible-ms-struct)

add_compile_options(-Wno-reserved-identifier)
else()
add_compile_options(-Wno-unused-but-set-variable)
add_compile_options(-Wno-unknown-pragmas)
add_compile_options(-Wno-uninitialized)
add_compile_options(-Wno-strict-aliasing)
Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/inc/corhlpr.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ struct COR_ILMETHOD_SECT
const COR_ILMETHOD_SECT* Next() const
{
if (!More()) return(0);
return ((COR_ILMETHOD_SECT*)(((BYTE *)this) + DataSize()))->Align();
return ((COR_ILMETHOD_SECT*)Align(((BYTE *)this) + DataSize()));
}

const BYTE* Data() const
Expand Down Expand Up @@ -374,9 +374,9 @@ struct COR_ILMETHOD_SECT
return((AsSmall()->Kind & CorILMethod_Sect_FatFormat) != 0);
}

const COR_ILMETHOD_SECT* Align() const
static const void* Align(const void* p)
{
return((COR_ILMETHOD_SECT*) ((((UINT_PTR) this) + 3) & ~3));
return((void*) ((((UINT_PTR) p) + 3) & ~3));
}

protected:
Expand Down Expand Up @@ -579,7 +579,7 @@ typedef struct tagCOR_ILMETHOD_FAT : IMAGE_COR_ILMETHOD_FAT

const COR_ILMETHOD_SECT* GetSect() const {
if (!More()) return (0);
return(((COR_ILMETHOD_SECT*) (GetCode() + GetCodeSize()))->Align());
return(((COR_ILMETHOD_SECT*) COR_ILMETHOD_SECT::Align(GetCode() + GetCodeSize())));
}
} COR_ILMETHOD_FAT;

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/bitsetasshortlong.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ class BitSetOps</*BitSetType*/ BitSetShortLongRep,
{
if (IsShort(env))
{
(size_t&)out = (size_t)out & ((size_t)gen | (size_t)in);
out = (BitSetShortLongRep)((size_t)out & ((size_t)gen | (size_t)in));
}
else
{
Expand All @@ -361,7 +361,7 @@ class BitSetOps</*BitSetType*/ BitSetShortLongRep,
{
if (IsShort(env))
{
(size_t&)in = (size_t)use | ((size_t)out & ~(size_t)def);
in = (BitSetShortLongRep)((size_t)use | ((size_t)out & ~(size_t)def));
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/inlinepolicy.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class DefaultPolicy : public LegalPolicy
class ExtendedDefaultPolicy : public DefaultPolicy
{
public:
ExtendedDefaultPolicy::ExtendedDefaultPolicy(Compiler* compiler, bool isPrejitRoot)
ExtendedDefaultPolicy(Compiler* compiler, bool isPrejitRoot)
: DefaultPolicy(compiler, isPrejitRoot)
, m_ProfileFrequency(0.0)
, m_BinaryExprWithCns(0)
Expand Down
3 changes: 3 additions & 0 deletions src/libraries/Native/Unix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ add_compile_options(-Wno-cast-align)
add_compile_options(-Wno-typedef-redefinition)
add_compile_options(-Wno-c11-extensions)
add_compile_options(-Wno-unknown-pragmas)
add_compile_options(-Wno-unknown-warning-option)
add_compile_options(-Wno-unused-but-set-variable)

check_c_compiler_flag(-Wimplicit-fallthrough COMPILER_SUPPORTS_W_IMPLICIT_FALLTHROUGH)
if (COMPILER_SUPPORTS_W_IMPLICIT_FALLTHROUGH)
Expand All @@ -48,6 +50,7 @@ add_compile_options(-g)
if(CMAKE_C_COMPILER_ID STREQUAL Clang)
add_compile_options(-Wthread-safety)
add_compile_options(-Wno-thread-safety-analysis)
add_compile_options(-Wno-reserved-identifier)
elseif(CMAKE_C_COMPILER_ID STREQUAL GNU)
add_compile_options(-Wno-stringop-truncation)
endif()
Expand Down
20 changes: 19 additions & 1 deletion src/libraries/Native/Unix/System.Native/pal_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,24 @@ static int SetGroups(uint32_t* userGroups, int32_t userGroupsLength, uint32_t* p
return rv;
}

typedef void (*VoidIntFn)(int);

static
VoidIntFn
handler_from_sigaction (struct sigaction *sa)
{
if (((unsigned int)sa->sa_flags) & SA_SIGINFO)
{
// work around -Wcast-function-type
void (*tmp)(void) = (void (*)(void))sa->sa_sigaction;
return (void (*)(int))tmp;
}
else
{
return sa->sa_handler;
}
}

int32_t SystemNative_ForkAndExecProcess(const char* filename,
char* const argv[],
char* const envp[],
Expand Down Expand Up @@ -371,7 +389,7 @@ int32_t SystemNative_ForkAndExecProcess(const char* filename,
}
if (!sigaction(sig, NULL, &sa_old))
{
void (*oldhandler)(int) = (((unsigned int)sa_old.sa_flags) & SA_SIGINFO) ? (void (*)(int))sa_old.sa_sigaction : sa_old.sa_handler;
void (*oldhandler)(int) = handler_from_sigaction (&sa_old);
if (oldhandler != SIG_IGN && oldhandler != SIG_DFL)
{
// It has a custom handler, put the default handler back.
Expand Down