From 59eb9ddecf6d504e59a77c42df3ea4a7995731c1 Mon Sep 17 00:00:00 2001 From: makise-homura Date: Mon, 15 Jan 2024 03:06:31 +0300 Subject: LCC: Correct C compiler default C standards --- Modules/Compiler/LCC-C.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Compiler/LCC-C.cmake b/Modules/Compiler/LCC-C.cmake index 99f791f..52c3bf3 100644 --- a/Modules/Compiler/LCC-C.cmake +++ b/Modules/Compiler/LCC-C.cmake @@ -33,4 +33,4 @@ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 1.26) set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std=gnu17") endif() -__compiler_check_default_language_standard(C 1.23 90 1.20 11 1.26 17) +__compiler_check_default_language_standard(C 1.17 89 1.23 99 1.26 17) -- cgit v0.12 From 25ab83305208abd0b5f89f18ba298a87b7733c58 Mon Sep 17 00:00:00 2001 From: makise-homura Date: Mon, 15 Jan 2024 03:10:19 +0300 Subject: cppdap: Use std::is_same<>::value instead of std::is_same<>() for old LCC std::is_same<>() is not const instead of std::is_same<>::value at least on LCC 1.21, so this produces an error. Still ()-notation seems to be fairly equivalent functionally to ::value-notation. --- Utilities/cmcppdap/include/dap/any.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/cmcppdap/include/dap/any.h b/Utilities/cmcppdap/include/dap/any.h index b05f03d..6060546 100644 --- a/Utilities/cmcppdap/include/dap/any.h +++ b/Utilities/cmcppdap/include/dap/any.h @@ -159,7 +159,7 @@ any& any::operator=(const std::nullptr_t&) { template T& any::get() const { - static_assert(!std::is_same(), + static_assert(!std::is_same::value, "Cannot get nullptr from 'any'."); assert(is()); return *reinterpret_cast(value); -- cgit v0.12 From 9bc2aba3b4abb55233026e9e4e9093392845bf76 Mon Sep 17 00:00:00 2001 From: makise-homura Date: Mon, 15 Jan 2024 03:14:57 +0300 Subject: LCC: get rid of ambiguous assignments of {} for LCC LCC 1.21 can't determine the exact type of right side of assignment and so produces an error. Here it is resolved by an intermediate variable. --- Source/cmDebuggerExceptionManager.cxx | 2 +- Source/cmSystemTools.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/cmDebuggerExceptionManager.cxx b/Source/cmDebuggerExceptionManager.cxx index a27426c..470e44c 100644 --- a/Source/cmDebuggerExceptionManager.cxx +++ b/Source/cmDebuggerExceptionManager.cxx @@ -78,7 +78,7 @@ cmDebuggerExceptionManager::HandleExceptionInfoRequest() response.exceptionId = TheException->Id; response.breakMode = "always"; response.description = TheException->Description; - TheException = {}; + TheException = cm::nullopt; } return response; } diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index f606c22..1b3dbe2 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1673,7 +1673,7 @@ void cmSystemTools::EnvDiff::PutEnv(const std::string& env) void cmSystemTools::EnvDiff::UnPutEnv(const std::string& env) { - diff[env] = {}; + diff[env] = cm::nullopt; } bool cmSystemTools::EnvDiff::ParseOperation(const std::string& envmod) @@ -1728,7 +1728,7 @@ bool cmSystemTools::EnvDiff::ParseOperation(const std::string& envmod) } else if (op == "set"_s) { diff[name] = value; } else if (op == "unset"_s) { - diff[name] = {}; + diff[name] = cm::nullopt; } else if (op == "string_append"_s) { apply_diff(name, [&value](std::string& output) { output += value; }); } else if (op == "string_prepend"_s) { -- cgit v0.12 From 67de0c197b6a1c1cba36a473fe4c62ea64fc6bae Mon Sep 17 00:00:00 2001 From: makise-homura Date: Mon, 15 Jan 2024 03:16:25 +0300 Subject: cmcurl: fix X509_STORE_up_ref issue not just on LCC 1.23, but on LCC <= 1.23 --- Utilities/cmcurl/lib/vtls/openssl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Utilities/cmcurl/lib/vtls/openssl.c b/Utilities/cmcurl/lib/vtls/openssl.c index ca6d931..4bcb340 100644 --- a/Utilities/cmcurl/lib/vtls/openssl.c +++ b/Utilities/cmcurl/lib/vtls/openssl.c @@ -293,9 +293,9 @@ typedef unsigned long sslerr_t; #define HAVE_SSL_X509_STORE_SHARE #endif -/* FIXME: On a specific machine using LCC 1.23, OpenSSL 2.0.0 - * is found but does not seem to have X509_STORE_up_ref. */ -#if defined(__LCC__) && defined(__EDG__) && (__LCC__ == 123) +/* FIXME: On LCC <= 1.23, OpenSSL 2.0.0 may be + * found but does not seem to have X509_STORE_up_ref. */ +#if defined(__LCC__) && defined(__EDG__) && (__LCC__ <= 123) #undef HAVE_SSL_X509_STORE_SHARE #endif -- cgit v0.12 From 77e046b47c8d17ec44fea8a01bd8dab39c898c6a Mon Sep 17 00:00:00 2001 From: makise-homura Date: Mon, 15 Jan 2024 03:18:20 +0300 Subject: jsoncpp: fix missing template deletion support on LCC < 1.23 --- Utilities/cmjsoncpp/include/json/value.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Utilities/cmjsoncpp/include/json/value.h b/Utilities/cmjsoncpp/include/json/value.h index f6ac9e3..421fef8 100644 --- a/Utilities/cmjsoncpp/include/json/value.h +++ b/Utilities/cmjsoncpp/include/json/value.h @@ -33,6 +33,10 @@ #if __clang_major__ == 3 && __clang_minor__ <= 8 #define JSONCPP_TEMPLATE_DELETE #endif +#elif defined(__EDG__) && defined(__LCC__) +#if __LCC__ < 123 +#define JSONCPP_TEMPLATE_DELETE +#endif #endif #if !defined(JSONCPP_TEMPLATE_DELETE) #define JSONCPP_TEMPLATE_DELETE = delete -- cgit v0.12 From fa764ce311f450c61817d202095d6155c76f0251 Mon Sep 17 00:00:00 2001 From: makise-homura Date: Mon, 15 Jan 2024 03:20:23 +0300 Subject: liblzma: Make cmliblzma buildable on LCC 1.21 --- Utilities/cmliblzma/common/sysdefs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Utilities/cmliblzma/common/sysdefs.h b/Utilities/cmliblzma/common/sysdefs.h index 86c5da0..6e3495e 100644 --- a/Utilities/cmliblzma/common/sysdefs.h +++ b/Utilities/cmliblzma/common/sysdefs.h @@ -172,9 +172,9 @@ typedef unsigned char _Bool; # include #endif -// As of MSVC 2013, inline and restrict are supported with +// As of MSVC 2013 and LCC <= 1.21, inline and restrict are supported with // non-standard keywords. -#if defined(_WIN32) && defined(_MSC_VER) +#if (defined(_WIN32) && defined(_MSC_VER)) || (defined(__EDG__) && defined(__LCC__)) # ifndef inline # define inline __inline # endif -- cgit v0.12 From 83af26d9ad5ef9a1732f4573c06797ff8d74058a Mon Sep 17 00:00:00 2001 From: makise-homura Date: Mon, 15 Jan 2024 06:13:04 +0300 Subject: LCC: Don't enable debugger on LCC that don't have --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a99cf50..dfbb38d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,6 +140,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) if(CMAKE_SYSTEM_NAME MATCHES "Windows|Darwin|Linux|BSD|DragonFly|CYGWIN|MSYS" AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.16) AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "XLClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.1) + AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "LCC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 1.23) ) set(CMake_ENABLE_DEBUGGER 1) else() -- cgit v0.12 From 1dbb31cea25adcfe9a11f1797ebcfdc11712c2b6 Mon Sep 17 00:00:00 2001 From: makise-homura Date: Mon, 15 Jan 2024 06:11:28 +0300 Subject: libarchive: avoid lchmod not implemented warning on old LCC --- Utilities/cmlibarchive/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt index 1237608..e47184b 100644 --- a/Utilities/cmlibarchive/CMakeLists.txt +++ b/Utilities/cmlibarchive/CMakeLists.txt @@ -1425,7 +1425,9 @@ CHECK_FUNCTION_EXISTS_GLIBC(getpid HAVE_GETPID) CHECK_FUNCTION_EXISTS_GLIBC(getvfsbyname HAVE_GETVFSBYNAME) CHECK_FUNCTION_EXISTS_GLIBC(gmtime_r HAVE_GMTIME_R) CHECK_FUNCTION_EXISTS_GLIBC(lchflags HAVE_LCHFLAGS) -CHECK_FUNCTION_EXISTS_GLIBC(lchmod HAVE_LCHMOD) +if(NOT CMAKE_C_COMPILER_ID STREQUAL "LCC" OR NOT CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL "1.23") + CHECK_FUNCTION_EXISTS_GLIBC(lchmod HAVE_LCHMOD) +endif() CHECK_FUNCTION_EXISTS_GLIBC(lchown HAVE_LCHOWN) CHECK_FUNCTION_EXISTS_GLIBC(link HAVE_LINK) CHECK_FUNCTION_EXISTS_GLIBC(linkat HAVE_LINKAT) -- cgit v0.12 From 9dd0ab9c88490b1555e62a473341da695ae0b438 Mon Sep 17 00:00:00 2001 From: makise-homura Date: Mon, 15 Jan 2024 08:44:06 +0300 Subject: LCC: Make CMake build without warnings on LCC 1.21 --- Source/cmConfigure.cmake.h.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in index de74716..23e4846 100644 --- a/Source/cmConfigure.cmake.h.in +++ b/Source/cmConfigure.cmake.h.in @@ -14,8 +14,13 @@ #pragma warning(disable : 1572) /* floating-point equality test */ #endif -#if defined(__LCC__) && defined(__EDG__) && (__LCC__ == 123) +#if defined(__LCC__) && defined(__EDG__) +#if __LCC__ == 123 #pragma diag_suppress 2910 /* excess -Wunused-function in 1.23.x */ +#elif __LCC__ == 121 +#pragma diag_suppress 2727 /* excess -Wunused-function in 1.21.x */ +#include /* ..._MIN, ..._MAX constants */ +#endif #endif #cmakedefine HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE -- cgit v0.12 From 202f4b316139dcb00dc057bc4fcc85b00b8a62cb Mon Sep 17 00:00:00 2001 From: makise-homura Date: Mon, 15 Jan 2024 03:00:19 +0300 Subject: Tests: Exclude some tests on broken libc on Elbrus These tests found to be occasionally failing, so just in case CMake is used in such environment, don't test this at all. --- Tests/RunCMake/CMakeLists.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 0399e74..ef088aa 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -1058,6 +1058,10 @@ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "e2k" AND NOT DEFINED CMake_TEST_E2K_BROKEN_L execute_process(COMMAND "${DPKG_QUERY}" "-f" "\${Version}" "-W" "glibc" OUTPUT_VARIABLE LIBC_VERSION) if(LIBC_VERSION MATCHES "2.29-25.*") list(REMOVE_ITEM cpack_tests + DEB.DEFAULT_PERMISSIONS + DEB.DEBUGINFO + DEB.MINIMAL + DEB.PER_COMPONENT_FIELDS DEB.AUTO_SUFFIXES DEB.CUSTOM_NAMES DEB.DEB_PACKAGE_VERSION_BACK_COMPATIBILITY @@ -1125,12 +1129,12 @@ add_RunCMake_test(CMakePresets -DPython_EXECUTABLE=${Python_EXECUTABLE} -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA} ) -add_RunCMake_test(CMakePresetsBuild - -DPython_EXECUTABLE=${Python_EXECUTABLE} - -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA} - -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} - ) if(NOT CMake_TEST_E2K_BROKEN_LIBC) + add_RunCMake_test(CMakePresetsBuild + -DPython_EXECUTABLE=${Python_EXECUTABLE} + -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA} + -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} + ) add_RunCMake_test(CMakePresetsTest -DPython_EXECUTABLE=${Python_EXECUTABLE} -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA} -- cgit v0.12