www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - dmd not building with dmd

reply Steven Schveighoffer <schveiguy yahoo.com> writes:
I went to create a PR, and did a git pull on all my repositories. After 
make clean on OSX, dmd would not build:

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src -f posix.mak
no cpu specified, assuming X86
CC=c++ dmd idgen.d
Undefined symbols for architecture x86_64:
   "__Unwind_GetIPInfo", referenced from:
       ___dmd_personality_v0 in libphobos2.a(dwarfeh_5c8_811.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see 
invocation)

I had to revert to dmd 2.070 as the build tool to get it to build.

My question is: is this expected behavior, or should I file a bug?

-Steve
May 07 2016
next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 5/7/2016 11:43 PM, Steven Schveighoffer wrote:
 I went to create a PR, and did a git pull on all my repositories. After make
 clean on OSX, dmd would not build:

 /Applications/Xcode.app/Contents/Developer/usr/bin/make -C src -f posix.mak
 no cpu specified, assuming X86
 CC=c++ dmd idgen.d
 Undefined symbols for architecture x86_64:
   "__Unwind_GetIPInfo", referenced from:
       ___dmd_personality_v0 in libphobos2.a(dwarfeh_5c8_811.o)
 ld: symbol(s) not found for architecture x86_64
 clang: error: linker command failed with exit code 1 (use -v to see invocation)

 I had to revert to dmd 2.070 as the build tool to get it to build.

 My question is: is this expected behavior, or should I file a bug?

 -Steve
__dmd_personality_v0 is in druntime\src\rt\dwarfeh.d, and was added rather recently. So it seems you have a dmd-phobos mismatch.
May 08 2016
next sibling parent Steven Schveighoffer <schveiguy yahoo.com> writes:
On 5/8/16 9:18 AM, Walter Bright wrote:
 On 5/7/2016 11:43 PM, Steven Schveighoffer wrote:
 I went to create a PR, and did a git pull on all my repositories.
 After make
 clean on OSX, dmd would not build:

 /Applications/Xcode.app/Contents/Developer/usr/bin/make -C src -f
 posix.mak
 no cpu specified, assuming X86
 CC=c++ dmd idgen.d
 Undefined symbols for architecture x86_64:
   "__Unwind_GetIPInfo", referenced from:
       ___dmd_personality_v0 in libphobos2.a(dwarfeh_5c8_811.o)
 ld: symbol(s) not found for architecture x86_64
 clang: error: linker command failed with exit code 1 (use -v to see
 invocation)

 I had to revert to dmd 2.070 as the build tool to get it to build.

 My question is: is this expected behavior, or should I file a bug?

 -Steve
__dmd_personality_v0 is in druntime\src\rt\dwarfeh.d, and was added rather recently. So it seems you have a dmd-phobos mismatch.
I don't know what I'm doing wrong: Stevens-MacBook-Pro:dmd steves$ dmd --version DMD64 D Compiler v2.071.0 Copyright (c) 1999-2015 by Digital Mars written by Walter Bright Stevens-MacBook-Pro:dmd steves$ type dmd dmd is hashed (/Users/steves/.dvm/compilers/dmd-2.071.0/osx/bin/dmd) I'm using dvm to install dmd, so I'm very sure it should work, I don't know if I have strange files somewhere? If I build idgen manually and continue building, it fails again, this time with c++ compiler: Stevens-MacBook-Pro:dmd steves$ cd src Stevens-MacBook-Pro:src steves$ dmd idgen.d Stevens-MacBook-Pro:src steves$ cd .. Stevens-MacBook-Pro:dmd steves$ make -f posix.mak /Applications/Xcode.app/Contents/Developer/usr/bin/make -C src -f posix.mak no cpu specified, assuming X86 (CC) ROOT_OBJS root/newdelete.c c++ -c -Wno-deprecated -Wstrict-aliasing -Wno-logical-op-parentheses -Wno-dynamic-class-memaccess -Wno-switch -fno-exceptions -fno-rtti -D__pascal= -DMARS=1 -DTARGET_OSX=1 -DDM_TARGET_CPU_X86=1 -m64 -Iroot -MMD -MF newdelete.deps root/newdelete.c (CC) GLUE_OBJS glue.c c++ -c -Wno-deprecated -Wstrict-aliasing -Wno-logical-op-parentheses -Wno-dynamic-class-memaccess -Wno-switch -fno-exceptions -fno-rtti -D__pascal= -DMARS=1 -DTARGET_OSX=1 -DDM_TARGET_CPU_X86=1 -m64 -Iroot -Itk -Ibackend -MMD -MF glue.deps glue.c glue.c:26:10: fatal error: 'id.h' file not found #include "id.h" ^ 1 error generated. make[1]: *** [glue.o] Error 1 make: *** [all] Error 2 Does this give any more clues? -Steve
May 08 2016
prev sibling next sibling parent Jacob Carlborg <doob me.com> writes:
On Sunday, 8 May 2016 at 07:18:05 UTC, Walter Bright wrote:

 __dmd_personality_v0 is in druntime\src\rt\dwarfeh.d, and was 
 added rather recently. So it seems you have a dmd-phobos 
 mismatch.
I'm not sure what how your current setup looks like. But on OS X these days we should target clang, libc++ and libc++abi. Unwind_GetIPInfo does not exist in libc++abi. -- /Jacob Carlborg
May 08 2016
prev sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 5/8/2016 12:18 AM, Walter Bright wrote:
 On 5/7/2016 11:43 PM, Steven Schveighoffer wrote:
 I went to create a PR, and did a git pull on all my repositories. After make
 clean on OSX, dmd would not build:

 /Applications/Xcode.app/Contents/Developer/usr/bin/make -C src -f posix.mak
 no cpu specified, assuming X86
 CC=c++ dmd idgen.d
 Undefined symbols for architecture x86_64:
   "__Unwind_GetIPInfo", referenced from:
       ___dmd_personality_v0 in libphobos2.a(dwarfeh_5c8_811.o)
 ld: symbol(s) not found for architecture x86_64
 clang: error: linker command failed with exit code 1 (use -v to see invocation)

 I had to revert to dmd 2.070 as the build tool to get it to build.

 My question is: is this expected behavior, or should I file a bug?

 -Steve
__dmd_personality_v0 is in druntime\src\rt\dwarfeh.d, and was added rather recently. So it seems you have a dmd-phobos mismatch.
I should read more carefully, it is __Unwind_GetIPInfo that is undefined, not __dmd_personality_v0. Anyhow, thanks to Jacob for correctly diagnosing it.
May 08 2016
prev sibling next sibling parent reply Jacob Carlborg <doob me.com> writes:
On Sunday, 8 May 2016 at 06:43:38 UTC, Steven Schveighoffer wrote:

 Undefined symbols for architecture x86_64:
   "__Unwind_GetIPInfo", referenced from:
       ___dmd_personality_v0 in libphobos2.a(dwarfeh_5c8_811.o)
 ld: symbol(s) not found for architecture x86_64
It's a bug that has been reported and fixed [1]. Unwind_GetIPInfo is not available on OS X or rather in libc++abi which is used by default on OS X. [1] https://issues.dlang.org/show_bug.cgi?id=15911 -- /Jacob Carlborg
May 08 2016
parent reply Steven Schveighoffer <schveiguy yahoo.com> writes:
On Sunday, 8 May 2016 at 10:30:06 UTC, Jacob Carlborg wrote:
 On Sunday, 8 May 2016 at 06:43:38 UTC, Steven Schveighoffer 
 wrote:

 Undefined symbols for architecture x86_64:
   "__Unwind_GetIPInfo", referenced from:
       ___dmd_personality_v0 in libphobos2.a(dwarfeh_5c8_811.o)
 ld: symbol(s) not found for architecture x86_64
It's a bug that has been reported and fixed [1]. Unwind_GetIPInfo is not available on OS X or rather in libc++abi which is used by default on OS X. [1] https://issues.dlang.org/show_bug.cgi?id=15911 -- /Jacob Carlborg
Ok thanks. Will wait for next release. For some reason this doesn't affect command line compiles -Steve
May 08 2016
parent reply Jacob Carlborg <doob me.com> writes:
On 2016-05-08 12:33, Steven Schveighoffer wrote:

 Ok thanks. Will wait for next release. For some reason this doesn't
 affect command line compiles
Since you're using DVM, :), you can easily roll back to 2.070.0 as a workaround. If I recall correctly, DMD is buildable with DMD 2.067.0 and later. -- /Jacob Carlborg
May 09 2016
parent reply Steven Schveighoffer <schveiguy yahoo.com> writes:
On 5/10/16 2:41 AM, Jacob Carlborg wrote:
 On 2016-05-08 12:33, Steven Schveighoffer wrote:

 Ok thanks. Will wait for next release. For some reason this doesn't
 affect command line compiles
Since you're using DVM, :), you can easily roll back to 2.070.0 as a workaround.
Oh yes, that's what I did ;) I still have some nagging issues with dvm (I've reported them already), but otherwise, fantastic tool.
 If I recall correctly, DMD is buildable with DMD 2.067.0 and later.
I couldn't remember the exact version, but since 2.070.2 worked, I didn't look any further. I just was curious whether the policy is that this is an expectation that you have to use a prior version to build dmd, or if we should report bugs when dmd can't build itself. -Steve
May 10 2016
parent Jacob Carlborg <doob me.com> writes:
On 2016-05-10 14:29, Steven Schveighoffer wrote:

 I couldn't remember the exact version, but since 2.070.2 worked, I
 didn't look any further. I just was curious whether the policy is that
 this is an expectation that you have to use a prior version to build
 dmd, or if we should report bugs when dmd can't build itself.
I think there was some requirement that LDC should be able to build DMD. So they just picked the current version of LDC at that time (when switching to D) and made sure it worked. -- /Jacob Carlborg
May 10 2016
prev sibling parent reply Lionello Lunesu <lionello lunesu.remove.com> writes:
On 8/5/2016 14:43, Steven Schveighoffer wrote:
 I went to create a PR, and did a git pull on all my repositories. After
 make clean on OSX, dmd would not build:

 /Applications/Xcode.app/Contents/Developer/usr/bin/make -C src -f posix.mak
 no cpu specified, assuming X86
 CC=c++ dmd idgen.d
 Undefined symbols for architecture x86_64:
    "__Unwind_GetIPInfo", referenced from:
        ___dmd_personality_v0 in libphobos2.a(dwarfeh_5c8_811.o)
 ld: symbol(s) not found for architecture x86_64
 clang: error: linker command failed with exit code 1 (use -v to see
 invocation)

 I had to revert to dmd 2.070 as the build tool to get it to build.

 My question is: is this expected behavior, or should I file a bug?

 -Steve
I ran into this as well. It's a bug in the package from brew: it shipped with the wrong phobos. You can build your own DMD: $ make -f posix.mak AUTO_BOOTSTRAP=1
May 09 2016
parent reply John Colvin <john.loughran.colvin gmail.com> writes:
On Monday, 9 May 2016 at 07:57:33 UTC, Lionello Lunesu wrote:
 On 8/5/2016 14:43, Steven Schveighoffer wrote:
 [...]
I ran into this as well. It's a bug in the package from brew: it shipped with the wrong phobos. You can build your own DMD: $ make -f posix.mak AUTO_BOOTSTRAP=1
In what way do you mean "shipped with the wrong phobos"?
May 09 2016
parent reply Lionello Lunesu <lionello lunesu.remove.com> writes:
On 9/5/2016 20:19, John Colvin wrote:
 On Monday, 9 May 2016 at 07:57:33 UTC, Lionello Lunesu wrote:
 On 8/5/2016 14:43, Steven Schveighoffer wrote:
 [...]
I ran into this as well. It's a bug in the package from brew: it shipped with the wrong phobos. You can build your own DMD: $ make -f posix.mak AUTO_BOOTSTRAP=1
In what way do you mean "shipped with the wrong phobos"?
Well, it's either wrong phobos or wrong dmd. I assumed phobos was mismatched, but perhaps DMD was mismatched? Installing with brew suggest it's installing 2.071.0, but DMD appears to be 2.070: $ brew install dmd ==> Downloading https://homebrew.bintray.com/bottles/dmd-2.071.0.el_capitan.bottle.tar.gz Already downloaded: /Library/Caches/Homebrew/dmd-2.071.0.el_capitan.bottle.tar.gz ==> Pouring dmd-2.071.0.el_capitan.bottle.tar.gz 🍺 /usr/local/Cellar/dmd/2.071.0: 561 files, 65.0M $ /usr/local/bin/dmd --version DMD64 D Compiler v2.070 Copyright (c) 1999-2015 by Digital Mars written by Walter Bright
May 09 2016
next sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2016-05-10 06:49, Lionello Lunesu wrote:

 Well, it's either wrong phobos or wrong dmd. I assumed phobos was
 mismatched, but perhaps DMD was mismatched? Installing with brew suggest
 it's installing 2.071.0, but DMD appears to be 2.070:
The issue Steven is having is that the symbol doesn't exist in the default C++ runtime. This has been fixed in master. He installed DMD using DVM so it's not a Brew packaging problem. Rolling back to 2.70.0 can be used as a workaround. -- /Jacob Carlborg
May 09 2016
parent Lionello Lunesu <lionello lunesu.remove.com> writes:
On 10/5/2016 14:39, Jacob Carlborg wrote:
 On 2016-05-10 06:49, Lionello Lunesu wrote:

 Well, it's either wrong phobos or wrong dmd. I assumed phobos was
 mismatched, but perhaps DMD was mismatched? Installing with brew suggest
 it's installing 2.071.0, but DMD appears to be 2.070:
The issue Steven is having is that the symbol doesn't exist in the default C++ runtime. This has been fixed in master. He installed DMD using DVM so it's not a Brew packaging problem. Rolling back to 2.70.0 can be used as a workaround.
Yeah, I see now. I thought it was because of the version "mismatch". Didn't know it was an actual bug. I had build my own and it worked. I guess I had gotten the fix. Thanks for correcting me.
May 11 2016
prev sibling parent reply John Colvin <john.loughran.colvin gmail.com> writes:
On Tuesday, 10 May 2016 at 04:49:33 UTC, Lionello Lunesu wrote:
 Well, it's either wrong phobos or wrong dmd. I assumed phobos 
 was mismatched, but perhaps DMD was mismatched? Installing with 
 brew suggest it's installing 2.071.0, but DMD appears to be 
 2.070:

 $ brew install dmd
 ==> Downloading 
 https://homebrew.bintray.com/bottles/dmd-2.071.0.el_capitan.bottle.tar.gz
 Already downloaded: 
 /Library/Caches/Homebrew/dmd-2.071.0.el_capitan.bottle.tar.gz
 ==> Pouring dmd-2.071.0.el_capitan.bottle.tar.gz
 🍺  /usr/local/Cellar/dmd/2.071.0: 561 files, 65.0M

 $ /usr/local/bin/dmd --version
 DMD64 D Compiler v2.070
 Copyright (c) 1999-2015 by Digital Mars written by Walter Bright
That's because for some reason the VERSION file is wrong in the dmd github release. Should be fixed by https://github.com/Homebrew/homebrew-core/pull/1040
May 10 2016
parent Lionello Lunesu <lionello lunesu.remove.com> writes:
On 10/5/2016 16:24, John Colvin wrote:
 On Tuesday, 10 May 2016 at 04:49:33 UTC, Lionello Lunesu wrote:
 Well, it's either wrong phobos or wrong dmd. I assumed phobos was
 mismatched, but perhaps DMD was mismatched? Installing with brew
 suggest it's installing 2.071.0, but DMD appears to be 2.070:

 $ brew install dmd
 ==> Downloading
 https://homebrew.bintray.com/bottles/dmd-2.071.0.el_capitan.bottle.tar.gz
 Already downloaded:
 /Library/Caches/Homebrew/dmd-2.071.0.el_capitan.bottle.tar.gz
 ==> Pouring dmd-2.071.0.el_capitan.bottle.tar.gz
 🍺  /usr/local/Cellar/dmd/2.071.0: 561 files, 65.0M

 $ /usr/local/bin/dmd --version
 DMD64 D Compiler v2.070
 Copyright (c) 1999-2015 by Digital Mars written by Walter Bright
That's because for some reason the VERSION file is wrong in the dmd github release. Should be fixed by https://github.com/Homebrew/homebrew-core/pull/1040
Ah, I see. Thanks!
May 11 2016