[Top][All Lists]

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

Re: Static linking errors on Solaris-2.5.1

From: Sven Mascheck
Subject: Re: Static linking errors on Solaris-2.5.1
Date: 27 Jun 2001 18:02:45 +0200
User-agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))

address@hidden wrote:

> gcc -L./builtins [...] -static  [...]
> -lmalloc -Wl,-B,dynamic -Wl,-R/etc/lib -ldl -Wl,-B,static -lintl 

> ld: fatal: option -dn and -Bdynamic are incompatible

"-dn" for the linker is apparently caused by "-static" for the driver.
Manually repeating the above gcc-call without "-static" should
work, as "-Wl,-Bstatic" already suffices.

configuring without "--enable-static-linking" and making with

> make STATIC_LD= LOCAL_LIBS='-Wl,-B,dynamic -Wl,-R/etc/lib -ldl

should work also.

BTW, "-Wl,-L/etc/lib" (aka "-L/etc/lib") might also be necessary,
as "-R" is not evaluated for the compile time search path
and /usr/lib interestingly enough is not always searched (for me).

When experimenting, whatch out for a second "-ldl" wrongly not
surrounded by the "-Wl,-Bstatic ... dynamic", as it might (amazingly)
get wrong the compile time search path again:

  $ gcc -L./builtins [...]
  -Wl,-B,dynamic -Wl,-R/etc/lib -ldl -Wl,-B,static -Wl,-L/etc/lib -lintl -ldl
  ld: fatal: library -ldl: not found

no matter if "-Wl,-L/etc/lib" or "-L/etc/lib" (as gcc knows about
the -R and -L options for ld(1) on Solaris well).

Sven  (BTW, gcc-2.95.2)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]