When trying to compile with OpenCSW GCC, I'm getting the following error:
ld: fatal: file crt1.o: open failed: No such file or directory
This error occurs on an Intel host, but not on a SPARC host. What should provide the file?
asked: 2012-04-19 by: automaciej
Seemone answers:
the package "lint" contains the file for Opensolaris snv_134
Gerardo answers:
Hi,
it's been some time since this questions was asked, by I happend to stumble on this same issue yesterday on a kind of fresh Solaris 10 x86 install.
First check that package SUNWarc is installed (I think it should be always installed, I guess..):
bash-3.2# pkgchk -l SUNWarc|grep ^Pathname |awk '{print $2}'|grep crt1
/usr/lib/amd64/crt1.o
/usr/lib/amd64/gcrt1.o
/usr/lib/crt1.o
/usr/lib/gcrt1.o
Then check if you did set up correctly your compilation flags, particularly LDFLAGS, something like:
LDFLAGS="-L/opt/csw/lib -L/lib/ -L/usr/lib"
Note: Maybe I'm wrong here, or this might not be all what's needed - I did so much hacking around yesterday and the day before, I don't remember exactly what I did to solve this (and I forgot to take notes on this particular problem).
Gerardo answers:
Ah! ..And I think the linker your PATH points to is also important; try to include /usr/ccs/bin/ in your PATH.