Thread overview | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
May 19, 2006 Wishlist: 64 bit on linux | ||||
---|---|---|---|---|
| ||||
I recently upgraded to an Athlon 64, and installed Fedora Core 5 with the AMD64 kernel. This broke my D applications, because Phobos is released as a 32-bit library. I am writing this partly as an FYI for anybody else who hits this problem, and partly as a request to Walter TO MAKE THINGS WORK: You need to pass -m32 to gcc. Most importantly, you need to do that at the link step. So, if you're like me, and you used to use dmd to link, then you'll see something like this: dmd ...FILES... -ofcebu gcc ...FILES... -o cebu -lphobos -lpthread -lm /usr/bin/ld: skipping incompatible /usr/lib/libphobos.a when searching for -lphobos /usr/bin/ld: cannot find -lphobos Basically, you need to change your Makefile to call gcc directly, and pass it the -m32 argument: gcc -m32 ...FILES... -o cebu -lphobos -lpthread -lm Also, if you link with any C files, then you need to pass -m32 to gcc when you build those as well. FOR WALTER: I don't know how much this would take, but it would be really nice if you released a 64-bit version of Phobos, as well as the 32-bit one. I suppose that this would mean that the compiler would need to be able to produce 64-bit ELF files. But, I realize that this is probably low on the priority list. That is probably as it should be. |
May 22, 2006 Lack of 64bit support breaks -run | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russ Lewis | Since dmd can't link properly on AMD64 linux, I can't use -run.
It has occurred to me that one (simple) solution to this would be to add an argument to dmd which it would pass to gcc, so that I could pass -m32. I tried using -L, but that passes the argument
-Xlinker -m32
to gcc rather than what I'm attempting to pass, which is simply
-m32
Russ
Russ Lewis wrote:
> I recently upgraded to an Athlon 64, and installed Fedora Core 5 with the AMD64 kernel. This broke my D applications, because Phobos is released as a 32-bit library. I am writing this partly as an FYI for anybody else who hits this problem, and partly as a request to Walter
>
>
> TO MAKE THINGS WORK:
>
> You need to pass -m32 to gcc. Most importantly, you need to do that at the link step. So, if you're like me, and you used to use dmd to link, then you'll see something like this:
> dmd ...FILES... -ofcebu
> gcc ...FILES... -o cebu -lphobos -lpthread -lm
> /usr/bin/ld: skipping incompatible /usr/lib/libphobos.a when searching for -lphobos
> /usr/bin/ld: cannot find -lphobos
>
> Basically, you need to change your Makefile to call gcc directly, and pass it the -m32 argument:
> gcc -m32 ...FILES... -o cebu -lphobos -lpthread -lm
>
> Also, if you link with any C files, then you need to pass -m32 to gcc when you build those as well.
>
>
>
> FOR WALTER:
>
> I don't know how much this would take, but it would be really nice if you released a 64-bit version of Phobos, as well as the 32-bit one. I suppose that this would mean that the compiler would need to be able to produce 64-bit ELF files.
>
> But, I realize that this is probably low on the priority list. That is probably as it should be.
|
May 22, 2006 Re: Lack of 64bit support breaks -run | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russ Lewis Attachments: | Russ Lewis schrieb am 2006-05-22:
> Since dmd can't link properly on AMD64 linux, I can't use -run.
>
> It has occurred to me that one (simple) solution to this would be to add
> an argument to dmd which it would pass to gcc, so that I could pass
> -m32. I tried using -L, but that passes the argument
> -Xlinker -m32
> to gcc rather than what I'm attempting to pass, which is simply
> -m32
work around:
CC="gcc -m32" dmd -run source.d
Thomas
|
May 22, 2006 Re: Lack of 64bit support breaks -run | ||||
---|---|---|---|---|
| ||||
Posted in reply to Thomas Kuehne | Doesn't seem to work. I get this:
CC="gcc -m32" dmd -run ~/bin/global_uniq.d < parser.h
gcc -m32: No such file or directory
--- errorlevel 255
[russ@russ project]$
Thomas Kuehne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Russ Lewis schrieb am 2006-05-22:
>
>>Since dmd can't link properly on AMD64 linux, I can't use -run.
>>
>>It has occurred to me that one (simple) solution to this would be to add an argument to dmd which it would pass to gcc, so that I could pass -m32. I tried using -L, but that passes the argument
>> -Xlinker -m32
>>to gcc rather than what I'm attempting to pass, which is simply
>> -m32
>
>
> work around:
>
> CC="gcc -m32" dmd -run source.d
>
> Thomas
>
>
> -----BEGIN PGP SIGNATURE-----
>
> iD8DBQFEciwD3w+/yD4P9tIRAiBzAKCjsiYfysCdSB5nIJ6U4v4k/E0q2gCfTCeM
> EyxfeV58iN9vRoKdKPlAp1Y=
> =m3PI
> -----END PGP SIGNATURE-----
|
May 23, 2006 Re: Lack of 64bit support breaks -run | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russ Lewis Attachments: | Russ Lewis schrieb am 2006-05-22:
> Doesn't seem to work. I get this:
>
> CC="gcc -m32" dmd -run ~/bin/global_uniq.d < parser.h
> gcc -m32: No such file or directory
> --- errorlevel 255
> [russ@russ project]$
On my system "gcc -m32" doesn't work, but "gcc32" does:
CC="gcc32" dmd -run ~/bin/global_uniq.d
Thomas
|
May 23, 2006 Re: Lack of 64bit support breaks -run | ||||
---|---|---|---|---|
| ||||
Posted in reply to Thomas Kuehne | Thomas Kuehne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Russ Lewis schrieb am 2006-05-22:
>> Doesn't seem to work. I get this:
>>
>> CC="gcc -m32" dmd -run ~/bin/global_uniq.d < parser.h
>> gcc -m32: No such file or directory
>> --- errorlevel 255
>> [russ@russ project]$
>
> On my system "gcc -m32" doesn't work, but "gcc32" does:
>
> CC="gcc32" dmd -run ~/bin/global_uniq.d
Does -m32 break on 32 bit linux?
|
May 23, 2006 Re: Lack of 64bit support breaks -run | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russ Lewis | Looks like that doesn't work b/c DMD takes the CC env variable and runs it as a command, so you have to use gcc32 as Thomas suggested. Does gcc32 exist on all systems?
~John Demme
Russ Lewis wrote:
> Doesn't seem to work. I get this:
>
> CC="gcc -m32" dmd -run ~/bin/global_uniq.d < parser.h
> gcc -m32: No such file or directory
> --- errorlevel 255
> [russ@russ project]$
>
> Thomas Kuehne wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Russ Lewis schrieb am 2006-05-22:
>>
>>>Since dmd can't link properly on AMD64 linux, I can't use -run.
>>>
>>>It has occurred to me that one (simple) solution to this would be to add
>>>an argument to dmd which it would pass to gcc, so that I could pass
>>>-m32. I tried using -L, but that passes the argument
>>>-Xlinker -m32
>>>to gcc rather than what I'm attempting to pass, which is simply
>>>-m32
>>
>>
>> work around:
>>
>> CC="gcc -m32" dmd -run source.d
>>
>> Thomas
>>
>>
>> -----BEGIN PGP SIGNATURE-----
>>
>> iD8DBQFEciwD3w+/yD4P9tIRAiBzAKCjsiYfysCdSB5nIJ6U4v4k/E0q2gCfTCeM
>> EyxfeV58iN9vRoKdKPlAp1Y=
>> =m3PI
>> -----END PGP SIGNATURE-----
|
May 23, 2006 Re: Lack of 64bit support breaks -run | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote:
> Thomas Kuehne wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Russ Lewis schrieb am 2006-05-22:
>>> Doesn't seem to work. I get this:
>>>
>>> CC="gcc -m32" dmd -run ~/bin/global_uniq.d < parser.h
>>> gcc -m32: No such file or directory
>>> --- errorlevel 255
>>> [russ@russ project]$
>>
>> On my system "gcc -m32" doesn't work, but "gcc32" does:
>>
>> CC="gcc32" dmd -run ~/bin/global_uniq.d
>
> Does -m32 break on 32 bit linux?
Adding -m32 doesn't appear to do any damage on my Gentoo GCC 3.4.6 system.
~John Demme
|
May 23, 2006 Re: Lack of 64bit support breaks -run | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Demme | I found that I could get gcc32 by installing the package "compat-gcc-32" (on Fedora Core 5), but it still didn't work for me: [russ@russ project]$ CC=gcc32 dmd -run ~/bin/global_uniq.d < parser.h /usr/bin/ld: skipping incompatible /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/../../../libphobos.a when searching for -lphobos /usr/bin/ld: skipping incompatible /usr/lib/libphobos.a when searching for -lphobos /usr/bin/ld: cannot find -lphobos collect2: ld returned 1 exit status --- errorlevel 1 [russ@russ project]$ John Demme wrote: > Looks like that doesn't work b/c DMD takes the CC env variable and runs it > as a command, so you have to use gcc32 as Thomas suggested. Does gcc32 > exist on all systems? > > ~John Demme > > Russ Lewis wrote: > > >>Doesn't seem to work. I get this: >> >>CC="gcc -m32" dmd -run ~/bin/global_uniq.d < parser.h >>gcc -m32: No such file or directory >>--- errorlevel 255 >>[russ@russ project]$ >> >>Thomas Kuehne wrote: >> >>>-----BEGIN PGP SIGNED MESSAGE----- >>>Hash: SHA1 >>> >>>Russ Lewis schrieb am 2006-05-22: >>> >>> >>>>Since dmd can't link properly on AMD64 linux, I can't use -run. >>>> >>>>It has occurred to me that one (simple) solution to this would be to add >>>>an argument to dmd which it would pass to gcc, so that I could pass >>>>-m32. I tried using -L, but that passes the argument >>>>-Xlinker -m32 >>>>to gcc rather than what I'm attempting to pass, which is simply >>>>-m32 >>> >>> >>>work around: >>> >>>CC="gcc -m32" dmd -run source.d >>> >>>Thomas >>> >>> >>>-----BEGIN PGP SIGNATURE----- >>> >>>iD8DBQFEciwD3w+/yD4P9tIRAiBzAKCjsiYfysCdSB5nIJ6U4v4k/E0q2gCfTCeM >>>EyxfeV58iN9vRoKdKPlAp1Y= >>>=m3PI >>>-----END PGP SIGNATURE----- > > |
May 23, 2006 Re: Lack of 64bit support breaks -run | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russ Lewis | compile it without -run (and with CC=gcc32), and compare the gcc comands
between the two runs.
~John Demme
Russ Lewis wrote:
> I found that I could get gcc32 by installing the package "compat-gcc-32" (on Fedora Core 5), but it still didn't work for me:
>
> [russ@russ project]$ CC=gcc32 dmd -run ~/bin/global_uniq.d < parser.h
> /usr/bin/ld: skipping incompatible
> /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/../../../libphobos.a when
> searching for -lphobos
> /usr/bin/ld: skipping incompatible /usr/lib/libphobos.a when searching
> for -lphobos
> /usr/bin/ld: cannot find -lphobos
> collect2: ld returned 1 exit status
> --- errorlevel 1
> [russ@russ project]$
>
>
> John Demme wrote:
>> Looks like that doesn't work b/c DMD takes the CC env variable and runs
>> it
>> as a command, so you have to use gcc32 as Thomas suggested. Does gcc32
>> exist on all systems?
>>
>> ~John Demme
>>
>> Russ Lewis wrote:
>>
>>
>>>Doesn't seem to work. I get this:
>>>
>>>CC="gcc -m32" dmd -run ~/bin/global_uniq.d < parser.h
>>>gcc -m32: No such file or directory
>>>--- errorlevel 255
>>>[russ@russ project]$
>>>
>>>Thomas Kuehne wrote:
>>>
>>>>-----BEGIN PGP SIGNED MESSAGE-----
>>>>Hash: SHA1
>>>>
>>>>Russ Lewis schrieb am 2006-05-22:
>>>>
>>>>
>>>>>Since dmd can't link properly on AMD64 linux, I can't use -run.
>>>>>
>>>>>It has occurred to me that one (simple) solution to this would be to
>>>>>add an argument to dmd which it would pass to gcc, so that I could pass
>>>>>-m32. I tried using -L, but that passes the argument
>>>>>-Xlinker -m32
>>>>>to gcc rather than what I'm attempting to pass, which is simply
>>>>>-m32
>>>>
>>>>
>>>>work around:
>>>>
>>>>CC="gcc -m32" dmd -run source.d
>>>>
>>>>Thomas
>>>>
>>>>
>>>>-----BEGIN PGP SIGNATURE-----
>>>>
>>>>iD8DBQFEciwD3w+/yD4P9tIRAiBzAKCjsiYfysCdSB5nIJ6U4v4k/E0q2gCfTCeM
>>>>EyxfeV58iN9vRoKdKPlAp1Y=
>>>>=m3PI
>>>>-----END PGP SIGNATURE-----
>>
>>
|
Copyright © 1999-2021 by the D Language Foundation