[R-SIG-Mac] namespaces in OS X

Jan de Leeuw deleeuw at stat.ucla.edu
Sun Oct 23 23:26:05 CEST 2005


The Mac OS X linker can create object files with flat namespaces, in
which the default is to abort if there is more than one
definition, and object files with two-level namespaces, in which
the default is to just issue a warning. If two-level namespaces
are used then not just the symbol name is remembered, but also in
which file it was defined.

In the current setup for R the main program is linked by using the
default, which is two-level namespaces, but the packages are linked
using flat namespaces.

One easy way to force a link anyway is to call gcc with the
flag "-Xlinker -m", which means that multiple definitions only lead to
warnings even if objects with flat namespaces are created (and it  
basically
means that the last definition of the symbol seen by the linker is used,
overriding the others).

Apple strongly advises against this practice, of course it is dangerous,
and modifying the source files using external definitions is really  
the way to
go.


On Oct 23, 2005, at 24:35 , Paul Roebuck wrote:


> It's not exactly what I would call peculiar ("odd"); rather
> it simply enforces that a given variable definition only
> occurs once.
>


===
Jan de Leeuw; Distinguished Professor and Chair, UCLA Department of  
Statistics;
Editor: Journal of Multivariate Analysis, Journal of Statistical  
Software
US mail: 8130 Math Sciences Bldg, Box 951554, Los Angeles, CA 90095-1554
phone (310)-825-9550;  fax (310)-206-5658;  email: deleeuw at stat.ucla.edu
.mac: jdeleeuw ++++++  aim: deleeuwjan ++++++ skype: j_deleeuw
homepages: http://gifi.stat.ucla.edu ++++++ http://www.cuddyvalley.org
   
------------------------------------------------------------------------ 
-------------------------
           No matter where you go, there you are. --- Buckaroo Banzai
                    http://gifi.stat.ucla.edu/sounds/nomatter.au



More information about the R-SIG-Mac mailing list