diff --git a/cmake/modules/platform/toolcfg/xlc.cmake b/cmake/modules/platform/toolcfg/xlc.cmake index f20d8f2abfc..84868a60128 100644 --- a/cmake/modules/platform/toolcfg/xlc.cmake +++ b/cmake/modules/platform/toolcfg/xlc.cmake @@ -168,7 +168,12 @@ elseif(OMR_OS_ZOS) # Configure the platform dependent library for multithreading set(OMR_PLATFORM_THREAD_LIBRARY "") +endif() + +set(SPP_CMD ${CMAKE_C_COMPILER}) +set(SPP_FLAGS -E -P) +if(OMR_OS_ZOS) function(_omr_toolchain_process_exports TARGET_NAME) # We only need to do something if we are dealing with a shared library get_target_property(target_type ${TARGET_NAME} TYPE) @@ -181,7 +186,19 @@ elseif(OMR_OS_ZOS) -Wc,DLL,EXPORTALL ) endfunction() -endif() +else() + function(_omr_toolchain_process_exports TARGET_NAME) + # we only need to do something if we are dealing with a shared library + get_target_property(target_type ${TARGET_NAME} TYPE) + if(NOT target_type STREQUAL "SHARED_LIBRARY") + return() + endif() -set(SPP_CMD ${CMAKE_C_COMPILER}) -set(SPP_FLAGS -E -P) + set(exp_file "$/${TARGET_NAME}.exp") + omr_process_template( + "${omr_SOURCE_DIR}/cmake/modules/platform/toolcfg/xlc_exports.exp.in" + "${exp_file}" + ) + set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-bE:${TARGET_NAME}.exp") + endfunction() +endif() diff --git a/cmake/modules/platform/toolcfg/xlc_exports.exp.in b/cmake/modules/platform/toolcfg/xlc_exports.exp.in new file mode 100644 index 00000000000..8e8c90cc723 --- /dev/null +++ b/cmake/modules/platform/toolcfg/xlc_exports.exp.in @@ -0,0 +1,23 @@ +******************************************************************************* +* Copyright (c) 2019, 2019 IBM Corp. and others +* +* This program and the accompanying materials are made available under +* the terms of the Eclipse Public License 2.0 which accompanies this +* distribution and is available at http://eclipse.org/legal/epl-2.0 +* or the Apache License, Version 2.0 which accompanies this distribution +* and is available at https://www.apache.org/licenses/LICENSE-2.0. +* +* This Source Code may also be made available under the following Secondary +* Licenses when the conditions for such availability set forth in the +* Eclipse Public License, v. 2.0 are satisfied: GNU General Public License, +* version 2 with the GNU Classpath Exception [1] and GNU General Public +* License, version 2 with the OpenJDK Assembly Exception [2]. +* +* [1] https://www.gnu.org/software/classpath/license.html +* [2] http://openjdk.java.net/legal/assembly-exception.html +* +* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception +***************************************************************************** + +$, +>