Linking error: cannot find crti.o

Iain Buclaw ibuclaw at ubuntu.com
Tue Oct 2 15:14:51 PDT 2012


On 2 October 2012 23:00, Joseph Rushton Wakeling
<joseph.wakeling at webdrake.net> wrote:
> Hello all,
>
> I'm trying to build GDC from the gdc-4.7 branch and using the gcc-4.7.2
> sources, on Ubuntu 12.10.
>
> When setting up, I called configure as follows:
>
> ../gcc-4.7.2/configure --enable-languages=d --disable-bootstrap
> --with-bugurl="http://gdcproject.org/bugzilla" --enable-checking=yes
> --enable-lto --enable-ld --enable-multilib --enable-shared
>
> After going through most of the compile process, I wind up with the
> following error:
>
> ----------------------------------------------------------------------------------
> /usr/bin/ld: cannot find crti.o: No such file or directory
> collect2: error: ld returned 1 exit status
> make[2]: *** [libgcc_s.so] Error 1
> make[2]: Leaving directory
> `/home/joseph/code/D/gdc-4.7/objdir/x86_64-unknown-linux-gnu/libgcc'
> make[1]: *** [all-target-libgcc] Error 2
> make[1]: Leaving directory `/home/joseph/code/D/gdc-4.7/objdir'
> make: *** [all] Error 2
> ----------------------------------------------------------------------------------
>
> I'm a complete novice where anything GCC-related is concerned (apart from
> using it) so the error message isn't really meaningful to me.  Googling
> suggests to either install libc0.1-dev (not an Ubuntu package) or libc6-dev
> (already installed).
>
> Can anyone advise?
>
> Thanks & best wishes,
>
>     -- Joe

Ubuntu has a strange set-up called multiarch.  It requires patching
the vanilla gnu sources with debian patches to work without working
around it.

The workaround without patches is to put the path to the multiarch lib
and include folders in your ~/.bashrc

eg:

LIBRARY_PATH=/usr/lib/arm-linux-gnueabihf
CPATH=/usr/include/arm-linux-gnueabihf
export LIBRARY_PATH CPATH


Regards
-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the D.gnu mailing list