Re: -m64 option in LDFLAGS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 20 Jan 2010, Dr. David Kirkby wrote:

On Solaris, where both 32 and 64-bit executables are built, it is necessary to use the -m64 flag to gcc/g++/gfortran to build 64-bit binaries. On some code I see people as:

LDFLAGS=-m64

before building the code. My understanding is that LDFLAGS is passed to the linker. Neither the GNU or Sun linkers have -m64 as an option (the Sun linker supports -64, but not -m64). So I can't understand how this does not generate an error message. Not only does if fail to generate an error, but some code will simply not build without having -m64 in LDFLAGS.

Can anyone explain this to me please?

LDFLAGS is passed to $LD, which nowadays should be gcc (or g++, gfortran). gcc in turn will call ld with options that ld can understand (it may actually go through collect2 in between).

--
Marc Glisse

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux