ソースを参照

GCC Support for Linux

Updates and fixes to support GCC for Linux

Signed-off-by: Steve Pham <[email protected]>

Co-authored-by: lumberyard-employee-dm <[email protected]>
Steve Pham 3 年 前
コミット
59e43813f0
98 ファイル変更1051 行追加430 行削除
  1. 1 1
      Code/Editor/Include/SandboxAPI.h
  2. 9 0
      Code/Editor/Platform/Common/GCC/editor_lib_gcc.cmake
  3. 0 2
      Code/Editor/TopRendererWnd.h
  4. 7 2
      Code/Framework/AzCore/AzCore/EBus/EBus.h
  5. 5 5
      Code/Framework/AzCore/AzCore/EBus/Internal/BusContainer.h
  6. 1 1
      Code/Framework/AzCore/AzCore/EBus/Internal/CallstackEntry.h
  7. 43 51
      Code/Framework/AzCore/AzCore/IO/Path/Path.inl
  8. 2 2
      Code/Framework/AzCore/AzCore/Math/MathIntrinsics.h
  9. 3 1
      Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h
  10. 3 1
      Code/Framework/AzCore/AzCore/Name/NameDictionary.h
  11. 85 7
      Code/Framework/AzCore/AzCore/PlatformDef.h
  12. 4 3
      Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.h
  13. 21 8
      Code/Framework/AzCore/AzCore/RTTI/RTTI.h
  14. 24 12
      Code/Framework/AzCore/AzCore/RTTI/TypeInfo.h
  15. 1 1
      Code/Framework/AzCore/AzCore/Script/ScriptContext.h
  16. 6 0
      Code/Framework/AzCore/AzCore/Serialization/Json/RegistrationContext.h
  17. 2 9
      Code/Framework/AzCore/AzCore/UnitTest/TestTypes.h
  18. 1 0
      Code/Framework/AzCore/AzCore/azcore_files.cmake
  19. 1 60
      Code/Framework/AzCore/AzCore/base.h
  20. 1 0
      Code/Framework/AzCore/AzCore/std/containers/compressed_pair.h
  21. 1 1
      Code/Framework/AzCore/AzCore/std/containers/fixed_vector.h
  22. 1 1
      Code/Framework/AzCore/AzCore/std/containers/map.h
  23. 4 3
      Code/Framework/AzCore/AzCore/std/containers/node_handle.h
  24. 1 1
      Code/Framework/AzCore/AzCore/std/containers/set.h
  25. 1 1
      Code/Framework/AzCore/AzCore/std/containers/unordered_map.h
  26. 1 1
      Code/Framework/AzCore/AzCore/std/containers/unordered_set.h
  27. 2 2
      Code/Framework/AzCore/AzCore/std/function/function_base.h
  28. 1 1
      Code/Framework/AzCore/AzCore/std/function/function_template.h
  29. 1 0
      Code/Framework/AzCore/AzCore/std/function/invoke.h
  30. 15 5
      Code/Framework/AzCore/AzCore/std/string/fixed_string.inl
  31. 5 3
      Code/Framework/AzCore/AzCore/std/string/string.h
  32. 88 22
      Code/Framework/AzCore/AzCore/std/string/string_view.h
  33. 1 0
      Code/Framework/AzCore/AzCore/std/typetraits/conjunction.h
  34. 3 4
      Code/Framework/AzCore/AzCore/std/typetraits/intrinsics.h
  35. 64 0
      Code/Framework/AzCore/AzCore/variadic.h
  36. 1 1
      Code/Framework/AzCore/Platform/Common/Unimplemented/AzCore/Memory/OverrunDetectionAllocator_Unimplemented.h
  37. 2 1
      Code/Framework/AzCore/Platform/Linux/platform_linux.cmake
  38. 28 28
      Code/Framework/AzCore/Tests/AZStd/String.cpp
  39. 15 15
      Code/Framework/AzCore/Tests/EBus.cpp
  40. 11 6
      Code/Framework/AzCore/Tests/Serialization.cpp
  41. 1 1
      Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpConnection.cpp
  42. 1 1
      Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpConnectionSet.cpp
  43. 1 1
      Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp
  44. 0 2
      Code/Framework/AzTest/AzTest/Platform/Linux/AzTest_Traits_Linux.h
  45. 0 1
      Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Entries/AssetBrowserEntry.h
  46. 1 1
      Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityHelpers.h
  47. 1 1
      Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp
  48. 1 1
      Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/Thumbnail.h
  49. 0 1
      Code/Framework/AzToolsFramework/Platform/Common/GCC/aztoolsframework_gcc.cmake
  50. 0 1
      Code/Framework/GridMate/CMakeLists.txt
  51. 2 2
      Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp
  52. 2 0
      Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.cpp
  53. 5 0
      Code/Framework/GridMate/GridMate/Carrier/StreamSecureSocketDriver.cpp
  54. 1 1
      Code/Legacy/CrySystem/IDebugCallStack.cpp
  55. 12 0
      Code/Tools/ProjectManager/Platform/Common/GCC/projectmanager_gcc.cmake
  56. 12 0
      Code/Tools/PythonBindingsExample/source/Platform/Common/GCC/pythonbindingsexample_gcc.cmake
  57. 50 43
      Gems/AWSCore/Code/Include/Framework/AWSApiRequestJob.h
  58. 70 65
      Gems/AWSCore/Code/Include/Framework/ServiceRequestJob.h
  59. 12 0
      Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Common/GCC/imageprocessingatom_editor_static_gcc.cmake
  60. 12 0
      Gems/Atom/Asset/Shader/Code/Source/Platform/Common/GCC/atom_asset_shader_static_gcc.cmake
  61. 1 0
      Gems/Atom/Feature/Common/Code/Include/Atom/Feature/ParamMacros/MapParamCommon.inl
  62. 12 0
      Gems/Atom/Feature/Common/Code/Platform/Common/atom_feature_common_gcc.cmake
  63. 13 0
      Gems/Atom/Feature/Common/Code/Source/Platform/Common/GCC/atom_feature_common_gcc.cmake
  64. 2 2
      Gems/Atom/RPI/Code/Include/Atom/RPI.Public/GpuQuery/Query.h
  65. 6 2
      Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ParentPass.h
  66. 8 4
      Gems/Atom/RPI/Code/Source/Platform/Common/GCC/atom_rpi_public_gcc.cmake
  67. 12 0
      Gems/EditorPythonBindings/Code/Source/Platform/Common/GCC/editorpythonbindings_static_gcc.cmake
  68. 12 0
      Gems/EditorPythonBindings/Code/Source/Platform/Common/GCC/editorpythonbindings_tests_gcc.cmake
  69. 1 1
      Gems/ExpressionEvaluation/Code/Tests/ExpressionEngineTestFixture.h
  70. 22 22
      Gems/ExpressionEvaluation/Code/Tests/MathExpressionTests.cpp
  71. 1 0
      Gems/GradientSignal/Code/Source/ImageAsset.cpp
  72. 1 1
      Gems/LyShine/Code/Source/Animation/AnimSplineTrack.h
  73. 1 1
      Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.h
  74. 10 0
      Gems/Metastream/Code/Source/Platform/Common/GCC/metastream_gcc.cmake
  75. 2 0
      Gems/PhysX/Code/CMakeLists.txt
  76. 7 0
      Gems/PhysX/Code/Source/Platform/Common/Clang/physx_editor_static_clang.cmake
  77. 12 0
      Gems/PhysX/Code/Source/Platform/Common/GCC/physx_editor_static_gcc.cmake
  78. 7 0
      Gems/PhysX/Code/Source/Platform/Common/MSVC/physx_editor_static_msvc.cmake
  79. 12 0
      Gems/PythonAssetBuilder/Code/Source/Platform/Common/GCC/pythonassetbuilder_static_gcc.cmake
  80. 12 0
      Gems/PythonAssetBuilder/Code/Source/Platform/Common/GCC/pythonassetbuilder_tests_gcc.cmake
  81. 12 0
      Gems/QtForPython/Code/Source/Platform/Common/GCC/qtforpython_gcc.cmake
  82. 1 1
      Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp
  83. 1 1
      Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp
  84. 1 1
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.h
  85. 7 0
      Gems/ScriptCanvasTesting/Code/Platform/Common/GCC/scriptcanvastesting_editor_tests_gcc.cmake
  86. 5 4
      Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventsAsset.h
  87. 1 1
      Gems/ScriptEvents/Code/Source/Editor/ScriptEventsSystemEditorComponent.cpp
  88. 1 0
      Gems/WhiteBox/Code/CMakeLists.txt
  89. 7 0
      Gems/WhiteBox/Code/Source/Platform/Common/Clang/whitebox_editor_clang.cmake
  90. 12 0
      Gems/WhiteBox/Code/Source/Platform/Common/GCC/whitebox_editor_gcc.cmake
  91. 7 0
      Gems/WhiteBox/Code/Source/Platform/Common/MSVC/whitebox_editor_msvc.cmake
  92. 2 2
      cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake
  93. 16 1
      cmake/Configurations.cmake
  94. 87 0
      cmake/Platform/Common/GCC/Configurations_gcc.cmake
  95. 27 0
      cmake/Platform/Linux/Configurations_linux.cmake
  96. 3 0
      cmake/Platform/Linux/PAL_linux.cmake
  97. 32 0
      scripts/build/Platform/Linux/build_config.json
  98. 25 2
      scripts/build/Platform/Linux/build_linux.sh

+ 1 - 1
Code/Editor/Include/SandboxAPI.h

@@ -21,7 +21,7 @@
 #endif
 
 #if defined(SANDBOX_IMPORTS) && defined(SANDBOX_EXPORTS)
-#error SANDBOX_EXPORTS and SANDBOX_IMPORTS can't be defined at the same time
+#error SANDBOX_EXPORTS and SANDBOX_IMPORTS cannot be defined at the same time
 #endif
 
 #if defined(SANDBOX_EXPORTS)

+ 9 - 0
Code/Editor/Platform/Common/GCC/editor_lib_gcc.cmake

@@ -0,0 +1,9 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(LY_COMPILE_OPTIONS PRIVATE -fexceptions)

+ 0 - 2
Code/Editor/TopRendererWnd.h

@@ -81,8 +81,6 @@ public:
     bool m_bShowStatObjects;
     bool m_bShowWater;
     bool m_bAutoScaleGreyRange;
-
-    friend class QTopRendererWnd;
 };
 
 #endif // CRYINCLUDE_EDITOR_TOPRENDERERWND_H

+ 7 - 2
Code/Framework/AzCore/AzCore/EBus/EBus.h

@@ -23,6 +23,11 @@
 #include <AzCore/EBus/Results.h>
 #include <AzCore/EBus/Internal/Debug.h>
 
+ // Included for backwards compatibility purposes
+#include <AzCore/std/typetraits/typetraits.h>
+#include <AzCore/std/smart_ptr/unique_ptr.h>
+#include <AzCore/std/containers/unordered_set.h>
+
 #include <AzCore/std/typetraits/is_same.h>
 
 #include <AzCore/std/utils.h>
@@ -515,7 +520,7 @@ namespace AZ
         * This is not EBus Context Mutex when LocklessDispatch is set
         */
         template <typename DispatchMutex>
-        using DispatchLockGuard = typename ImplTraits::template DispatchLockGuard<DispatchMutex>;
+        using DispatchLockGuardTemplate = typename ImplTraits::template DispatchLockGuard<DispatchMutex>;
 
         //////////////////////////////////////////////////////////////////////////
         // Check to help identify common mistakes
@@ -645,7 +650,7 @@ namespace AZ
              * during broadcast/event dispatch.
              * @see EBusTraits::LocklessDispatch
              */
-            using DispatchLockGuard = DispatchLockGuard<ContextMutexType>;
+            using DispatchLockGuard = DispatchLockGuardTemplate<ContextMutexType>;
 
             /**
             * The scoped lock guard to use during connection.  Some specialized policies execute handler methods which

+ 5 - 5
Code/Framework/AzCore/AzCore/EBus/Internal/BusContainer.h

@@ -93,14 +93,14 @@ namespace AZ
             // This struct will hold the handlers per address
             struct HandlerHolder;
             // This struct will hold each handler
-            using HandlerNode = HandlerNode<Interface, Traits, HandlerHolder>;
+            using HandlerNode = AZ::Internal::HandlerNode<Interface, Traits, HandlerHolder>;
             // Defines how handler holders are stored (will be some sort of map-like structure from id -> handler holder)
             using AddressStorage = AddressStoragePolicy<Traits, HandlerHolder>;
             // Defines how handlers are stored per address (will be some sort of list)
             using HandlerStorage = HandlerStoragePolicy<Interface, Traits, HandlerNode>;
 
             using Handler = IdHandler<Interface, Traits, ContainerType>;
-            using MultiHandler = MultiHandler<Interface, Traits, ContainerType>;
+            using MultiHandler = AZ::Internal::MultiHandler<Interface, Traits, ContainerType>;
             using BusPtr = AZStd::intrusive_ptr<HandlerHolder>;
 
             EBusContainer() = default;
@@ -774,13 +774,13 @@ namespace AZ
             // This struct will hold the handler per address
             struct HandlerHolder;
             // This struct will hold each handler
-            using HandlerNode = HandlerNode<Interface, Traits, HandlerHolder>;
+            using HandlerNode = AZ::Internal::HandlerNode<Interface, Traits, HandlerHolder>;
             // Defines how handler holders are stored (will be some sort of map-like structure from id -> handler holder)
             using AddressStorage = AddressStoragePolicy<Traits, HandlerHolder>;
             // No need for HandlerStorage, there's only 1 so it will always just be a HandlerNode*
 
             using Handler = IdHandler<Interface, Traits, ContainerType>;
-            using MultiHandler = MultiHandler<Interface, Traits, ContainerType>;
+            using MultiHandler = AZ::Internal::MultiHandler<Interface, Traits, ContainerType>;
             using BusPtr = AZStd::intrusive_ptr<HandlerHolder>;
 
             EBusContainer() = default;
@@ -1316,7 +1316,7 @@ namespace AZ
             // This struct will hold the handlers per address
             struct HandlerHolder;
             // This struct will hold each handler
-            using HandlerNode = HandlerNode<Interface, Traits, HandlerHolder>;
+            using HandlerNode = AZ::Internal::HandlerNode<Interface, Traits, HandlerHolder>;
             // Defines how handlers are stored per address (will be some sort of list)
             using HandlerStorage = HandlerStoragePolicy<Interface, Traits, HandlerNode>;
             // No need for AddressStorage, there's only 1

+ 1 - 1
Code/Framework/AzCore/AzCore/EBus/Internal/CallstackEntry.h

@@ -161,7 +161,7 @@ namespace AZ
         template <class C>
         struct EBusCallstackStorage<C, true>
         {
-            AZ_THREAD_LOCAL static C* s_entry;
+            static AZ_THREAD_LOCAL C* s_entry;
 
             EBusCallstackStorage() = default;
             ~EBusCallstackStorage() = default;

+ 43 - 51
Code/Framework/AzCore/AzCore/IO/Path/Path.inl

@@ -13,50 +13,6 @@
 
 #include <AzCore/IO/Path/PathIterable.inl>
 
-// extern instantiations of Path templates to prevent implicit instantiations
-namespace AZ::IO
-{
-    // Class templates explicit declarations
-    extern template class BasicPath<AZStd::string>;
-    extern template class BasicPath<FixedMaxPathString>;
-    extern template class PathIterator<PathView>;
-    extern template class PathIterator<Path>;
-    extern template class PathIterator<FixedMaxPath>;
-
-    // Swap function explicit declarations
-    extern template void swap<AZStd::string>(Path& lhs, Path& rhs) noexcept;
-    extern template void swap<FixedMaxPathString>(FixedMaxPath& lhs, FixedMaxPath& rhs) noexcept;
-
-    // Hash function explicit declarations
-    extern template size_t hash_value<AZStd::string>(const Path& pathToHash);
-    extern template size_t hash_value<FixedMaxPathString>(const FixedMaxPath& pathToHash);
-
-    // Append operator explicit declarations
-    extern template BasicPath<AZStd::string> operator/<AZStd::string>(const BasicPath<AZStd::string>& lhs, const PathView& rhs);
-    extern template BasicPath<FixedMaxPathString> operator/<FixedMaxPathString>(const BasicPath<FixedMaxPathString>& lhs, const PathView& rhs);
-    extern template BasicPath<AZStd::string> operator/<AZStd::string>(const BasicPath<AZStd::string>& lhs, AZStd::string_view rhs);
-    extern template BasicPath<FixedMaxPathString> operator/<FixedMaxPathString>(const BasicPath<FixedMaxPathString>& lhs, AZStd::string_view rhs);
-    extern template BasicPath<AZStd::string> operator/<AZStd::string>(const BasicPath<AZStd::string>& lhs,
-        const typename BasicPath<AZStd::string>::value_type* rhs);
-    extern template BasicPath<FixedMaxPathString> operator/<FixedMaxPathString>(const BasicPath<FixedMaxPathString>& lhs,
-        const typename BasicPath<FixedMaxPathString>::value_type* rhs);
-
-    // Iterator compare explicit declarations
-    extern template bool operator==<PathView>(const PathIterator<PathView>& lhs,
-        const PathIterator<PathView>& rhs);
-    extern template bool operator==<Path>(const PathIterator<Path>& lhs,
-        const PathIterator<Path>& rhs);
-    extern template bool operator==<FixedMaxPath>(const PathIterator<FixedMaxPath>& lhs,
-        const PathIterator<FixedMaxPath>& rhs);
-    extern template bool operator!=<PathView>(const PathIterator<PathView>& lhs,
-        const PathIterator<PathView>& rhs);
-    extern template bool operator!=<Path>(const PathIterator<Path>& lhs,
-        const PathIterator<Path>& rhs);
-    extern template bool operator!=<FixedMaxPath>(const PathIterator<FixedMaxPath>& lhs,
-        const PathIterator<FixedMaxPath>& rhs);
-}
-
-
 //! PathView implementation
 namespace AZ::IO
 {
@@ -939,13 +895,13 @@ namespace AZ::IO
             // then it has no root directory nor filename
             if (rootNameView.end() == m_path.end())
             {
-                // has_root_directory || has_filename = false
-                // If the root name is of the form
-                // # C: - then it isn't absolute unless it has a root directory C:\
-                // # \\?\ = is a UNC path that can't exist without a root directory
-                // # \\server - Is absolute, but has no root directory
-                // Therefore if the rootName is larger than three characters
-                // then append the path separator
+                /* has_root_directory || has_filename = false
+                   If the root name is of the form
+                   C: - then it isn't absolute unless it has a root directory C:\.
+                   \\?\ = is a UNC path that can't exist without a root directory.
+                   \\server - Is absolute, but has no root directory.
+                   Therefore if the rootName is larger than three characters
+                   then append the path separator. */
                 if (rootNameView.size() >= 3)
                 {
                     m_path.push_back(m_preferred_separator);
@@ -1550,3 +1506,39 @@ namespace AZ::IO
         return AZStd::hash<PathView>{}(pathToHash);
     }
 }
+
+// extern instantiations of Path templates to prevent implicit instantiations
+namespace AZ::IO
+{
+    // Swap function explicit declarations
+    extern template void swap<AZStd::string>(Path& lhs, Path& rhs) noexcept;
+    extern template void swap<FixedMaxPathString>(FixedMaxPath& lhs, FixedMaxPath& rhs) noexcept;
+
+    // Hash function explicit declarations
+    extern template size_t hash_value<AZStd::string>(const Path& pathToHash);
+    extern template size_t hash_value<FixedMaxPathString>(const FixedMaxPath& pathToHash);
+
+    // Append operator explicit declarations
+    extern template BasicPath<AZStd::string> operator/<AZStd::string>(const BasicPath<AZStd::string>& lhs, const PathView& rhs);
+    extern template BasicPath<FixedMaxPathString> operator/<FixedMaxPathString>(const BasicPath<FixedMaxPathString>& lhs, const PathView& rhs);
+    extern template BasicPath<AZStd::string> operator/<AZStd::string>(const BasicPath<AZStd::string>& lhs, AZStd::string_view rhs);
+    extern template BasicPath<FixedMaxPathString> operator/<FixedMaxPathString>(const BasicPath<FixedMaxPathString>& lhs, AZStd::string_view rhs);
+    extern template BasicPath<AZStd::string> operator/<AZStd::string>(const BasicPath<AZStd::string>& lhs,
+        const typename BasicPath<AZStd::string>::value_type* rhs);
+    extern template BasicPath<FixedMaxPathString> operator/<FixedMaxPathString>(const BasicPath<FixedMaxPathString>& lhs,
+        const typename BasicPath<FixedMaxPathString>::value_type* rhs);
+
+    // Iterator compare explicit declarations
+    extern template bool operator==<PathView>(const PathIterator<PathView>& lhs,
+        const PathIterator<PathView>& rhs);
+    extern template bool operator==<Path>(const PathIterator<Path>& lhs,
+        const PathIterator<Path>& rhs);
+    extern template bool operator==<FixedMaxPath>(const PathIterator<FixedMaxPath>& lhs,
+        const PathIterator<FixedMaxPath>& rhs);
+    extern template bool operator!=<PathView>(const PathIterator<PathView>& lhs,
+        const PathIterator<PathView>& rhs);
+    extern template bool operator!=<Path>(const PathIterator<Path>& lhs,
+        const PathIterator<Path>& rhs);
+    extern template bool operator!=<FixedMaxPath>(const PathIterator<FixedMaxPath>& lhs,
+        const PathIterator<FixedMaxPath>& rhs);
+}

+ 2 - 2
Code/Framework/AzCore/AzCore/Math/MathIntrinsics.h

@@ -14,7 +14,7 @@
     #define az_clz_u64(x)    _lzcnt_u64(x)
     #define az_popcnt_u32(x) __popcnt(x)
     #define az_popcnt_u64(x) __popcnt64(x)
-#elif defined(AZ_COMPILER_CLANG)
+#elif defined(AZ_COMPILER_CLANG) || defined(AZ_COMPILER_GCC)
     #define az_ctz_u32(x)    __builtin_ctz(x)
     #define az_ctz_u64(x)    __builtin_ctzll(x)
     #define az_clz_u32(x)    __builtin_clz(x)
@@ -22,5 +22,5 @@
     #define az_popcnt_u32(x) __builtin_popcount(x)
     #define az_popcnt_u64(x) __builtin_popcountll(x)
 #else
-    #error Count Leading Zeros, Count Trailing Zeros and Pop Count intrinsics isn't supported for this compiler
+    #error Count Leading Zeros, Count Trailing Zeros and Pop Count intrinsics isnt supported for this compiler
 #endif

+ 3 - 1
Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h

@@ -39,6 +39,9 @@ namespace AZ
         template<typename T> constexpr friend void AZStd::destroy_at(T*);
 
     public:
+
+        AllocatorManager();
+
         typedef AZStd::function<void (IAllocator* allocator, size_t /*byteSize*/, size_t /*alignment*/, int/* flags*/, const char* /*name*/, const char* /*fileName*/, int lineNum /*=0*/)>    OutOfMemoryCBType;
 
         static void PreRegisterAllocator(IAllocator* allocator);  // Only call if the environment is not yet attached
@@ -185,7 +188,6 @@ namespace AZ
         AZ::Debug::AllocationRecords::Mode m_defaultTrackingRecordMode;
         AZStd::unique_ptr<AZ::MallocSchema, void(*)(AZ::MallocSchema*)> m_mallocSchema;
 
-        AllocatorManager();
         ~AllocatorManager();
 
         static AllocatorManager g_allocMgr;    ///< The single instance of the allocator manager

+ 3 - 1
Code/Framework/AzCore/AzCore/Name/NameDictionary.h

@@ -45,7 +45,9 @@ namespace AZ
     //! that already exist.
     class NameDictionary final
     {
+    public:
         AZ_CLASS_ALLOCATOR(NameDictionary, AZ::OSAllocator, 0);
+    private:
 
         friend Module;
         friend Name;
@@ -75,8 +77,8 @@ namespace AZ
         //! @return A Name instance. If the hash was not found, the Name will be empty.
         Name FindName(Name::Hash hash) const;
 
-    private:
         NameDictionary();
+    private:
         ~NameDictionary();
 
         void ReportStats() const;

+ 85 - 7
Code/Framework/AzCore/AzCore/PlatformDef.h

@@ -10,10 +10,17 @@
 //////////////////////////////////////////////////////////////////////////
 // Platforms
 
+#include <AzCore/variadic.h>
+
 #include "PlatformRestrictedFileDef.h"
 
 #if defined(__clang__)
     #define AZ_COMPILER_CLANG   __clang_major__
+#elif defined(__GNUC__)
+    //  Assign AZ_COMPILER_GCC to a number that represents the major+minor (2 digits) + path level (2 digits)  i.e. 3.2.0 == 30200
+    #define AZ_COMPILER_GCC     (__GNUC__ * 10000 \
+                               + __GNUC_MINOR__ * 100 \
+                               + __GNUC_PATCHLEVEL__)
 #elif defined(_MSC_VER)
     #define AZ_COMPILER_MSVC    _MSC_VER
 #else
@@ -29,7 +36,7 @@
 #define AZ_DYNAMIC_LIBRARY_PREFIX       AZ_TRAIT_OS_DYNAMIC_LIBRARY_PREFIX
 #define AZ_DYNAMIC_LIBRARY_EXTENSION    AZ_TRAIT_OS_DYNAMIC_LIBRARY_EXTENSION
 
-#if defined(AZ_COMPILER_CLANG)
+#if defined(AZ_COMPILER_CLANG) || defined(AZ_COMPILER_GCC)
     #define AZ_DLL_EXPORT               AZ_TRAIT_OS_DLL_EXPORT_CLANG
     #define AZ_DLL_IMPORT               AZ_TRAIT_OS_DLL_IMPORT_CLANG
 #elif defined(AZ_COMPILER_MSVC)
@@ -67,12 +74,36 @@
 #if defined(AZ_COMPILER_MSVC)
 
 /// Disables a warning using push style. For use matched with an AZ_POP_WARNING
-#define AZ_PUSH_DISABLE_WARNING(_msvcOption, __)    \
-    __pragma(warning(push))                         \
+
+// Compiler specific AZ_PUSH_DISABLE_WARNING
+#define AZ_PUSH_DISABLE_WARNING_MSVC(_msvcOption)       \
+    __pragma(warning(push))                             \
+    __pragma(warning(disable : _msvcOption))
+#define AZ_PUSH_DISABLE_WARNING_CLANG(_clangOption)
+#define AZ_PUSH_DISABLE_WARNING_GCC(_gccOption)
+
+/// Compiler specific AZ_POP_DISABLE_WARNING. This needs to be matched with the compiler specific AZ_PUSH_DISABLE_WARNINGs
+#define AZ_POP_DISABLE_WARNING_CLANG                     
+#define AZ_POP_DISABLE_WARNING_MSVC                     \
+    __pragma(warning(pop))
+#define AZ_POP_DISABLE_WARNING_GCC
+
+
+// Variadic definitions for AZ_PUSH_DISABLE_WARNING for the current compiler
+#define AZ_PUSH_DISABLE_WARNING_1(_msvcOption)          \
+    __pragma(warning(push))                             \
+    __pragma(warning(disable : _msvcOption))
+
+#define AZ_PUSH_DISABLE_WARNING_2(_msvcOption, _2)      \
+    __pragma(warning(push))                             \
+    __pragma(warning(disable : _msvcOption))
+
+#define AZ_PUSH_DISABLE_WARNING_3(_msvcOption, _2, _3)  \
+    __pragma(warning(push))                             \
     __pragma(warning(disable : _msvcOption))
 
 /// Pops the warning stack. For use matched with an AZ_PUSH_DISABLE_WARNING
-#define AZ_POP_DISABLE_WARNING                      \
+#define AZ_POP_DISABLE_WARNING                          \
     __pragma(warning(pop))
 
 
@@ -94,17 +125,62 @@
 #   define AZ_FUNCTION_SIGNATURE    __FUNCSIG__
 
 //////////////////////////////////////////////////////////////////////////
-#elif defined(AZ_COMPILER_CLANG)
+#elif defined(AZ_COMPILER_CLANG) || defined(AZ_COMPILER_GCC)
+
+#if defined(AZ_COMPILER_CLANG)
 
 /// Disables a single warning using push style. For use matched with an AZ_POP_WARNING
-#define AZ_PUSH_DISABLE_WARNING(__, _clangOption)           \
-    _Pragma("clang diagnostic push")                        \
+
+// Compiler specific AZ_PUSH_DISABLE_WARNING
+#define AZ_PUSH_DISABLE_WARNING_CLANG(_clangOption)  \
+    _Pragma("clang diagnostic push")                 \
     _Pragma(AZ_STRINGIZE(clang diagnostic ignored _clangOption))
+#define AZ_PUSH_DISABLE_WARNING_MSVC(_msvcOption)
+#define AZ_PUSH_DISABLE_WARNING_GCC(_gccOption)
+
+/// Compiler specific AZ_POP_DISABLE_WARNING. This needs to be matched with the compiler specific AZ_PUSH_DISABLE_WARNINGs
+#define AZ_POP_DISABLE_WARNING_CLANG                       \
+    _Pragma("clang diagnostic pop")
+#define AZ_POP_DISABLE_WARNING_MSVC
+#define AZ_POP_DISABLE_WARNING_GCC
+
+// Variadic definitions for AZ_PUSH_DISABLE_WARNING for the current compiler
+#define AZ_PUSH_DISABLE_WARNING_1(_1)
+#define AZ_PUSH_DISABLE_WARNING_2(_1, _clangOption)     AZ_PUSH_DISABLE_WARNING_CLANG(_clangOption)
+#define AZ_PUSH_DISABLE_WARNING_3(_1, _clangOption, _2) AZ_PUSH_DISABLE_WARNING_CLANG(_clangOption)
 
 /// Pops the warning stack. For use matched with an AZ_PUSH_DISABLE_WARNING
 #define AZ_POP_DISABLE_WARNING                              \
     _Pragma("clang diagnostic pop")
 
+#else
+
+/// Disables a single warning using push style. For use matched with an AZ_POP_WARNING
+
+// Compiler specific AZ_PUSH_DISABLE_WARNING
+#define AZ_PUSH_DISABLE_WARNING_GCC(_gccOption)             \
+    _Pragma("GCC diagnostic push")                          \
+    _Pragma(AZ_STRINGIZE(GCC diagnostic ignored _gccOption))
+#define AZ_PUSH_DISABLE_WARNING_CLANG(_clangOption)
+#define AZ_PUSH_DISABLE_WARNING_MSVC(_msvcOption)
+
+/// Compiler specific AZ_POP_DISABLE_WARNING. This needs to be matched with the compiler specific AZ_PUSH_DISABLE_WARNINGs
+#define AZ_POP_DISABLE_WARNING_CLANG
+#define AZ_POP_DISABLE_WARNING_MSVC
+#define AZ_POP_DISABLE_WARNING_GCC                          \
+    _Pragma("GCC diagnostic pop")
+
+// Variadic definitions for AZ_PUSH_DISABLE_WARNING for the current compiler
+#define AZ_PUSH_DISABLE_WARNING_1(_1)
+#define AZ_PUSH_DISABLE_WARNING_2(_1, _2)
+#define AZ_PUSH_DISABLE_WARNING_3(_1, _2, _gccOption)   AZ_PUSH_DISABLE_WARNING_GCC(_gccOption)
+
+/// Pops the warning stack. For use matched with an AZ_PUSH_DISABLE_WARNING
+#define AZ_POP_DISABLE_WARNING                              
+    _Pragma("GCC diagnostic pop")
+
+#endif // defined(AZ_COMPILER_CLANG)
+
 #define AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING
 #define AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
 #define AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
@@ -121,6 +197,8 @@
     #error Compiler not supported
 #endif
 
+#define AZ_PUSH_DISABLE_WARNING(...) AZ_MACRO_SPECIALIZE(AZ_PUSH_DISABLE_WARNING_, AZ_VA_NUM_ARGS(__VA_ARGS__), (__VA_ARGS__))
+
 // We need to define AZ_DEBUG_BUILD in debug mode. We can also define it in debug optimized mode (left up to the user).
 // note that _DEBUG is not in fact always defined on all platforms, and only AZ_DEBUG_BUILD should be relied on.
 #if !defined(AZ_DEBUG_BUILD) && defined(_DEBUG)

+ 4 - 3
Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.h

@@ -1541,7 +1541,7 @@ namespace AZ
         }
 
         template<class T>
-        static bool SetClassEqualityComparer(BehaviorClass* behaviorClass, const T*)
+        static void SetClassEqualityComparer(BehaviorClass* behaviorClass, const T*)
         {
             behaviorClass->m_equalityComparer = &DefaultEqualityComparer<T>;
         }
@@ -2341,8 +2341,6 @@ namespace AZ
         // For some reason the Script.cpp test validates that an incomplete type can be used with the SetResult struct
         template<typename T, typename U, typename = void>
         static constexpr bool IsCopyAssignable = false;
-        template<typename T, typename U>
-        static constexpr bool IsCopyAssignable<T, U, AZStd::void_t<decltype(AZStd::declval<T>() = AZStd::declval<U>())>> = true;
 
         template<class T>
         static bool Set(BehaviorValueParameter& param, T&& result, bool IsValueCopy)
@@ -2402,6 +2400,9 @@ namespace AZ
         }
     };
 
+    template<typename T, typename U>
+    constexpr bool SetResult::IsCopyAssignable<T, U, AZStd::void_t<decltype(AZStd::declval<T>() = AZStd::declval<U>())>> = true;
+
     AZ_FORCE_INLINE BehaviorValueParameter& BehaviorValueParameter::operator=(BehaviorValueParameter&& other)
     {
         *static_cast<BehaviorParameter*>(this) = AZStd::move(static_cast<BehaviorParameter&&>(other));

+ 21 - 8
Code/Framework/AzCore/AzCore/RTTI/RTTI.h

@@ -977,26 +977,32 @@ namespace AZ
     {
         return AzGenericTypeInfo::Uuid<U>();
     }
-    
+
+    #if defined(AZ_COMPILER_MSVC)
+    // There is a bug with the MSVC compiler when using the 'auto' keyword here. It appears that MSVC is unable to distinguish between a template
+    // template argument with a type variadic pack vs a template template argument with a non-type auto variadic pack. 
     template<template<AZStd::size_t...> class U, typename = void>
+    #else
+    template<template<auto...> class U, typename = void>
+    #endif // defined(AZ_COMPILER_MSVC)
     inline const AZ::TypeId& RttiTypeId()
     {
         return AzGenericTypeInfo::Uuid<U>();
     }
     
-    template<template<typename, AZStd::size_t> class U, typename = void>
+    template<template<typename, auto> class U, typename = void>
     inline const AZ::TypeId& RttiTypeId()
     {
         return AzGenericTypeInfo::Uuid<U>();
     }
     
-    template<template<typename, typename, AZStd::size_t> class U, typename = void>
+    template<template<typename, typename, auto> class U, typename = void>
     inline const AZ::TypeId& RttiTypeId()
     {
         return AzGenericTypeInfo::Uuid<U>();
     }
     
-    template<template<typename, typename, typename, AZStd::size_t> class U, typename = void>
+    template<template<typename, typename, typename, auto> class U, typename = void>
     inline const AZ::TypeId& RttiTypeId()
     {
         return AzGenericTypeInfo::Uuid<U>();
@@ -1027,15 +1033,22 @@ namespace AZ
     }
 
     // Returns true if the type is contained, otherwise false. Safe to call for type not supporting AZRtti (returns false unless type fully match).
+
+#if defined(AZ_COMPILER_MSVC)
+    // There is a bug with the MSVC compiler when using the 'auto' keyword here. It appears that MSVC is unable to distinguish between a template
+    // template argument with a type variadic pack vs a template template argument with a non-type auto variadic pack. 
     template<template<AZStd::size_t...> class T, class U>
-    inline bool     RttiIsTypeOf(const U&)
+#else
+    template<template<auto...> class T, class U>
+#endif // defined(AZ_COMPILER_MSVC)
+    inline bool RttiIsTypeOf(const U&)
     {
         using CheckType = typename AZ::Internal::RttiRemoveQualifiers<U>::type;
         return AzGenericTypeInfo::Uuid<T>() == RttiTypeId<CheckType, AZ::GenericTypeIdTag>();
     }
 
     // Returns true if the type is contained, otherwise false. Safe to call for type not supporting AZRtti (returns false unless type fully match).
-    template<template<typename, AZStd::size_t> class T, class U>
+    template<template<typename, auto> class T, class U>
     inline bool     RttiIsTypeOf(const U&)
     {
         using CheckType = typename AZ::Internal::RttiRemoveQualifiers<U>::type;
@@ -1043,7 +1056,7 @@ namespace AZ
     }
 
     // Returns true if the type is contained, otherwise false.Safe to call for type not supporting AZRtti(returns false unless type fully match).
-    template<template<typename, typename, AZStd::size_t> class T, class U>
+    template<template<typename, typename, auto> class T, class U>
     inline bool     RttiIsTypeOf(const U&)
     {
         using CheckType = typename AZ::Internal::RttiRemoveQualifiers<U>::type;
@@ -1051,7 +1064,7 @@ namespace AZ
     }
 
     // Returns true if the type is contained, otherwise false.Safe to call for type not supporting AZRtti(returns false unless type fully match).
-    template<template<typename, typename, typename, AZStd::size_t> class T, class U>
+    template<template<typename, typename, typename, auto> class T, class U>
     inline bool     RttiIsTypeOf(const U&)
     {
         using CheckType = typename AZ::Internal::RttiRemoveQualifiers<U>::type;

+ 24 - 12
Code/Framework/AzCore/AzCore/RTTI/TypeInfo.h

@@ -148,11 +148,18 @@ namespace AZ
     {
         /// Needs to match declared parameter type.
         template <template <typename...> class> constexpr bool false_v1 = false;
-        template <template <AZStd::size_t...> class> constexpr bool false_v2 = false;
-        template <template <typename, AZStd::size_t> class> constexpr bool false_v3 = false;
-        template <template <typename, typename, AZStd::size_t> class> constexpr bool false_v4 = false;
-        template <template <typename, typename, typename, AZStd::size_t> class> constexpr bool false_v5 = false;
-        template <template <typename, AZStd::size_t, typename> class> constexpr bool false_v6 = false;
+#if defined(AZ_COMPILER_MSVC)
+        // There is a bug with the MSVC compiler when using the 'auto' keyword here. It appears that MSVC is unable to distinguish between a template
+        // template argument with a type variadic pack vs a template template argument with a non-type auto variadic pack. 
+        template<template<AZStd::size_t...> class> constexpr bool false_v2 = false;
+#else
+        template<template<auto...> class> constexpr bool false_v2 = false;
+#endif // defined(AZ_COMPILER_MSVC)
+        template<template<typename, auto> class>
+        constexpr bool false_v3 = false;
+        template <template <typename, typename, auto> class> constexpr bool false_v4 = false;
+        template <template <typename, typename, typename, auto> class> constexpr bool false_v5 = false;
+        template <template <typename, auto, typename> class> constexpr bool false_v6 = false;
 
         template<typename T>
         inline const AZ::TypeId& Uuid()
@@ -167,8 +174,13 @@ namespace AZ
             static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull();
             return s_uuid;
         }
-
+#if defined(AZ_COMPILER_MSVC)
+        // There is a bug with the MSVC compiler when using the 'auto' keyword here. It appears that MSVC is unable to distinguish between a template
+        // template argument with a type variadic pack vs a template template argument with a non-type auto variadic pack. 
         template<template<AZStd::size_t...> class T>
+#else
+        template<template<auto...> class T>
+#endif // defined(AZ_COMPILER_MSVC)
         inline const AZ::TypeId& Uuid()
         {
             static_assert(false_v2<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
@@ -176,7 +188,8 @@ namespace AZ
             return s_uuid;
         }
 
-        template<template<typename, AZStd::size_t> class T>
+
+        template<template<typename, auto> class T>
         inline const AZ::TypeId& Uuid()
         {
             static_assert(false_v3<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
@@ -184,7 +197,7 @@ namespace AZ
             return s_uuid;
         }
 
-        template<template<typename, typename, AZStd::size_t> class T>
+        template<template<typename, typename, auto> class T>
         inline const AZ::TypeId& Uuid()
         {
             static_assert(false_v4<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
@@ -192,7 +205,7 @@ namespace AZ
             return s_uuid;
         }
 
-        template<template<typename, typename, typename, AZStd::size_t> class T>
+        template<template<typename, typename, typename, auto> class T>
         inline const AZ::TypeId& Uuid()
         {
             static_assert(false_v5<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
@@ -200,7 +213,7 @@ namespace AZ
             return s_uuid;
         }
 
-        template<template<typename, AZStd::size_t, typename> class T>
+        template<template<typename, auto, typename> class T>
         inline const AZ::TypeId& Uuid()
         {
             static_assert(false_v6<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
@@ -689,8 +702,7 @@ namespace AZ
 #define AZ_TYPE_INFO_INTERNAL_CLASS_VARARGS__UUID(Tag, A) AZ::Internal::AggregateTypes< A... >::template Uuid< Tag >()
 #define AZ_TYPE_INFO_INTERNAL_CLASS_VARARGS__NAME(A) AZ::Internal::AggregateTypes< A... >::TypeName(typeName, AZ_ARRAY_SIZE(typeName));
 
-// Once C++17 has been introduced size_t can be replaced with auto for all integer non-type arguments
-#define AZ_TYPE_INFO_INTERNAL_AUTO__TYPE AZStd::size_t
+#define AZ_TYPE_INFO_INTERNAL_AUTO__TYPE auto
 #define AZ_TYPE_INFO_INTERNAL_AUTO__ARG(A) A
 #define AZ_TYPE_INFO_INTERNAL_AUTO__UUID(Tag, A) AZ::Internal::GetTypeId< A , Tag >()
 #define AZ_TYPE_INFO_INTERNAL_AUTO__NAME(A) AZ::Internal::AzTypeInfoSafeCat(typeName, AZ_ARRAY_SIZE(typeName), AZ::Internal::GetTypeName< A >())

+ 1 - 1
Code/Framework/AzCore/AzCore/Script/ScriptContext.h

@@ -796,7 +796,7 @@ namespace AZ
         // Note: Always use l over context->NativeContext(), as require may be called from a thread.
         using RequireHook = AZStd::function<int(lua_State* lua, ScriptContext* context, const char* module)>;
 
-        using StackVariableAllocator = StackVariableAllocator;
+        using StackVariableAllocator = AZ::StackVariableAllocator;
         /// Stack temporary memory
         
         /**

+ 6 - 0
Code/Framework/AzCore/AzCore/Serialization/Json/RegistrationContext.h

@@ -69,7 +69,13 @@ namespace AZ
                 return HandlesTypeId(azrtti_typeid<T>(), overwriteExisting);
             }
 
+#if defined(AZ_COMPILER_MSVC)
+            // There is a bug with the MSVC compiler when using the 'auto' keyword here. It appears that MSVC is unable to distinguish between a template
+            // template argument with a type variadic pack vs a template template argument with a non-type auto variadic pack. 
             template<template<AZStd::size_t...> class T>
+#else
+            template<template<auto...> class T>
+#endif // defined(AZ_COMPILER_MSVC)
             SerializerBuilder* HandlesType(bool overwriteExisting = false)
             {
                 return HandlesTypeId(azrtti_typeid<T>(), overwriteExisting);

+ 2 - 9
Code/Framework/AzCore/AzCore/UnitTest/TestTypes.h

@@ -17,16 +17,9 @@
 
 #if defined(HAVE_BENCHMARK)
 
-#if defined(AZ_COMPILER_CLANG)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-#endif // clang
-
+AZ_PUSH_DISABLE_WARNING(, "-Wdeprecated-declarations", "-Wdeprecated-declarations")
 #include <benchmark/benchmark.h>
-
-#if defined(AZ_COMPILER_CLANG)
-#pragma clang diagnostic pop
-#endif // clang
+AZ_POP_DISABLE_WARNING
 
 #endif // HAVE_BENCHMARK
 

+ 1 - 0
Code/Framework/AzCore/AzCore/azcore_files.cmake

@@ -9,6 +9,7 @@
 set(FILES
     base.h
     Docs.h
+    variadic.h
     Platform.cpp
     Platform.h
     PlatformDef.h

+ 1 - 60
Code/Framework/AzCore/AzCore/base.h

@@ -7,6 +7,7 @@
  */
 #pragma once
 
+#include <AzCore/variadic.h>
 #include <AzCore/PlatformDef.h> ///< Platform/compiler specific defines
 #include <AzCore/base_Platform.h>
 
@@ -135,66 +136,6 @@
 
 #define AZ_INVALID_POINTER  reinterpret_cast<void*>(0x0badf00dul)
 
-// Variadic MACROS util functions
-
-/**
- * AZ_VA_NUM_ARGS
- * counts number of parameters (up to 10).
- * example. AZ_VA_NUM_ARGS(x,y,z) -> expands to 3
- */
-#ifndef AZ_VA_NUM_ARGS
-
-#   define AZ_VA_HAS_ARGS(...) ""#__VA_ARGS__[0] != 0
-
-// we add the zero to avoid the case when we require at least 1 param at the end...
-#   define AZ_VA_NUM_ARGS(...) AZ_VA_NUM_ARGS_IMPL_((__VA_ARGS__, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0))
-#   define AZ_VA_NUM_ARGS_IMPL_(tuple) AZ_VA_NUM_ARGS_IMPL tuple
-#   define AZ_VA_NUM_ARGS_IMPL(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, N, ...) N
-// Expands a macro and calls a different macro based on the number of arguments.
-//
-// Example: We need to specialize a macro for 1 and 2 arguments
-// #define AZ_MY_MACRO(...)   AZ_MACRO_SPECIALIZE(AZ_MY_MACRO_,AZ_VA_NUM_ARGS(__VA_ARGS__),(__VA_ARGS__))
-//
-// #define AZ_MY_MACRO_1(_1)    /* code for 1 param */
-// #define AZ_MY_MACRO_2(_1,_2) /* code for 2 params */
-// ... etc.
-//
-//
-// We have 3 levels of macro expansion...
-#   define AZ_MACRO_SPECIALIZE_II(MACRO_NAME, NPARAMS, PARAMS)    MACRO_NAME##NPARAMS PARAMS
-#   define AZ_MACRO_SPECIALIZE_I(MACRO_NAME, NPARAMS, PARAMS)     AZ_MACRO_SPECIALIZE_II(MACRO_NAME, NPARAMS, PARAMS)
-#   define AZ_MACRO_SPECIALIZE(MACRO_NAME, NPARAMS, PARAMS)       AZ_MACRO_SPECIALIZE_I(MACRO_NAME, NPARAMS, PARAMS)
-
-#endif // AZ_VA_NUM_ARGS
-
-
-// Out of all supported compilers, mwerks is the only one
-// that requires variadic macros to have at least 1 param.
-// This is a pain they we use macros to call functions (with no params).
-
-// we implement functions for up to 10 params
-#define AZ_FUNCTION_CALL_1(_1)                                          _1()
-#define AZ_FUNCTION_CALL_2(_1, _2)                                      _1(_2)
-#define AZ_FUNCTION_CALL_3(_1, _2, _3)                                  _1(_2, _3)
-#define AZ_FUNCTION_CALL_4(_1, _2, _3, _4)                              _1(_2, _3, _4)
-#define AZ_FUNCTION_CALL_5(_1, _2, _3, _4, _5)                          _1(_2, _3, _4, _5)
-#define AZ_FUNCTION_CALL_6(_1, _2, _3, _4, _5, _6)                      _1(_2, _3, _4, _5, _6)
-#define AZ_FUNCTION_CALL_7(_1, _2, _3, _4, _5, _6, _7)                  _1(_2, _3, _4, _5, _6, _7)
-#define AZ_FUNCTION_CALL_8(_1, _2, _3, _4, _5, _6, _7, _8)              _1(_2, _3, _4, _5, _6, _7, _8)
-#define AZ_FUNCTION_CALL_9(_1, _2, _3, _4, _5, _6, _7, _8, _9)          _1(_2, _3, _4, _5, _6, _7, _8, _9)
-#define AZ_FUNCTION_CALL_10(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10)    _1(_2, _3, _4, _5, _6, _7, _8, _9, _10)
-
-// We require at least 1 param FunctionName
-#define AZ_FUNCTION_CALL(...)           AZ_MACRO_SPECIALIZE(AZ_FUNCTION_CALL_, AZ_VA_NUM_ARGS(__VA_ARGS__), (__VA_ARGS__))
-
-
-
-
-
-// Based on boost macro expansion fix...
-#define AZ_PREVENT_MACRO_SUBSTITUTION
-
-
 //////////////////////////////////////////////////////////////////////////
 
 #include <cstddef> // the macros NULL and offsetof as well as the types ptrdiff_t, wchar_t, and size_t.

+ 1 - 0
Code/Framework/AzCore/AzCore/std/containers/compressed_pair.h

@@ -8,6 +8,7 @@
 #pragma once
 
 #include <AzCore/std/utils.h>
+#include <AzCore/std/typetraits/is_same.h>
 #include <AzCore/std/typetraits/is_constructible.h>
 #include <AzCore/std/typetraits/remove_cvref.h>
 

+ 1 - 1
Code/Framework/AzCore/AzCore/std/containers/fixed_vector.h

@@ -253,7 +253,7 @@ namespace AZStd::Internal
         }
 
         template <typename U, typename = enable_if_t<is_convertible_v<U, T>>>
-        fixed_non_trivial_storage(AZStd::initializer_list<U> ilist) noexcept(noexcept(emplace_back(AZStd::declval<U>())))
+        fixed_non_trivial_storage(AZStd::initializer_list<U> ilist) noexcept(noexcept(this->emplace_back(AZStd::declval<U>())))
         {
             AZSTD_CONTAINER_ASSERT(ilist.size() <= capacity(), "Initializer list cannot be larger than storage capacity");
             for (const U& element : ilist)

+ 1 - 1
Code/Framework/AzCore/AzCore/std/containers/map.h

@@ -79,7 +79,7 @@ namespace AZStd
         typedef typename tree_type::const_reverse_iterator      const_reverse_iterator;
         
         using node_type = map_node_handle<map_node_traits<key_type, mapped_type, allocator_type, typename tree_type::node_type, typename tree_type::node_deleter>>;
-        using insert_return_type = insert_return_type<iterator, node_type>;
+        using insert_return_type = AZStd::AssociativeInternal::insert_return_type<iterator, node_type>;
 
         AZ_FORCE_INLINE explicit map(const Compare& comp = Compare(), const Allocator& alloc = Allocator())
             : m_tree(comp, alloc) {}

+ 4 - 3
Code/Framework/AzCore/AzCore/std/containers/node_handle.h

@@ -123,7 +123,8 @@ namespace AZStd
                 }
             }
 
-            friend void swap(node_handle& lhs, node_handle& rhs);
+            template <typename SwapNodeTraits, template <typename, typename> class SwapMapOrSetNodeHandleBase> 
+                friend void swap(node_handle<SwapNodeTraits, SwapMapOrSetNodeHandleBase>& lhs, node_handle<SwapNodeTraits, SwapMapOrSetNodeHandleBase>& rhs);
 
         private:
             node_handle(node_pointer_type node, const allocator_type& allocator)
@@ -152,8 +153,8 @@ namespace AZStd
             optional<allocator_type> m_allocator;
         };
 
-        template <typename NodeTraits, template <typename, typename> class MapOrSetNodeHandleBase>
-        void swap(node_handle<NodeTraits, MapOrSetNodeHandleBase>& lhs, node_handle<NodeTraits, MapOrSetNodeHandleBase>& rhs)
+        template <typename SwapNodeTraits, template <typename, typename> class SwapMapOrSetNodeHandleBase>
+        void swap(node_handle<SwapNodeTraits, SwapMapOrSetNodeHandleBase>& lhs, node_handle<SwapNodeTraits, SwapMapOrSetNodeHandleBase>& rhs)
         {
             lhs.swap(rhs);
         }

+ 1 - 1
Code/Framework/AzCore/AzCore/std/containers/set.h

@@ -68,7 +68,7 @@ namespace AZStd
         typedef typename tree_type::const_reverse_iterator      const_reverse_iterator;
 
         using node_type = set_node_handle<set_node_traits<value_type, allocator_type, typename tree_type::node_type, typename tree_type::node_deleter>>;
-        using insert_return_type = insert_return_type<iterator, node_type>;
+        using insert_return_type = AZStd::AssociativeInternal::insert_return_type<iterator, node_type>;
 
         AZ_FORCE_INLINE explicit set(const Compare& comp = Compare(), const Allocator& alloc = Allocator())
             : m_tree(comp, alloc) {}

+ 1 - 1
Code/Framework/AzCore/AzCore/std/containers/unordered_map.h

@@ -102,7 +102,7 @@ namespace AZStd
         typedef typename base_type::pair_iter_bool              pair_iter_bool;
 
         using node_type = map_node_handle<map_node_traits<key_type, mapped_type, allocator_type, typename base_type::list_node_type, typename base_type::node_deleter>>;
-        using insert_return_type = insert_return_type<iterator, node_type>;
+        using insert_return_type = AZStd::AssociativeInternal::insert_return_type<iterator, node_type>;
 
         AZ_FORCE_INLINE unordered_map()
             : base_type(hasher(), key_eq(), allocator_type()) {}

+ 1 - 1
Code/Framework/AzCore/AzCore/std/containers/unordered_set.h

@@ -87,7 +87,7 @@ namespace AZStd
         typedef typename base_type::const_local_iterator        const_local_iterator;
 
         using node_type = set_node_handle<set_node_traits<value_type, allocator_type, typename base_type::list_node_type, typename base_type::node_deleter>>;
-        using insert_return_type = insert_return_type<iterator, node_type>;
+        using insert_return_type = AZStd::AssociativeInternal::insert_return_type<iterator, node_type>;
 
         AZ_FORCE_INLINE unordered_set()
             : base_type(hasher(), key_eq(), allocator_type()) {}

+ 2 - 2
Code/Framework/AzCore/AzCore/std/function/function_base.h

@@ -279,11 +279,11 @@ namespace AZStd
                             reinterpret_cast<functor_type*>(&in_buffer.data);
                         if (op == clone_functor_tag)
                         {
-                            new ((void*)&out_buffer.data)functor_type(*in_functor);
+                            AZStd::construct_at(reinterpret_cast<functor_type*>(&out_buffer), functor_type(*in_functor));
                         }
                         else if (op == move_functor_tag)
                         {
-                            new ((void*)&out_buffer.data)functor_type(AZStd::move(*in_functor));
+                            AZStd::construct_at(reinterpret_cast<functor_type*>(&out_buffer), functor_type(AZStd::move(*in_functor)));
                             // Casting via union to get around compiler warnings (strict type on GCC, unused variable on MSVC)
                             union
                             {

+ 1 - 1
Code/Framework/AzCore/AzCore/std/function/function_template.h

@@ -291,7 +291,7 @@ namespace AZStd
                 assign_functor(FunctionObj&& f, function_buffer& functor, AZStd::true_type)
                 {
                     using RawFunctorObjType = AZStd::decay_t<FunctionObj>;
-                    new ((void*)&functor.data)RawFunctorObjType(AZStd::forward<FunctionObj>(f));
+                    AZStd::construct_at(reinterpret_cast<RawFunctorObjType*>(&functor), RawFunctorObjType(AZStd::forward<FunctionObj>(f)));
                 }
                 template<typename FunctionObj, typename Allocator>
                 void

+ 1 - 0
Code/Framework/AzCore/AzCore/std/function/invoke.h

@@ -8,6 +8,7 @@
 
 #pragma once
 
+#include <AzCore/std/typetraits/typetraits.h>
 #include <AzCore/std/typetraits/invoke_traits.h>
 
 namespace AZStd

+ 15 - 5
Code/Framework/AzCore/AzCore/std/string/fixed_string.inl

@@ -30,9 +30,8 @@ namespace AZStd
     // #3
     template<class Element, size_t MaxElementCount, class Traits>
     inline constexpr basic_fixed_string<Element, MaxElementCount, Traits>::basic_fixed_string(const basic_fixed_string& rhs,
-        size_type rhsOffset)
+        size_type rhsOffset) : basic_fixed_string(rhs, rhsOffset, npos)
     {   // construct from rhs [rhsOffset, npos)
-        assign(rhs, rhsOffset, npos);
     }
 
     // #3
@@ -40,7 +39,15 @@ namespace AZStd
     inline constexpr basic_fixed_string<Element, MaxElementCount, Traits>::basic_fixed_string(const basic_fixed_string& rhs,
         size_type rhsOffset, size_type count)
     {   // construct from rhs [rhsOffset, rhsOffset + count)
-        assign(rhs, rhsOffset, count);
+        AZSTD_CONTAINER_ASSERT(rhs.size() >= rhsOffset, "Invalid offset");
+        size_type num = AZStd::min(count, rhs.size() - rhsOffset);
+
+        // make room and assign new stuff
+        pointer data = m_buffer;
+        const_pointer rhsData = rhs.m_buffer;
+        Traits::copy(data, rhsData + rhsOffset, num);
+        m_size = static_cast<internal_size_type>(num);
+        Traits::assign(data[num], Element()); // terminate
     }
 
     // #4
@@ -68,15 +75,18 @@ namespace AZStd
     // #7
     template<class Element, size_t MaxElementCount, class Traits>
     inline constexpr basic_fixed_string<Element, MaxElementCount, Traits>::basic_fixed_string(const basic_fixed_string& rhs)
+      : basic_fixed_string(rhs, size_type(0), npos)
     {
-        assign(rhs, size_type(0), npos);
     }
 
     // #8
     template<class Element, size_t MaxElementCount, class Traits>
     inline constexpr basic_fixed_string<Element, MaxElementCount, Traits>::basic_fixed_string(basic_fixed_string&& rhs)
     {
-        assign(AZStd::move(rhs));
+        Traits::copy(m_buffer, rhs.m_buffer, rhs.size() + 1);
+        m_size = rhs.m_size;
+        rhs.m_size = 0;
+        Traits::assign(rhs.m_buffer[0], Element{});
     }
 
     // #9

+ 5 - 3
Code/Framework/AzCore/AzCore/std/string/string.h

@@ -18,6 +18,8 @@
 #include <AzCore/std/allocator.h>
 #include <AzCore/std/allocator_traits.h>
 #include <AzCore/std/algorithm.h>
+#include <AzCore/std/typetraits/alignment_of.h>
+#include <AzCore/std/typetraits/is_convertible.h>
 #include <AzCore/std/typetraits/is_integral.h>
 
 #include <AzCore/std/string/string_view.h>
@@ -1483,11 +1485,11 @@ namespace AZStd
             }
         };
 
-        // Clang supports compile-time check for printf-like signatures
+        // Clang/GCC supports compile-time check for printf-like signatures
         // On MSVC, *only* if /analyze flag is enabled(defines _PREFAST_) we can also do a compile-time check
         // For not affecting final release binary size, we don't use the templated version on Release configuration either
-#if AZ_COMPILER_CLANG || defined(_PREFAST_) || defined(_RELEASE)
-#    if AZ_COMPILER_CLANG
+#if AZ_COMPILER_CLANG || AZ_COMPILER_GCC || defined(_PREFAST_) || defined(_RELEASE)
+#    if AZ_COMPILER_CLANG || AZ_COMPILER_GCC
 #        define FORMAT_FUNC      __attribute__((format(printf, 1, 2)))
 #        define FORMAT_FUNC_ARG
 #    elif AZ_COMPILER_MSVC

+ 88 - 22
Code/Framework/AzCore/AzCore/std/string/string_view.h

@@ -308,34 +308,71 @@ namespace AZStd
         }
         static constexpr bool eq(char_type left, char_type right) noexcept { return left == right; }
         static constexpr bool lt(char_type left, char_type right) noexcept { return left < right; }
-        static constexpr int compare(const char_type* s1, const char_type* s2, size_t count) noexcept
+        static constexpr int compare(const char_type* s1, const char_type* s2, size_t count) noexcept 
+        { 
+            // In GCC versions prior to major version 10, __builtin_memcmp fails in valid checks in constexpr evaluation 
+#if !defined(AZ_COMPILER_GCC) || AZ_COMPILER_GCC >= 100000 
+            if constexpr (AZStd::is_same_v<char_type, char>) 
+            { 
+                return __builtin_memcmp(s1, s2, count); 
+            } 
+            else if constexpr (AZStd::is_same_v<char_type, wchar_t>) 
+            { 
+                return __builtin_wmemcmp(s1, s2, count); 
+            } else 
+#endif 
+            { 
+                if (az_builtin_is_constant_evaluated()) 
+                { 
+                    for (; count; --count, ++s1, ++s2) 
+                    {
+                        if (lt(*s1, *s2)) 
+                        { 
+                            return -1; 
+                        } 
+                        else if (lt(*s2, *s1)) 
+                        { 
+                            return 1; 
+                        } 
+                    } 
+                    return 0; 
+                } 
+                else 
+                { 
+                    return ::memcmp(s1, s2, count * sizeof(char_type)); 
+                } 
+            } 
+        }
+
+        static constexpr size_t length(const char_type* s) noexcept
         {
+            // For GCC versions less than 10, __builtin_strlen and __builtin_wcslen is not supported as const expressions
+            // so for that case it will need to manually count the characters (at compile time) instead
+#if defined(AZ_COMPILER_GCC) && AZ_COMPILER_GCC < 100000
+
             if constexpr (AZStd::is_same_v<char_type, char>)
             {
-                return __builtin_memcmp(s1, s2, count);
+                if (!az_builtin_is_constant_evaluated())
+                {
+                    return strlen(s);
+                }
             }
             else if constexpr (AZStd::is_same_v<char_type, wchar_t>)
             {
-                return __builtin_wmemcmp(s1, s2, count);
-            }
-            else
-            {
-                for (; count; --count, ++s1, ++s2)
+                if (!az_builtin_is_constant_evaluated())
                 {
-                    if (lt(*s1, *s2))
-                    {
-                        return -1;
-                    }
-                    else if (lt(*s2, *s1))
-                    {
-                        return 1;
-                    }
+                    return wcslen(s);
                 }
-                return 0;
             }
-        }
-        static constexpr size_t length(const char_type* s) noexcept
-        {
+
+            size_t strLength{};
+            for (; *s; ++s, ++strLength)
+            {
+                ;
+            }
+            return strLength;
+#else
+
             if constexpr (AZStd::is_same_v<char_type, char>)
             {
                 return __builtin_strlen(s);
@@ -353,9 +390,39 @@ namespace AZStd
                 }
                 return strLength;
             }
+#endif // defined(AZ_COMPILER_GCC) && AZ_COMPILER_GCC < 100000
         }
+
         static constexpr const char_type* find(const char_type* s, size_t count, const char_type& ch) noexcept
         {
+            // For GCC versions less than 10, __builtin_char_memchr and __builtin_wmemchr is not supported, and 
+            // __builtin_memchr is not supported as const expressions. In those cases we will manually locate and 
+            // return the pointer to 's' (at compile time)
+#if defined(AZ_COMPILER_GCC) && AZ_COMPILER_GCC < 100000
+            if constexpr (AZStd::is_same_v<char_type, char>)
+            {
+                if (!az_builtin_is_constant_evaluated())
+                {
+                    return static_cast<const char_type*>(__builtin_memchr(s, ch, count));
+                }
+            }
+            else if constexpr (AZStd::is_same_v<char_type, wchar_t>)
+            {
+                if (!az_builtin_is_constant_evaluated())
+                {
+                    return wmemchr(s, ch, count);
+                }
+            }
+
+            for (; count; --count, ++s)
+            {
+                if (eq(*s, ch))
+                {
+                    return s;
+                }
+            }
+            return nullptr;
+#else
             if constexpr (AZStd::is_same_v<char_type, char>)
             {
                 return __builtin_char_memchr(s, ch, count);
@@ -363,7 +430,6 @@ namespace AZStd
             else if constexpr (AZStd::is_same_v<char_type, wchar_t>)
             {
                 return __builtin_wmemchr(s, ch, count);
-
             }
             else
             {
@@ -376,6 +442,7 @@ namespace AZStd
                 }
                 return nullptr;
             }
+#endif 
         }
         static constexpr char_type* move(char_type* dest, const char_type* src, size_t count) noexcept
         {
@@ -438,8 +505,6 @@ namespace AZStd
         }
         static constexpr char_type* copy(char_type* dest, const char_type* src, size_t count) noexcept
         {
-            AZ_Assert(dest != nullptr && src != nullptr, "Invalid input!");
-
         #if az_has_builtin_memcpy
             __builtin_memcpy(dest, src, count * sizeof(char_type));
         #else
@@ -455,6 +520,7 @@ namespace AZStd
                 }
                 else
                 {
+                    AZ_Assert(dest1 != nullptr && src1 != nullptr, "Invalid input!");
                     ::memcpy(dest1, src1, count1 * sizeof(char_type));
                 }
                 return dest1;

+ 1 - 0
Code/Framework/AzCore/AzCore/std/typetraits/conjunction.h

@@ -7,6 +7,7 @@
  */
 #pragma once
 
+#include <AzCore/std/typetraits/typetraits.h>
 #include <AzCore/std/typetraits/conditional.h>
 #include <AzCore/std/typetraits/integral_constant.h> // for true_type
 

+ 3 - 4
Code/Framework/AzCore/AzCore/std/typetraits/intrinsics.h

@@ -58,14 +58,13 @@
 #   define AZSTD_IS_ABSTRACT(T) __is_abstract(T)
 #   define AZSTD_IS_BASE_OF(T, U) (__is_base_of(T, U) && !is_same<T, U>::value)
 #   define AZSTD_IS_CLASS(T) __is_class(T)
-//  This one doesn't quite always do the right thing:
-#   define AZSTD_IS_CONVERTIBLE(_From, _To) __is_convertible_to(_From, _To)
 #   define AZSTD_IS_ENUM(T) __is_enum(T)
 //  This one doesn't quite always do the right thing:
+#   define AZSTD_IS_CONVERTIBLE(_From, _To) __is_convertible_to(_From, _To)
 //  #   define AZSTD_IS_POLYMORPHIC(T) __is_polymorphic(T)
 #endif
 
-#if defined(AZ_COMPILER_CLANG)
+#if defined(AZ_COMPILER_CLANG) || defined(AZ_COMPILER_GCC)
 #   include <AzCore/std/typetraits/is_same.h>
 #   include <AzCore/std/typetraits/is_reference.h>
 #   include <AzCore/std/typetraits/is_volatile.h>
@@ -86,8 +85,8 @@
 #   define AZSTD_IS_ABSTRACT(T) __is_abstract(T)
 #   define AZSTD_IS_BASE_OF(T, U) (__is_base_of(T, U) && !is_same<T, U>::value)
 #   define AZSTD_IS_CLASS(T) __is_class(T)
-#   define AZSTD_IS_CONVERTIBLE(_From, _To) __is_convertible_to(_From, _To)
 #   define AZSTD_IS_ENUM(T) __is_enum(T)
+#   define AZSTD_IS_CONVERTIBLE(_From, _To) AZStd::is_convertible_v<_From, _To>
 #   define AZSTD_IS_POLYMORPHIC(T) __is_polymorphic(T)
 #endif
 

+ 64 - 0
Code/Framework/AzCore/AzCore/variadic.h

@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+#pragma once
+
+
+// Variadic MACROS util functions
+
+/**
+ * AZ_VA_NUM_ARGS
+ * counts number of parameters (up to 10).
+ * example. AZ_VA_NUM_ARGS(x,y,z) -> expands to 3
+ */
+#ifndef AZ_VA_NUM_ARGS
+
+#   define AZ_VA_HAS_ARGS(...) ""#__VA_ARGS__[0] != 0
+
+// we add the zero to avoid the case when we require at least 1 param at the end...
+#   define AZ_VA_NUM_ARGS(...) AZ_VA_NUM_ARGS_IMPL_((__VA_ARGS__, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0))
+#   define AZ_VA_NUM_ARGS_IMPL_(tuple) AZ_VA_NUM_ARGS_IMPL tuple
+#   define AZ_VA_NUM_ARGS_IMPL(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, N, ...) N
+// Expands a macro and calls a different macro based on the number of arguments.
+//
+// Example: We need to specialize a macro for 1 and 2 arguments
+// #define AZ_MY_MACRO(...)   AZ_MACRO_SPECIALIZE(AZ_MY_MACRO_,AZ_VA_NUM_ARGS(__VA_ARGS__),(__VA_ARGS__))
+//
+// #define AZ_MY_MACRO_1(_1)    /* code for 1 param */
+// #define AZ_MY_MACRO_2(_1,_2) /* code for 2 params */
+// ... etc.
+//
+//
+// We have 3 levels of macro expansion...
+#   define AZ_MACRO_SPECIALIZE_II(MACRO_NAME, NPARAMS, PARAMS)    MACRO_NAME##NPARAMS PARAMS
+#   define AZ_MACRO_SPECIALIZE_I(MACRO_NAME, NPARAMS, PARAMS)     AZ_MACRO_SPECIALIZE_II(MACRO_NAME, NPARAMS, PARAMS)
+#   define AZ_MACRO_SPECIALIZE(MACRO_NAME, NPARAMS, PARAMS)       AZ_MACRO_SPECIALIZE_I(MACRO_NAME, NPARAMS, PARAMS)
+
+#endif // AZ_VA_NUM_ARGS
+
+
+// Out of all supported compilers, mwerks is the only one
+// that requires variadic macros to have at least 1 param.
+// This is a pain they we use macros to call functions (with no params).
+
+// we implement functions for up to 10 params
+#define AZ_FUNCTION_CALL_1(_1)                                          _1()
+#define AZ_FUNCTION_CALL_2(_1, _2)                                      _1(_2)
+#define AZ_FUNCTION_CALL_3(_1, _2, _3)                                  _1(_2, _3)
+#define AZ_FUNCTION_CALL_4(_1, _2, _3, _4)                              _1(_2, _3, _4)
+#define AZ_FUNCTION_CALL_5(_1, _2, _3, _4, _5)                          _1(_2, _3, _4, _5)
+#define AZ_FUNCTION_CALL_6(_1, _2, _3, _4, _5, _6)                      _1(_2, _3, _4, _5, _6)
+#define AZ_FUNCTION_CALL_7(_1, _2, _3, _4, _5, _6, _7)                  _1(_2, _3, _4, _5, _6, _7)
+#define AZ_FUNCTION_CALL_8(_1, _2, _3, _4, _5, _6, _7, _8)              _1(_2, _3, _4, _5, _6, _7, _8)
+#define AZ_FUNCTION_CALL_9(_1, _2, _3, _4, _5, _6, _7, _8, _9)          _1(_2, _3, _4, _5, _6, _7, _8, _9)
+#define AZ_FUNCTION_CALL_10(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10)    _1(_2, _3, _4, _5, _6, _7, _8, _9, _10)
+
+// We require at least 1 param FunctionName
+#define AZ_FUNCTION_CALL(...)           AZ_MACRO_SPECIALIZE(AZ_FUNCTION_CALL_, AZ_VA_NUM_ARGS(__VA_ARGS__), (__VA_ARGS__))
+
+// Based on boost macro expansion fix...
+#define AZ_PREVENT_MACRO_SUBSTITUTION

+ 1 - 1
Code/Framework/AzCore/Platform/Common/Unimplemented/AzCore/Memory/OverrunDetectionAllocator_Unimplemented.h

@@ -23,7 +23,7 @@ namespace AZ
         public:
             virtual SystemInformation GetSystemInformation() override
             {
-                SystemInformation result;
+                SystemInformation result {0, 0};
                 return result;
             }
 

+ 2 - 1
Code/Framework/AzCore/Platform/Linux/platform_linux.cmake

@@ -16,6 +16,7 @@ set(LY_BUILD_DEPENDENCIES
     PRIVATE
         pthread
         3rdParty::unwind
-        dl
         atomic
+    PUBLIC
+        ${CMAKE_DL_LIBS}
 )

+ 28 - 28
Code/Framework/AzCore/Tests/AZStd/String.cpp

@@ -19,6 +19,7 @@
 #include <AzCore/std/string/regex.h>
 #include <AzCore/std/string/wildcard.h>
 #include <AzCore/std/string/fixed_string.h>
+#include <AzCore/std/typetraits/is_convertible.h>
 
 // we need this for AZ_TEST_FLOAT compare
 #include <cinttypes>
@@ -1458,34 +1459,33 @@ namespace UnitTest
 
         using ValidFormatArg = AZStd::string::_Format_Internal::ValidFormatArg;
 
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v1),  ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v2),  ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v3),  ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v4),  ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v5),  ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v6),  ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v7),  ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v8),  ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v9),  ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v10), ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v11), ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v12), ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v13), ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v14), ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v15), ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v16), ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v17), ValidFormatArg), "Should be valid format argument");
-        static_assert(AZSTD_IS_CONVERTIBLE(decltype(v18), ValidFormatArg), "Should be valid format argument");
-
-        static_assert(!AZSTD_IS_CONVERTIBLE(AZStd::string, ValidFormatArg), "AZStd::string shouldn't be a valid format argument");
-        static_assert(!AZSTD_IS_CONVERTIBLE(std::string, ValidFormatArg), "std::string shouldn't be a valid format argument");
-        static_assert(!AZSTD_IS_CONVERTIBLE(AZStd::wstring, ValidFormatArg), "AZStd::wstring shouldn't be a valid format argument");
-        static_assert(!AZSTD_IS_CONVERTIBLE(std::wstring, ValidFormatArg), "std::wstring shouldn't be a valid format argument");
-        static_assert(!AZSTD_IS_CONVERTIBLE(WrappedInt, ValidFormatArg), "WrappedInt shouldn't be a valid format argument");
-        static_assert(!AZSTD_IS_CONVERTIBLE(AZStd::string_view, ValidFormatArg), "AZStd::string_view shouldn't be a valid format argument");
-        static_assert(!AZSTD_IS_CONVERTIBLE(AZStd::wstring_view, ValidFormatArg), "AZStd::wstring_view shouldn't be a valid format argument");
-        static_assert(!AZSTD_IS_CONVERTIBLE(std::string_view, ValidFormatArg), "string_view shouldn't be a valid format argument");
-        static_assert(!AZSTD_IS_CONVERTIBLE(std::wstring_view, ValidFormatArg), "wstring_view shouldn't be a valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v1),  ValidFormatArg>, "Should be valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v2),  ValidFormatArg>, "Should be valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v3),  ValidFormatArg>, "Should be valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v4),  ValidFormatArg>, "Should be valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v5),  ValidFormatArg>, "Should be valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v7),  ValidFormatArg>, "Should be valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v8),  ValidFormatArg>, "Should be valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v9),  ValidFormatArg>, "Should be valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v10), ValidFormatArg>, "Should be valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v11), ValidFormatArg>, "Should be valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v12), ValidFormatArg>, "Should be valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v13), ValidFormatArg>, "Should be valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v14), ValidFormatArg>, "Should be valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v15), ValidFormatArg>, "Should be valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v16), ValidFormatArg>, "Should be valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v17), ValidFormatArg>, "Should be valid format argument");
+        static_assert(AZStd::is_convertible_v<decltype(v18), ValidFormatArg>, "Should be valid format argument");
+
+        static_assert(!AZStd::is_convertible_v<AZStd::string, ValidFormatArg>, "AZStd::string shouldn't be a valid format argument");
+        static_assert(!AZStd::is_convertible_v<std::string, ValidFormatArg>, "std::string shouldn't be a valid format argument");
+        static_assert(!AZStd::is_convertible_v<AZStd::wstring, ValidFormatArg>, "AZStd::wstring shouldn't be a valid format argument");
+        static_assert(!AZStd::is_convertible_v<std::wstring, ValidFormatArg>, "std::wstring shouldn't be a valid format argument");
+        static_assert(!AZStd::is_convertible_v<WrappedInt, ValidFormatArg>, "WrappedInt shouldn't be a valid format argument");
+        static_assert(!AZStd::is_convertible_v<AZStd::string_view, ValidFormatArg>, "AZStd::string_view shouldn't be a valid format argument");
+        static_assert(!AZStd::is_convertible_v<AZStd::wstring_view, ValidFormatArg>, "AZStd::wstring_view shouldn't be a valid format argument");
+        static_assert(!AZStd::is_convertible_v<std::string_view, ValidFormatArg>, "string_view shouldn't be a valid format argument");
+        static_assert(!AZStd::is_convertible_v<std::wstring_view, ValidFormatArg>, "wstring_view shouldn't be a valid format argument");
     }
 
     TEST_F(String, StringViewPrintf)

+ 15 - 15
Code/Framework/AzCore/Tests/EBus.cpp

@@ -373,8 +373,8 @@ namespace UnitTest
         : public AllocatorsFixture
     {
     public:
-        using Handler = Handler<Bus>;
-        using MultiHandlerById = MultiHandlerById<Bus>;
+        using BusHandler = Handler<Bus>;
+        using BusMultiHandlerById = MultiHandlerById<Bus>;
 
         EBusTestAll()
         {
@@ -402,7 +402,7 @@ namespace UnitTest
             {
                 for (int handler = 0; handler < numHandlersPerAddress; ++handler)
                 {
-                    m_handlers[address].emplace_back(aznew Handler(address, connectOnConstruct));
+                    m_handlers[address].emplace_back(aznew BusHandler(address, connectOnConstruct));
                     ++m_numHandlers;
                 }
             }
@@ -429,7 +429,7 @@ namespace UnitTest
         {
             for (const auto& handlerPair : m_handlers)
             {
-                for (Handler* handler : handlerPair.second)
+                for (BusHandler* handler : handlerPair.second)
                 {
                     delete handler;
                 }
@@ -452,7 +452,7 @@ namespace UnitTest
             if (AddressesAreOrdered())
             {
                 // Collect the first handler from each address
-                using PairType = AZStd::pair<int, Handler*>;
+                using PairType = AZStd::pair<int, BusHandler*>;
                 AZStd::vector<PairType> sortedHandlers;
                 for (const auto& handlerPair : m_handlers)
                 {
@@ -495,7 +495,7 @@ namespace UnitTest
         {
             auto& handlers = m_handlers[id];
 
-            for (Handler* handler : handlers)
+            for (BusHandler* handler : handlers)
             {
                 EXPECT_EQ(expected, handler->m_eventCalls);
             }
@@ -505,11 +505,11 @@ namespace UnitTest
             {
                 // Sort the handlers the same way we expect the bus to sort them
                 auto sortedHandlers = handlers;
-                AZStd::sort(sortedHandlers.begin(), sortedHandlers.end(), AZStd::bind(&Handler::Compare, AZStd::placeholders::_1, AZStd::placeholders::_2));
+                AZStd::sort(sortedHandlers.begin(), sortedHandlers.end(), AZStd::bind(&BusHandler::Compare, AZStd::placeholders::_1, AZStd::placeholders::_2));
 
                 // Iterate over the list, and validate that they were called in the correct order
                 unsigned int lastExecuted = 0;
-                for (const Handler* handler : sortedHandlers)
+                for (const BusHandler* handler : sortedHandlers)
                 {
                     if (lastExecuted > 0)
                     {
@@ -550,7 +550,7 @@ namespace UnitTest
         }
 
     protected:
-        AZStd::unordered_map<int, AZStd::vector<Handler*>> m_handlers;
+        AZStd::unordered_map<int, AZStd::vector<BusHandler*>> m_handlers;
         int m_numHandlers = 0;
     };
     TYPED_TEST_CASE(EBusTestAll, BusTypesAll);
@@ -578,7 +578,7 @@ namespace UnitTest
     TYPED_TEST(EBusTestAll, ConnectDisconnect)
     {
         using Bus = TypeParam;
-        using Handler = typename EBusTestAll<Bus>::Handler;
+        using Handler = typename EBusTestAll<Bus>::BusHandler;
 
         constexpr bool connectOnConstruct{ true };
         Handler meh(0, connectOnConstruct);
@@ -602,13 +602,13 @@ namespace UnitTest
     TYPED_TEST(EBusTestIdMultiHandlers, EnumerateHandlers_MultiHandler)
     {
         using Bus = TypeParam;
-        using MultiHandlerById = typename EBusTestAll<Bus>::MultiHandlerById;
+        using BusMultiHandlerById = typename EBusTestAll<Bus>::BusMultiHandlerById;
 
-        MultiHandlerById sourceMultiHandler{ 0, 1, 2 };
-        MultiHandlerById multiHandlerWithOverlappingIds{ 1, 3, 5 };
+        BusMultiHandlerById sourceMultiHandler{ 0, 1, 2 };
+        BusMultiHandlerById multiHandlerWithOverlappingIds{ 1, 3, 5 };
 
         // Test handlers' enumeration functionality
-        Bus::EnumerateHandlers([](typename MultiHandlerById::Interface* interfaceInst) -> bool
+        Bus::EnumerateHandlers([](typename BusMultiHandlerById::Interface* interfaceInst) -> bool
         {
             interfaceInst->OnEvent();
             return true;
@@ -618,7 +618,7 @@ namespace UnitTest
     TYPED_TEST(EBusTestId, FindFirstHandler)
     {
         using Bus = TypeParam;
-        using Handler = typename EBusTestAll<Bus>::Handler;
+        using Handler = typename EBusTestAll<Bus>::BusHandler;
         constexpr bool connectOnConstruct{ true };
         Handler meh0(0, connectOnConstruct);  /// <-- Bind to bus 0
         Handler meh1(1, connectOnConstruct);  /// <-- Bind to bus 1

+ 11 - 6
Code/Framework/AzCore/Tests/Serialization.cpp

@@ -4014,9 +4014,12 @@ TEST_F(SerializeBasicTest, BasicTypeTest_Succeed)
         };
     }
 } // namespace UnitTest
-AZ_TYPE_INFO_SPECIALIZE(UnitTest::EditTest::MyEditStruct3::EditEnum, "{4AF433C2-055E-4E34-921A-A7D16AB548CA}");
-AZ_TYPE_INFO_SPECIALIZE(UnitTest::EditTest::MyEditStruct3::EditEnumClass, "{4FEC2F0B-A599-4FCD-836B-89E066791793}");
 
+namespace AZ
+{
+    AZ_TYPE_INFO_SPECIALIZE(UnitTest::EditTest::MyEditStruct3::EditEnum, "{4AF433C2-055E-4E34-921A-A7D16AB548CA}");
+    AZ_TYPE_INFO_SPECIALIZE(UnitTest::EditTest::MyEditStruct3::EditEnumClass, "{4FEC2F0B-A599-4FCD-836B-89E066791793}");
+}
 
 namespace UnitTest
 {
@@ -7798,10 +7801,12 @@ namespace UnitTest
     };
 }
 
-AZ_TYPE_INFO_SPECIALIZE(UnitTest::TestUnscopedSerializationEnum, "{83383BFA-F6DA-4124-BE4F-2FAAB7C594E7}");
-AZ_TYPE_INFO_SPECIALIZE(UnitTest::TestScopedSerializationEnum, "{17341C5E-81C3-44CB-A40D-F97D49C2531D}");
-
-AZ_TYPE_INFO_SPECIALIZE(UnitTest::TestUnsignedEnum, "{0F91A5AE-DADA-4455-B158-8DB79D277495}");
+namespace AZ
+{
+    AZ_TYPE_INFO_SPECIALIZE(UnitTest::TestUnscopedSerializationEnum, "{83383BFA-F6DA-4124-BE4F-2FAAB7C594E7}");
+    AZ_TYPE_INFO_SPECIALIZE(UnitTest::TestScopedSerializationEnum, "{17341C5E-81C3-44CB-A40D-F97D49C2531D}");
+    AZ_TYPE_INFO_SPECIALIZE(UnitTest::TestUnsignedEnum, "{0F91A5AE-DADA-4455-B158-8DB79D277495}");
+}
 
 namespace UnitTest
 {

+ 1 - 1
Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpConnection.cpp

@@ -383,7 +383,7 @@ namespace AzNetworking
 
         if (compErr != CompressorError::Ok)
         {
-            AZLOG_ERROR("Decompress failed with error %d this will lead to data read errors!", compErr);
+            AZLOG_ERROR("Decompress failed with error %d this will lead to data read errors!", aznumeric_cast<int32_t>(compErr));
             return false;
         }
 

+ 1 - 1
Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpConnectionSet.cpp

@@ -35,7 +35,7 @@ namespace AzNetworking
 
     bool TcpConnectionSet::DeleteConnection(SocketFd socketFd)
     {
-        AZLOG(TcpConnectionSet, "Deleting Tcp connection by socketId (%u)", socketFd);
+        AZLOG(TcpConnectionSet, "Deleting Tcp connection by socketId (%u)", aznumeric_cast<int32_t>(socketFd));
         TcpConnection* connection = GetConnection(socketFd);
         if (connection == nullptr)
         {

+ 1 - 1
Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp

@@ -446,7 +446,7 @@ namespace AzNetworking
 
         if (compErr != CompressorError::Ok)
         {
-            AZLOG_ERROR("Decompress failed with error %d this will lead to data read errors!", compErr);
+            AZLOG_ERROR("Decompress failed with error %d this will lead to data read errors!", aznumeric_cast<int32_t>(compErr));
             return false;
         }
 

+ 0 - 2
Code/Framework/AzTest/AzTest/Platform/Linux/AzTest_Traits_Linux.h

@@ -15,8 +15,6 @@
 
 #define AZ_TRAIT_DISABLE_FAILED_NATIVE_WINDOWS_TESTS true
 #define AZ_TRAIT_DISABLE_FAILED_EMOTION_FX_TESTS true
-#define AZ_TRAIT_DISABLE_FAILED_DLL_TESTS true
-#define AZ_TRAIT_DISABLE_FAILED_MODULE_TESTS true
 #define AZ_TRAIT_DISABLE_FAILED_EMOTION_FX_EDITOR_TESTS true
 
 // Golden perline gradiant values for random seed 7878 for this platform

+ 0 - 1
Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Entries/AssetBrowserEntry.h

@@ -43,7 +43,6 @@ namespace AzToolsFramework
         {
             friend class AssetBrowserModel;
             friend class AssetBrowserFilterModel;
-            friend class AssetBrowserEntry;
             friend class RootAssetBrowserEntry;
             friend class FolderAssetBrowserEntry;
             friend class SourceAssetBrowserEntry;

+ 1 - 1
Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityHelpers.h

@@ -69,7 +69,7 @@ namespace AzToolsFramework
             {
                 return nullptr;
             }
-            return entity->FindComponent<ComponentType>();
+            return entity->template FindComponent<ComponentType>();
         }
     };
 

+ 1 - 1
Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp

@@ -3460,7 +3460,7 @@ namespace AzToolsFramework
                 static const AZ::u32 kPixelIndentationPerLevel = GetSliceHierarchyMenuIdentationPerLevel();
 
                 // Any asset that acts as a valid target for all selected slice-instance-owned entities can be shown.
-                QMenu* quickPushMenu = quickPushMenu = new QMenu(parent);
+                QMenu* quickPushMenu = new QMenu(parent);
 
                 bool setupMenu = false;
                 if (pushableChangesAvailable)

+ 1 - 1
Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/Thumbnail.h

@@ -139,7 +139,7 @@ namespace AZStd
     };
 
     template <>
-    struct AZStd::equal_to<AzToolsFramework::Thumbnailer::SharedThumbnailKey>
+    struct equal_to<AzToolsFramework::Thumbnailer::SharedThumbnailKey>
     {
         AZ_FORCE_INLINE bool operator()(const AzToolsFramework::Thumbnailer::SharedThumbnailKey& left, const AzToolsFramework::Thumbnailer::SharedThumbnailKey& right) const
         {

+ 0 - 1
Code/Framework/GridMate/Platform/Common/gridmate_msvc.cmake → Code/Framework/AzToolsFramework/Platform/Common/GCC/aztoolsframework_gcc.cmake

@@ -5,4 +5,3 @@
 # SPDX-License-Identifier: Apache-2.0 OR MIT
 #
 #
-

+ 0 - 1
Code/Framework/GridMate/CMakeLists.txt

@@ -18,7 +18,6 @@ ly_add_target(
         ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
     PLATFORM_INCLUDE_FILES
         ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
-        ${common_dir}/gridmate_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake
     INCLUDE_DIRECTORIES
         PUBLIC
             .

+ 2 - 2
Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp

@@ -1702,7 +1702,7 @@ CarrierThread::UpdateReceive()
 
                         if (compErr != CompressorError::Ok)
                         {
-                            AZ_Error("GridMate", compErr == CompressorError::Ok, "Decompress failed with error %d this will lead to data read errors!", compErr);
+                            AZ_Error("GridMate", compErr == CompressorError::Ok, "Decompress failed with error %d this will lead to data read errors!", aznumeric_cast<int32_t>(compErr));
                             conn->m_isBadPackets = true;
                             break;  /// stop processing this data
                         }
@@ -2136,7 +2136,7 @@ bool CarrierThread::SendDatagram(ThreadConnection* connection)
         {
             if (compErr != CompressorError::Ok)
             {
-                AZ_Error("GridMate", compErr == CompressorError::Ok, "Failed to compress chunk with error=%d.\n", static_cast<int>(compErr));
+                AZ_Error("GridMate", compErr == CompressorError::Ok, "Failed to compress chunk with error=%d.\n", aznumeric_cast<int32_t>(compErr));
             }
 
             // we can use writeBuffer directly because we already added the compression hint to indicate that this data is uncompressed

+ 2 - 0
Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.cpp

@@ -1455,7 +1455,9 @@ namespace GridMate
         ERR_load_SSL_strings();
         SSL_load_error_strings();
 
+        AZ_PUSH_DISABLE_WARNING(, "-Wdeprecated-declarations", "-Wdeprecated-declarations")
         m_sslContext = SSL_CTX_new(DTLSv1_2_method());
+        AZ_POP_DISABLE_WARNING
         if (m_sslContext == nullptr)
         {
             return EC_SECURE_CREATE;

+ 5 - 0
Code/Framework/GridMate/GridMate/Carrier/StreamSecureSocketDriver.cpp

@@ -47,7 +47,10 @@ namespace GridMate
     {
         if (s_initializeOpenSSLCount.fetch_sub(1) == 1)
         {
+            AZ_PUSH_DISABLE_WARNING(, "-Wdeprecated-declarations", "-Wdeprecated-declarations")
             ERR_remove_state(0);
+            AZ_POP_DISABLE_WARNING
+
             ERR_free_strings();
             EVP_cleanup();
             sk_SSL_COMP_free(SSL_COMP_get_compression_methods());
@@ -85,7 +88,9 @@ namespace GridMate
             {
                 return Driver::EC_SECURE_CREATE;
             }
+            AZ_PUSH_DISABLE_WARNING(, "-Wdeprecated-declarations", "-Wdeprecated-declarations")
             m_ctx = SSL_CTX_new(TLSv1_2_method());
+            AZ_POP_DISABLE_WARNING
             if (m_ctx == nullptr)
             {
                 return Driver::EC_SECURE_CREATE;

+ 1 - 1
Code/Legacy/CrySystem/IDebugCallStack.cpp

@@ -164,7 +164,7 @@ AZ_PUSH_DISABLE_WARNING(4996, "-Wunknown-warning-option")
 
     char s[1024];
     //! Use strftime to build a customized time string.
-    strftime(s, 128, "Logged at %#c\n", today);
+    strftime(s, 128, "Logged at %c\n", today);
     azstrcat(str, length, s);
     sprintf_s(s, "FileVersion: %s\n", sFileVersion);
     azstrcat(str, length, s);

+ 12 - 0
Code/Tools/ProjectManager/Platform/Common/GCC/projectmanager_gcc.cmake

@@ -0,0 +1,12 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(LY_COMPILE_OPTIONS
+    PUBLIC
+        -fexceptions # The macro PYBIND11_EMBEDDED_MODULE uses a try catch block
+)

+ 12 - 0
Code/Tools/PythonBindingsExample/source/Platform/Common/GCC/pythonbindingsexample_gcc.cmake

@@ -0,0 +1,12 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(LY_COMPILE_OPTIONS
+    PRIVATE
+        -fexceptions
+)

+ 50 - 43
Gems/AWSCore/Code/Include/Framework/AWSApiRequestJob.h

@@ -174,6 +174,9 @@ namespace AWSCore
         using IConfig = IAwsApiRequestJobConfig<RequestTraits>;
         using Config = AwsApiRequestJobConfig<RequestTraits>;
 
+        using OnSuccessFunction = AZStd::function<void(AwsApiRequestJob* job)>;
+        using OnFailureFunction = AZStd::function<void(AwsApiRequestJob* job)>;
+
         static Config* GetDefaultConfig()
         {
             static AwsApiJobConfigHolder<Config> s_configHolder{};
@@ -185,6 +188,28 @@ namespace AWSCore
         {
         }
 
+        AwsApiRequestJob(bool queueOnSuccess,
+                         OnSuccessFunction onSuccess,
+                         bool queueOnFailure,
+                         OnFailureFunction onFailure,
+                         bool queueDelete,
+                         IConfig* config = GetDefaultConfig()
+        ) : AwsApiClientJobType(false, config)
+          , m_queueOnSuccess{ queueOnSuccess }
+          , m_onSuccess{ onSuccess }
+          , m_queueOnFailure{ queueOnFailure }
+          , m_onFailure{ onFailure }
+          , m_queueDelete{ queueDelete }
+        {
+        }
+
+        AwsApiRequestJob(OnSuccessFunction onSuccess,
+                         OnFailureFunction onFailure,
+                         IConfig* config = GetDefaultConfig()
+        ) : AwsApiRequestJob(true, onSuccess, true, onFailure, true, config)
+        {
+        }
+
         RequestType request;
         ResultType result;
         ErrorType error;
@@ -209,6 +234,17 @@ namespace AWSCore
     protected:
         bool m_wasSuccess{ false };
 
+        // Flag and optional function call to queue for onSuccess events
+        bool m_queueOnSuccess{ false };
+        OnSuccessFunction m_onSuccess{};
+
+        // Flag and optional function call to queue for onFailure events
+        bool m_queueOnFailure{ false };
+        OnFailureFunction m_onFailure{};
+
+        // Flag to queue the delete during the DoCleanup calls
+        bool m_queueDelete{ false };
+
         void Process() override
         {
 
@@ -266,43 +302,7 @@ namespace AWSCore
         /// Called when request has completed successfully.
         virtual void OnSuccess()
         {
-        }
-
-        /// Called when the request fails.
-        virtual void OnFailure()
-        {
-        }
-
-        /// Called when request can't process and still requires cleanup (Specifically for our derived class Function which does not use auto delete)
-        virtual void DoCleanup()
-        {
-        }
-
-    public:
-        using OnSuccessFunction = AZStd::function<void(AwsApiRequestJob* job)>;
-        using OnFailureFunction = AZStd::function<void(AwsApiRequestJob* job)>;
-
-        /// A specialization of AwsApiRequestJob that lets you provide functions
-        /// that are called on success or failure of the request.
-        class Function : public AwsApiRequestJob
-        {
-
-        public:
-            // To use a different allocator, extend this class and use this macro.
-            AZ_CLASS_ALLOCATOR(Function, AZ::SystemAllocator, 0);
-
-            Function(OnSuccessFunction onSuccess, OnFailureFunction onFailure = OnFailureFunction{}, IConfig* config = GetDefaultConfig())
-                : AwsApiRequestJobType(false, config) // No auto delete - we need to perform our callbacks on the main thread so we queue them through tickbus
-                , m_onSuccess{ onSuccess }
-                , m_onFailure{ onFailure }
-            {
-            }
-
-        private:
-            OnSuccessFunction m_onSuccess;
-            OnFailureFunction m_onFailure;
-
-            void OnSuccess() override
+            if (m_queueOnSuccess)
             {
                 AZStd::function<void()> callbackHandler = [this]()
                 {
@@ -314,8 +314,12 @@ namespace AWSCore
                 };
                 AZ::TickBus::QueueFunction(callbackHandler);
             }
+        }
 
-            void OnFailure() override
+        /// Called when the request fails.
+        virtual void OnFailure()
+        {
+            if (m_queueOnFailure)
             {
                 AZStd::function<void()> callbackHandler = [this]()
                 {
@@ -327,9 +331,12 @@ namespace AWSCore
                 };
                 AZ::TickBus::QueueFunction(callbackHandler);
             }
+        }
 
-            // Code doesn't use auto delete - this allows code to make sure things get cleaned up in cases where success or failure can't be called.
-            void DoCleanup() override
+        /// Called when request can't process and still requires cleanup (Specifically for our derived class Function which does not use auto delete)
+        virtual void DoCleanup()
+        {
+            if (m_queueDelete)
             {
                 AZStd::function<void()> callbackHandler = [this]()
                 {
@@ -337,14 +344,14 @@ namespace AWSCore
                 };
                 AZ::TickBus::QueueFunction(callbackHandler);
             }
-        };
+        }
 
+    public:
         template<class Allocator = AZ::SystemAllocator>
         static AwsApiRequestJob* Create(OnSuccessFunction onSuccess, OnFailureFunction onFailure = OnFailureFunction{}, IConfig* config = GetDefaultConfig())
         {
-            return azcreate(Function, (onSuccess, onFailure, config), Allocator);
+            return azcreate(AwsApiRequestJob, (onSuccess, onFailure, config), Allocator);
         }
-
     };
 
 } // namespace AWSCore

+ 70 - 65
Gems/AWSCore/Code/Include/Framework/ServiceRequestJob.h

@@ -147,6 +147,9 @@ namespace AWSCore
         using ServiceRequestJobType = ServiceRequestJob<RequestType>;
         using ServiceClientJobType = ServiceClientJob<typename RequestType::ServiceTraits>;
 
+        using OnSuccessFunction = AZStd::function<void(ServiceRequestJob* job)>;
+        using OnFailureFunction = AZStd::function<void(ServiceRequestJob* job)>;
+
         static Config* GetDefaultConfig()
         {
             static AwsApiJobConfigHolder<Config> s_configHolder{};
@@ -175,6 +178,29 @@ namespace AWSCore
             }
         }
 
+        ServiceRequestJob(bool queueOnSuccess,
+                          OnSuccessFunction onSuccess,
+                          bool queueOnFailure,
+                          OnFailureFunction onFailure,
+                          bool queueDelete,
+                          IConfig* config = GetDefaultConfig()
+        ) : ServiceClientJobType{ false, config }
+          , m_requestUrl{ config->GetRequestUrl() }
+          , m_queueOnSuccess{ queueOnSuccess }
+          , m_onSuccess{ onSuccess }
+          , m_queueOnFailure{ queueOnFailure }
+          , m_onFailure{ onFailure }
+          , m_queueDelete{ queueDelete }
+        {
+        }
+
+        ServiceRequestJob(OnSuccessFunction onSuccess,
+                          OnFailureFunction onFailure,
+                          IConfig* config = GetDefaultConfig()
+        ) : ServiceRequestJob(true, onSuccess, true, onFailure, true, config)
+        {
+        }
+
         bool HasCredentials(IConfig* config)
         {
             if (config == nullptr)
@@ -215,6 +241,17 @@ namespace AWSCore
         /// for replacing these parts of the url.
         const Aws::String& m_requestUrl;
 
+        // Flag and optional function call to queue for onSuccess events
+        bool m_queueOnSuccess{ false };
+        OnSuccessFunction m_onSuccess{};
+
+        // Flag and optional function call to queue for onFailure events
+        bool m_queueOnFailure{ false };
+        OnFailureFunction m_onFailure{};
+
+        // Flag to queue the delete during the DoCleanup calls
+        bool m_queueDelete{ false };
+
         std::shared_ptr<Aws::Client::AWSAuthV4Signer> m_AWSAuthSigner{ nullptr };
 
         // Passed in configuration contains the AWS Credentials to use. If this request requires credentials 
@@ -241,16 +278,48 @@ namespace AWSCore
         /// Called when a request completes without error.
         virtual void OnSuccess()
         {
+            if (m_queueOnSuccess)
+            {
+                AZStd::function<void()> callbackHandler = [this]()
+                {
+                    if (m_onSuccess)
+                    {
+                        m_onSuccess(this);
+                    }
+                    delete this;
+                };
+                AZ::TickBus::QueueFunction(callbackHandler);
+            }
         }
 
         /// Called when an error occurs.
         virtual void OnFailure()
         {
+            if (m_queueOnFailure)
+            {
+                AZStd::function<void()> callbackHandler = [this]()
+                {
+                    if (m_onFailure)
+                    {
+                        m_onFailure(this);
+                    }
+                    delete this;
+                };
+                AZ::TickBus::QueueFunction(callbackHandler);
+            }
         }
 
         /// Provided so derived functions that do not auto delete can clean up
         virtual void DoCleanup()
         {
+            if (m_queueDelete)
+            {
+                AZStd::function<void()> callbackHandler = [this]()
+                {
+                    delete this;
+                };
+                AZ::TickBus::QueueFunction(callbackHandler);
+            }
         }
 
     private:
@@ -597,77 +666,13 @@ namespace AWSCore
             AZ_Printf(logRequestsChannel, "Response Body:\n");
             PrintRequestOutput(responseContent);
         }
-
     public:
-        using OnSuccessFunction = AZStd::function<void(ServiceRequestJob* job)>;
-        using OnFailureFunction = AZStd::function<void(ServiceRequestJob* job)>;
-
-        /// A derived class that calls lambda functions on job completion.
-        class Function : public ServiceRequestJobType
-        {
-
-        public:
-
-            // To use a different allocator, extend this class and use this macro.
-            AZ_CLASS_ALLOCATOR(Function, AZ::SystemAllocator, 0);
-
-            Function(OnSuccessFunction onSuccess, OnFailureFunction onFailure = OnFailureFunction{}, IConfig* config = GetDefaultConfig())
-                : ServiceRequestJob(false, config) // No auto delete - we'll take care of it
-                , m_onSuccess{ onSuccess }
-                , m_onFailure{ onFailure }
-            {
-            }
-
-        protected:
-
-            OnSuccessFunction m_onSuccess;
-            OnFailureFunction m_onFailure;
-
-            void OnSuccess() override
-            {
-                AZStd::function<void()> callbackHandler = [this]()
-                {
-                    if (m_onSuccess)
-                    {
-                        m_onSuccess(this);
-                    }
-                    delete this;
-                };
-                AZ::TickBus::QueueFunction(callbackHandler);
-            }
-
-            void OnFailure() override
-            {
-                AZStd::function<void()> callbackHandler = [this]()
-                {
-                    if (m_onFailure)
-                    {
-                        m_onFailure(this);
-                    }
-                    delete this;
-                };
-                AZ::TickBus::QueueFunction(callbackHandler);
-            }
-
-            // Code doesn't use auto delete - this ensure things get cleaned up in cases when code can't call success or failure
-            void DoCleanup() override
-            {
-                AZStd::function<void()> callbackHandler = [this]()
-                {
-                    delete this;
-                };
-                AZ::TickBus::QueueFunction(callbackHandler);
-            }
-        };
-
         template<class Allocator = AZ::SystemAllocator>
         static ServiceRequestJob* Create(OnSuccessFunction onSuccess, OnFailureFunction onFailure = OnFailureFunction{}, IConfig* config = GetDefaultConfig())
         {
-            return azcreate(Function, (onSuccess, onFailure, config), Allocator);
+            return azcreate(ServiceRequestJob, (onSuccess, onFailure, config), Allocator);
         }
-
     };
-
 } // namespace AWSCore
 
 

+ 12 - 0
Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Common/GCC/imageprocessingatom_editor_static_gcc.cmake

@@ -0,0 +1,12 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(LY_COMPILE_OPTIONS
+    PRIVATE
+        -fexceptions #ImageLoader/ExrLoader.cpp uses exceptions
+)

+ 12 - 0
Gems/Atom/Asset/Shader/Code/Source/Platform/Common/GCC/atom_asset_shader_static_gcc.cmake

@@ -0,0 +1,12 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(LY_COMPILE_OPTIONS
+    PRIVATE
+        -fexceptions # The macro PYBIND11_EMBEDDED_MODULE uses a try catch block
+)

+ 1 - 0
Gems/Atom/Feature/Common/Code/Include/Atom/Feature/ParamMacros/MapParamCommon.inl

@@ -32,3 +32,4 @@
 
 #define AZ_GFX_TEXTURE2D_PARAM(Name, MemberName, DefaultValue)                                          \
         AZ_GFX_COMMON_PARAM(AZStd::string, Name, MemberName, DefaultValue)                              \
+

+ 12 - 0
Gems/Atom/Feature/Common/Code/Platform/Common/atom_feature_common_gcc.cmake

@@ -0,0 +1,12 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(LY_COMPILE_OPTIONS
+    PRIVATE
+        -fexceptions
+)

+ 13 - 0
Gems/Atom/Feature/Common/Code/Source/Platform/Common/GCC/atom_feature_common_gcc.cmake

@@ -0,0 +1,13 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set_source_files_properties(
+    Source/LuxCore/LuxCoreRenderer.cpp
+    PROPERTIES
+        COMPILE_OPTIONS -fexceptions
+)

+ 2 - 2
Gems/Atom/RPI/Code/Include/Atom/RPI.Public/GpuQuery/Query.h

@@ -101,7 +101,7 @@ namespace AZ
             QueryResultCode GetLatestResult(T& queryResult)
             {
                 void* resultData = static_cast<void*>(&queryResult);
-                GetLatestResult(resultData, sizeof(T));
+                return GetLatestResult(resultData, sizeof(T));
             }
 
             //! Returns the result of the earliest possible query. It might stall the calling thread, depending if the query result is available for polling
@@ -123,7 +123,7 @@ namespace AZ
             QueryResultCode GetLatestResultAndWait(T& queryResult)
             {
                 void* resultData = static_cast<void*>(&queryResult);
-                GetLatestResultAndWait(resultData, sizeof(T));
+                return GetLatestResultAndWait(resultData, sizeof(T));
             }
 
             //! Removes the reference of this instance in the RPI QueryPool where it was created.

+ 6 - 2
Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ParentPass.h

@@ -23,8 +23,12 @@ namespace AZ
         class ParentPass
             : public Pass
         {
-            AZ_RPI_PASS(ParentPass);
-
+            friend class PassFactory;
+            friend class PassLibrary;
+            friend class PassSystem;
+            friend class PassFactory;
+            friend class RenderPipeline;
+            friend class UnitTest::PassTests;
             friend class Pass;
 
         public:

+ 8 - 4
Code/Framework/GridMate/Platform/Common/gridmate_clang.cmake → Gems/Atom/RPI/Code/Source/Platform/Common/GCC/atom_rpi_public_gcc.cmake

@@ -7,9 +7,13 @@
 #
 
 ly_add_source_properties(
-    SOURCES
-        GridMate/Carrier/SecureSocketDriver.cpp
-        GridMate/Carrier/StreamSecureSocketDriver.cpp
+    SOURCES External/MaskedOcclusionCulling/MaskedOcclusionCullingAVX2.cpp
     PROPERTY COMPILE_OPTIONS
-    VALUES -Wno-deprecated-declarations
+    VALUES -mavx2 -mfma
+)
+
+ly_add_source_properties(
+    SOURCES External/MaskedOcclusionCulling/MaskedOcclusionCulling.cpp
+    PROPERTY COMPILE_OPTIONS
+    VALUES -mno-avx
 )

+ 12 - 0
Gems/EditorPythonBindings/Code/Source/Platform/Common/GCC/editorpythonbindings_static_gcc.cmake

@@ -0,0 +1,12 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(LY_COMPILE_OPTIONS
+    PUBLIC
+        -fexceptions # The macro PYBIND11_EMBEDDED_MODULE uses a try catch block
+)

+ 12 - 0
Gems/EditorPythonBindings/Code/Source/Platform/Common/GCC/editorpythonbindings_tests_gcc.cmake

@@ -0,0 +1,12 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(LY_COMPILE_OPTIONS
+    PRIVATE
+        -fexceptions # The macro PYBIND11_EMBEDDED_MODULE uses a try catch block
+)

+ 1 - 1
Gems/ExpressionEvaluation/Code/Tests/ExpressionEngineTestFixture.h

@@ -83,7 +83,7 @@ namespace ExpressionEvaluation
             expressionTree.PushElement(AZStd::move(expressionToken));
         }
 
-        ExpressionEvaluationRequests* ExpressionEvaluationRequests()
+        ExpressionEvaluationRequests* GetExpressionEvaluationRequests()
         {
             return m_systemComponent;
         }

+ 22 - 22
Gems/ExpressionEvaluation/Code/Tests/MathExpressionTests.cpp

@@ -287,7 +287,7 @@ namespace ExpressionEvaluation
             PushPrimitive(tree, 1.0);
             PushOperator(tree, Interfaces::MathOperators, MathExpressionOperators::AddOperator());
 
-            auto result = ExpressionEvaluationRequests()->Evaluate(tree);
+            auto result = GetExpressionEvaluationRequests()->Evaluate(tree);
 
             ConfirmResult<double>(result, 3.0+1.0);
         }
@@ -307,7 +307,7 @@ namespace ExpressionEvaluation
             PushPrimitive(tree, 2.0);
             PushOperator(tree, Interfaces::MathOperators, MathExpressionOperators::DivideOperator());
 
-            auto result = ExpressionEvaluationRequests()->Evaluate(tree);
+            auto result = GetExpressionEvaluationRequests()->Evaluate(tree);
 
             ConfirmResult<double>(result, ((2.0 + 2.0)*(4.0 - 3.0)) / 2.0);
         }
@@ -315,7 +315,7 @@ namespace ExpressionEvaluation
 
     TEST_F(ExpressionEngineTestFixture, ExpressionEngine_MathTest_BasicParserPass)
     {
-        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = ExpressionEvaluationRequests()->ParseExpression("3+1");
+        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = GetExpressionEvaluationRequests()->ParseExpression("3+1");
 
         EXPECT_TRUE(treeOutcome.IsSuccess());
 
@@ -323,13 +323,13 @@ namespace ExpressionEvaluation
 
         EXPECT_EQ(tree.GetTreeSize(), 3);
 
-        auto result = ExpressionEvaluationRequests()->Evaluate(tree);
+        auto result = GetExpressionEvaluationRequests()->Evaluate(tree);
         ConfirmResult<double>(result, 3+1);
     }
 
     TEST_F(ExpressionEngineTestFixture, ExpressionEngine_MathTest_BasicParserPassMultiOperator)
     {
-        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = ExpressionEvaluationRequests()->ParseExpression("3+1*5");
+        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = GetExpressionEvaluationRequests()->ParseExpression("3+1*5");
         EXPECT_TRUE(treeOutcome.IsSuccess());
 
         const ExpressionTree& tree = treeOutcome.GetValue();
@@ -337,26 +337,26 @@ namespace ExpressionEvaluation
         // 3 Values + 2 Operators
         EXPECT_EQ(tree.GetTreeSize(), 3 + 2);
 
-        auto result = ExpressionEvaluationRequests()->Evaluate(tree);
+        auto result = GetExpressionEvaluationRequests()->Evaluate(tree);
         ConfirmResult<double>(result, 3 + 1 * 5);
     }
 
     TEST_F(ExpressionEngineTestFixture, ExpressionEngine_NumericParser_ComplexParserPass)
     {
-        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = ExpressionEvaluationRequests()->ParseExpression("(3 + 1)");
+        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = GetExpressionEvaluationRequests()->ParseExpression("(3 + 1)");
         EXPECT_TRUE(treeOutcome.IsSuccess());
 
         const ExpressionTree& tree = treeOutcome.GetValue();
 
         EXPECT_EQ(tree.GetTreeSize(), 3);
 
-        auto result = ExpressionEvaluationRequests()->Evaluate(tree);
+        auto result = GetExpressionEvaluationRequests()->Evaluate(tree);
         ConfirmResult<double>(result, (3.0 + 1.0));
     }
 
     TEST_F(ExpressionEngineTestFixture, ExpressionEngine_NumericParser_ComplexParserPassMultiOperator)
     {
-        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = ExpressionEvaluationRequests()->ParseExpression("((2.0 + 2.0)*(4.0 - 3.0)) / 2.0");
+        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = GetExpressionEvaluationRequests()->ParseExpression("((2.0 + 2.0)*(4.0 - 3.0)) / 2.0");
         EXPECT_TRUE(treeOutcome.IsSuccess());
 
         const ExpressionTree& tree = treeOutcome.GetValue();
@@ -364,13 +364,13 @@ namespace ExpressionEvaluation
         // 5 values + 4 operators
         EXPECT_EQ(tree.GetTreeSize(), 5 + 4);
 
-        auto result = ExpressionEvaluationRequests()->Evaluate(tree);
+        auto result = GetExpressionEvaluationRequests()->Evaluate(tree);
         ConfirmResult<double>(result, ((2.0 + 2.0)*(4.0 - 3.0)) / 2.0);
     }
 
     TEST_F(ExpressionEngineTestFixture, ExpressionEngine_NumericParser_ObtuseParserPassMultiOperator)
     {
-        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = ExpressionEvaluationRequests()->ParseExpression("((   ((   )  )(       2.0) + 2.0)*(4.0 - 3.0)) / (((2.0              )))");
+        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = GetExpressionEvaluationRequests()->ParseExpression("((   ((   )  )(       2.0) + 2.0)*(4.0 - 3.0)) / (((2.0              )))");
         EXPECT_TRUE(treeOutcome.IsSuccess());
 
         const ExpressionTree& tree = treeOutcome.GetValue();
@@ -378,26 +378,26 @@ namespace ExpressionEvaluation
         // 5 values + 4 operators
         EXPECT_EQ(tree.GetTreeSize(), 5 + 4);
 
-        auto result = ExpressionEvaluationRequests()->Evaluate(tree);
+        auto result = GetExpressionEvaluationRequests()->Evaluate(tree);
         ConfirmResult<double>(result, ((2.0 + 2.0)*(4.0 - 3.0)) / 2.0);
     }
 
     TEST_F(ExpressionEngineTestFixture, ExpressionEngine_NumericParser_AdvancedParserPass)
     {
-        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = ExpressionEvaluationRequests()->ParseExpression("(3 + 1) % 2");
+        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = GetExpressionEvaluationRequests()->ParseExpression("(3 + 1) % 2");
         EXPECT_TRUE(treeOutcome.IsSuccess());
 
         const ExpressionTree& tree = treeOutcome.GetValue();
 
         EXPECT_EQ(tree.GetTreeSize(), 3 + 2);
 
-        auto result = ExpressionEvaluationRequests()->Evaluate(tree);
+        auto result = GetExpressionEvaluationRequests()->Evaluate(tree);
         ConfirmResult<double>(result, (3+1)%2);
     }
 
     TEST_F(ExpressionEngineTestFixture, ExpressionEngine_NumericParser_BasicVariablePass)
     {
-        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = ExpressionEvaluationRequests()->ParseExpression("{A}+{B}");
+        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = GetExpressionEvaluationRequests()->ParseExpression("{A}+{B}");
         EXPECT_TRUE(treeOutcome.IsSuccess());
 
         ExpressionTree& tree = treeOutcome.GetValue();
@@ -421,13 +421,13 @@ namespace ExpressionEvaluation
             tree.SetVariable(variable, 1.0);
         }
 
-        auto result = ExpressionEvaluationRequests()->Evaluate(tree);
+        auto result = GetExpressionEvaluationRequests()->Evaluate(tree);
         ConfirmResult<double>(result, 3.0+1.0);
     }
 
     TEST_F(ExpressionEngineTestFixture, ExpressionEngine_NumericParser_BasicRepeatedVariablePass)
     {
-        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = ExpressionEvaluationRequests()->ParseExpression("{A}+{B}+{A}");
+        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = GetExpressionEvaluationRequests()->ParseExpression("{A}+{B}+{A}");
         EXPECT_TRUE(treeOutcome.IsSuccess());
 
         ExpressionTree& tree = treeOutcome.GetValue();
@@ -451,34 +451,34 @@ namespace ExpressionEvaluation
             tree.SetVariable(variable, 1.0);
         }
 
-        auto result = ExpressionEvaluationRequests()->Evaluate(tree);
+        auto result = GetExpressionEvaluationRequests()->Evaluate(tree);
         ConfirmResult<double>(result, 3.0 + 1.0 + 3.0);
     }
 
     TEST_F(ExpressionEngineTestFixture, ExpressionEngine_NumericParser_BasicFail)
     {
-        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = ExpressionEvaluationRequests()->ParseRestrictedExpression(MathOnlyOperatorRestrictions(), "true || false");
+        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = GetExpressionEvaluationRequests()->ParseRestrictedExpression(MathOnlyOperatorRestrictions(), "true || false");
         EXPECT_FALSE(treeOutcome.IsSuccess());
         EXPECT_EQ(treeOutcome.GetError().m_offsetIndex, 0);
     }
 
     TEST_F(ExpressionEngineTestFixture, ExpressionEngine_NumericParser_ComplexFail)
     {
-        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = ExpressionEvaluationRequests()->ParseRestrictedExpression(MathOnlyOperatorRestrictions(), "2+2 || 1+3");
+        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = GetExpressionEvaluationRequests()->ParseRestrictedExpression(MathOnlyOperatorRestrictions(), "2+2 || 1+3");
         EXPECT_FALSE(treeOutcome.IsSuccess());
         EXPECT_EQ(treeOutcome.GetError().m_offsetIndex, 4);
     }
 
     TEST_F(ExpressionEngineTestFixture, ExpressionEngine_ParenParser_UnbalancedCloseFail)
     {
-        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = ExpressionEvaluationRequests()->ParseRestrictedExpression(MathOnlyOperatorRestrictions(), "1+1)");
+        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = GetExpressionEvaluationRequests()->ParseRestrictedExpression(MathOnlyOperatorRestrictions(), "1+1)");
         EXPECT_FALSE(treeOutcome.IsSuccess());
         EXPECT_EQ(treeOutcome.GetError().m_offsetIndex, 3);
     }
 
     TEST_F(ExpressionEngineTestFixture, ExpressionEngine_ParenParser_UnbalancedOpenFail)
     {
-        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = ExpressionEvaluationRequests()->ParseRestrictedExpression(MathOnlyOperatorRestrictions(), "(1+1");
+        AZ::Outcome<ExpressionTree, ParsingError> treeOutcome = GetExpressionEvaluationRequests()->ParseRestrictedExpression(MathOnlyOperatorRestrictions(), "(1+1");
         EXPECT_FALSE(treeOutcome.IsSuccess());
         EXPECT_EQ(treeOutcome.GetError().m_offsetIndex, 0);
     }

+ 1 - 0
Gems/GradientSignal/Code/Source/ImageAsset.cpp

@@ -24,6 +24,7 @@ namespace
     float RetrieveValue(const AZ::u8* mem,  size_t index)
     {
         AZ_Assert(false, "Unimplemented!");
+        return 0.0f;
     }
 
     template <>

+ 1 - 1
Gems/LyShine/Code/Source/Animation/AnimSplineTrack.h

@@ -378,7 +378,7 @@ private:
 
     UiAnimParamData m_componentParamData;
 
-    static bool VersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) {};
+    static bool VersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) { return false; };
 };
 
 //////////////////////////////////////////////////////////////////////////

+ 1 - 1
Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.h

@@ -409,7 +409,7 @@ private:
 
     unsigned int m_id = 0;
 
-    static bool VersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) {};
+    static bool VersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) { return false; };
 };
 
 //////////////////////////////////////////////////////////////////////////

+ 10 - 0
Gems/Metastream/Code/Source/Platform/Common/GCC/metastream_gcc.cmake

@@ -0,0 +1,10 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+# CivetHttpServer.cpp uses a try catch block
+set(LY_COMPILE_OPTIONS PRIVATE -fexceptions)

+ 2 - 0
Gems/PhysX/Code/CMakeLists.txt

@@ -85,6 +85,8 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
         AUTOUIC
         FILES_CMAKE
             ${physx_editor_files}
+        PLATFORM_INCLUDE_FILES
+            ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common/${PAL_TRAIT_COMPILER_ID}/physx_editor_static_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake
         COMPILE_DEFINITIONS
             PUBLIC
                 PHYSX_EDITOR

+ 7 - 0
Gems/PhysX/Code/Source/Platform/Common/Clang/physx_editor_static_clang.cmake

@@ -0,0 +1,7 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#

+ 12 - 0
Gems/PhysX/Code/Source/Platform/Common/GCC/physx_editor_static_gcc.cmake

@@ -0,0 +1,12 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(LY_COMPILE_OPTIONS
+    PUBLIC
+        -fexceptions # poly2tri 3rd Party library uses exception handling
+)

+ 7 - 0
Gems/PhysX/Code/Source/Platform/Common/MSVC/physx_editor_static_msvc.cmake

@@ -0,0 +1,7 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#

+ 12 - 0
Gems/PythonAssetBuilder/Code/Source/Platform/Common/GCC/pythonassetbuilder_static_gcc.cmake

@@ -0,0 +1,12 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(LY_COMPILE_OPTIONS
+    PRIVATE
+        -fexceptions
+)

+ 12 - 0
Gems/PythonAssetBuilder/Code/Source/Platform/Common/GCC/pythonassetbuilder_tests_gcc.cmake

@@ -0,0 +1,12 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(LY_COMPILE_OPTIONS
+    PRIVATE
+        -fexceptions
+)

+ 12 - 0
Gems/QtForPython/Code/Source/Platform/Common/GCC/qtforpython_gcc.cmake

@@ -0,0 +1,12 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(LY_COMPILE_OPTIONS
+    PRIVATE
+        -fexceptions # QtForPythonSystemComponent uses a try catch block
+)

+ 1 - 1
Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp

@@ -3779,7 +3779,7 @@ namespace ScriptCanvasEditor
             {
                 if (assetSanitizationSet.find(currentIter->first) == assetSanitizationSet.end())
                 {
-                    currentIter->second = {};
+                    currentIter->second = ScriptEvents::ScriptEventsAssetPtr{};
                     currentIter = GetGraphData()->m_scriptEventAssets.erase(currentIter);
                     graphNeedsDirtying = true;
                 }

+ 1 - 1
Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp

@@ -328,7 +328,7 @@ namespace ScriptCanvasEditor
         {
             if (sm->m_assetSanitizationSet.find(currentIter->first) == sm->m_assetSanitizationSet.end())
             {
-                currentIter->second = {};
+                currentIter->second = ScriptEvents::ScriptEventsAssetPtr{};
                 currentIter = graph->GetGraphData()->m_scriptEventAssets.erase(currentIter);
                 sm->m_graphNeedsDirtying = true;
             }

+ 1 - 1
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.h

@@ -103,7 +103,7 @@ namespace ScriptCanvas
                     const AZ::Data::AssetId GetAssetId() const { return m_scriptEventAssetId; }
                     ScriptEvents::ScriptEventsAssetRef& GetAssetRef() { return m_scriptEventAsset; }
                     const ScriptEvents::ScriptEvent& GetScriptEvent() const { return m_definition; }
-                    ScriptEvents::ScriptEventsAssetPtr GetAsset() const { return m_asset; }
+                    ScriptEvents::ScriptEventsAssetPtr GetAsset() const { return ScriptEvents::ScriptEventsAssetPtr{ m_asset.Get(), AZ::Data::AssetLoadBehavior::PreLoad }; }
 
                     AZStd::pair<AZ::Data::Asset<ScriptEvents::ScriptEventsAsset>, bool> IsAssetOutOfDate() const;
 

+ 7 - 0
Gems/ScriptCanvasTesting/Code/Platform/Common/GCC/scriptcanvastesting_editor_tests_gcc.cmake

@@ -0,0 +1,7 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#

+ 5 - 4
Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventsAsset.h

@@ -87,14 +87,15 @@ namespace ScriptEvents
             : AZ::Data::Asset<ScriptEventsAsset>(loadBehavior)
         {}
 
-        ScriptEventsAssetPtr(const BaseType& scriptEventsAsset)
-            : BaseType(scriptEventsAsset)
-        {}
+        ScriptEventsAssetPtr(const ScriptEventsAssetPtr& scriptEventsAsset) = default;
+        ScriptEventsAssetPtr(ScriptEventsAssetPtr&& scriptEventsAsset) = default;
 
         virtual ~ScriptEventsAssetPtr() = default;
 
         using BaseType::BaseType;
-        using BaseType::operator=;
+
+        ScriptEventsAssetPtr& operator=(const ScriptEventsAssetPtr&) = default;
+        ScriptEventsAssetPtr& operator=(ScriptEventsAssetPtr&&) = default;
 
         static void Reflect(AZ::ReflectContext* context)
         {

+ 1 - 1
Gems/ScriptEvents/Code/Source/Editor/ScriptEventsSystemEditorComponent.cpp

@@ -69,7 +69,7 @@ namespace ScriptEventsEditor
         AZStd::shared_ptr<AZ::Data::AssetDataStream> stream,
         const AZ::Data::AssetFilterCB& assetLoadFilterCB)
     {
-        AZ::Data::AssetHandler::LoadResult loadedData = loadedData = AzFramework::GenericAssetHandler<ScriptEvents::ScriptEventsAsset>::LoadAssetData(asset, stream, assetLoadFilterCB);
+        AZ::Data::AssetHandler::LoadResult loadedData = AzFramework::GenericAssetHandler<ScriptEvents::ScriptEventsAsset>::LoadAssetData(asset, stream, assetLoadFilterCB);
 
         if (loadedData == AZ::Data::AssetHandler::LoadResult::LoadComplete)
         {

+ 1 - 0
Gems/WhiteBox/Code/CMakeLists.txt

@@ -96,6 +96,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
             whitebox_editor_supported_files.cmake
         PLATFORM_INCLUDE_FILES
             ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_tools.cmake
+            ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common/${PAL_TRAIT_COMPILER_ID}/whitebox_editor_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake
         INCLUDE_DIRECTORIES
             PRIVATE
                 Source

+ 7 - 0
Gems/WhiteBox/Code/Source/Platform/Common/Clang/whitebox_editor_clang.cmake

@@ -0,0 +1,7 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#

+ 12 - 0
Gems/WhiteBox/Code/Source/Platform/Common/GCC/whitebox_editor_gcc.cmake

@@ -0,0 +1,12 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(LY_COMPILE_OPTIONS
+    PUBLIC
+        -fexceptions # OpenMesh 3rd Party library uses exception handling
+)

+ 7 - 0
Gems/WhiteBox/Code/Source/Platform/Common/MSVC/whitebox_editor_msvc.cmake

@@ -0,0 +1,7 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#

+ 2 - 2
cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake

@@ -15,7 +15,6 @@ ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev3-multiplatform
 ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform                        TARGETS cityhash                    PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2)
 ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform                         TARGETS expat                       PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418)
 ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform                           TARGETS zstd                        PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665)
-ly_associate_package(PACKAGE_NAME SQLite-3.32.2-rev3-multiplatform                  TARGETS SQLite                      PACKAGE_HASH dd4d3de6cbb4ce3d15fc504ba0ae0587e515dc89a25228037035fc0aef4831f4)
 ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform                TARGETS glad                        PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee)
 ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform                   TARGETS xxhash                      PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e)
 
@@ -25,7 +24,7 @@ ly_associate_package(PACKAGE_NAME AWSGameLiftServerSDK-3.4.1-rev1-linux
 ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev3-linux                          TARGETS TIFF                        PACKAGE_HASH 2377f48b2ebc2d1628d9f65186c881544c92891312abe478a20d10b85877409a)
 ly_associate_package(PACKAGE_NAME freetype-2.10.4.16-linux                          TARGETS freetype                    PACKAGE_HASH 3f10c703d9001ecd2bb51a3bd003d3237c02d8f947ad0161c0252fdc54cbcf97)
 ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.9.50-rev1-linux                    TARGETS AWSNativeSDK                PACKAGE_HASH f30b6969c6732a7c1a23a59d205a150633a7f219dcb60d837b543888d2c63ea1)
-ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev5-linux                              TARGETS Lua                         PACKAGE_HASH 1adc812abe3dd0dbb2ca9756f81d8f0e0ba45779ac85bf1d8455b25c531a38b0)
+ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev7-linux                              TARGETS Lua                         PACKAGE_HASH 81a6ce4965c63e264f923d3ca04ddc40c27074b3e607073c6ad90eca32b9c260)
 ly_associate_package(PACKAGE_NAME PhysX-4.1.2.29882248-rev5-linux                   TARGETS PhysX                       PACKAGE_HASH fa72365df409376aef02d1763194dc91d255bdfcb4e8febcfbb64d23a3e50b96)
 ly_associate_package(PACKAGE_NAME mcpp-2.7.2_az.2-rev1-linux                        TARGETS mcpp                        PACKAGE_HASH df7a998d0bc3fedf44b5bdebaf69ddad6033355b71a590e8642445ec77bc6c41)
 ly_associate_package(PACKAGE_NAME mikkelsen-1.0.0.4-linux                           TARGETS mikkelsen                   PACKAGE_HASH 5973b1e71a64633588eecdb5b5c06ca0081f7be97230f6ef64365cbda315b9c8)
@@ -46,3 +45,4 @@ ly_associate_package(PACKAGE_NAME astc-encoder-3.2-rev2-linux
 ly_associate_package(PACKAGE_NAME ISPCTexComp-36b80aa-rev1-linux                    TARGETS ISPCTexComp                 PACKAGE_HASH 065fd12abe4247dde247330313763cf816c3375c221da030bdec35024947f259)
 ly_associate_package(PACKAGE_NAME lz4-1.9.3-vcpkg-rev4-linux                        TARGETS lz4                         PACKAGE_HASH 5de3dbd3e2a3537c6555d759b3c5bb98e5456cf85c74ff6d046f809b7087290d)
 ly_associate_package(PACKAGE_NAME pyside2-5.15.2-rev2-linux                         TARGETS pyside2                     PACKAGE_HASH 7589c397c8224d0c3ad691ff02e1afd55d9a1f9de1967c14eb8105dd2b0c4dd1)
+ly_associate_package(PACKAGE_NAME SQLite-3.32.2-rev1-linux                          TARGETS SQLite                      PACKAGE_HASH a8e167591f7f5f060a2e5718d2fcabb80436544421180d475a075624b5ced4c5)

+ 16 - 1
cmake/Configurations.cmake

@@ -25,6 +25,10 @@ include(cmake/ConfigurationTypes.cmake)
 # \arg:DEFINES_${CONFIGURATION}
 # \arg:COMPILATION
 # \arg:COMPILATION_${CONFIGURATION}
+# \arg:COMPILATION_C
+# \arg:COMPILATION_C_${CONFIGURATION}
+# \arg:COMPILATION_CXX
+# \arg:COMPILATION_CXX_${CONFIGURATION}
 # \arg:LINK
 # \arg:LINK_${CONFIGURATION}
 # \arg:LINK_STATIC
@@ -45,6 +49,8 @@ function(ly_append_configurations_options)
     set(multiArgs
         DEFINES
         COMPILATION
+        COMPILATION_C
+        COMPILATION_CXX
         LINK
         LINK_STATIC
         LINK_NON_STATIC
@@ -73,7 +79,16 @@ function(ly_append_configurations_options)
         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILATION_STR}" PARENT_SCOPE)
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILATION_STR}" PARENT_SCOPE)
     endif()
-
+    if(ly_append_configurations_options_COMPILATION_C)
+        string(REPLACE ";" " " COMPILATION_STR "${ly_append_configurations_options_COMPILATION}")
+        string(APPEND CMAKE_C_FLAGS " " ${COMPILATION_STR})
+        set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} PARENT_SCOPE)
+    endif()
+    if(ly_append_configurations_options_COMPILATION_CXX)
+        string(REPLACE ";" " " COMPILATION_STR "${ly_append_configurations_options_COMPILATION}")
+        string(APPEND CMAKE_CXX_FLAGS " " ${COMPILATION_STR})
+        set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} PARENT_SCOPE)
+    endif()
     if(ly_append_configurations_options_LINK)
         string(REPLACE ";" " " LINK_STR "${ly_append_configurations_options_LINK}")
         set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} ${LINK_STR}" PARENT_SCOPE)

+ 87 - 0
cmake/Platform/Common/GCC/Configurations_gcc.cmake

@@ -0,0 +1,87 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+include(cmake/Platform/Common/Configurations_common.cmake)
+
+set(LY_GCC_BUILD_FOR_GCOV FALSE CACHE BOOL "Flag to enable the build for gcov usage")
+if(LY_GCC_BUILD_FOR_GCOV)
+    set(LY_GCC_GCOV_FLAGS "--coverage")
+endif()
+
+set(LY_GCC_BUILD_FOR_GPROF FALSE CACHE BOOL "Flag to enable the build for gprof usage")
+if(LY_GCC_BUILD_FOR_GPROF)
+    set(LY_GCC_GPROF_FLAGS "-pg")
+endif()
+
+
+ly_append_configurations_options(
+    COMPILATION
+        -fno-exceptions
+        -fvisibility=hidden
+        -Wall
+        -Werror
+
+        ${LY_GCC_GCOV_FLAGS}
+        ${LY_GCC_GPROF_FLAGS}
+
+        # Disabled warnings 
+        -Wno-format-security
+        -Wno-multichar
+        -Wno-parentheses
+        -Wno-switch
+        -Wno-tautological-compare
+        -Wno-unknown-pragmas
+        -Wno-unused-function
+        -Wno-unused-value
+        -Wno-unused-variable
+        -Wno-format-truncation
+        -Wno-reorder
+        -Wno-uninitialized
+        -Wno-array-bounds
+        -Wno-class-memaccess
+        -Wno-nonnull-compare
+        -Wno-strict-aliasing
+        -Wno-unused-result
+        -Wno-sign-compare
+        -Wno-return-local-addr
+        -Wno-stringop-overflow
+        -Wno-attributes
+        -Wno-logical-not-parentheses
+        -Wno-stringop-truncation
+        -Wno-memset-elt-size
+        -Wno-unused-but-set-variable
+        -Wno-enum-compare
+        -Wno-int-in-bool-context
+        -Wno-sequence-point
+        -Wno-delete-non-virtual-dtor
+        -Wno-comment
+        -Wno-reorder
+        -Wno-restrict
+        -Wno-format-overflow
+
+    COMPILATION_C
+        -Wno-absolute-value
+
+    COMPILATION_CXX
+        -fvisibility-inlines-hidden
+        -Wno-invalid-offsetof
+
+    COMPILATION_DEBUG
+        -O0 # No optimization
+        -g # debug symbols
+        -fno-inline # don't inline functions
+        -fstack-protector # Add additional checks to catch stack corruption issues
+    COMPILATION_PROFILE
+        -O2
+        -g # debug symbols
+    COMPILATION_RELEASE
+        -O2
+)
+
+include(cmake/Platform/Common/TargetIncludeSystemDirectories_supported.cmake)
+

+ 27 - 0
cmake/Platform/Linux/Configurations_linux.cmake

@@ -20,6 +20,33 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
             -msse4.1
     )
     ly_set(CMAKE_CXX_EXTENSIONS OFF)
+elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+
+    include(cmake/Platform/Common/GCC/Configurations_gcc.cmake)
+
+    if(LY_GCC_BUILD_FOR_GCOV)
+        set(LY_GCC_GCOV_LFLAGS "-lgcov")
+    endif()
+    if(LY_GCC_BUILD_FOR_GPROF)
+        set(LY_GCC_GPROF_LFLAGS "-pg")
+    endif()
+
+    ly_append_configurations_options(
+        DEFINES
+            LINUX
+            __linux__
+            LINUX64
+        COMPILATION
+            -fPIC
+            -msse4.1
+        LINK_NON_STATIC
+            ${LY_GCC_GCOV_LFLAGS}
+            ${LY_GCC_GPROF_LFLAGS}
+            -Wl,--no-undefined
+            -lpthread
+    )
+    ly_set(CMAKE_CXX_EXTENSIONS OFF)
+
 else()
 
     message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} not supported in ${PAL_PLATFORM_NAME}")

+ 3 - 0
cmake/Platform/Linux/PAL_linux.cmake

@@ -30,6 +30,9 @@ ly_set(PAL_TRAIT_TEST_TARGET_TYPE MODULE)
 if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
     ly_set(PAL_TRAIT_COMPILER_ID Clang)
     ly_set(PAL_TRAIT_COMPILER_ID_LOWERCASE clang)
+elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+    ly_set(PAL_TRAIT_COMPILER_ID GCC)
+    ly_set(PAL_TRAIT_COMPILER_ID_LOWERCASE gcc)
 else()
     message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} not supported in ${PAL_PLATFORM_NAME}")
 endif()

+ 32 - 0
scripts/build/Platform/Linux/build_config.json

@@ -58,6 +58,21 @@
       "CMAKE_TARGET": "all"
     }
   },
+  "profile_gcc_nounity": {
+    "TAGS": [
+      "nightly-incremental",
+      "nightly-clean"
+    ],
+    "COMMAND": "build_linux.sh",
+    "PARAMETERS": {
+      "CONFIGURATION": "profile",
+      "OUTPUT_DIRECTORY": "build/linux_gcc",
+      "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DLY_UNITY_BUILD=FALSE -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLY_PARALLEL_LINK_JOBS=4 -DLY_GCC_BUILD_FOR_GCOV=OFF",
+      "CMAKE_LY_PROJECTS": "AutomatedTesting",
+      "CMAKE_TARGET": "all",
+      "LY_MIN_MEMORY_PER_CORE": "2097152"
+    }
+ },
   "profile_nounity": {
     "TAGS": [
       "weekly-build-metrics"
@@ -87,6 +102,23 @@
       "TEST_RESULTS": "False"
     }
   },
+  "test_profile_gcc_nounity": {
+    "TAGS": [
+      "nightly-incremental",
+      "nightly-clean"
+    ],
+    "COMMAND": "build_test_linux.sh",
+    "PARAMETERS": {
+      "CONFIGURATION": "profile",
+      "OUTPUT_DIRECTORY": "build/linux_gcc",
+      "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DLY_UNITY_BUILD=FALSE -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLY_PARALLEL_LINK_JOBS=4 -DLY_GCC_BUILD_FOR_GCOV=ON",
+      "CMAKE_LY_PROJECTS": "AutomatedTesting",
+      "CMAKE_TARGET": "all",
+      "CTEST_OPTIONS": "-E (AutomatedTesting::Atom_TestSuite_Main|AutomatedTesting::TerrainTests_Main|Gem::EMotionFX.Editor.Tests) -L (SUITE_smoke|SUITE_main) -LE (REQUIRES_gpu) --no-tests=error",
+      "TEST_RESULTS": "False",
+      "LY_MIN_MEMORY_PER_CORE": "2097152"
+    }
+  },
   "test_profile_nounity": {
     "TAGS": [],
     "COMMAND": "build_test_linux.sh",

+ 25 - 2
scripts/build/Platform/Linux/build_linux.sh

@@ -43,7 +43,30 @@ if [[ ! -z "$RUN_CONFIGURE" ]]; then
     echo "${CONFIGURE_CMD}" > ${LAST_CONFIGURE_CMD_FILE}
 fi
 
-eval echo [ci_build] cmake --build . --target ${CMAKE_TARGET} --config ${CONFIGURATION} -j $(grep -c processor /proc/cpuinfo) -- ${CMAKE_NATIVE_BUILD_ARGS}
-eval cmake --build . --target ${CMAKE_TARGET} --config ${CONFIGURATION} -j $(grep -c processor /proc/cpuinfo) -- ${CMAKE_NATIVE_BUILD_ARGS}
+TOTAL_MEMORY=$(cat /proc/meminfo | grep MemTotal | awk '{print $2}')
+TOTAL_CORE_COUNT=$(grep -c processor /proc/cpuinfo)
+echo "Total Memory        : $TOTAL_MEMORY kB"
+echo "Total Cores         : $TOTAL_CORE_COUNT"
+
+# For machines that has a core to memory ratio that could cause running out of resources, 
+# we will check for an environment variable LY_MIN_MEMORY_PER_CORE to restrict the number
+# of cores that we will allow.  If set, it will use this as the minimum anticipated memory
+# that all cores will need in order to no fall below that number. 
+#
+# This is based on the value the total memory (in kB) divided by the LY_MIN_MEMORY_PER_CORE 
+# (in kB, e.g. 2 GB = 2097152 kB)
+
+if [[ "${LY_MIN_MEMORY_PER_CORE:-0}" -gt 0 ]]; then
+    MIN_MEMORY_PER_CORE=${LY_MIN_MEMORY_PER_CORE}
+    CALCULATED_MAX_CORE_USAGE=$(expr $TOTAL_MEMORY / $MIN_MEMORY_PER_CORE - 1)
+    CORE_COUNT=$((CALCULATED_MAX_CORE_USAGE > TOTAL_CORE_COUNT ? TOTAL_CORE_COUNT :  CALCULATED_MAX_CORE_USAGE))
+    echo "Max Usable Cores    : $CORE_COUNT"
+else
+    CORE_COUNT=$TOTAL_CORE_COUNT
+fi
+
+
+eval echo [ci_build] cmake --build . --target ${CMAKE_TARGET} --config ${CONFIGURATION} -j $CORE_COUNT -- ${CMAKE_NATIVE_BUILD_ARGS}
+eval cmake --build . --target ${CMAKE_TARGET} --config ${CONFIGURATION} -j $CORE_COUNT -- ${CMAKE_NATIVE_BUILD_ARGS}
 
 popd