From 7510860a8051cf2570e24581e9438f1762518e44 Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Tue, 5 Nov 2024 12:28:37 +0000 Subject: [PATCH 1/4] Patches for building on AIX --- CMakeLists.txt | 7 +++++++ cmake/opentelemetry-proto.cmake | 3 ++- cmake/tools.cmake | 4 ++++ .../sdk/resource/semantic_conventions.h | 13 +++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0710834bf..ec46f759b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,13 @@ else() elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) set(ARCH x86) endif() + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc") + # AIX will report the processor as 'powerpc' even if building in 64-bit mode + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(ARCH ppc64) + else() + set(ARCH ppc32) + endif() elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*|arm64.*|ARM64.*)") set(ARCH arm64) diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake index fa6e185c13..30da0aee16 100644 --- a/cmake/opentelemetry-proto.cmake +++ b/cmake/opentelemetry-proto.cmake @@ -348,7 +348,8 @@ if(WITH_OTLP_GRPC) target_link_libraries(opentelemetry_proto_grpc PUBLIC opentelemetry_proto) get_target_property(grpc_lib_type gRPC::grpc++ TYPE) - if(grpc_lib_type STREQUAL "SHARED_LIBRARY") + get_target_property(opentelemetry_proto_grpc_lib_type opentelemetry_proto_grpc TYPE) + if ((grpc_lib_type STREQUAL "SHARED_LIBRARY") OR (opentelemetry_proto_grpc_lib_type STREQUAL "SHARED_LIBRARY")) target_link_libraries(opentelemetry_proto_grpc PUBLIC gRPC::grpc++) endif() set_target_properties(opentelemetry_proto_grpc PROPERTIES EXPORT_NAME diff --git a/cmake/tools.cmake b/cmake/tools.cmake index 43c1a7b43f..d01257d386 100644 --- a/cmake/tools.cmake +++ b/cmake/tools.cmake @@ -160,6 +160,10 @@ function(project_build_tools_patch_default_imported_config) if(IS_ALIAS_TARGET) continue() endif() + get_target_property(IS_ALIASED_TARGET ${TARGET_NAME} ALIASED_TARGET) + if (IS_ALIASED_TARGET) + continue() + endif() if(CMAKE_VERSION VERSION_LESS "3.19.0") get_target_property(TARGET_TYPE_NAME ${TARGET_NAME} TYPE) diff --git a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h index 9ff985be4d..fd67abc560 100644 --- a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h +++ b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h @@ -13,6 +13,19 @@ #include "opentelemetry/common/macros.h" #include "opentelemetry/version.h" +/* + * Special considerations for HostArchValues + * + * The sys/systemcfg.h header on AIX is known to define an IA64 macro, + * which collides with HostArchValues::IA64. + */ +#ifdef _AIX +# ifdef IA64 +# pragma message "Removing define on IA64" +# undef IA64 +# endif +#endif + OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { From e477abba7c3e4dd7cce60fc413664ab59c326107 Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Thu, 7 Nov 2024 14:15:35 +0000 Subject: [PATCH 2/4] Remove duplicated action on alias target --- cmake/tools.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cmake/tools.cmake b/cmake/tools.cmake index d01257d386..43c1a7b43f 100644 --- a/cmake/tools.cmake +++ b/cmake/tools.cmake @@ -160,10 +160,6 @@ function(project_build_tools_patch_default_imported_config) if(IS_ALIAS_TARGET) continue() endif() - get_target_property(IS_ALIASED_TARGET ${TARGET_NAME} ALIASED_TARGET) - if (IS_ALIASED_TARGET) - continue() - endif() if(CMAKE_VERSION VERSION_LESS "3.19.0") get_target_property(TARGET_TYPE_NAME ${TARGET_NAME} TYPE) From 50457135a2dfe0af59ec59463cabb2df9891146e Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Sun, 10 Nov 2024 06:27:47 +0000 Subject: [PATCH 3/4] Withdraw undef of IA64 as already fixed by CNCF --- .../sdk/resource/semantic_conventions.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h index fd67abc560..9ff985be4d 100644 --- a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h +++ b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h @@ -13,19 +13,6 @@ #include "opentelemetry/common/macros.h" #include "opentelemetry/version.h" -/* - * Special considerations for HostArchValues - * - * The sys/systemcfg.h header on AIX is known to define an IA64 macro, - * which collides with HostArchValues::IA64. - */ -#ifdef _AIX -# ifdef IA64 -# pragma message "Removing define on IA64" -# undef IA64 -# endif -#endif - OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { From 4c908f77fc770e22a428cdfb31781d31d2dbf534 Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Mon, 11 Nov 2024 08:44:44 +0000 Subject: [PATCH 4/4] Back out change to cmake/opentelemetry-proto.cmake as it caused the tests to go into a loop --- cmake/opentelemetry-proto.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake index 30da0aee16..fa6e185c13 100644 --- a/cmake/opentelemetry-proto.cmake +++ b/cmake/opentelemetry-proto.cmake @@ -348,8 +348,7 @@ if(WITH_OTLP_GRPC) target_link_libraries(opentelemetry_proto_grpc PUBLIC opentelemetry_proto) get_target_property(grpc_lib_type gRPC::grpc++ TYPE) - get_target_property(opentelemetry_proto_grpc_lib_type opentelemetry_proto_grpc TYPE) - if ((grpc_lib_type STREQUAL "SHARED_LIBRARY") OR (opentelemetry_proto_grpc_lib_type STREQUAL "SHARED_LIBRARY")) + if(grpc_lib_type STREQUAL "SHARED_LIBRARY") target_link_libraries(opentelemetry_proto_grpc PUBLIC gRPC::grpc++) endif() set_target_properties(opentelemetry_proto_grpc PROPERTIES EXPORT_NAME