This commit is a mix of upstream commits specific to tizen unified.
* [release/7.0] Suppress clang-16 warnings (backport #81573) (#84444)
Fix DBI loading problem on Linux (#82461)
* Use logical and for boolean operation in bstr (#67858)
This seems like a mistake and recent versions of clang even complain
about it:
/runtime/src/coreclr/palrt/bstr.cpp:50:13: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
if (SUCCEEDED(ULongMult(cchSize, sizeof(WCHAR), &temp)) &
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&&
/runtime/src/coreclr/pal/inc/pal.h:5144:27: note: expanded from macro 'SUCCEEDED'
#define SUCCEEDED(Status) ((HRESULT)(Status) >= 0)
^
/runtime/src/coreclr/palrt/bstr.cpp:50:13: note: cast one or both operands to int to silence this warning
/runtime/src/coreclr/pal/inc/pal.h:5144:27: note: expanded from macro 'SUCCEEDED'
#define SUCCEEDED(Status) ((HRESULT)(Status) >= 0)
^
1 error generated.
* Fix Wunqualified-std-cast-call in singlefilehost (#72305)
Modified by hand due to mingling w/ other commits
---------
Co-authored-by: Antoine Martin <dev@ayakael.net>
Co-authored-by: Omair Majid <omajid@redhat.com>
add_compile_options(-Wno-incompatible-ms-struct)
add_compile_options(-Wno-reserved-identifier)
+
+ # clang 16.0 introduced buffer hardening https://discourse.llvm.org/t/rfc-c-buffer-hardening/65734
+ # which we are not conforming to yet.
+ add_compile_options(-Wno-unsafe-buffer-usage)
+
+ # other clang 16.0 suppressions
+ add_compile_options(-Wno-single-bit-bitfield-constant-conversion)
+ add_compile_options(-Wno-cast-function-type-strict)
+ add_compile_options(-Wno-incompatible-function-pointer-types-strict)
else()
add_compile_options(-Wno-unknown-pragmas)
add_compile_options(-Wno-uninitialized)
mscordaccore
)
+ # Before llvm 16, lld was setting `--undefined-version` by default. The default was
+ # flipped to `--no-undefined-version` in lld 16, so we will explicitly set it to
+ # `--undefined-version` for our use-case.
+ include(CheckLinkerFlag OPTIONAL)
+ if(COMMAND check_linker_flag)
+ check_linker_flag(CXX -Wl,--undefined-version LINKER_SUPPORTS_UNDEFINED_VERSION)
+ if (LINKER_SUPPORTS_UNDEFINED_VERSION)
+ add_linker_flag(-Wl,--undefined-version)
+ endif(LINKER_SUPPORTS_UNDEFINED_VERSION)
+ endif(COMMAND check_linker_flag)
+
# COREDBI_LIBRARIES is mentioned twice because ld is one pass linker and will not find symbols
# if they are defined after they are used. Having all libs twice makes sure that ld will actually
# find all symbols.
else
{
ULONG temp = 0; // should not use in-place addition in ULongAdd
- if (SUCCEEDED(ULongMult(cchSize, sizeof(WCHAR), &temp)) &
+ if (SUCCEEDED(ULongMult(cchSize, sizeof(WCHAR), &temp)) &&
SUCCEEDED(ULongAdd(temp, constant, result)))
{
*result = *result & ~WIN32_ALLOC_ALIGN;
# We mark the function which needs exporting with PALEXPORT
add_compile_options(-fvisibility=hidden)
+# clang 16.0 introduced buffer hardening https://discourse.llvm.org/t/rfc-c-buffer-hardening/65734
+# which we are not conforming to yet.
+add_compile_options(-Wno-unsafe-buffer-usage)
+
+# other clang 16.0 suppressions
+add_compile_options(-Wno-single-bit-bitfield-constant-conversion)
+add_compile_options(-Wno-cast-function-type-strict)
+add_compile_options(-Wno-incompatible-function-pointer-types-strict)
+
add_compile_options(-Wno-format-nonliteral)
add_compile_options(-Wno-disabled-macro-expansion)
add_compile_options(-Wno-padded)
add_linker_flag("/DEF:${CMAKE_CURRENT_SOURCE_DIR}/singlefilehost.def")
else()
- if(CLR_CMAKE_TARGET_OSX)
- set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/singlefilehost_OSXexports.src)
+ if(CLR_CMAKE_TARGET_FREEBSD)
+ set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/singlefilehost_freebsdexports.src)
else()
set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/singlefilehost_unixexports.src)
endif()
; Used by profilers
MetaDataGetDispenser
+
+; FreeBSD needs to reexport these
+__progname
+environ
; Used by profilers
MetaDataGetDispenser
-
-; FreeBSD needs to reexport these
-__progname
-environ
}
sdk_resolver::sdk_resolver(fx_ver_t version, sdk_roll_forward_policy roll_forward, bool allow_prerelease) :
- version(move(version)),
+ version(std::move(version)),
roll_forward(roll_forward),
allow_prerelease(allow_prerelease)
{
}
}
- global_file = move(global_file_path);
+ global_file = std::move(global_file_path);
return true;
}
if (pal::directory_exists(probe_path))
{
trace::verbose(_X("Found requested SDK directory [%s]"), probe_path.c_str());
- sdk_path = move(probe_path);
+ sdk_path = std::move(probe_path);
resolved_version = version;
// The SDK path has been resolved
changed = true;
resolved_version = ver;
- resolved_version_str = move(version);
+ resolved_version_str = std::move(version);
}
if (changed)