Bug 16632 - Using -Wl,-bexpall causes many duplicate symbol warnings
Summary: Using -Wl,-bexpall causes many duplicate symbol warnings
Status: UNCONFIRMED
Alias: None
Product: R
Classification: Unclassified
Component: Installation (show other bugs)
Version: R-devel (trunk)
Hardware: PowerPC AIX
: P5 enhancement
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2015-12-15 14:09 UTC by Michael Felt
Modified: 2015-12-16 08:26 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Felt 2015-12-15 14:09:16 UTC
For a simple build I see over 800 duplicate symbol message warnings on AIX - caused by the addition of the ld option -bexpall

root@x065:[/data/prj/cran/32/R-devel]grep -n -i duplicate ../scripts/*001* | grep WARNING | wc
     815    4890   42636
root@x065:[/data/prj/cran/32/R-devel]grep -n -i duplicate ../scripts/*001* | grep WARNING | grep -v R_Output | wc
     804    4824   42003

The exclusion of R_Output has to do with bug https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16631

The following change eliminates most of these messages. The remaining messages are other bug(s) I am currently investigating.

This diff is not the correct to apply the proposed fix - but it does show, clearly, what was changed (I have only tested the 32-bit)

diff -ru R-devel_2015-12-14/configure R-devel/configure
--- R-devel_2015-12-14/configure        2015-12-07 02:00:31 +0000
+++ R-devel/configure   2015-12-15 10:29:13 +0000
@@ -28100,10 +28100,13 @@
     ##ADD: This black magic puts lc before lR and pockets this.
     if test "x${OBJECT_MODE}" = "x64"; then
       main_ldflags="${wl}-brtl ${wl}-bexpall ${wl}-bpT:0x100000000 ${wl}-bpD:0x110000000 -lc"
+      main_ldflags="${wl}-brtl ${wl}-bpT:0x100000000 ${wl}-bpD:0x110000000 -lc"
     else
       main_ldflags="${wl}-brtl ${wl}-bexpall -lc"
+      main_ldflags="${wl}-brtl ${wl}-bmaxdata:0xd0000000/dsa -lc"
     fi
     shlib_ldflags="${wl}-brtl ${wl}-G ${wl}-bexpall ${wl}-bnoentry -lc"
+    shlib_ldflags="${wl}-brtl ${wl}-G ${wl}-bnoentry -lc"
     SHLIB_LIBADD="\$(LIBM)"
     shlib_cxxldflags="${shlib_ldflags}"
     if test "${GCC}" = yes; then

PLEASE NOTE: the addition of the flag -bmaxdata:0xd0000000/dsa has nothing to do with the duplicate symbols - however, it does increase the default maxdata to 13x 256MB (or > 3GB) for the 32-bit build. Without this, it is only 256MB.

After this patch:
root@x065:[/data/prj/cran/32/R-devel]grep -n -i duplicate ../scripts/*002* | grep WARNING | grep -v R_Output | wc
       7      42     401
or

root@x065:[/data/prj/cran/32/R-devel]grep -n -i duplicate ../scripts/*002* | grep WARNING | grep -v R_Output
711:ld: 0711-224 WARNING: Duplicate symbol: Rf_yylval
712:ld: 0711-224 WARNING: Duplicate symbol: Rf_yychar
713:ld: 0711-224 WARNING: Duplicate symbol: Rf_yynerrs
799:ld: 0711-224 WARNING: Duplicate symbol: baseRegisterIndex
832:ld: 0711-224 WARNING: Duplicate symbol: .Rf_dpptr
833:ld: 0711-224 WARNING: Duplicate symbol: baseRegisterIndex
834:ld: 0711-224 WARNING: Duplicate symbol: Rf_dpptr