digitalmars.D - -m64 doesn't work?
- Andre Tampubolon (43/43) Feb 12 2012 When I was looking at dmd's options, I found this:
- Trass3r (1/3) Feb 12 2012 ^^ You don't need impcnvgen, idgen and optabgen.
- Andre Tampubolon (6/9) Feb 12 2012 Uhmm OK. But what does it do with dmd? I mean, dmd -m64 still doesn't wo...
- Mike Wey (4/7) Feb 12 2012 Try adding -L--no-warn-search-mismatch
- Andre Tampubolon (2/9) Feb 12 2012
- Mike Wey (4/13) Feb 12 2012 Can you post the output of dmd when compiling with: "-v" ?
- Andre Tampubolon (8/23) Feb 12 2012 This is the log:
- Michel Fortin (10/22) Feb 12 2012 ... Are you sure it's libphobos.a and not libphobos2.a?
- Andre Tampubolon (2/25) Feb 12 2012
When I was looking at dmd's options, I found this: m64 generate 64 bit code I guessed it behaves like gcc (m64 for 64 bit code and m32 for 32 bit code, assuming you have the multilibs), so I did a rebuild. This is the structure of my /opt/dmd-dev |-bin (64-bit version of dmd, impcnvgen, idgen, optabgen, plus dmd.conf) |-import |---core |-----stdc |-----sync |-----sys |-------osx |---------mach |-------posix |---------arpa |---------net |---------netinet |---------sys |-------windows |-lib32 (libdruntime-linux32.a and libphobos.a) |-lib64 (libdruntime-linux64.a and libphobos.a) |-phobos |---std |-----c |-------freebsd |-------linux |-------osx |-------windows |-----internal |-------math |-------windows |-----net |-----windows And this is my dmd.conf: [Environment] DFLAGS=-I/opt/dmd-dev/import -I/opt/dmd-dev/phobos -L-L/opt/dmd-dev/lib32 -L-L/opt/dmd-dev/lib64 dmd -32 works fine. But either dmd or dmd -m64 doesn't work, e.g: $ dmd -m64 einstein2b.d /usr/bin/ld: skipping incompatible /opt/dmd-dev/lib32//libphobos2.a when searching for -lphobos2 /usr/bin/ld: cannot find -lphobos2 collect2: ld returned 1 exit status --- errorlevel 1 I wonder why ld searches at /opt/dmd-dev/lib32, whereas it should be /opt/dmd-dev/lib64 ?
Feb 12 2012
|-bin (64-bit version of dmd, impcnvgen, idgen, optabgen, plus dmd.conf)^^ You don't need impcnvgen, idgen and optabgen.
Feb 12 2012
Uhmm OK. But what does it do with dmd? I mean, dmd -m64 still doesn't work. Anyway, I used to build both versions and put this on my ~/.bashrc: alias dmd32='/opt/dmd-dev/bin32/dmd' alias dmd64='/opt/dmd-dev/bin64/dmd' But if a single dmd can generate both 32 and 64 bit code, it will be very convenient. On 02/12/2012 06:58 PM, Trass3r wrote:|-bin (64-bit version of dmd, impcnvgen, idgen, optabgen, plus dmd.conf)^^ You don't need impcnvgen, idgen and optabgen.
Feb 12 2012
On 02/12/2012 09:26 AM, Andre Tampubolon wrote:And this is my dmd.conf: [Environment] DFLAGS=-I/opt/dmd-dev/import -I/opt/dmd-dev/phobos -L-L/opt/dmd-dev/lib32 -L-L/opt/dmd-dev/lib64Try adding -L--no-warn-search-mismatch -- Mike Wey
Feb 12 2012
Hmm doesn't work. The same error still applies. On 02/12/2012 08:36 PM, Mike Wey wrote:On 02/12/2012 09:26 AM, Andre Tampubolon wrote:And this is my dmd.conf: [Environment] DFLAGS=-I/opt/dmd-dev/import -I/opt/dmd-dev/phobos -L-L/opt/dmd-dev/lib32 -L-L/opt/dmd-dev/lib64Try adding -L--no-warn-search-mismatch
Feb 12 2012
On 02/12/2012 03:21 PM, Andre Tampubolon wrote:Hmm doesn't work. The same error still applies. On 02/12/2012 08:36 PM, Mike Wey wrote:Can you post the output of dmd when compiling with: "-v" ? -- Mike WeyOn 02/12/2012 09:26 AM, Andre Tampubolon wrote:And this is my dmd.conf: [Environment] DFLAGS=-I/opt/dmd-dev/import -I/opt/dmd-dev/phobos -L-L/opt/dmd-dev/lib32 -L-L/opt/dmd-dev/lib64Try adding -L--no-warn-search-mismatch
Feb 12 2012
This is the log: http://pastebin.com/bGt7MVd2 Anyway, I found the culprit, which is ~/dmd.conf. The content is: [Environment] DFLAGS=-I/opt/dmd-dev/import -I/opt/dmd-dev/phobos -L-L/opt/dmd-dev/lib32/ That's why dmd couldn't locate the 64 bit libs. I should use only 1 dmd.conf, which is located in /opt/dmd-dev/bin. Now -m64 works fine :) On 02/12/2012 09:45 PM, Mike Wey wrote:On 02/12/2012 03:21 PM, Andre Tampubolon wrote:Hmm doesn't work. The same error still applies. On 02/12/2012 08:36 PM, Mike Wey wrote:Can you post the output of dmd when compiling with: "-v" ?On 02/12/2012 09:26 AM, Andre Tampubolon wrote:And this is my dmd.conf: [Environment] DFLAGS=-I/opt/dmd-dev/import -I/opt/dmd-dev/phobos -L-L/opt/dmd-dev/lib32 -L-L/opt/dmd-dev/lib64Try adding -L--no-warn-search-mismatch
Feb 12 2012
On Sunday, 12 February 2012 at 08:26:07 UTC, Andre Tampubolon wrote:|-lib32 (libdruntime-linux32.a and libphobos.a) |-lib64 (libdruntime-linux64.a and libphobos.a)... Are you sure it's libphobos.a and not libphobos2.a?dmd -32 works fine. But either dmd or dmd -m64 doesn't work, e.g: $ dmd -m64 einstein2b.d /usr/bin/ld: skipping incompatible /opt/dmd-dev/lib32//libphobos2.a when searching for -lphobos2 /usr/bin/ld: cannot find -lphobos2 collect2: ld returned 1 exit status --- errorlevel 1 I wonder why ld searches at /opt/dmd-dev/lib32, whereas it should be /opt/dmd-dev/lib64 ?Actually it searches both directories all the time because dmd.conf adds the two to the link path. The theory is that the linker should just discard the wrong one. -- Michel Fortin michel.fortin michelf.com http://michelf.com
Feb 12 2012
Sorry, libphobos.a is a typo :) On 02/12/2012 09:42 PM, Michel Fortin wrote:On Sunday, 12 February 2012 at 08:26:07 UTC, Andre Tampubolon wrote:|-lib32 (libdruntime-linux32.a and libphobos.a) |-lib64 (libdruntime-linux64.a and libphobos.a)... Are you sure it's libphobos.a and not libphobos2.a?dmd -32 works fine. But either dmd or dmd -m64 doesn't work, e.g: $ dmd -m64 einstein2b.d /usr/bin/ld: skipping incompatible /opt/dmd-dev/lib32//libphobos2.a when searching for -lphobos2 /usr/bin/ld: cannot find -lphobos2 collect2: ld returned 1 exit status --- errorlevel 1 I wonder why ld searches at /opt/dmd-dev/lib32, whereas it should be /opt/dmd-dev/lib64 ?Actually it searches both directories all the time because dmd.conf adds the two to the link path. The theory is that the linker should just discard the wrong one. -- Michel Fortin michel.fortin michelf.com http://michelf.com
Feb 12 2012