[csw-users] configure: error: C compiler cannot create executables

Sebastian Kayser skayser at opencsw.org
Wed Mar 11 13:08:57 CET 2009


Hi Maciej,

Maciej Bliziński wrote:
> I'm trying to build a package using gcc4. Running configure...
> ...
> ld: fatal: File processing errors. No output written to a.out
> 
> collect2: ld returned 1 exit status
> 
> As a workaround, I could use:
> 
> chmod 644 /usr/ccs/bin/ld
> cd /opt/csw/bin/
> ln -s gld ld
> 
> But it's ugly. Do you have any better ideas?

i am not a gcc expert (compile all my packages with Sun Studio),
but i faced a similar question a while ago and that's what i found out
then.

Other than what one might think, gcc -> /usr/ccs/bin/ld is a valid build
chain and according to some a more robust one than gcc -> gld [1,2].
Of course, the configure script has to be clever enough to notice the
non GNU ld, which it doesn't seem to be in your case.

You might give the -B option [3] to gcc/collect2 a try (pass it along
with EXTRA_CFLAGS), although i don't know whether it is intended for
that sort of stuff.

Any particular reason you are compiling with gcc? Sun Studio 11 is the
default compiler used with GAR and its available for free [4]. Install
it with a prefix of /opt/studio/SOS11 and you have a machine that
closely resembles one of our build hosts. I am not saying that this
will make your life easier regarding the builds though ;)

I usually tweak the autoconf files or Makefiles until they configure
and build with Sun Studio.

Sebastian

[1] http://opensolaris.org/jive/thread.jspa?messageID=155501
[2] http://sourceware.org/ml/binutils/2006-11/msg00301.html
[3] http://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/Directory-Options.html#index-B-664
[4] http://developers.sun.com/sunstudio/products/previous/11/index.jsp




More information about the users mailing list