Commit Graph

884 Commits

Author SHA1 Message Date
Rafael Espindola 7ba97afc4d Add -rdynamic to freebsd and openbsd. Patch by Ruben.
llvm-svn: 118771
2010-11-11 02:17:51 +00:00
Rafael Espindola 124798484a Add support for Exherbo. Patch by Elias Pipping.
llvm-svn: 118769
2010-11-11 02:07:13 +00:00
Rafael Espindola 66b291a41b Add support for Ubuntu Jaunty.
llvm-svn: 118673
2010-11-10 05:00:22 +00:00
Bruno Cardoso Lopes e7f211c89f Add support for soft/hard float options to the Sparc target
llvm-svn: 118514
2010-11-09 17:21:19 +00:00
Roman Divacky b45d2672f7 Add a forgotten break. Found by Rafael Espindola!
llvm-svn: 118433
2010-11-08 19:39:10 +00:00
Roman Divacky 137426a42f Use integrated-as for processing .s files on FreeBSD. Copied
from Linux/OpenBSD code.

llvm-svn: 118419
2010-11-08 17:46:39 +00:00
Rafael Espindola c5688628d8 Pass "-z relro" as two arguments. This works with both gnu ld and gold.
Patch by Frits van Bommel.

llvm-svn: 118406
2010-11-08 14:48:47 +00:00
Rafael Espindola 96aef794ba Use the integrated assembler when procession .s files on OpenBSD and Linux.
Original patch for OpenBSD by Vladimir Kirillov.

llvm-svn: 118386
2010-11-07 23:13:01 +00:00
Rafael Espindola 1c76c59bbc Add support for -rdynamic.
llvm-svn: 118384
2010-11-07 22:57:16 +00:00
Rafael Espindola c8f008f649 Use ld directly on linux. Changes from the previous try:
*) Try to detect as much as possible from the system itself, not the distro.
   This should make it easier to port to a new distro and more likely to
   work on a unknown one.
*) The distro enum now doesn't include the arch. Just use the existing
   host detection support in LLVM.
*) Correctly handle --sysroot.

A small regression is that now clang will pass bitcode file to the linker.
This is necessary for the gold plugin support to work.

It might be better to detect this at configure/cmake time, but doing it in
c++ first is a lot easier.

llvm-svn: 118382
2010-11-07 20:14:31 +00:00
Argyrios Kyrtzidis 71731d6b05 Implement -working-directory.
When -working-directory is passed in command line, file paths are resolved relative to the specified directory.
This helps both when using libclang (where we can't require the user to actually change the working directory)
and to help reproduce test cases when the reproduction work comes along.

--FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains
 the working directory value if set).
--FileSystemOptions are passed around to various interfaces that perform file operations.
--Opening & reading the content of files should be done only through FileManager. This is useful in general since
 file operations will be abstracted in the future for the reproduction mechanism.

FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same
FileManager but with different FileSystemOptions.

Addresses rdar://8583824.

llvm-svn: 118203
2010-11-03 22:45:23 +00:00
Rafael Espindola b2cbd85be8 Revert while I debug test failures :-(
llvm-svn: 118150
2010-11-03 04:43:56 +00:00
Rafael Espindola c5dfb607f5 Switch clang to run ld directly on linux. I tested this on all the linux
distros listed by running

gcc main.o -o main
g++ main.o -o main
gcc main.o -o main -static
g++ main.o -o main -static
gcc f.o -o f.so -shared
g++ f.o -o f.so -shared

and comparing the ld line with the one created by clang. I also added
-m32/m64 in distros that support it.

While I tested many distros, there will always be more. If you are hit by this
it should be somewhat easy to add your distro. If you are in a hurry, do
revert this, but please inform how to detect you distro and the ld command
lines produced by the above gcc invocations. Most distros have some patches
on gcc :-(

llvm-svn: 118149
2010-11-03 04:37:51 +00:00
Daniel Dunbar 3ada2b7996 Driver: Silently ignore -fasm-blocks for now instead of error'ing, this cause
some unexpected fallout.

llvm-svn: 118037
2010-11-02 19:42:04 +00:00
Benjamin Kramer 7d11382b8c Use the expanded form of S_ISREG. Hopefully this unbreaks the MSVC build.
llvm-svn: 117779
2010-10-30 08:28:42 +00:00
Dan Gohman e89c04e518 Don't test isRegularFile before calling eraseFromDisk, since
eraseFromDisk does the same check. This avoids a stat call
in the common case.

llvm-svn: 117744
2010-10-29 23:26:14 +00:00
Rafael Espindola acc8709850 Switch to using the integrated assembler by default on x86 and x86-64 ELF
systems.

llvm-svn: 117697
2010-10-29 20:14:02 +00:00
Daniel Dunbar a78e589b08 Driver/IA: Ignore -L for now, which users shouldn't be using for semantic effect.
llvm-svn: 117600
2010-10-28 20:36:23 +00:00
Michael J. Spencer 4992ca4b17 Reorganize predefined macros for all Windows targets.
This adds an option to set the _MSC_VER macro without
recompiling. This is very useful when testing compatibility
with the Windows SDK and c++stdlib headers.

-fmsc-version=<version> (defaults to VS2003 (1300))

llvm-svn: 116999
2010-10-21 05:21:48 +00:00
Michael J. Spencer 4c0ffa823f Fix Whitespace.
llvm-svn: 116990
2010-10-21 03:16:25 +00:00
Chandler Carruth 24e17e175d Add support for the '--sysroot' flag, and an accompanying test of its
interactions with -isysroot and other driver commands.

llvm-svn: 116912
2010-10-20 07:00:47 +00:00
Chandler Carruth 06067c556a Use CLANG_RESOURCE_DIR define if one is provided, otherwise use the default of
'../lib/clang/<version>'. Actually use '..' rather than removing the trailing
component to correctly handle paths containing '.' or symlinks in the presence
of -no-canonical-prefixes, etc. This shouldn't change any existing behavior.

llvm-svn: 116803
2010-10-19 08:47:51 +00:00
Daniel Dunbar 473f8a6f88 Driver: Reject -fasm-blocks except on X86 (where we just ignore it, since
passing it is very prevalent in some circles).

llvm-svn: 116761
2010-10-18 22:49:46 +00:00
Daniel Dunbar 2b4de14b1d Driver/IA: Accept and ignore -force_cpusubtype_ALL, as in 'clang -c
-Wa,-force_cpusubtype_ALL t.c'.
 - Tweaks -Wa, and -Xassembler handling to only accept an explicit short list of
   arguments and give an obvious unsupported error on others.

llvm-svn: 116759
2010-10-18 22:36:15 +00:00
Daniel Dunbar 767bbabb24 Driver/Darwin: Forward -ObjC when linking, which may be needed when using static
libraries with Objective-C code.

llvm-svn: 116758
2010-10-18 22:08:36 +00:00
Daniel Dunbar 6358d6866d Driver: Error on -fno-for-scope, which we have no intention of supporting.
llvm-svn: 116627
2010-10-15 22:30:42 +00:00
Argyrios Kyrtzidis dfe47dba37 Revert r116605, a lot more were committed by mistake.
llvm-svn: 116606
2010-10-15 18:51:34 +00:00
Argyrios Kyrtzidis ffbba26285 Add '-include-pch' option to the driver, so it can get passed to the cc1 driver.
llvm-svn: 116605
2010-10-15 18:49:01 +00:00
Dan Gohman 10169b94cf Wire up the -fstrict-aliasing and -fno-strict-aliasing options
to CodeGenOption flags.

llvm-svn: 116530
2010-10-14 22:36:56 +00:00
Daniel Dunbar 89329cb8f7 Driver/Darwin: Remove a useless warning about missing runtime libraries. These
are almost never needed, so the warning isn't very useful.

llvm-svn: 116263
2010-10-11 23:31:07 +00:00
Douglas Gregor 4e0f15a4a2 Eliminate -fdiagnostics-binary and all of the infrastructure for
emitting diagnostics in a binary form to be consumed by libclang,
since libclang no longer does any of its work out-of-process, making
this code dead. Besides, this stuff never worked at 100% anyway.

llvm-svn: 116250
2010-10-11 22:02:06 +00:00
Axel Naumann b151c3c2d6 Declare argv parameters as const char* const* instead of to char** to clarify that they are not modified, and to allow for string literals as arguments.
llvm-svn: 116200
2010-10-11 09:18:43 +00:00
NAKAMURA Takumi 89acd1e7ef lib/Driver/Driver.cpp: Use the driver g++-4 for Cygwin-1.5.
llvm-svn: 116183
2010-10-11 02:28:42 +00:00
NAKAMURA Takumi 6bdc8a2d8a lib/Driver/Tools.cpp: Disable cxa_atexit by default also on Cygwin.
llvm-svn: 116161
2010-10-10 01:53:03 +00:00
Argyrios Kyrtzidis 74825bcfb9 Implement -fshort-enums (rdar://8490496).
llvm-svn: 116020
2010-10-08 00:25:19 +00:00
John McCall 2a981c2056 Teach the driver to pass -fexceptions in Objective-C inputs on ARM.
I don't know when this stopped happening, but this seems to be the
right place to do it.

llvm-svn: 115730
2010-10-06 01:40:51 +00:00
Devang Patel 91bbb5547d Introduce -flimit-debug-info.
In this experimental mode try avoiding debug info emission for classes as much as possible. The goal is to reduce size of produced debuginfo without reducing quality of debug info in general. This is a work in progress.

llvm-svn: 115188
2010-09-30 19:05:55 +00:00
Argyrios Kyrtzidis 2f23b414e9 Driver: Ignore the found PCH file if its '-include' is not the first one.
llvm-svn: 115158
2010-09-30 16:53:47 +00:00
Daniel Dunbar f247675c55 Driver/Linux: Translate rewritten lib options back to standard -l form when
using generic GCC tools.

llvm-svn: 114793
2010-09-25 18:10:05 +00:00
Daniel Dunbar 4ed214a191 Driver: Add -fallow-unsupported which disables some of the eager error'ing we do
to prevent users from trying unsupported stuff. Useful for testing.

llvm-svn: 114749
2010-09-24 19:39:37 +00:00
Nick Lewycky 6e1ce29b01 Revert r114712 due to failure on darwin buildbot.
llvm-svn: 114713
2010-09-24 00:46:53 +00:00
Nick Lewycky e351fed104 Make -M/-MM behave like in gcc; use -MF first then -o else use stdout.
llvm-svn: 114712
2010-09-23 23:49:25 +00:00
Nick Lewycky e47c245b90 Fix header comment so we don't break emacs.
llvm-svn: 114711
2010-09-23 23:48:20 +00:00
Argyrios Kyrtzidis 4f92016ed3 If -fcolor-diagnostics is explicitly passed to the driver respect that even if the driver is of the opinion that
stderr can't handle them. (see http://llvm.org/PR8150)
Patch by Frits van Bommel!

llvm-svn: 114638
2010-09-23 12:56:06 +00:00
Daniel Dunbar da4f6b5151 Driver/Darwin: Add a runtime library just for ___eprintf -- when targeting i386
some projects still depend on ___eprintf being available.

llvm-svn: 114509
2010-09-22 00:03:52 +00:00
Daniel Dunbar c1dd0e97f3 Driver/Objective-C: Retool Objective-C ABI flags to be more usable, and actually
document behavior. Will wonders never cease.

llvm-svn: 114334
2010-09-20 18:19:55 +00:00
Shantonu Sen afeb03b41d Driver: implement driver automagic support for -lcc_kext
Rewrite linker arguments to use libclang_rt.cc_kext.a
instead of gcc-specific libcc_kext.a

Resolves Radar 7808495

llvm-svn: 114193
2010-09-17 18:39:08 +00:00
David Chisnall dd84ef1e62 Add a -ftrapv-handler= option which allows a handler to invoke instead of simply aborting when a signed operation overflows. This mirrors the (GCC-incompatible) behaviour from clang 1.0 and 1.1 when -ftrapv was specified, but allows the handler to be defined for each compilation unit.
llvm-svn: 114192
2010-09-17 18:29:54 +00:00
Daniel Dunbar 00aff04c8d Driver/DarwinClang: Add GCC libexec paths so we can find the cc1 binaries if we
ever use fallback.
 - Not necessary for clang as a compiler, but useful for testing purposes.

llvm-svn: 114172
2010-09-17 08:22:12 +00:00
Daniel Dunbar 14287de654 Reapply "Driver/Darwin: Time for another spin at switching to the DarwinClang",
now that eprintf symbol issue is resolved.

llvm-svn: 114166
2010-09-17 04:25:28 +00:00