Building GDC

Steve Teale steve.teale at britseyeview.com
Thu Oct 31 05:45:22 PDT 2013


>
> Supposing that you're using $SOMEDIR/gdc to store everything, a 
> rough description of the procedure would be:
>
>     * Clone GDC master into gdc/dev
>
>     * Unzip the GCC source into gdc, which will give you a 
> subdirectory
>       called gcc-$VERSION (currently gcc-4.8.2)
>
>     * cd into gdc/dev and run ./setup-gcc.sh ../gcc-4.8.2
>
>     * cd back into gdc, create gdc/objdir, cd gdc/objdir
>
>     * Run configure and make.
>
> Here's how I like to run configure for a release build:
>
> ../gcc-4.8.2/configure --enable-languages=d --disable-multilib 
> --enable-multiarch --enable-checking=release --prefix=/opt/gdc
>
> You can miss off the --enable-multiarch -- which will also 
> probably speed up your build time.
>
> With this you shouldn't need to custom-set CPATH or LPATH.  
> Does it work for you?

I'm using gcc 4.8.2 - procedure as you describe and as per 
gdcproject wiki

This is on 32bit Ubuntu 12.04

Console output prior to the error is:

...
make[2]: Entering directory `/home/steve/gdc/objdir/gcc'
make[2]: Leaving directory `/home/steve/gdc/objdir/gcc'
Checking multilib configuration for libgcc...
Configuring in i686-pc-linux-gnu/libgcc
configure: loading cache ./config.cache
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... mawk
checking for i686-pc-linux-gnu-ar... ar
checking for i686-pc-linux-gnu-lipo... lipo
checking for i686-pc-linux-gnu-nm... 
/home/steve/gdc/objdir/./gcc/nm
checking for i686-pc-linux-gnu-ranlib... ranlib
checking for i686-pc-linux-gnu-strip... strip
checking whether ln -s works... yes
checking for i686-pc-linux-gnu-gcc... 
/home/steve/gdc/objdir/./gcc/xgcc -B/home/steve/gdc/objdir/./gcc/ 
-B/opt/gdc/i686-pc-linux-gnu/bin/ 
-B/opt/gdc/i686-pc-linux-gnu/lib/ -isystem 
/opt/gdc/i686-pc-linux-gnu/include -isystem 
/opt/gdc/i686-pc-linux-gnu/sys-include
checking for suffix of object files... configure: error: in 
`/home/steve/gdc/objdir/i686-pc-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot 
compile
See `config.log' for more details.
make[1]: *** [configure-target-libgcc] Error 1
make[1]: Leaving directory `/home/steve/gdc/objdir'
make: *** [all] Error 2

The config.log file from .../gdc/objdir/gcc has the following 
errors I marked with ****:

xgcc: error: unrecognized command line option '-V'
**** xgcc: fatal error: no input files
compilation terminated.
configure:3358: $? = 1
configure:3347: /home/steve/gdc/objdir/./gcc/xgcc 
-B/home/steve/gdc/objdir/./gcc/ -B/opt/gdc/i686-pc-linux-gnu/bin/ 
-B/opt/gdc/i686-pc-linux-gnu/lib/ -isystem 
/opt/gdc/i686-pc-linux-gnu/include -isystem 
/opt/gdc/i686-pc-linux-gnu/sys-include    -qversion >&5
**** xgcc: error: unrecognized command line option '-qversion'
**** xgcc: fatal error: no input files
compilation terminated.
configure:3358: $? = 1
configure:3374: /home/steve/gdc/objdir/./gcc/xgcc 
-B/home/steve/gdc/objdir/./gcc/ -B/opt/gdc/i686-pc-linux-gnu/bin/ 
-B/opt/gdc/i686-pc-linux-gnu/lib/ -isystem 
/opt/gdc/i686-pc-linux-gnu/include -isystem 
/opt/gdc/i686-pc-linux-gnu/sys-include    -o conftest -g -O2   
conftest.c  >&5
**** /home/steve/gdc/objdir/./gcc/cc1: error while loading shared 
libraries: libmpfr.so.1: cannot open shared object file: No such 
file or directory
configure:3377: $? = 1
configure:3565: checking for suffix of object files
configure:3587: /home/steve/gdc/objdir/./gcc/xgcc 
-B/home/steve/gdc/objdir/./gcc/ -B/opt/gdc/i686-pc-linux-gnu/bin/ 
-B/opt/gdc/i686-pc-linux-gnu/lib/ -isystem 
/opt/gdc/i686-pc-linux-gnu/include -isystem 
/opt/gdc/i686-pc-linux-gnu/sys-include    -c -g -O2  conftest.c 
 >&5
**** /home/steve/gdc/objdir/./gcc/cc1: error while loading shared 
libraries: libmpfr.so.1: cannot open shared object file: No such 
file or directory
configure:3591: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:3605: error: in 
`/home/steve/gdc/objdir/i686-pc-linux-gnu/libgcc':
configure:3608: error: cannot compute suffix of object files: 
cannot compile
See `config.log' for more details.

There are xgcc errors, and a shared library for MPFR that can't 
be found.

The offending file libmpfr.so.1 is in /usr/local/lib, and the 
corresponding header file in /usr/local/include

Setting $LIBRARY_PATH and $CPATH to these values does not effect 
the outcome - they were initially blank - fails both ways. Where 
does the build process look for this.

Stumbling blindly
Steve


More information about the D.gnu mailing list