Commit graph

45 commits

Author SHA1 Message Date
Alexey Prokhin
fb5618e336 Fixed #65 — Renaming shared lib 2012-02-15 13:23:23 +04:00
Alexey Prokhin
dd6b89e182 Issue #42 — Multilib: --no-warn-search-mismatch.
Pass -Xlinker before every additional linker switch, so gcc will,
in its turn, pass the switch to ld.
2011-12-09 12:49:05 +04:00
Alexey Prokhin
641cc85e64 Added -shared switch.
If the flag is passed, ldc will create a shared library not an executable file.
2011-12-06 19:43:14 +04:00
Alexey Prokhin
fdead0d154 Fixed #21 — Added -lib switch 2011-12-06 17:24:49 +04:00
Alexey Prokhin
250d8ed214 Sanity check — can't create a directory with an empty path 2011-12-02 13:59:49 +04:00
kai
aa20673c72 Fix indentation (TAB -> SPACE in 2 cases). 2011-11-21 20:47:38 +01:00
kai
1ecd536f45 Replace deprecated LLVM functions.
Several functions regarding file handling are deprecated. This commit replaces these functions with the new one from llvm::sys::fs and llvm::sys::path. It also removes some warnings about signed/unsigned mismatches.
2011-11-16 19:05:23 +01:00
David Nadlinger
7a24e12736 Cleanup: Remove unused code in backend, silence some warnings.
This removed quite some clutter that has presumably piled up because LDC is seldom built with a lot of warnings enabled due to DMDFE.
2011-04-24 12:21:33 +02:00
Kelly Wilson
72ea043124 Recommit klickverbot's patch for LLVM-2.9. 2011-04-20 09:28:37 -06:00
Kelly Wilson
7c81278b9c Backed out changeset 5253bfbb3890 2011-04-20 00:28:23 -06:00
Kelly Wilson
b26b0f4196 Upgrade to LLVM-2.9. Thanks to David Nadlinger for the patch. 2011-04-19 21:57:15 -06:00
Alexey Prokhin
6d89bfa961 Use _d_assocarrayliteralTX to initialize associative arrays. Replace depricated _d_arrayappendcT() by _d_arrayappendcTX(). Make sure that a l-value of a binassign expressions is only evaluated once (reapllied 1784 but only for D2) 2011-02-20 19:00:45 +03:00
Moritz Warning
233299e5c8 Haiku OS support; thanks to MrSunshine 2010-10-04 00:58:14 +02:00
Tomas Lindquist Olsen
1fac40d2bd Update to work with LLVM 2.7.
Removed use of dyn_cast, llvm no compiles
without exceptions and rtti by
default. We do need exceptions for the libconfig stuff, but rtti isn't
necessary (anymore).

Debug info needs to be rewritten, as in LLVM 2.7 the format has
completely changed. To have something to look at while rewriting, the
old code has been wrapped inside #ifndef DISABLE_DEBUG_INFO , this means
that you have to define this to compile at the moment.

Updated tango 0.99.9 patch to include updated EH runtime code, which is
needed for LLVM 2.7 as well.
2010-05-19 12:42:32 +02:00
Robert Clipsham
42eca04683 Folded in a patch by Troy Straszheim to better report errors with -run. 2009-12-28 02:23:41 +00:00
Christian Kamm
64a8e47ad6 Fix several 'reaches end of function' warnings by making fatal noreturn.
The warnings also pointed out a few genuine bugs. Replace some tabs with
spaces.
2009-11-06 21:51:41 +01:00
Frits van Bommel
4158fb474a Add an llvm::OStream workalike class for use with Logger::cout(), with the
crucial difference being special handling of `llvm::Type`s so they get printed
by name rather than printing their full representation (which can be positively
*huge*).

This allows re-enabling some logger calls that were disabled due to extreme
verbosity.
2009-06-16 19:31:10 +02:00
Frits van Bommel
f5b56ce346 Fix typo in function name 2009-05-07 15:33:06 +02:00
Frits van Bommel
cf0b8936ce Factor out the code to find gcc, and add a command-line option to override the
default executable name.
This should help cross-compilation by allowing a cross-gcc to be specified from
the configuration file instead of only through the CC environment variable.
2009-05-04 13:32:16 +02:00
Frits van Bommel
257d305032 Change meaning of optimization levels: -O0 now means 'no optimization' like with
other compilers.
2009-03-29 15:51:14 +02:00
Frits van Bommel
e129494812 Allow specific optimization passes to be requested from the command line.
Now you can run "`ldc test.d -c -mem2reg -simplifycfg`" if you feel the urge.
The -O<N> options are still supported, and are inserted in the passes list in
the position where they appear on the command line.
(so -simplifycfg -O1 -instcombine does the "right thing")

One small change: -inline is renamed to -enable-inlining due to a naming
conflict with the option to add the -inline pass. -inline now inserts the
inlining pass in the position specified, not in the middle of -O<N>.
(ldmd has been updated to translate -inline to -enable-inlining)
2009-03-29 15:46:55 +02:00
Frits van Bommel
a742c59a67 Pass -m32/-m64 on to gcc when assembling and linking 2009-03-01 22:59:03 +01:00
Frits van Bommel
e37c82d1ec Use LLVM OStream wrapper instead of <iostream> in the logger.
llvm::OStream provides all std::ostream functionality (by holding a
std::ostream* internally), but
 * doesn't include <iostream>, avoiding per-file overhead.
 * allows the stream pointer to be null, and the (inlined) operators do nothing
   when that's the case. (This also allows removal of the ofstream("/dev/null")
   hack Logger used when disabled, which presumably wasn't very portable)
2009-02-26 14:51:02 +01:00
Frits van Bommel
b3d87205ad Use LLVM-style command line (instead of DMD-style)
Note: For a backward compatible interface, use the new bin/ldmd script. It
      supports all old options while passing on anything it doesn't recognize.

Some changes caused by this:
* -debug and -version are now -d-debug and -d-version due to a conflict with
  standard LLVM options.
* All "flag" options now allow an optional =true/=1/=false/=0 suffix.
* Some "hidden debug switches" starting with "--" were renamed because LLVM
  doesn't care about the number of dashes, so they were conflicting with other
  options (such as -c).
  The new versions start with "-hidden-debug-" instead of "--"
* --help works, but has a non-zero exit code. This breaks some Tango scripts
  which use it to test for compiler existence. See tango.patch.

Some changes not (directly) caused by this;
* (-enable/-disable)-FOO options are now available for pre- and postconditions.
* -march is used instead of -m (like other LLVM programs), but -m is an alias
  for it.
* -defaultlib, -debuglib, -d-debug and -d-version allow comma-separated values.
  The effect should be identical to specifying the same option multiple times.
  I decided against allowing these for some other options because paths might
  contain commas on some systems.
* -fPIC is removed in favor of the standard LLVM option -relocation-model=pic

Bug:
* If -run is specified as the last argument in DFLAGS, no error is generated.
  (Not very serious IMHO)
2009-02-25 17:34:51 +01:00
Christian Kamm
287fa3446c Add -m64 switch to gcc calls on 64-bit platforms. 2009-01-23 10:12:57 +01:00
Christian Kamm
ab9b9cc2e9 Solaris compatibility and proc map parsing #183, thanks BlueZeniX! 2009-01-22 18:53:32 +01:00
Christian Kamm
4042f90800 Apply afb's patch from #168 to use $CC instead of "gcc" for toobj and linker. 2009-01-17 17:52:09 +01:00
elrood
4c3d23ddfe modified gen/linker.cpp to only append .exe suffix on windows if not already present 2008-12-18 19:24:33 +01:00
Christian Kamm
881a141a1a Guess exe name from first object name if none specified. 2008-10-13 19:02:03 +02:00
Christian Kamm
b4e57e83eb Another link order fix. 2008-10-11 22:14:16 +02:00
Christian Kamm
ee407e597a Link using gcc instead. 2008-10-11 21:21:21 +02:00
Christian Kamm
6eeeafdba6 First part of rename to LDC. 2008-10-06 22:46:55 +02:00
Tomas Lindquist Olsen
d0c5df393c Applied the FreeBSD patch from Ralith, closes ticket #95 , slightly changed but basically the same. Thanx Ralith :) 2008-10-02 03:25:46 +02:00
Christian Kamm
877da230a3 Get rid of runtime path. Allow defaultlib and debuglib switches to be given multiple times. 2008-09-02 19:14:25 +02:00
Christian Kamm
8efe20f5f9 Link in pthread, dl and m on OS X. 2008-08-29 14:11:20 +02:00
Christian Kamm
72a2db6d7c Get rid of isLinux and isWindows in favor of global.params.os. 2008-08-24 16:22:58 +02:00
Tomas Lindquist Olsen
1f00395f0b Fixed path seperator issue on windows in linker. 2008-07-27 14:15:22 +02:00
Tomas Lindquist Olsen
70f16e36fb Added bitcode filename to very verbose logging.
Fixed -O<n> switches from llvm 2.4.
Removed md5 from the kdevelop project filelist.
2008-07-26 15:02:57 +02:00
Christian Kamm
d54a1347a4 Do only link to libpthread, libm and libdl on Linux. 2008-07-21 20:12:24 +02:00
Christian Kamm
6a45ce2474 [svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
Made runtime to compile to native by default. Changed linker.cpp to link in native runtime library.
This change requires a runtime rebuild as well as a new symbolic link in lib/ to tango/lib/libtango-base-llvmdc-native.a.
2008-07-10 19:38:34 +02:00
Tomas Lindquist Olsen
a3c7b8b369 [svn r327] Fixed some more MinGW32 issues. It's now very close to working.
Fixed problems with inline asm like: mov EAX, FS:4 , which incidentally is used in the runtime to get the stack bottom, on Windows.
2008-06-27 23:58:22 +02:00
Tomas Lindquist Olsen
fe09b045f3 [svn r299] forgot to return status in runExecutable 2008-06-20 22:12:15 +02:00
Tomas Lindquist Olsen
41a104c0f4 [svn r298] Eliminated the dmd/link.c source file entirely in favor of a llvm::sys based approach to the same functionality. 2008-06-20 22:09:04 +02:00
Tomas Lindquist Olsen
c743549032 [svn r297] Fixed: rewrote linker code to use LLVM's Program facilities instead of DMD's oldschool broken "native" approach. 2008-06-20 17:45:13 +02:00
Tomas Lindquist Olsen
8b83eda2a2 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
Did a lot of smaller cleans up here and there.
Replaced more llvm::Foo with LLFoo for common stuff.
Split up tollvm.cpp.
2008-06-09 09:37:08 +02:00