diff options
| author | Mingming Liu <mingmingl@google.com> | 2025-09-10 15:25:31 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-10 15:25:31 -0700 |
| commit | 1417dafa1db9cb1b2b09438aa9f53ea5ab6e36e2 (patch) | |
| tree | 57f4b1f313c8cf74eed8819870f39c36ea263c68 /libclc/cmake | |
| parent | 898b813bc8a6d0276bf0f4769f5f2f64b34e632d (diff) | |
| parent | b8cefcb601ddaa18482555c4ff363c01a270c2fe (diff) | |
Merge branch 'main' into users/mingmingl-llvm/samplefdo-profile-formatusers/mingmingl-llvm/samplefdo-profile-format
Diffstat (limited to 'libclc/cmake')
| -rw-r--r-- | libclc/cmake/modules/AddLibclc.cmake | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/libclc/cmake/modules/AddLibclc.cmake b/libclc/cmake/modules/AddLibclc.cmake index 5cc202ddbaa8..aa8dd9859cd2 100644 --- a/libclc/cmake/modules/AddLibclc.cmake +++ b/libclc/cmake/modules/AddLibclc.cmake @@ -92,19 +92,35 @@ function(link_bc) ${ARGN} ) - set( LINK_INPUT_ARG ${ARG_INPUTS} ) + if( ARG_INTERNALIZE ) + set( inputs_with_flag ${ARG_INPUTS} ) + else() + # Add the --override flag for non-generic bitcode files so that their + # symbols can override definitions in generic bitcode files. + set( inputs_with_flag ) + foreach( file IN LISTS ARG_INPUTS ) + string( FIND ${file} "/generic/" is_generic ) + if( is_generic LESS 0 ) + list( APPEND inputs_with_flag "--override" ) + endif() + list( APPEND inputs_with_flag ${file} ) + endforeach() + endif() + if( WIN32 OR CYGWIN ) # Create a response file in case the number of inputs exceeds command-line # character limits on certain platforms. file( TO_CMAKE_PATH ${LIBCLC_ARCH_OBJFILE_DIR}/${ARG_TARGET}.rsp RSP_FILE ) # Turn it into a space-separate list of input files - list( JOIN ARG_INPUTS " " RSP_INPUT ) + list( JOIN inputs_with_flag " " RSP_INPUT ) file( GENERATE OUTPUT ${RSP_FILE} CONTENT ${RSP_INPUT} ) # Ensure that if this file is removed, we re-run CMake set_property( DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${RSP_FILE} ) set( LINK_INPUT_ARG "@${RSP_FILE}" ) + else() + set( LINK_INPUT_ARG ${inputs_with_flag} ) endif() if( ARG_INTERNALIZE ) |
