www.digitalmars.com         C & C++   DMDScript  

D.gnu - C compiler cannot create executables?

reply dsimcha <dsimcha yahoo.com> writes:
I keep getting the following error on two newly set up Debian testing 
boxes, as well as a Ubuntu Oneric box, when building GDC tip using GCC 
4.6.1:

checking for x86_64-unknown-linux-gnu-gcc... 
/var/tmp/gdcStuff/gdc/dev/gcc-4.6.1/objdir/./gcc/xgcc 
-B/var/tmp/gdcStuff/gdc/dev/gcc-4.6.1/objdir/./gcc/ 
-B/gdc/x86_64-unknown-linux-gnu/bin/ 
-B/gdc/x86_64-unknown-linux-gnu/lib/ -isystem 
/gdc/x86_64-unknown-linux-gnu/include -isystem 
/gdc/x86_64-unknown-linux-gnu/sys-include
checking for C compiler default output file name...
configure: error: in 
`/var/tmp/gdcStuff/gdc/dev/gcc-4.6.1/objdir/x86_64-unknown-linux-gnu/libgomp':
configure: error: C compiler cannot create executables
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgomp] Error 77
make[2]: Leaving directory `/var/tmp/gdcStuff/gdc/dev/gcc-4.6.1/objdir'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/var/tmp/gdcStuff/gdc/dev/gcc-4.6.1/objdir'
make: *** [all] Error 2


Somehow, this error does not occur on my work box, where I run Ubuntu 
10.04.  I have no idea what the difference is.  Below is my (very 
quick-and-dirty) build script, mostly cut and pasted from the GDC wiki.

rm -rf /var/tmp/gdcStuff
mkdir /var/tmp/gdcStuff
cp -R * /var/tmp/gdcStuff  # Copies the gcc bzip file
cd /var/tmp/gdcStuff
hg clone https://bitbucket.org/goshawk/gdc
mkdir gdc/dev
cd gdc/dev
tar -xvf ../../gcc-4.6.1.tar.bz2
cd gcc-4.6.1
ln -s ../../../d gcc/d
./gcc/d/setup-gcc.sh -v2
mkdir objdir
cd objdir
../configure --enable-languages=d,c++ --disable-shared \
     --prefix=/gdc --enable-multilib \
     --with-bugurl="https://bitbucket.org/goshawk/gdc/issues" \
     --enable-checking=release
make -j 2 2>&1 | tee build.log                            # insert your 
number of cores in the -j argument
make install DESTDIR=$HOME/apps
Sep 26 2011
parent reply Andrew Wiley <wiley.andrew.j gmail.com> writes:
On Mon, Sep 26, 2011 at 6:11 PM, dsimcha <dsimcha yahoo.com> wrote:
 I keep getting the following error on two newly set up Debian testing box=

 as well as a Ubuntu Oneric box, when building GDC tip using GCC 4.6.1:

 checking for x86_64-unknown-linux-gnu-gcc...
 /var/tmp/gdcStuff/gdc/dev/gcc-4.6.1/objdir/./gcc/xgcc
 -B/var/tmp/gdcStuff/gdc/dev/gcc-4.6.1/objdir/./gcc/
 -B/gdc/x86_64-unknown-linux-gnu/bin/ -B/gdc/x86_64-unknown-linux-gnu/lib/
 -isystem /gdc/x86_64-unknown-linux-gnu/include -isystem
 /gdc/x86_64-unknown-linux-gnu/sys-include
 checking for C compiler default output file name...
 configure: error: in
 `/var/tmp/gdcStuff/gdc/dev/gcc-4.6.1/objdir/x86_64-unknown-linux-gnu/libg=

 configure: error: C compiler cannot create executables
 See `config.log' for more details.
 make[2]: *** [configure-stage1-target-libgomp] Error 77
 make[2]: Leaving directory `/var/tmp/gdcStuff/gdc/dev/gcc-4.6.1/objdir'
 make[1]: *** [stage1-bubble] Error 2
 make[1]: Leaving directory `/var/tmp/gdcStuff/gdc/dev/gcc-4.6.1/objdir'
 make: *** [all] Error 2


 Somehow, this error does not occur on my work box, where I run Ubuntu 10.=

 =A0I have no idea what the difference is. =A0Below is my (very quick-and-=

 build script, mostly cut and pasted from the GDC wiki.

 rm -rf /var/tmp/gdcStuff
 mkdir /var/tmp/gdcStuff
 cp -R * /var/tmp/gdcStuff =A0# Copies the gcc bzip file
 cd /var/tmp/gdcStuff
 hg clone https://bitbucket.org/goshawk/gdc
 mkdir gdc/dev
 cd gdc/dev
 tar -xvf ../../gcc-4.6.1.tar.bz2
 cd gcc-4.6.1
 ln -s ../../../d gcc/d
 ./gcc/d/setup-gcc.sh -v2
 mkdir objdir
 cd objdir
 ../configure --enable-languages=3Dd,c++ --disable-shared \
 =A0 =A0--prefix=3D/gdc --enable-multilib \
 =A0 =A0--with-bugurl=3D"https://bitbucket.org/goshawk/gdc/issues" \
 =A0 =A0--enable-checking=3Drelease
 make -j 2 2>&1 | tee build.log =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =

 number of cores in the -j argument
 make install DESTDIR=3D$HOME/apps

Have you searched for the error in config.log? That basically means that the default set of options that configure is using is causing GCC to get an error.
Sep 26 2011
parent reply =?UTF-8?B?IkrDqXLDtG1lIE0uIEJlcmdlciI=?= <jeberger free.fr> writes:
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Andrew Wiley wrote:
 On Mon, Sep 26, 2011 at 6:11 PM, dsimcha <dsimcha yahoo.com> wrote:
 I keep getting the following error on two newly set up Debian testing =


 as well as a Ubuntu Oneric box, when building GDC tip using GCC 4.6.1:=




 Have you searched for the error in config.log? That basically means
 that the default set of options that configure is using is causing GCC
 to get an error.

My bet is that the error is along the lines of "Cannot find cc1". If that is the case, it means you have the current directory (".") in your path. You need to remove it. Jerome --=20 mailto:jeberger free.fr http://jeberger.free.fr Jabber: jeberger jabber.fr
Sep 26 2011
parent reply Iain Buclaw <ibuclaw ubuntu.com> writes:
== Quote from "Jérôme M. Berger" (jeberger free.fr)'s article
 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
 --------------enigEFBBD89E592FB5B6388005AB
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: quoted-printable
 Andrew Wiley wrote:
 On Mon, Sep 26, 2011 at 6:11 PM, dsimcha <dsimcha yahoo.com> wrote:
 I keep getting the following error on two newly set up Debian testing =


 as well as a Ubuntu Oneric box, when building GDC tip using GCC 4.6.1:=


 Have you searched for the error in config.log? That basically means
 that the default set of options that configure is using is causing GCC
 to get an error.

If that is the case, it means you have the current directory (".") in your path. You need to remove it. Jerome

For Debian/Ubuntu, you also need to consider that they've been experimenting with multiarch system for 32 and 64bit, which requires special patches to GCC so that it can find the correct locations of headers, libraries, etc. If you are using a vanilla GCC tarball to build, it may help if you put the following in your .bashrc LIBRARY_PATH=/usr/lib/i386-linux-gnu CPATH=/usr/include/i386-linux-gnu export LIBRARY_PATH CPATH Regards Iain
Sep 26 2011
next sibling parent dsimcha <dsimcha yahoo.com> writes:
On 9/27/2011 1:44 AM, Iain Buclaw wrote:
 For Debian/Ubuntu, you also need to consider that they've been experimenting
with
 multiarch system for 32 and 64bit, which requires special patches to GCC so
that
 it can find the correct locations of headers, libraries, etc.

 If you are using a vanilla GCC tarball to build, it may help if you put the
 following in your .bashrc

 LIBRARY_PATH=/usr/lib/i386-linux-gnu
 CPATH=/usr/include/i386-linux-gnu
 export LIBRARY_PATH CPATH

Thanks. I ended up figuring out the same thing almost simultaneously. I solved it slightly differently by adding a few symlinks for important files to my /usr/lib and /usr/include/gnu directories.
Sep 27 2011
prev sibling parent dsimcha <dsimcha yahoo.com> writes:
== Quote from Iain Buclaw (ibuclaw ubuntu.com)'s article
 For Debian/Ubuntu, you also need to consider that they've been experimenting
with
 multiarch system for 32 and 64bit, which requires special patches to GCC so
that
 it can find the correct locations of headers, libraries, etc.
 If you are using a vanilla GCC tarball to build, it may help if you put the
 following in your .bashrc
 LIBRARY_PATH=/usr/lib/i386-linux-gnu
 CPATH=/usr/include/i386-linux-gnu
 export LIBRARY_PATH CPATH
 Regards
 Iain

Another way to fix this is apparently to just disable the bootstrap feature via --disable-bootstrap. It seems rather useless anyhow. Why should I care what my compiler was compiled with?
Sep 27 2011