Commit Graph

456 Commits

Author SHA1 Message Date
Chad Rosier c14ded7182 Rename the driver option to -mno-implicit-float, per Eli's suggestion.
llvm-svn: 156950
2012-05-16 21:19:55 +00:00
Chad Rosier f1985d2a44 [driver] Allow the driver to directly accept the -no-implicit-float option, so that the
generation of implicit floating point instructions can be disable for ARM. 
rdar://11409142

llvm-svn: 156942
2012-05-16 20:40:09 +00:00
Chad Rosier e2d8fbbbf1 Tweek r156937 a bit so that the suggestions are correct.
llvm-svn: 156938
2012-05-16 19:42:03 +00:00
Chad Rosier 286852a10c Warn about -Wno-foo where foo is an unknown warning option. This is helpful
for subtle misspellings such as -Wno-unused-command-line-arguments instead of
-Wno-unused-command-line-argument.

Also fix the diagnostic messages to properly handle -Wno- options.  Previously,
the positive version was always emitted (i.e., -Wfoo was emitted for -Wno-foo).
rdar://11461500

llvm-svn: 156937
2012-05-16 19:28:02 +00:00
Douglas Gregor 9295df0569 Add the Objective-C runtime linking arguments after user-specified
linker arguments. Fixes <rdar://problem/11417441>. 

llvm-svn: 156853
2012-05-15 21:00:27 +00:00
Bob Wilson 16d939584b Do not link with Objective-C libraries with -nostdlib or -nodefaultlibs.
<rdar://problem/11433499>

llvm-svn: 156841
2012-05-15 18:57:39 +00:00
Chandler Carruth 94a3201179 Teach the driver on Linux to respect -nodefaultlibs.
Patch from Andrew C. Morrow.

llvm-svn: 156771
2012-05-14 18:31:18 +00:00
Chad Rosier 3adc08e1ad Update test case for new default of 3.0
llvm-svn: 156493
2012-05-09 18:23:04 +00:00
Chad Rosier f761fe9d23 [driver] Use the iOS target triple to infer the deployment target.
rdar://11409204

llvm-svn: 156489
2012-05-09 18:09:58 +00:00
Nuno Lopes 3d6311d5f7 add -fbounds-checking option.
When enabled, clang generates bounds checks for array and pointers dereferences. Work to follow in LLVM's backend.

OK'ed by Chad; thanks for the review.

llvm-svn: 156431
2012-05-08 22:10:46 +00:00
Jean-Daniel Dupas 73d801cd8a Fix -Wlarge-by-value-copy option handling in the driver.
CC1 supports only the joined format.

llvm-svn: 156161
2012-05-04 08:08:37 +00:00
Alexey Samsonov 74a3868dbb This patch adds a new Clang compiler flag "-gline-tables-only".
It reduces the amount of emitted debug information:
1) DIEs in .debug_info have types DW_TAG_compile_unit, DW_TAG_subprogram,
DW_TAG_inlined_subroutine (for opt builds) and DW_TAG_lexical_block only.
2) .debug_str contains only function names.
3) No debug data for types/namespaces/variables is emitted.
4) The data in .debug_line is enough to produce valid stack traces with
function names and line numbers.

Reviewed by Eric Christopher.

llvm-svn: 156160
2012-05-04 07:39:27 +00:00
Simon Atanasyan e16a8c8db8 Test case Clang::Driver/debug-options-as.c depends on the integrated assembler. Turn it on explicitly on all platforms by the "-integrated-as" option.
llvm-svn: 156063
2012-05-03 13:57:00 +00:00
Benjamin Kramer c242ef245c Driver: Turn the default value for -fmath-errno into a proper target hook and disable it by default on more platforms.
For now -fno-math-errno is the default on BSD-derived platforms (Darwin,
DragonFlyBSD, FreeBSD, NetBSD, OpenBSD). If the default is not right for
your platform, please yell. I only verified the result with the default
compilers on Darwin and FreeBSD.

llvm-svn: 155990
2012-05-02 14:55:48 +00:00
James Molloy cebf75e8ca Fix forwarding of -fpack-struct from driver to CC1, and add a test.
-fpack-struct's handling has changed in CC1 (one of only two flags that needed changing) because the driver treats "-fpack-struct" as a boolean flag, and CC1 (did) treat it as an option with a separated value.

This change causes -fpack-struct=X to be forwarded correctly to -fpack-struct=X instead of erroneously to "-fpack-struct X"

llvm-svn: 155981
2012-05-02 07:56:14 +00:00
Douglas Gregor d37a0c0944 Revert r155874.
llvm-svn: 155878
2012-05-01 02:04:03 +00:00
Douglas Gregor 77b2b350f7 Move a non portable test to FileCheck, from Jonathan Gray!
llvm-svn: 155874
2012-05-01 01:42:40 +00:00
Chad Rosier 98ab91c226 [driver] Don't try to set the deployment target when there is no bound
architecture; this was happening for tools such as lipo and dsymutil.
Also, if no -arch option has been specified, set the architecture based
on the TC default.
rdar://11329656

llvm-svn: 155730
2012-04-27 19:51:11 +00:00
NAKAMURA Takumi c4f6e37c97 test/Driver/fast-math.c: Mark this as XFAIL:cygming. They use gcc driver for as.
llvm-svn: 155691
2012-04-27 04:36:27 +00:00
Simon Atanasyan 9bb634df36 MIPS: Add support for 64-bit MIPS targets: mips64 / mips64el.
llvm-svn: 155656
2012-04-26 19:57:02 +00:00
Simon Atanasyan 2be62257a8 MIPS: Add tests to check the debian multiarch stuff for mips and mipsel targets.
llvm-svn: 155628
2012-04-26 08:35:58 +00:00
Chandler Carruth 3634c66b41 Fix a long-standing bug where Clang had a different default from GCC on
Linux and other (non-Darwin) platforms and have it use -fmath-errno by
default (for better or worse).

Darwin has seen the light here and uses -fno-math-errno by default, this
patch preserves that.

If any maintainers for a non-Linux platform would also like to opt-in to
-fno-math-errno by default, I'm happy to add folks, but we're currently
getting buts and misleading comparisons with GCC due to this difference
in behavior on Linux at least.

llvm-svn: 155607
2012-04-26 02:10:51 +00:00
Evgeniy Stepanov 0a0655affa Make asan-ld test windows-safe.
llvm-svn: 155543
2012-04-25 09:28:10 +00:00
Evgeniy Stepanov 7786671b5a Clang driver support for linking on Android.
llvm-svn: 155541
2012-04-25 08:59:22 +00:00
Evgeniy Stepanov 78eaa2cd1b Fix default cpu for -march=armv5e.
llvm-svn: 155540
2012-04-25 08:35:56 +00:00
Evgeniy Stepanov 582911a089 Only pass -mcpu, -march, -mfpu to linux-as on ARM.
llvm-svn: 155431
2012-04-24 09:05:31 +00:00
Bob Wilson 16c4a4f471 Add a test for svn r155263.
llvm-svn: 155353
2012-04-23 16:22:22 +00:00
Evgeniy Stepanov ed943f66d6 Pass -mfloat-abi= to linuxtools assembler.
llvm-svn: 155191
2012-04-20 09:03:40 +00:00
Evgeniy Stepanov 70cb3d623b Pass -march, -mcpu, -mfpu to linuxtools assembler.
llvm-svn: 154389
2012-04-10 09:05:40 +00:00
Rafael Espindola fc1562dbca Fix the testcase :-(
llvm-svn: 154363
2012-04-10 00:13:42 +00:00
Rafael Espindola 9446d76e80 Fix an annoying little bug I found while debugging another LTO issue. Gold
requires the -plugin to come before any -plugin-opt options, we were passing
them the other way around. With this one can run (for example):

clang -o foo foo.c -O4 -Wl,-plugin-opt=generate-api-file

llvm-svn: 154357
2012-04-09 23:53:34 +00:00
Daniel Dunbar 883f2bb1f9 Author: Daniel Dunbar <daniel@zuster.org>
--- log message follows this test ---
[tests] Fixup some tests to work in "CLANG_IS_PRODUCTION" mode.

llvm-svn: 154342
2012-04-09 20:40:11 +00:00
Fariborz Jahanian 0568407543 objective-c: remove -fobjc-default-synthesize-properties from the driver.
cc1 option remains though to invoke default property synthesis.
// rdar://11209719

llvm-svn: 154334
2012-04-09 18:58:55 +00:00
Fariborz Jahanian ba8ef296e4 objective-c: Remove -fno-objc-default-synthesize-properties
as the driver option.
// rdar://11209719

llvm-svn: 154331
2012-04-09 18:20:28 +00:00
Chandler Carruth c0c0455f55 Teach Clang about PIE compilations. This is the first step of PR12380.
First, this patch cleans up the parsing of the PIC and PIE family of
options in the driver. The existing logic failed to claim arguments all
over the place resulting in kludges that marked the options as unused.
Instead actually walk all of the arguments and claim them properly.

We now treat -f{,no-}{pic,PIC,pie,PIE} as a single set, accepting the
last one on the commandline. Previously there were lots of ordering bugs
that could creep in due to the nature of the parsing. Let me know if
folks would like weird things such as "-fPIE -fno-pic" to turn on PIE,
but disable full PIC. This doesn't make any sense to me, but we could in
theory support it.

Options that seem to have intentional "trump" status (-static, -mkernel,
etc) continue to do so and are commented as such.

Next, a -pie-level flag is threaded into the frontend, rigged to
a language option, and handled preprocessor, setting up the appropriate
defines. We'll now have the correct defines when compiling with -fpie.

The one place outside of the preprocessor that was inspecting the PIC
level (as opposed to the relocation model, which is set and handled
separately, yay!) is in the GNU ObjC runtime. I changed it to exactly
preserve existing behavior. If folks want to change its behavior in the
face of PIE, they can do that in a separate patch.

Essentially the only functionality changed here is the preprocessor
defines and bug-fixes to the argument management.

Tests have been updated and extended to test all of this a bit more
thoroughly.

llvm-svn: 154291
2012-04-08 16:40:35 +00:00
Simon Atanasyan 571d7bde3c MIPS: Pass -mabi option to the assmbler when compile MIPS targets.
llvm-svn: 154270
2012-04-07 22:31:29 +00:00
Chad Rosier 706c235013 [driver] In general, the driver claims redundant args and uses the last arg.
However, the '-x' option has special handling and wasn't following this
paradigm.  Fix it to do so by claiming the arg as we parse the '-x' option.
rdar://11203340

llvm-svn: 154231
2012-04-07 00:01:31 +00:00
Simon Atanasyan 1e1e2e2d9a MIPS: Provide a correct path to the dynamic linker when build for MIPS 64-bit targets.
llvm-svn: 154200
2012-04-06 20:14:27 +00:00
Simon Atanasyan 2390aa1813 MIPS: Pass -EB/-EL argument to the assembler according to selected endian when compile for MIPS targets.
llvm-svn: 154195
2012-04-06 19:15:24 +00:00
Simon Atanasyan 5e21c800e8 MIPS: Move tests check float ABI macros definitions to the more appropriate place.
llvm-svn: 154184
2012-04-06 17:51:49 +00:00
Chandler Carruth 69a125bf02 Fix using Clang as a cross compiler installed on a host machine and not
inside of a sysroot targeting a system+sysroot which is "similar" or
"compatible" with the host system. This shows up when trying to build
system images on largely compatible hardware as-if fully cross compiled.

The problem is that previously we *perfectly* mimiced GCC here, and it
turns out GCC has a bug that no one has really stumbled across. GCC will
try to look in thy system prefix ('/usr/local' f.ex.) into which it is
instaled to find libraries installed along side GCC that should be
preferred to the base system libraries ('/usr' f.ex.). This seems not
unreasonable, but it has a very unfortunate consequence when combined
with a '--sysroot' which does *not* contain the GCC installation we're
using to complete the toolchain. That results in some of the host
system's library directories being searched during the link.

Now, it so happens that most folks doing stuff like this use
'--with-sysroot' and '--disable-multilib' when configuring GCC. Even
better, they're usually not cross-compiling to a target that is similar
to the host. As a result, searching the host for libraries doesn't
really matter -- most of the time weird directories get appended that
don't exist (no arm triple lib directory, etc). Even if you're
cross-compiling from 32-bit to 64-bit x86 or vice-versa, disabling
multilib makes it less likely that you'll actually find viable libraries
on the host. But that's just luck. We shouldn't rely on this, and this
patch disables looking in the system prefix containing the GCC
installation if that system prefix is *outside* of the sysroot. For
empty sysroots, this has no effect. Similarly, when using the GCC
*inside* of the sysroot, we still track wherever it is installed within
the sysroot and look there for libraries. But now we can use a cross
compiler GCC installation outside the system root, and only look for the
crtbegin.o in the GCC installation, and look for all the other libraries
inside the system root.

This should fix PR12478, allowing Clang to be used when building
a ChromiumOS image without polluting the image with libraries from the
host system.

llvm-svn: 154176
2012-04-06 16:32:06 +00:00
Nico Weber bea0d04f8c Honor -fno-pic, -fno-PIC, -fno-pie, -fno-PIE.
Review at http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120402/055759.html

llvm-svn: 154064
2012-04-04 23:00:14 +00:00
Chad Rosier 45619cbc03 [driver] When using the -mfpmath= option, add an error message when trying to
enable neonfp on a CPU that doesn't support NEON.
rdar://11108618

llvm-svn: 154061
2012-04-04 22:13:40 +00:00
Chad Rosier 1f0e52e361 [driver] Create a new -mfpmath= option, which is used to control whether clang
uses Neon instructions for single-precision FP.

-mfpmath=neon is analogous to passing llc -mattr=+neonfp.
-mfpmath=[vfp|vfp2|vfp3|vfp4] is analogous to passing llc -mattr=-neonfp.

rdar://11108618

llvm-svn: 154046
2012-04-04 20:39:32 +00:00
Fariborz Jahanian 7ebeedea6c modern objc translator. Add more
rewriter specific option to cc1 with -rewrite-objc.
// rdar://11143173

llvm-svn: 154037
2012-04-04 18:50:28 +00:00
Bob Wilson 8c9356b3d8 Simplify test a bit now that it's not actually running cc1plus.
llvm-svn: 154018
2012-04-04 14:43:40 +00:00
Benjamin Kramer ab90ebe917 Don't actually execute gcc during testing.
llvm-svn: 154005
2012-04-04 09:05:21 +00:00
Bob Wilson 5b6411591c Add a testcase for svn r153854.
llvm-svn: 154001
2012-04-04 07:06:30 +00:00
Fariborz Jahanian 73223bbd0a Use -rewrite-legacy-objc as clang argument for translating
objective-c's fragile abi, Use -rewrite-objc for translating 
objective-c's modern abi.  // rdar://11143173

llvm-svn: 153877
2012-04-02 15:59:19 +00:00
Jan Wen Voung 1d4c2d9a48 Define __LITTLE_ENDIAN__ for le32, since "le" stands for little endian.
Add a test for this too.

llvm-svn: 153616
2012-03-29 00:05:59 +00:00