@@ -965,6 +965,16 @@ if(.Platform$OS.type == "windows") {
965965 if (! length(so_files )) return (invisible (NULL )) # typically a fake install
966966
967967 bad <- Filter(length , lapply(so_files , check_so_symbols ))
968+ # # Allow experimenting with finding bad symbols not in
969+ # # symbols.rds, likely from following the "best approach" from
970+ # # section "Compiling in sub-directories" of WRE and compiling
971+ # # code in subdirs into static libraries instead of adding to
972+ # # OBJECTS.
973+ # # See PR#18789 <https://bugs.r-project.org/show_bug.cgi?id=18789>,
974+ # # "R CMD check does not check symbol tables of linked static
975+ # # libraries".
976+ if (config_val_to_logical(Sys.getenv(" _R_CHECK_COMPILED_CODE_USE_OBJECTS_SYMBOL_TABLES_" ,
977+ " TRUE" ))) {
968978 objects_symbol_tables_file <- if (nzchar(r_arch ))
969979 file.path(dir , " libs" , r_arch , " symbols.rds" )
970980 else file.path(dir , " libs" , " symbols.rds" )
@@ -973,6 +983,7 @@ if(.Platform$OS.type == "windows") {
973983 bad <- Filter(length , lapply(bad , compare ))
974984 } else if (useST )
975985 cat(" Note: information on .o files is not available\n " )
986+ }
976987 nAPIs <- lapply(lapply(so_files , check_so_symbols ),
977988 function (x ) if (length(z <- attr(x , " nonAPI" )))
978989 structure(z ,
0 commit comments