Skip to content

Commit 52befa6

Browse files
author
kalibera
committed
Fix parsing of dump of import tables with recent binutils on Windows. Include
symbols from static libraries to symbols.rds for package checks (enable 87984 on Windows). git-svn-id: https://svn.r-project.org/R/trunk@88026 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent af8ba44 commit 52befa6

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

share/make/winshlib.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ shlib-clean:
3333
## FIXME: why not Rscript?
3434
symbols.rds: $(OBJECTS)
3535
@$(ECHO) "tools:::.shlib_objects_symbol_tables()" | \
36-
$(R_HOME)/bin$(R_ARCH)/Rterm.exe --vanilla --no-echo --args $(OBJECTS)
36+
$(R_HOME)/bin$(R_ARCH)/Rterm.exe --vanilla --no-echo --args $(OBJECTS) --pkglibs $(PKG_LIBS)
3737

3838
compilers:
3939
@$(ECHO) "CC = $(CC)"

src/library/tools/R/sotools.R

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File src/library/tools/R/sotools.R
22
# Part of the R package, https://www.R-project.org
33
#
4-
# Copyright (C) 2011-2024 The R Core Team
4+
# Copyright (C) 2011-2025 The R Core Team
55
#
66
# This program is free software; you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
@@ -49,7 +49,12 @@ if(.Platform$OS.type == "windows") {
4949
l2 <- grep("^The Export Tables", s0)
5050
if (!length(l1) || !length(l2)) return()
5151
s1 <- s0[(l1[1L] + 2L):(l2 - 4L)]
52-
s2 <- grep("\t[0-9a-f]+\t +[0-9]+", s1, value = TRUE)
52+
53+
# The format of the dump of import tables changed in Rtools45
54+
# (binutils 2.43.1). Previously, there was a joint column
55+
# "Hint/Ord". Newly these are split ("Ordinal" and "Hint"). The
56+
# regex below has been relaxed to match both.
57+
s2 <- grep("\t[0-9a-f]+[\t ]+", s1, value = TRUE)
5358
sub(".* ([_A-Za-z0-9]+)$", "\\1", s2)
5459
}
5560
}
@@ -1049,16 +1054,9 @@ function(x, ...)
10491054
function(file = "symbols.rds")
10501055
{
10511056
args <- commandArgs(trailingOnly = TRUE)
1052-
## <FIXME WINDOWS>
1053-
if(.Platform$OS.type != "windows") {
1054-
pos <- which(args == "--pkglibs")[1L]
1055-
objects <- args[seq_len(pos - 1L)]
1056-
pkglibs <- args[-seq_len(pos)]
1057-
} else {
1058-
objects <- args
1059-
pkglibs <- character()
1060-
}
1061-
## </FIXME>
1057+
pos <- which(args == "--pkglibs")[1L]
1058+
objects <- args[seq_len(pos - 1L)]
1059+
pkglibs <- args[-seq_len(pos)]
10621060
## Also determine the local static libraries linked against by
10631061
## following the approach suggested in section "Compiling in
10641062
## sub-directories" of WRE.

0 commit comments

Comments
 (0)