]> granicus.if.org Git - clang/commit
Supports Sourcery CodeBench Mips toolchain directories tree.
authorSimon Atanasyan <simon@atanasyan.com>
Sat, 20 Apr 2013 08:15:03 +0000 (08:15 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Sat, 20 Apr 2013 08:15:03 +0000 (08:15 +0000)
commit8e8e95c57c310bbc52cdc8d32df23c95afc77916
tree0b1fa2de9a25f76f1a6cf7502bbc57ba13005afd
parent8ef064d53fb33b5a8f8743bcbb0a2fd5c3e97be1
Supports Sourcery CodeBench Mips toolchain directories tree.

Sourcery CodeBench and modern FSF Mips toolchains require a bit more
complicated algorithm to calculate headers, libraries and sysroot paths
than implemented by Clang driver now. The main problem is that all these
paths depend on a set of command line arguments additionally to a target
triple value. For example, let $TC is a toolchain installation directory.
If we compile big-endian 32-bit mips code, crtbegin.o is in the
$TC/lib/gcc/mips-linux-gnu/4.7.2 folder and the toolchain's linker requires
--sysroot=$TC/mips-linux-gnu/libc argument. If we compile little-endian
32-bit soft-float mips code, crtbegin.o is in the
$TC/lib/gcc/mips-linux-gnu/4.7.2/soft-float/el folder and the toolchain's
linker requires --sysroot=$TC/mips-linux-gnu/libc/soft-float/el argument.

1. Calculate MultiarchSuffix using all necessary command line options and
   use this MultiarchSuffix to detect crtbegin.o location in the
   GCCInstallationDetector::ScanLibDirForGCCTriple() routine.
2. If a user does not provide --sysroot argument to the driver explicitly,
   calculate new sysroot value based on command line options. Then use this
   calculated sysroot path:
   a. To populate a file search paths list in the Linux::Linux() constructor.
   b. To find Mips toolchain specific include headers directories
      in the Linux::AddClangSystemIncludeArgs() routine.
   c. To provide -–sysroot argument for a linker.

Note:
- The FSF's tree slightly differs (folder names) and is not supported
  yet.
- New addExternCSystemIncludeIfExits() routine is a temporary solution.
  I plan to move path existence check to the addExternCSystemInclude()
  routine by a separate commit.

The patch reviewed by Rafael Espindola.
http://llvm-reviews.chandlerc.com/D644

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179934 91177308-0d34-0410-b5e6-96231b3b80d8
122 files changed:
include/clang/Driver/ToolChain.h
lib/Driver/ToolChain.cpp
lib/Driver/ToolChains.cpp
lib/Driver/ToolChains.h
test/Driver/Inputs/mips_cs_tree/bin/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/64/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/64/crtend.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/crtend.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/el/64/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/el/64/crtend.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/el/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/el/crtend.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/64/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/el/64/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/micromips/el/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/micromips/soft-float/el/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/mips16/el/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/mips16/soft-float/el/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/soft-float/64/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/soft-float/el/64/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/micromips/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/micromips/crtend.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/micromips/el/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/micromips/el/crtend.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/micromips/soft-float/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/micromips/soft-float/crtend.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/micromips/soft-float/el/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/micromips/soft-float/el/crtend.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/mips16/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/mips16/crtend.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/mips16/el/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/mips16/el/crtend.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/mips16/soft-float/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/mips16/soft-float/crtend.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/mips16/soft-float/el/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/mips16/soft-float/el/crtend.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/soft-float/64/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/soft-float/64/crtend.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/soft-float/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/soft-float/crtend.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/soft-float/el/64/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/soft-float/el/64/crtend.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/soft-float/el/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/soft-float/el/crtend.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/include/c++/4.6.3/mips-linux-gnu/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/el/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/micromips/el/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/micromips/soft-float/el/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/mips16/el/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/mips16/soft-float/el/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/soft-float/el/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib64/el/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib64/soft-float/el/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/el/lib/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/el/lib64/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/el/usr/lib/crt1.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/el/usr/lib/crti.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/el/usr/lib/crtn.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/el/usr/lib64/crt1.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/el/usr/lib64/crti.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/el/usr/lib64/crtn.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/lib/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/lib64/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/micromips/el/lib/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/micromips/el/usr/lib/crt1.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/micromips/el/usr/lib/crti.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/micromips/el/usr/lib/crtn.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/micromips/lib/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/micromips/soft-float/el/lib/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/micromips/soft-float/el/usr/lib/crt1.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/micromips/soft-float/el/usr/lib/crti.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/micromips/soft-float/el/usr/lib/crtn.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/micromips/soft-float/lib/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/micromips/soft-float/usr/lib/crt1.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/micromips/soft-float/usr/lib/crti.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/micromips/soft-float/usr/lib/crtn.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/micromips/usr/lib/crt1.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/micromips/usr/lib/crti.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/micromips/usr/lib/crtn.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/mips16/el/lib/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/mips16/el/usr/lib/crt1.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/mips16/el/usr/lib/crti.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/mips16/el/usr/lib/crtn.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/mips16/lib/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/mips16/soft-float/el/lib/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/mips16/soft-float/el/usr/lib/crt1.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/mips16/soft-float/el/usr/lib/crti.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/mips16/soft-float/el/usr/lib/crtn.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/mips16/soft-float/lib/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/mips16/soft-float/usr/lib/crt1.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/mips16/soft-float/usr/lib/crti.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/mips16/soft-float/usr/lib/crtn.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/mips16/usr/lib/crt1.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/mips16/usr/lib/crti.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/mips16/usr/lib/crtn.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/soft-float/el/lib/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/soft-float/el/lib64/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/soft-float/el/usr/lib/crt1.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/soft-float/el/usr/lib/crti.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/soft-float/el/usr/lib/crtn.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/soft-float/el/usr/lib64/crt1.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/soft-float/el/usr/lib64/crti.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/soft-float/el/usr/lib64/crtn.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/soft-float/lib/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/soft-float/lib64/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/soft-float/usr/lib/crt1.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/soft-float/usr/lib/crti.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/soft-float/usr/lib/crtn.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/soft-float/usr/lib64/crt1.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/soft-float/usr/lib64/crti.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/soft-float/usr/lib64/crtn.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/usr/include/.keep [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/usr/lib/crt1.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/usr/lib/crti.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/usr/lib/crtn.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/usr/lib64/crt1.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/usr/lib64/crti.o [new file with mode: 0644]
test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/usr/lib64/crtn.o [new file with mode: 0644]
test/Driver/mips-cs-header-search.cpp [new file with mode: 0644]
test/Driver/mips-cs-ld.c [new file with mode: 0644]