Hi guys,

hopefully we're getting closer to the root of the misunderstanding(s)
here. Under Mac OS X, things might not be as you expect them to be,
given that "gcc" (or some version of it) is used. I've tried to help a
bit with libSingular in the past, from there my experience stems from.

Let's simplify a bit and say that there are two jobs to be done in
build scripts: firstly to compile (make ".o"'s from ".c"'s), and
secondly to link (make ".a"'s from ".o"'s). For the first job, usually
something which hides under the macro "GCC" is used (expanded by make
to "gcc", say). And for this first job, options "CFLAGS" are passed
along the way.

Now for the second job, i.e. linking, same story with "LD" instead of
"GCC" and "LDFLAGS" instead of "CFLAGS".

But --- at least under under Mac OS X, it makes a huge difference
whether "LD" expands to "ld", or (say) "libtool", or whether
"LD" (used for linking purposes solely and explicitly!!) expands to
"gcc". Bug me (hard) if really you need to see a concrete example from
e.g. the Singular build environment. But in the latter case (where
"gcc" is used under Mac OS X to *link* things, not compile them), some
magic is happening, which in one case or the other is needed to get
things working at all.

>From my memory, using "gcc" instead of "ld" silently adds certain
libraries from certain internal compiler/system paths during linkage,
and Singular would refuse to execute at runtime with some unresolved
symbol error when using "ld" only instead of "gcc".
(Error message: "Symbol not found: ___eprintf", please refer to trac
tickets #6470 et.al. for some history.)

And that might very well explain what we see here: passing the "-m64"
option to "gcc" used for *linking* purposes perhaps (I don't know for
sure, but it's at least plausible, isn't it?) silently adds different
libraries than it does without the "-m64" option.

I won't argue at all about what "in pure theory" the "GCC" resp.
"CFLAGS" resp. "LD" resp. "LDFLAGS" are supposed to mean. In real
life, Apple's version (adaption?) of gcc sometimes does not seem to
meet certain expectations. Please have a look at the GMP library
homepage (http://www.gmplib.org/macos.html) for some third party
opinions on that.

Cheers,
Georg
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to