Commit Graph

421 Commits

Author SHA1 Message Date
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
Chad Rosier 58439c5a92 [driver] Put -cpp-precomp and -no-cpp-precomp under the clang_ignored_f_group.
We don't currently support these options.
rdar://11120518

llvm-svn: 153485
2012-03-26 23:36:04 +00:00
Chad Rosier 98e5d863ad [driver] Testcase for r153469, r153470, and r153478.
llvm-svn: 153481
2012-03-26 22:43:28 +00:00
Akira Hatanaka efe96a682d Test case for r153348.
llvm-svn: 153449
2012-03-26 17:37:20 +00:00
NAKAMURA Takumi 9a0ca277b0 test/Driver/cpath.c: Escape a few args that contain %{pathsep}.
On msys bash, with %pathsep==os.pathsep==';', I can see lines like below in this script;

    env DIR=X:/foo%{pathsep}X:/bar

Then it is expanded to;

    env DIR=X:/foo;X:/bar

It should be with quote;

    env "DIR=X:/foo;X:/bar"

llvm-svn: 153402
2012-03-25 03:42:26 +00:00
Nico Weber 6a2eee0cfb Try to get cpath.c passing on windows, using lit's new ${pathsep} variable.
llvm-svn: 153214
2012-03-21 19:57:21 +00:00
NAKAMURA Takumi 7fc219f713 test/Driver/cpath.c: Mark this as XFAIL:mingw32,win32 for now.
On Win32 hosts, ';' is used for path separator.

llvm-svn: 153037
2012-03-19 16:07:58 +00:00
Nico Weber 8935578528 Fix a regression where ':' in CPLUS_INCLUDE_PATH and friends would no longer separate paths.
This regressed in r152583. Also add a test to make sure it doesn't regress again.

llvm-svn: 153034
2012-03-19 15:00:03 +00:00
NAKAMURA Takumi e235525557 test/Driver/linker-opts.c: Mark as XFAIL:cygming, using gcc linker driver. It should be aware of LIBRARY_PATH.
llvm-svn: 152896
2012-03-16 05:31:24 +00:00
Chad Rosier 9c76d24f9c [frontend] Fix how the frontend handles -fno-inline. AFAIK clang now matches
the behavior of gcc with respect to the -fno-inline and -fno-inline-functions
flags.

llvm-svn: 152861
2012-03-15 22:31:42 +00:00
Matt Beaumont-Gay 1c883c58dd Remove trailing whitespace (especially after a \ which should be trailing)
llvm-svn: 152695
2012-03-14 01:23:41 +00:00
Benjamin Kramer 91b9ac8ae9 -arch is a darwin-only feature, use -target instead to make the linux buildbots happy again.
Also check the error message.

llvm-svn: 152694
2012-03-14 01:17:52 +00:00
Chad Rosier b8d8b4cb65 Typo.
llvm-svn: 152686
2012-03-13 23:48:50 +00:00
Chad Rosier 864dfe11bd [driver] Clang should report an error for -faltivec on non-ppc.
rdar://10963572

llvm-svn: 152684
2012-03-13 23:45:51 +00:00
Chad Rosier 8028640704 Update test case to use not tool.
llvm-svn: 152664
2012-03-13 20:31:40 +00:00
Chad Rosier d6f716ab2a [driver] Parse diagnostic args in the driver.
Previously, only diagnostics thrown by the cc1 process were
actually honoring the diagnostic options given on the command line,
like -Werror.

Reuse the existing code in Frontend currently used for cc1,
adjusting it to not interpret -Wl, linker flags as warnings.

Also fix a faulty test exposed by this change.
It wasn't actually testing anything, and was giving this warning:

clang-3: warning: argument unused during compilation: '-verify'

Which -Werror didn't turn into an error because it was output
by the driver, not the cc1 process, and diagnostic options
weren't parsed by the driver. And you couldn't see the warning
when running the test suite.

Fixes PR12181.
Patch by Dylan Noblesmith <nobled@dreamwidth.org>.

llvm-svn: 152660
2012-03-13 20:09:56 +00:00
Bill Wendling c0938f3fdb Address some of the concerns by Chandler.
* s/AddDirectoryList/addDirectoryList/
* Move the call to ::getenv into the function.
* FileCheck-ize the testcase.

llvm-svn: 152583
2012-03-12 22:10:06 +00:00
Bill Wendling 281ca2917b Have clang pay attention to the LIBRARY_PATH environment variable.
The LIBRARY_PATH environment variable should be honored by clang. Have the
driver pass the directories to the linker.
<rdar://problem/9743567> and PR10296.

llvm-svn: 152578
2012-03-12 21:22:35 +00:00
Rafael Espindola c41db927f3 Implement -fno-dwarf2-cfi-asm on linux too.
llvm-svn: 152316
2012-03-08 14:39:55 +00:00
Chad Rosier 64d6be979f [driver] What was implemented in r152130 was actually -fno-inline-functions, not
-fno-inline.
Part of rdar://10972766

llvm-svn: 152145
2012-03-06 21:17:19 +00:00
Ted Kremenek e65b086e07 Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,
NSNumber, and boolean literals.  This includes both Sema and Codegen support.
Included is also support for new Objective-C container subscripting.

My apologies for the large patch.  It was very difficult to break apart.
The patch introduces changes to the driver as well to cause clang to link
in additional runtime support when needed to support the new language features.

Docs are forthcoming to document the implementation and behavior of these features.

llvm-svn: 152137
2012-03-06 20:05:56 +00:00
Chad Rosier 9a099ea3eb Whitespace.
llvm-svn: 152134
2012-03-06 19:14:53 +00:00
Chad Rosier 806031896d [driver] Add support for -fno-inline.
rdar://10972766

llvm-svn: 152130
2012-03-06 18:49:20 +00:00
Kostya Serebryany 28a7a1198b Add a flag -fthread-sanitizer.
This flag enables ThreadSanitizer instrumentation committed to llvm as r150423.
The patch includes one test for -fthread-sanitizer and one similar test for -faddress-sanitizer.
This patch does not modify the linker flags (as we do it for -faddress-sanitizer) because the run-time library is not yet
committed and it's structure in compiler-rt is not 100% clear.
The users manual wil be changed in a separate commit.

llvm-svn: 151846
2012-03-01 22:27:08 +00:00
Argyrios Kyrtzidis 3dbeb55874 [driver] Emit an error when trying to use ARC on macosx earlier than 10.6
rdar://10459258

llvm-svn: 151706
2012-02-29 03:43:52 +00:00
Chad Rosier 2ad368fce3 [driver] Add support for -g2 and -ggdb debug flags.
rdar://10947759

llvm-svn: 151654
2012-02-28 20:49:04 +00:00
Benjamin Kramer 6b2dc73d48 Okay, makes sense to change all the occurences to match clang.EXE.
llvm-svn: 151491
2012-02-26 14:55:10 +00:00
Benjamin Kramer 1c45c9c8b0 Allow any file extension for the clang binary in the linux-header-search test.
Turns out this can be .exe or .EXE, depending on the build system.

llvm-svn: 151490
2012-02-26 14:50:31 +00:00
Chandler Carruth df8ae4b949 Add the critical crtbegin.o files necessary for any of the tests in
r151482 and r151484 to work. Sorry about the fallout...

llvm-svn: 151485
2012-02-26 10:46:17 +00:00
Chandler Carruth 2e9d731761 A follow-up to r151482 which added support for powerpc and powerpc64
Debian multiarch libraries, this should in theory add support for those
platform's header search rules. I don't have a system to check this
with, so review appreciated. I've added the corresponding tests
referring to the debian multiarch tree.

We are starting to have a relatively completely tested Linux platform
for header search and library search, with several interesting
peculiarities. We should point people at the debian_multiarch_tree when
suggesting new tests. Folks with Debian systems that can check this for
correctness, it would be much appreciated. The missing chunks I know of
are testing bi-arch peudo-cross-compiling toolchains betwen 32-bit and
64-bit variants of platforms, and the MIPS and ARM Debian toolchains.

llvm-svn: 151484
2012-02-26 09:21:43 +00:00
Chandler Carruth af3c2090b4 Add support for PPC and PPC64 multiarch toolchains on Debain.
Patch from Michel Dänzer, sent our way via Jeremy Huddleston who added
64-bit support. I just added one other place where powerpc64-linux-gnu
was missing (we only had powerpc64-unknown-linux-gnu).

I've also added a tree to test out the debian multiarch stuff. I don't
use debian regularly, so I'm not certain this is entirely accurate. If
anyone wants to check it against a debian system and fix any
inaccuracies, fire away. This way at least folks can see how this is
*supposed* to be tested.

It'd be particularly good to get the Debian MIPS toolchains tested in
this way.

llvm-svn: 151482
2012-02-26 09:03:21 +00:00
Jim Grosbach ce398aa03b Update test for r151288
llvm-svn: 151290
2012-02-23 22:12:53 +00:00
Joerg Sonnenberger 17d7551e73 Revert part of r148839 and keep DefaultTargetTriple in the form adjusted
by -target and similar options. As discussed in PR 12026, the change
broke support for target-prefixed tools, i.e. calling x86_64--linux-ld
when compiling for x86_64--linux. Improve the test cases added
originally in r149083 to not require execution, just executable files.
Document the hack with appropiate FIXME comments.

llvm-svn: 151185
2012-02-22 19:15:16 +00:00
Chandler Carruth 85061b51d2 Skip testing the crtbegin.o, and resume using a single variable for the
prefixes. It seems only crtbegin.o uses the strange formatting.

llvm-svn: 151094
2012-02-21 22:21:50 +00:00
Chandler Carruth 286e0e0818 Clean up, add some documentation, and make this test return to checking
the linker toolchainness a bit more thoroughly. It used to work this
way, but hit buildbot issues. Hopefully subsequent fixes have addressed
those problems, but I'll be watching the bots.

llvm-svn: 151090
2012-02-21 21:51:40 +00:00
Aaron Ballman 4284c36ef5 Adding a test case for the working-directory fix
llvm-svn: 151014
2012-02-21 00:56:50 +00:00