From nobody Thu Sep 21 15:29:25 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RrzpY2brPz4tZH2; Thu, 21 Sep 2023 15:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RrzpY1x96z4MRv; Thu, 21 Sep 2023 15:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695310165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3N5XTRJ1vnnZWV07e9QSEobJB+e8qwnNSZnc3Yu3p1A=; b=NPcPaIt0rJXupBv6VFqra61nHqBAza8HNbMK1hrfUI4EfYPSvF9oxSfu3VdEwlu0UiuQ1B 3AdHc85o1HQ6drKQw4RC3Fpyeq+qqMAqxs37RiM5hGZrQRN1D0oKgL+uwiELI5l3hlZvoS 1IMVLh1K9WEBhKK2JPGeAQvMEyVrLU0A0Y7gH/b0HHcYStZIsKIleFz0GATdl2gR5iDDis VZ0OlVagsJ+XWu6kVq0P7ldqWdu2I2KSuhotkwAb7FWO75KlUr9ux/FSBpcAGipmfZ3gmr w+xF1/0nfzE1CcSrzKEqWWkxgzsBjx7a1+0CWlFSiNYM1iravSzH2ysmJOU6sg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695310165; a=rsa-sha256; cv=none; b=Vc9kFfsDUeC+870C1ZPk/V5ccNVdCIvuSeWOSIwDpOeVO623CXzm8Zy0FBzydp1uReeDeW xSH7t+laRVAdvs+jX4pF80oFu1+3P1dT/U3KuYJZkiv+XuaGJpNPXWkEbBxtUtumaqupv1 VGQRRuvTyDqTxAQqugg8vQ0yfq9cXPkiCkvdXBtvR8dvDqVgDHgy5j0dsRvrTHVGN8TluZ V5qXoy8L5DNGQC4sV7v6q1MQNNo4WLW75fTOc9JCZIUTBLbpsGdJGlHjBsqIDc8R+/k3Qy Bf85wcJFgvsviNY+lTR5fcoiP/k6DLT0lK99/6HL0rcqTgZe11vCD82fX8EgWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695310165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3N5XTRJ1vnnZWV07e9QSEobJB+e8qwnNSZnc3Yu3p1A=; b=aHQZvCGkgHHsHvNFANbRXPbxczzSunsDr2TDwSFoTWpREsQCAi+7M1Cf3+0LO8AZLENmtO +xesSubtP+JeJY0TXObc7yZnlqbFhlQ5gC9LaKu2aSteYuqq2SxUly7qjdeiovJevkD6ZS hrZulrRPsnlA7eHc11TH4up3j8pL7ovLvBUKqPPZDlpz4wgCGXodya0p24YSltXh0XGBf8 4CB/1ps2CiwNKQi46dgFCTrEAMN0kQtdcl/Xrd4ovNeVSZcZ01NrzgZI00JUUgaMpYLeUH xKc6poFtXiItS/6MBaOFBDyMW1EdSNTHhwOSa3ouvbQWQy1ESVaUaeEHfFyrqw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RrzpY0rFXzkX0; Thu, 21 Sep 2023 15:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38LFTPax090508; Thu, 21 Sep 2023 15:29:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38LFTPk7090505; Thu, 21 Sep 2023 15:29:25 GMT (envelope-from git) Date: Thu, 21 Sep 2023 15:29:25 GMT Message-Id: <202309211529.38LFTPk7090505@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Brooks Davis Subject: git: 266b5f5c37cd - main - devel/llvm14: fix build with lld 17 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 266b5f5c37cd92bd0e726ebe1c63afdcce576578 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/ports/commit/?id=266b5f5c37cd92bd0e726ebe1c63afdcce576578 commit 266b5f5c37cd92bd0e726ebe1c63afdcce576578 Author: Dimitry Andric AuthorDate: 2023-09-21 10:35:28 +0000 Commit: Brooks Davis CommitDate: 2023-09-21 15:23:33 +0000 devel/llvm14: fix build with lld 17 PR: 273959 --- devel/llvm14/files/patch-backport-version-fixes | 375 ++++++++++++++++++++++++ 1 file changed, 375 insertions(+) diff --git a/devel/llvm14/files/patch-backport-version-fixes b/devel/llvm14/files/patch-backport-version-fixes new file mode 100644 index 000000000000..6964bfd7e54d --- /dev/null +++ b/devel/llvm14/files/patch-backport-version-fixes @@ -0,0 +1,375 @@ +diff --git llvm/tools/lto/CMakeLists.txt llvm/tools/lto/CMakeLists.txt +index 67f6d3af40e0..9382ee9588b3 100644 +--- llvm/tools/lto/CMakeLists.txt ++++ llvm/tools/lto/CMakeLists.txt +@@ -19,7 +19,11 @@ set(SOURCES + lto.cpp + ) + +-set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports) ++if (LLVM_LINK_LLVM_DYLIB) ++ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.dylib.exports) ++else() ++ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports) ++endif() + + if(CMAKE_SYSTEM_NAME STREQUAL AIX) + set(LTO_LIBRARY_TYPE MODULE) +diff --git llvm/tools/lto/lto.dylib.exports llvm/tools/lto/lto.dylib.exports +new file mode 100644 +index 000000000000..4164c3919a97 +--- /dev/null ++++ llvm/tools/lto/lto.dylib.exports +@@ -0,0 +1,77 @@ ++lto_get_error_message ++lto_get_version ++lto_initialize_disassembler ++lto_module_create ++lto_module_create_from_fd ++lto_module_create_from_fd_at_offset ++lto_module_create_from_memory ++lto_module_create_from_memory_with_path ++lto_module_create_in_local_context ++lto_module_create_in_codegen_context ++lto_module_has_ctor_dtor ++lto_module_get_linkeropts ++lto_module_get_macho_cputype ++lto_module_get_num_symbols ++lto_module_get_symbol_attribute ++lto_module_get_symbol_name ++lto_module_get_target_triple ++lto_module_set_target_triple ++lto_module_is_object_file ++lto_module_is_object_file_for_target ++lto_module_is_object_file_in_memory ++lto_module_is_object_file_in_memory_for_target ++lto_module_has_objc_category ++lto_module_dispose ++lto_api_version ++lto_codegen_set_diagnostic_handler ++lto_codegen_add_module ++lto_codegen_set_module ++lto_codegen_add_must_preserve_symbol ++lto_codegen_compile ++lto_codegen_create ++lto_codegen_create_in_local_context ++lto_codegen_dispose ++lto_codegen_set_debug_model ++lto_codegen_set_pic_model ++lto_codegen_write_merged_modules ++lto_codegen_debug_options ++lto_codegen_debug_options_array ++lto_codegen_set_assembler_args ++lto_codegen_set_assembler_path ++lto_codegen_set_cpu ++lto_codegen_compile_to_file ++lto_codegen_optimize ++lto_codegen_compile_optimized ++lto_codegen_set_should_internalize ++lto_codegen_set_should_embed_uselists ++lto_set_debug_options ++thinlto_create_codegen ++thinlto_codegen_dispose ++thinlto_codegen_add_module ++thinlto_codegen_process ++thinlto_module_get_num_objects ++thinlto_module_get_object ++thinlto_codegen_set_pic_model ++thinlto_codegen_set_cache_dir ++thinlto_codegen_set_cache_pruning_interval ++thinlto_codegen_set_cache_entry_expiration ++thinlto_codegen_set_final_cache_size_relative_to_available_space ++thinlto_codegen_set_cache_size_bytes ++thinlto_codegen_set_cache_size_megabytes ++thinlto_codegen_set_cache_size_files ++thinlto_codegen_set_savetemps_dir ++thinlto_codegen_set_cpu ++thinlto_debug_options ++lto_module_is_thinlto ++thinlto_codegen_add_must_preserve_symbol ++thinlto_codegen_add_cross_referenced_symbol ++thinlto_codegen_set_codegen_only ++thinlto_codegen_disable_codegen ++thinlto_module_get_num_object_files ++thinlto_module_get_object_file ++thinlto_set_generated_objects_dir ++lto_input_create ++lto_input_dispose ++lto_input_get_num_dependent_libraries ++lto_input_get_dependent_library ++lto_runtime_lib_symbols_list +diff --git llvm/tools/lto/lto.exports llvm/tools/lto/lto.exports +index 3abae5f0fcba..4164c3919a97 100644 +--- llvm/tools/lto/lto.exports ++++ llvm/tools/lto/lto.exports +@@ -45,12 +45,6 @@ lto_codegen_compile_optimized + lto_codegen_set_should_internalize + lto_codegen_set_should_embed_uselists + lto_set_debug_options +-LLVMCreateDisasm +-LLVMCreateDisasmCPU +-LLVMDisasmDispose +-LLVMDisasmInstruction +-LLVMSetDisasmOptions +-LLVMCreateDisasmCPUFeatures + thinlto_create_codegen + thinlto_codegen_dispose + thinlto_codegen_add_module +diff --git llvm/tools/remarks-shlib/CMakeLists.txt llvm/tools/remarks-shlib/CMakeLists.txt +index f22cedd9ead7..2f108a42c9aa 100644 +--- llvm/tools/remarks-shlib/CMakeLists.txt ++++ llvm/tools/remarks-shlib/CMakeLists.txt +@@ -9,7 +9,11 @@ if(LLVM_ENABLE_PIC) + libremarks.cpp + ) + +- set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports) ++ if (LLVM_LINK_LLVM_DYLIB) ++ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.dylib.exports) ++ else() ++ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports) ++ endif() + + add_llvm_library(Remarks SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES}) + +diff --git llvm/tools/remarks-shlib/Remarks.dylib.exports llvm/tools/remarks-shlib/Remarks.dylib.exports +new file mode 100644 +index 000000000000..0c2a3c38c78c +--- /dev/null ++++ llvm/tools/remarks-shlib/Remarks.dylib.exports +@@ -0,0 +1 @@ ++LLVMRemarkVersion +diff --git openmp/libomptarget/plugins/exports openmp/libomptarget/plugins/exports +index 8664a2e493ee..cc7beda183af 100644 +--- openmp/libomptarget/plugins/exports ++++ openmp/libomptarget/plugins/exports +@@ -1,36 +1,6 @@ + VERS1.0 { + global: +- __tgt_rtl_is_valid_binary; +- __tgt_rtl_is_data_exchangable; +- __tgt_rtl_number_of_devices; +- __tgt_rtl_init_requires; +- __tgt_rtl_init_device; +- __tgt_rtl_load_binary; +- __tgt_rtl_data_alloc; +- __tgt_rtl_data_submit; +- __tgt_rtl_data_submit_async; +- __tgt_rtl_data_retrieve; +- __tgt_rtl_data_retrieve_async; +- __tgt_rtl_data_exchange; +- __tgt_rtl_data_exchange_async; +- __tgt_rtl_data_delete; +- __tgt_rtl_run_target_team_region; +- __tgt_rtl_run_target_team_region_async; +- __tgt_rtl_run_target_region; +- __tgt_rtl_run_target_region_async; +- __tgt_rtl_synchronize; +- __tgt_rtl_register_lib; +- __tgt_rtl_unregister_lib; +- __tgt_rtl_supports_empty_images; +- __tgt_rtl_set_info_flag; +- __tgt_rtl_print_device_info; +- __tgt_rtl_create_event; +- __tgt_rtl_record_event; +- __tgt_rtl_wait_event; +- __tgt_rtl_sync_event; +- __tgt_rtl_destroy_event; +- __tgt_rtl_init_device_info; +- __tgt_rtl_init_async_info; ++ __tgt_rtl*; + local: + *; + }; +diff --git openmp/libomptarget/src/exports openmp/libomptarget/src/exports +index 0ef4c8cce521..425a6fad49cf 100644 +--- openmp/libomptarget/src/exports ++++ openmp/libomptarget/src/exports +@@ -48,7 +48,6 @@ VERS1.0 { + omp_get_interop_int; + omp_get_interop_name; + omp_get_interop_type_desc; +- omp_get_interop_rc_desc; + __tgt_interop_init; + __tgt_interop_use; + __tgt_interop_destroy; +diff --git openmp/runtime/cmake/LibompHandleFlags.cmake openmp/runtime/cmake/LibompHandleFlags.cmake +index 9e19e59ba17d..1ddbc870e0f1 100644 +--- openmp/runtime/cmake/LibompHandleFlags.cmake ++++ openmp/runtime/cmake/LibompHandleFlags.cmake +@@ -98,7 +98,6 @@ function(libomp_get_ldflags ldflags) + IF_DEFINED CMAKE_C_OSX_CURRENT_VERSION_FLAG) + libomp_append(ldflags_local "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}${LIBOMP_VERSION_MAJOR}.${LIBOMP_VERSION_MINOR}" + IF_DEFINED CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG) +- libomp_append(ldflags_local -Wl,--warn-shared-textrel LIBOMP_HAVE_WARN_SHARED_TEXTREL_FLAG) + libomp_append(ldflags_local -Wl,--as-needed LIBOMP_HAVE_AS_NEEDED_FLAG) + libomp_append(ldflags_local "-Wl,--version-script=${LIBOMP_SRC_DIR}/exports_so.txt" LIBOMP_HAVE_VERSION_SCRIPT_FLAG) + libomp_append(ldflags_local -static-libgcc LIBOMP_HAVE_STATIC_LIBGCC_FLAG) +diff --git openmp/runtime/cmake/config-ix.cmake openmp/runtime/cmake/config-ix.cmake +index 0fe1266b0067..d3806a446743 100644 +--- openmp/runtime/cmake/config-ix.cmake ++++ openmp/runtime/cmake/config-ix.cmake +@@ -131,9 +131,8 @@ if(WIN32) + libomp_check_linker_flag(/SAFESEH LIBOMP_HAVE_SAFESEH_FLAG) + elseif(NOT APPLE) + libomp_check_linker_flag(-Wl,-x LIBOMP_HAVE_X_FLAG) +- libomp_check_linker_flag(-Wl,--warn-shared-textrel LIBOMP_HAVE_WARN_SHARED_TEXTREL_FLAG) + libomp_check_linker_flag(-Wl,--as-needed LIBOMP_HAVE_AS_NEEDED_FLAG) +- libomp_check_linker_flag("-Wl,--version-script=${LIBOMP_SRC_DIR}/exports_so.txt" LIBOMP_HAVE_VERSION_SCRIPT_FLAG) ++ libomp_check_linker_flag("-Wl,--version-script=${LIBOMP_SRC_DIR}/exports_test_so.txt" LIBOMP_HAVE_VERSION_SCRIPT_FLAG) + libomp_check_linker_flag(-static-libgcc LIBOMP_HAVE_STATIC_LIBGCC_FLAG) + libomp_check_linker_flag(-Wl,-z,noexecstack LIBOMP_HAVE_Z_NOEXECSTACK_FLAG) + endif() +diff --git openmp/runtime/src/exports_so.txt openmp/runtime/src/exports_so.txt +index ac188af31055..834c6118d820 100644 +--- openmp/runtime/src/exports_so.txt ++++ openmp/runtime/src/exports_so.txt +@@ -71,10 +71,8 @@ VERSION { + __kmp_fork_call; + __kmp_invoke_microtask; + #if KMP_USE_MONITOR +- __kmp_launch_monitor; + __kmp_reap_monitor; + #endif +- __kmp_launch_worker; + __kmp_reap_worker; + __kmp_release_64; + __kmp_wait_64; +diff --git openmp/runtime/src/exports_test_so.txt openmp/runtime/src/exports_test_so.txt +new file mode 100644 +index 000000000000..912d160e7c06 +--- /dev/null ++++ openmp/runtime/src/exports_test_so.txt +@@ -0,0 +1,60 @@ ++# exports_test_so.txt # ++ ++# ++#//===----------------------------------------------------------------------===// ++#// ++#// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. ++#// See https://llvm.org/LICENSE.txt for license information. ++#// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception ++#// ++#//===----------------------------------------------------------------------===// ++# ++ ++# This is used only to test if the linker supports version scripts. If the full ++# version script it used we may error on undefined symbols and erroneously fail. ++ ++VERSION { ++ ++ global: # Exported symbols. ++ ++ *; # All symbols as exported for testing. ++ ++ local: # Non-exported symbols. ++ ++ *; # All other symbols are not exported. ++ ++}; # VERSION ++ ++# sets up GCC OMP_ version dependency chain ++OMP_1.0 { ++}; ++OMP_2.0 { ++} OMP_1.0; ++OMP_3.0 { ++} OMP_2.0; ++OMP_3.1 { ++} OMP_3.0; ++OMP_4.0 { ++} OMP_3.1; ++OMP_4.5 { ++} OMP_4.0; ++OMP_5.0 { ++} OMP_4.5; ++ ++# sets up GCC GOMP_ version dependency chain ++GOMP_1.0 { ++}; ++GOMP_2.0 { ++} GOMP_1.0; ++GOMP_3.0 { ++} GOMP_2.0; ++GOMP_4.0 { ++} GOMP_3.0; ++GOMP_4.5 { ++} GOMP_4.0; ++GOMP_5.0 { ++} GOMP_4.5; ++GOMP_5.0.1 { ++} GOMP_5.0; ++ ++# end of file # +diff --git openmp/runtime/src/kmp_runtime.cpp openmp/runtime/src/kmp_runtime.cpp +index e1af2f43dae7..3db713e8c88b 100644 +--- openmp/runtime/src/kmp_runtime.cpp ++++ openmp/runtime/src/kmp_runtime.cpp +@@ -9156,3 +9156,20 @@ void __kmp_set_nesting_mode_threads() { + if (__kmp_nesting_mode == 1) // turn on nesting for this case only + set__max_active_levels(thread, __kmp_nesting_mode_nlevels); + } ++ ++// Empty symbols to export (see exports_so.txt) when feature is disabled ++extern "C" { ++#if !KMP_STATS_ENABLED ++void __kmp_reset_stats() {} ++#endif ++#if !USE_DEBUGGER ++int __kmp_omp_debug_struct_info = FALSE; ++int __kmp_debugging = FALSE; ++#endif ++#if !USE_ITT_BUILD || !USE_ITT_NOTIFY ++void __kmp_itt_fini_ittlib() {} ++void __kmp_itt_init_ittlib() {} ++#endif ++} ++ ++// end of file +diff --git openmp/runtime/src/kmp_utility.cpp openmp/runtime/src/kmp_utility.cpp +index 48d31e5ee7b7..5937f8026e39 100644 +--- openmp/runtime/src/kmp_utility.cpp ++++ openmp/runtime/src/kmp_utility.cpp +@@ -403,3 +403,16 @@ void __kmp_expand_file_name(char *result, size_t rlen, char *pattern) { + + *pos = '\0'; + } ++ ++#if !OMPT_SUPPORT ++extern "C" { ++typedef struct ompt_start_tool_result_t ompt_start_tool_result_t; ++// Define symbols expected by VERSION script ++ompt_start_tool_result_t *ompt_start_tool(unsigned int omp_version, ++ const char *runtime_version) { ++ return nullptr; ++} ++ ++void ompt_libomp_connect(ompt_start_tool_result_t *result) { result = nullptr; } ++} ++#endif +diff --git openmp/runtime/src/z_Linux_util.cpp openmp/runtime/src/z_Linux_util.cpp +index 5cd6ad6a0339..f6cad7b5320a 100644 +--- openmp/runtime/src/z_Linux_util.cpp ++++ openmp/runtime/src/z_Linux_util.cpp +@@ -987,7 +987,7 @@ void __kmp_exit_thread(int exit_status) { + #if KMP_USE_MONITOR + void __kmp_resume_monitor(); + +-void __kmp_reap_monitor(kmp_info_t *th) { ++extern "C" void __kmp_reap_monitor(kmp_info_t *th) { + int status; + void *exit_val; + +@@ -1029,6 +1029,12 @@ void __kmp_reap_monitor(kmp_info_t *th) { + + KMP_MB(); /* Flush all pending memory write invalidates. */ + } ++#else ++// Empty symbol to export (see exports_so.txt) when ++// monitor thread feature is disabled ++extern "C" void __kmp_reap_monitor(kmp_info_t *th) { ++ (void)th; ++} + #endif // KMP_USE_MONITOR + + void __kmp_reap_worker(kmp_info_t *th) {