Author Topic: DMD and GDC (D language compilers) enabled under Linux  (Read 5721 times)

Offline aarti_pl

  • Multiple posting newcomer
  • *
  • Posts: 23
DMD and GDC (D language compilers) enabled under Linux
« on: March 26, 2006, 02:46:15 pm »
Hello!

I posted yesterday a patch which enables under linux two compilers which are also available there.
https://developer.berlios.de/patch/?func=detailpatch&patch_id=956&group_id=5358
DMD compiler is tested and works good. I didn't try GDC, but it should work as well, as this compiler was already prepared for linux - it was just disabled.

I had only one problem with libraries - I had to add:
m_LinkLibs.Add(_("-lpthread"));
m_LinkLibs.Add(_("-lm"));

please notice -l option, which is hardcoded, but should be added from:
m_Switches.linkLibs = _T("-l");
m_Switches.libPrefix = _T("lib");
m_Switches.libExtension = _T("a");

It should, but it isn't... Anyone could comment why it doesn't work?

Best Regards
Aarti_pl

Offline Zingam

  • Multiple posting newcomer
  • *
  • Posts: 74
Re: DMD and GDC (D language compilers) enabled under Linux
« Reply #1 on: March 26, 2006, 03:31:08 pm »
If you know how to enable DMD, do you have any idea how to enable the generation of debug info? Currently the switches do not cause the generation of debug info. Well not exactly. In fact the problem is that the debug info is added during the link process.

Here is some more info: http://forums.codeblocks.org/index.php?topic=2476.0

Offline JThedering

  • Single posting newcomer
  • *
  • Posts: 9
Re: DMD and GDC (D language compilers) enabled under Linux
« Reply #2 on: April 29, 2006, 05:33:57 pm »
I've tried the GDC compiler (v0.17), which works very well too. Here even the debugger is usable (I just tried to set breakpoints, looked into local variables and into classes) if you have patched gdb for D support(http://dsource.org/projects/gdb-patches/).
With DMD (v0.154) I couldn't make the debug symbols begin put in, so debugging doesn't work.
Maybe interesting: If I use GDC through the DMD command line wrapper (gdmd) debugging doesn't work either.

I had to change the linker command for DMD from
Code
$linker -o $exe_output $link_options $link_objects $libs
to
Code
$linker -of$exe_output $link_options $link_objects $libs
to make linking work with DMD (no problems with GDC).

I hope this patch will be in svn soon, C::B seems really usable as a D Linux IDE with it, if it was more stable.

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: DMD and GDC (D language compilers) enabled under Linux
« Reply #3 on: May 08, 2006, 04:45:18 pm »
GDC works under Mac OS X too, when installed.
http://gdcmac.sourceforge.net/

Here is a patch that enables it for __WXMAC__:
http://developer.berlios.de/patch/?func=detailpatch&patch_id=1003&group_id=5358