www.digitalmars.com         C & C++   DMDScript  

D.gnu - Need help building GDC on 64-bit Debian

reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
Hi all,

I spent almost the whole day trying to get GDC to build on my 64-bit
Debian system, only to fail miserably. Are there any steps /
configurations that are known to work??

Here's what I figured out so far: Debian's multiarch directory structure
breaks the pristine gcc sources (due to stuff being moved to
/usr/include/$arch/* from /usr/include/*, ditto for /usr/lib). To remedy
this, I installed Debian's gcc sources (apt-get source gcc-4.7) and ran:

	debian/rules clean
	debian/rules patch

which applies a whole bunch of Debian patches that, presumably, fix the
gcc sources to be able to deal with multiarch directory structure.

So after running that, I cd to the GDC git sources and run update-gcc.sh
to link the D stuff into the source tree, then I ran configure and make.
This got a lot farther than when I was building directly from the
upstream GCC sources (due to the multiarch issue), but it still failed
miserably in various places, depending on which configure options I
tried. I still get:

	configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.

I did manage to get gcc itself to build, by using Debian's build script
(dpkg-buildpackage -rfakeroot), but I just can't figure out how exactly
the script is configuring the build -- it's a gigantic labyrinth of
scripts calling each other.

So anyway, for starters, I'd like to be able to at least get GDC to
build externally; eventually I'd like to figure out how to make it build
as a Debian package and maybe even upload it -- the current gdc in the
Debian archive is very old. Any help along those lines would be greatly
appreciated. :)


T

-- 
Doubtless it is a good thing to have an open mind, but a truly open mind should
be open at both ends, like the food-pipe, with the capacity for excretion as
well as absorption. -- Northrop Frye
Oct 19 2012
next sibling parent "Timo Sintonen" <t.sintonen luukku.com> writes:
I can not help you in this case, but this is a general problem in 
compiling gcc package, specially when making a cross compiler. 
The message is a bit misleading and is not related to the test 
which generates it.
Somewhere at the beginning, configure tests if it is possible to 
compile and link an executable program. If this fails, configure 
sets this variable telling that linking executables is not 
possible for this configuration. If some later test wants to test 
some feature by compiling and linking a test program, configure 
gives this error message. All tests would fail anyway, because it 
is not possible to make any kind of executable.
To make an executable we need headers, a working compiler, 
working binutils and working libraries for the target system. 
Even if the target system is the same ( I assume you are not 
making a cross-compiler) configure may give a different target 
name. In my Slackware the default configuration is 
x86_64-slackware-linux but the guessed configuration is 
x86_64-unknown-linux-gnu. Configure will not find all stuff for 
the guessed target and fails.
You have to look config.log at the directory make was when the 
error came. In somewhere near the beginning of the file there is 
something like "checking if gcc can produce executables" and you 
should look there what went wrong.
In my opinion configure should report an error and stop here, but 
I am not expert of that script either.
Oct 19 2012
prev sibling next sibling parent "Brad Lanam" <brad.lanam.comp -NOSPAM-gmail.com> writes:
On Saturday, 20 October 2012 at 05:37:20 UTC, H. S. Teoh wrote:
 	configure: error: Link tests are not allowed after 
 GCC_NO_EXECUTABLES.

Had this problem many, many times... IIRC I think this is the piece you need, which isn't documented well. if [[ $(uname -m) == "x86_64" ]]; then export LD_LIBRARY_PATH=/lib/i386-linux-gnu/ export CPATH=/usr/include/i386-linux-gnu fi I used: ../configure \ --prefix=/opt/${d} \ --enable-languages=d \ --disable-shared \ --disable-nls \ --disable-bootstrap \ --with-bugurl="https://bitbucket.org/goshawk/gdc/issues" \ --enable-checking=assert,runtime,misc,tree,gimple,types,rtlflag \ --disable-libgomp \ --disable-lbmudflap I haven't tried this in a long time, hope this helps.
Oct 21 2012
prev sibling parent Iain Buclaw <ibuclaw ubuntu.com> writes:
On 21 October 2012 21:31, Brad Lanam <brad.lanam.comp -nospam-gmail.com> wrote:
 On Saturday, 20 October 2012 at 05:37:20 UTC, H. S. Teoh wrote:
         configure: error: Link tests are not allowed after
 GCC_NO_EXECUTABLES.

Had this problem many, many times... IIRC I think this is the piece you need, which isn't documented well. if [[ $(uname -m) == "x86_64" ]]; then export LD_LIBRARY_PATH=/lib/i386-linux-gnu/ export CPATH=/usr/include/i386-linux-gnu fi

LD_LIBRARY_PATH / CPATH should be x86_64-linux-gnu on x86_64 systems, not i386. -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';
Oct 21 2012