Re: DMD on x86_64

2010-03-27 Thread Alvin Majik
tried the your approach it worked but compile cpp applications fails.
[Sanity Checks - fails]

i found my way arround it by installing cross32-gcc
and adding
CC=/usr/bin/i686-unknown-linux-gnu-gcc
to the dmd.conf file

I have added the procedure to Wiki4D
http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial/StartingWithD/
Compiler/DMD#ArchLinuxASaferSolutionD


Re: DMD on x86_64

2010-03-25 Thread Chinedu Okonkwo
Robert Clipsham Wrote:

 On 18/02/10 15:13, Jesse Phillips wrote:
  Please place them on Wiki4D, probably a sub-section under AMD64. If you
  don't I will, but I'll give you a chance  :)
 
  http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial/StartingWithD/Compiler/DMD
 
 Done, I hope it's alright, feel free to edit it as you see fit :)
 

tried the your approach it worked but compile cpp applications fails. [Sanity 
Checks - fails]

i found my way arround it by installing cross32-gcc
and adding 
CC=/usr/bin/i686-unknown-linux-gnu-gcc 
to the dmd.conf file

I have added the procedure to Wiki4D 
http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial/StartingWithD/Compiler/DMD#ArchLinuxASaferSolutionD




Re: DMD on x86_64

2010-02-18 Thread Jesse Phillips
Robert Clipsham wrote:

 On 15/02/10 15:54, Robert Clipsham wrote:
 I've been wanting to try D2 properly for a while now, but as I use linux
 x86-64 I've had to resort to using a virtual machine, which is really
 off putting when I just want to play around with it. I've read multiple
 threads about getting dmd working with a multilib system, but I still
 can't get it working, here's what I've tried:

 I managed to get it working! Took a lot of effort, but in short:

 % yaourt -S lib32-glibc-multilib

 # The next step should be yaourt -S gcc-multilib, but the package
 # is broken currently, and I suspect most people don't really want
 # to install another locale and wait over an hour for gcc to compile
 # only to find you forgot something and have to start again, so...

 % cd /tmp

 # I've uploaded my precompiled version of gcc-multilib with the tweaks
 # I needed to compile already done, removing the need to install new
 # locales and wait for gcc to compile, aren't I nice?
 # I might even post newer versions here when the package is updated on
 # AUR :)

 % wget http://omploader.org/vM2w4cw

 # I know this step looks questionable, it's needed though (try skipping
 # it if you want a reason)

 % sudo pacman -Rd gcc lib32-glibc lib32-glibc-multilib lib32-gcc-libs

 # And install gcc-multilib

 % sudo pacman -U gcc-multilib-4.4.2-10-x86_64.pkg.tar.gz

 # You should now be able to use dmd :)

 % cat  hello.d EOF
 import std.stdio;

 void main()
 {
  writeln( Hello World! );
 }
 EOF
 % dmd hello.d
 % ./hello
 Hello World!

 Hope this helps anyone having trouble getting dmd working on Arch Linux 
 x86-64 :) Thanks to everyone who helped me, I probably wouldn't have 
 managed without your help :)

 Robert

Please place them on Wiki4D, probably a sub-section under AMD64. If you
don't I will, but I'll give you a chance  :)

http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial/StartingWithD/Compiler/DMD



Re: DMD on x86_64

2010-02-18 Thread Robert Clipsham

On 18/02/10 15:13, Jesse Phillips wrote:

Please place them on Wiki4D, probably a sub-section under AMD64. If you
don't I will, but I'll give you a chance  :)

http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial/StartingWithD/Compiler/DMD


Done, I hope it's alright, feel free to edit it as you see fit :)



Re: DMD on x86_64

2010-02-17 Thread BCS

Hello Brad,


The other thing you could try is to take dmd out of the loop.  Can you
build a 32 bit c/c++ app with gcc/g++ directly?  If you can't get that
to work, it's unlikely that dmd will we successful either, given that
it relies on gcc to invoke the linker, picking up all the right c
library pieces.



if all else fails, you could use dmd -c and invoke the linker directly.

--
... IXOYE





Re: DMD on x86_64

2010-02-17 Thread Lutger
If you manage to find the proper 32 bit libraries, there is a configuration 
file for ld where you can specify the search paths, should be: 
/etc/ld.so.conf

The 64-bit distro's I have used fail to add the 32-bit lib paths to this 
file, even if you install the right packages.




Re: DMD on x86_64

2010-02-17 Thread Robert Clipsham

On 17/02/10 11:06, Lutger wrote:

If you manage to find the proper 32 bit libraries, there is a configuration
file for ld where you can specify the search paths, should be:
/etc/ld.so.conf

The 64-bit distro's I have used fail to add the 32-bit lib paths to this
file, even if you install the right packages.




The paths to my 32bit libs seem to be in there, thanks :)


Re: DMD on x86_64

2010-02-17 Thread Robert Clipsham

On 17/02/10 06:05, Jesse Phillips wrote:

Oh, yeah Arch dropped most efforts to support 32bit didn't they. This


I'm pretty sure they didn't... maybe they did on x86_64, I don't know.


probably won't help but maybe trying

dmd test.d -L-L/opt/lib32/lib -L-melf_i386


Already tried this, no luck :(



I'd hope that would at least stop it complaining about libpthread. (but
so should have your gcc -m32


No luck unfortunately with either method :s


Re: DMD on x86_64

2010-02-17 Thread Lars T. Kyllingstad

Robert Clipsham wrote:
I've been wanting to try D2 properly for a while now, but as I use linux 
x86-64 I've had to resort to using a virtual machine, which is really 
off putting when I just want to play around with it. I've read multiple 
threads about getting dmd working with a multilib system, but I still 
can't get it working, here's what I've tried:


test.d:
import std.stdio;

void main()
{
writeln( Hello World! );
}

% dmd -v test.d
-- snip --
gcc test.o -o test -m32 -Xlinker -L./../lib -lphobos2 -lpthread -lm
/usr/bin/ld: skipping incompatible 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../libpthread.so when 
searching for -lpthread
/usr/bin/ld: skipping incompatible 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../libpthread.a when 
searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching 
for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching 
for -lpthread

/usr/bin/ld: cannot find -lpthread
collect2: ld returned 1 exit status
--- errorlevel 1

I have a 32 bit version of libpthread in /opt/lib32/lib, so I then tried:

% dmd test.d -L-L/opt/lib32/lib
/usr/bin/ld: skipping incompatible 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../libpthread.so when 
searching for -lpthread
/usr/bin/ld: skipping incompatible 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../libpthread.a when 
searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching 
for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching 
for -lpthread

/usr/bin/ld: cannot find -lpthread
collect2: ld returned 1 exit status
--- errorlevel 1

ld still seems to be trying to use the 64 bit version. Trying to link 
manually with gcc (some options tweaked):


% gcc test.o -o test -m32 -Xlinker -L./../lib -L/opt/lib32/lib 
-L/opt/lib32/usr/lib -lphobos2 -lpthread -lm
/usr/bin/ld: skipping incompatible /lib/libpthread.so.0 when searching 
for /lib/libpthread.so.0

/usr/bin/ld: cannot find /lib/libpthread.so.0
collect2: ld returned 1 exit status

This seemed to get less errors than before. When I specified the path to 
libpthread manually it started complaining about libgcc. Using -v with 
the above command I found the linking command, then adapted that and 
tried manually again, but was left with the error:


/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 
08048c90


When editing the linking command I had to remove a selection of gcc 
libraries that I don't have 32 bit versions of, which could be the 
issue, however according to nm none of the other .o's or .a's that are 
meant to get linked contain _start. Does anyone have any idea how I can 
get dmd working with a multi lib x86-64 system? I'm using Arch Linux, if 
you could point me in the right direction to get the missing libraries 
or whatever's needed to get dmd working let me know, thanks.


Robert


Try typing:

  export LD_LIBRARY_PATH=/opt/lib32

before compiling.

-Lars


Re: DMD on x86_64

2010-02-17 Thread Robert Clipsham

On 17/02/10 16:58, Lars T. Kyllingstad wrote:

Try typing:

export LD_LIBRARY_PATH=/opt/lib32

before compiling.

-Lars


No luck unfortunately, I get all the same errors as when I use -L, (I 
believe -L is checked first anyway, not sure though).


Re: DMD on x86_64

2010-02-17 Thread Jérôme M. Berger
Don't forget that gcc adds a couple of system libraries (like
libgcc) to the linker command. You need to give the right path for
those too (you might want to try with --sysroot, or use --nostdlib
and specify -lgcc manually)

Jerome
-- 
mailto:jeber...@free.fr
http://jeberger.free.fr
Jabber: jeber...@jabber.fr



signature.asc
Description: OpenPGP digital signature


Re: DMD on x86_64

2010-02-17 Thread Jesse Phillips
Robert Clipsham Wrote:

 On 17/02/10 06:05, Jesse Phillips wrote:
  Oh, yeah Arch dropped most efforts to support 32bit didn't they. This
 
 I'm pretty sure they didn't... maybe they did on x86_64, I don't know.
 
  probably won't help but maybe trying
 
  dmd test.d -L-L/opt/lib32/lib -L-melf_i386
 
 Already tried this, no luck :(
 
 
  I'd hope that would at least stop it complaining about libpthread. (but
  so should have your gcc -m32
 
 No luck unfortunately with either method :s

My understanding was that all you had was x86_64 Arch

http://www.archlinux.org/news/440/

And I found this, I don't think that the default arch64 gcc is a 
cross-compiler so you won't be able to compile 32-bit apps with it

But isn't really related to linking so...

http://bbs.archlinux.org/viewtopic.php?id=64979


Re: DMD on x86_64

2010-02-16 Thread Lars T. Kyllingstad

Robert Clipsham wrote:

On 15/02/10 21:44, Jesse Phillips wrote:

Robert Clipsham wrote:


I've been wanting to try D2 properly for a while now, but as I use linux
x86-64 I've had to resort to using a virtual machine, which is really
off putting when I just want to play around with it. I've read multiple
threads about getting dmd working with a multilib system, but I still
can't get it working, here's what I've tried:


These instructions should work, I haven't tested but others say they
work:

http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial/StartingWithD/Compiler/DMD#AMD64 



I had originally posted this question to SO and it gave me a better
understanding of what the issue were:

http://stackoverflow.com/questions/856328/compiling-with-dmd-on-64bit-linux-or-linking-with-32bit-object-files 



I found that after installing the proper -dev packages you don't need
to specify the linking format.


I don't use ubuntu, so those instructions don't apply to me. I've tried 
to make sure I've got all the required 32 bit libs, can't be sure 
though, my guess is there's still some missing. I've installed the 32 
bit libs for gcc, that seems to miss out whatever's included in ubuntu's 
gcc-multilib package.


Here are listings of the files in the Ubuntu gcc-multilib and 
g++-multilib packages.  You can compare them to the files on your computer:


gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/crtbegin.o
gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/crtbeginS.o
gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/crtbeginT.o
gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/crtend.o
gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/crtendS.o
gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/crtfastmath.o
gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/crtprec32.o
gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/crtprec64.o
gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/crtprec80.o
gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/libgcc.a
gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/libgcc_eh.a
gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/libgcc_s.so
gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/libgcov.a
gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/libgomp.a
gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/libgomp.so
gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/libssp_nonshared.a
gcc-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/libgcc_s_32.so
gcc-4.4-multilib: /usr/share/doc/gcc-4.4-multilib

g++-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/libstdc++.a
g++-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/libstdc++.so
g++-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/libstdc++_pic.a
g++-4.4-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.4/32/libsupc++.a
g++-4.4-multilib: /usr/share/doc/g++-4.4-multilib


-Lars


Re: DMD on x86_64

2010-02-16 Thread Jesse Phillips
Robert Clipsham wrote:

 I don't use ubuntu, so those instructions don't apply to me.

I don't either, but the instructions still apply to me. What distro are
you using? If you figure it out, write up some instructions for it.



Re: DMD on x86_64

2010-02-16 Thread Robert Clipsham

On 16/02/10 15:20, Jesse Phillips wrote:

Robert Clipsham wrote:


I don't use ubuntu, so those instructions don't apply to me.


I don't either, but the instructions still apply to me. What distro are
you using? If you figure it out, write up some instructions for it.



I'm using Arch Linux. I've found a gcc-multilib package in AUR ( 
http://aur.archlinux.org/packages.php?ID=28545 ), it's out of date and 
doesn't build for me though, it seems to require the de_DE locale too 
for some unknown reason. I'm hoping when this package is updated it'll 
do what I need, I'm not holding my breath though.


Re: DMD on x86_64

2010-02-16 Thread Jesse Phillips
Robert Clipsham wrote:

 On 16/02/10 15:20, Jesse Phillips wrote:
 Robert Clipsham wrote:

 I don't use ubuntu, so those instructions don't apply to me.

 I don't either, but the instructions still apply to me. What distro are
 you using? If you figure it out, write up some instructions for it.


 I'm using Arch Linux. I've found a gcc-multilib package in AUR ( 
 http://aur.archlinux.org/packages.php?ID=28545 ), it's out of date and 
 doesn't build for me though, it seems to require the de_DE locale too 
 for some unknown reason. I'm hoping when this package is updated it'll 
 do what I need, I'm not holding my breath though.

Oh, yeah Arch dropped most efforts to support 32bit didn't they. This
probably won't help but maybe trying

dmd test.d -L-L/opt/lib32/lib -L-melf_i386

I'd hope that would at least stop it complaining about libpthread. (but
so should have your gcc -m32


Re: DMD on x86_64

2010-02-16 Thread Brad Roberts
On 2/16/2010 10:05 PM, Jesse Phillips wrote:
 Robert Clipsham wrote:
 
 On 16/02/10 15:20, Jesse Phillips wrote:
 Robert Clipsham wrote:

 I don't use ubuntu, so those instructions don't apply to me.

 I don't either, but the instructions still apply to me. What distro are
 you using? If you figure it out, write up some instructions for it.


 I'm using Arch Linux. I've found a gcc-multilib package in AUR ( 
 http://aur.archlinux.org/packages.php?ID=28545 ), it's out of date and 
 doesn't build for me though, it seems to require the de_DE locale too 
 for some unknown reason. I'm hoping when this package is updated it'll 
 do what I need, I'm not holding my breath though.
 
 Oh, yeah Arch dropped most efforts to support 32bit didn't they. This
 probably won't help but maybe trying
 
 dmd test.d -L-L/opt/lib32/lib -L-melf_i386
 
 I'd hope that would at least stop it complaining about libpthread. (but
 so should have your gcc -m32

The other thing you could try is to take dmd out of the loop.  Can you build a
32 bit c/c++ app with gcc/g++ directly?  If you can't get that to work, it's
unlikely that dmd will we successful either, given that it relies on gcc to
invoke the linker, picking up all the right c library pieces.


Re: DMD on x86_64

2010-02-15 Thread Jesse Phillips
Robert Clipsham wrote:

 I've been wanting to try D2 properly for a while now, but as I use linux 
 x86-64 I've had to resort to using a virtual machine, which is really 
 off putting when I just want to play around with it. I've read multiple 
 threads about getting dmd working with a multilib system, but I still 
 can't get it working, here's what I've tried:

These instructions should work, I haven't tested but others say they
work:

http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial/StartingWithD/Compiler/DMD#AMD64

I had originally posted this question to SO and it gave me a better
understanding of what the issue were:

http://stackoverflow.com/questions/856328/compiling-with-dmd-on-64bit-linux-or-linking-with-32bit-object-files

I found that after installing the proper -dev packages you don't need
to specify the linking format.