From 208c198d71476ebbe867d41dfc62b997c316bc2a Mon Sep 17 00:00:00 2001 From: Vladislav Sytchenko Date: Mon, 31 May 2021 19:28:19 -0400 Subject: [PATCH] SWDEV-273235 - Correct linker export file usage CMake doesn't handle linker export files in a general way well. On Windows it is able to recognize a .def file and pass it to the linker. Unfortunately it cannot do the same thing on Linux, so we have to manually specify it. Note that CMake can't recognize the current Windows export file due to the .in suffix, hence why the amdocl.def file is being added. The amdocl.def.in file will be removed later, as the Makefile build still uses it. Change-Id: I33a4151af0257d56d46cd27cbd028b34b77b706b [ROCm/clr commit: 75b232eea24c3841eecbb67d7c2d245580d19866] --- projects/clr/opencl/amdocl/CMakeLists.txt | 1 + projects/clr/opencl/amdocl/amdocl.def | 125 ++++++++++++++++++ .../clr/opencl/tools/cltrace/CMakeLists.txt | 1 + 3 files changed, 127 insertions(+) create mode 100644 projects/clr/opencl/amdocl/amdocl.def diff --git a/projects/clr/opencl/amdocl/CMakeLists.txt b/projects/clr/opencl/amdocl/CMakeLists.txt index 0294d73eac..ee7270d38b 100644 --- a/projects/clr/opencl/amdocl/CMakeLists.txt +++ b/projects/clr/opencl/amdocl/CMakeLists.txt @@ -97,6 +97,7 @@ if(BUILD_SHARED_LIBS) if(WIN32) target_sources(amdocl PRIVATE amdocl.def) else() + target_link_options(amdocl PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_LIST_DIR}/amdocl.map") set_target_properties(amdocl PROPERTIES LINK_DEPENDS "${CMAKE_CURRENT_LIST_DIR}/amdocl.map") endif() endif() diff --git a/projects/clr/opencl/amdocl/amdocl.def b/projects/clr/opencl/amdocl/amdocl.def new file mode 100644 index 0000000000..d16f85b2f8 --- /dev/null +++ b/projects/clr/opencl/amdocl/amdocl.def @@ -0,0 +1,125 @@ +EXPORTS +clBuildProgram +clCreateBuffer +clCreateCommandQueue +clCreateContext +clCreateContextFromType +clCreateFromGLBuffer +clCreateFromGLRenderbuffer +clCreateFromGLTexture2D +clCreateFromGLTexture3D +clCreateImage2D +clCreateImage3D +clCreateKernel +clCreateKernelsInProgram +clCreateProgramWithBinary +clCreateProgramWithSource +clCreateSampler +clEnqueueAcquireGLObjects +clEnqueueBarrier +clEnqueueCopyBuffer +clEnqueueCopyBufferToImage +clEnqueueCopyImage +clEnqueueCopyImageToBuffer +clEnqueueMapBuffer +clEnqueueMapImage +clEnqueueMarker +clEnqueueNDRangeKernel +clEnqueueNativeKernel +clEnqueueReadBuffer +clEnqueueReadImage +clEnqueueReleaseGLObjects +clEnqueueTask +clEnqueueUnmapMemObject +clEnqueueWaitForEvents +clEnqueueWriteBuffer +clEnqueueWriteImage +clFinish +clFlush +clGetCommandQueueInfo +clGetContextInfo +clGetDeviceIDs +clGetDeviceInfo +clGetEventInfo +clGetEventProfilingInfo +clGetExtensionFunctionAddress +clGetGLObjectInfo +clGetGLTextureInfo +clGetImageInfo +clGetKernelInfo +clGetKernelWorkGroupInfo +clGetMemObjectInfo +clGetPlatformIDs +clGetPlatformInfo +clGetProgramBuildInfo +clGetProgramInfo +clGetSamplerInfo +clGetSupportedImageFormats +clReleaseCommandQueue +clReleaseContext +clReleaseEvent +clReleaseKernel +clReleaseMemObject +clReleaseProgram +clReleaseSampler +clRetainCommandQueue +clRetainContext +clRetainEvent +clRetainKernel +clRetainMemObject +clRetainProgram +clRetainSampler +clSetCommandQueueProperty +clSetKernelArg +clUnloadCompiler +clWaitForEvents +clIcdGetPlatformIDsKHR +clCreateUserEvent +clSetUserEventStatus +clSetEventCallback +clSetMemObjectDestructorCallback +clCreateSubBuffer +clEnqueueReadBufferRect +clEnqueueWriteBufferRect +clEnqueueCopyBufferRect + +clCompileProgram +clCreateFromGLTexture +clCreateImage +clCreateProgramWithBuiltInKernels +clCreateSubDevices +clEnqueueBarrierWithWaitList +clEnqueueFillBuffer +clEnqueueFillImage +clEnqueueMarkerWithWaitList +clEnqueueMigrateMemObjects +clGetExtensionFunctionAddressForPlatform +clGetKernelArgInfo +clLinkProgram +clReleaseDevice +clRetainDevice +clUnloadPlatformCompiler + +clCreateCommandQueueWithProperties +clCreateSamplerWithProperties +clCreatePipe +clGetPipeInfo +clSVMAlloc +clSVMFree +clSetKernelArgSVMPointer +clSetKernelExecInfo +clEnqueueSVMFree +clEnqueueSVMMemcpy +clEnqueueSVMMemFill +clEnqueueSVMMap +clEnqueueSVMUnmap + +clCloneKernel +clCreateProgramWithIL +clEnqueueSVMMigrateMem +clGetDeviceAndHostTimer +clGetHostTimer +clGetKernelSubGroupInfo +clSetDefaultDeviceCommandQueue + +clCreateProgramWithIL diff --git a/projects/clr/opencl/tools/cltrace/CMakeLists.txt b/projects/clr/opencl/tools/cltrace/CMakeLists.txt index fa89669636..b8a432dcd3 100644 --- a/projects/clr/opencl/tools/cltrace/CMakeLists.txt +++ b/projects/clr/opencl/tools/cltrace/CMakeLists.txt @@ -3,6 +3,7 @@ add_library(cltrace SHARED cltrace.cpp) if(WIN32) target_sources(cltrace PRIVATE cltrace.def) else() + target_link_options(cltrace PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_LIST_DIR}/cltrace.map") set_target_properties(cltrace PROPERTIES LINK_DEPENDS "${CMAKE_CURRENT_LIST_DIR}/cltrace.map") endif()