Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can I force gcc to use another linker

281 views
Skip to first unread message

Klaus Zeitler

unread,
Jan 22, 2004, 8:11:24 AM1/22/04
to

they've recently installed gcc 3.3.2 on our solaris 5.8 machines (before
we used 3.0.4).

When I try to start emacs (built with the new compiler) I get a segmentation
fault in /usr/lib/libXt.so.4.

Looking closer at the 2 compiler versions I figured out, that gcc 3.0.4
calls the sun linker
(ld: Software Generation Utilities - Solaris Link Editors: 5.8-1.283),
whereas gcc 3.3.2 calls GNU ld (GNU ld version 2.14 20030612).

One of the emacs maintainer asked me if I could force gcc in using the SUN
linker.

According to gccint info I think it should be possible

---snip ---
The program `collect2' is installed as `ld' in the directory where
the passes of the compiler are installed. When `collect2' needs to
find the _real_ `ld', it tries the following file names:

* `real-ld' in the directories listed in the compiler's search
directories.

* `real-ld' in the directories listed in the environment variable
`PATH'.

* The file specified in the `REAL_LD_FILE_NAME' configuration macro,
if specified.

* `ld' in the compiler's search directories, except that `collect2'
will not execute itself recursively.

* `ld' in `PATH'.

"The compiler's search directories" means all the directories where
`gcc' searches for passes of the compiler. This includes directories
that you specify with `-B'.
--- snip ---

I've tried a link of real-ld to SUN ld and made sure that this link and also
SUN ld are found first in my PATH, but gcc 3.3.2 always calls GNU ld.

Can I force the use of a specific linker? If not I guess I need to have
gcc rebuilt for use of the SUN linker.

Thanks for your help

Klaus Zeitler


--
------------------------------------------
| Klaus Zeitler Lucent Technologies |
------------------------------------------
---
A budget is just a method of worrying before
you spend money, as well as afterward.

Wim Lauwers

unread,
Jan 23, 2004, 3:55:06 AM1/23/04
to
Klaus Zeitler wrote:
> Can I force the use of a specific linker? If not I guess I need to have
> gcc rebuilt for use of the SUN linker.

Yep, gcc has the path to the linker and assembler built-in (maybe in
some config file, but I wouldn't trust changing that). I always rebuild
if necessary. If you wan't to force using GNU as and ld, use
--with-gnu-as and --with-gnu-ld for "configure". You can also use
--with-ld=/path/ld and --with-as==/path/as.

Regards,
Wim

0 new messages