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
Showing
- include/clang/Driver/ToolChain.h 3 additions, 0 deletionsinclude/clang/Driver/ToolChain.h
- lib/Driver/ToolChain.cpp 8 additions, 0 deletionslib/Driver/ToolChain.cpp
- lib/Driver/ToolChains.cpp 147 additions, 29 deletionslib/Driver/ToolChains.cpp
- lib/Driver/ToolChains.h 2 additions, 0 deletionslib/Driver/ToolChains.h
- test/Driver/Inputs/mips_cs_tree/bin/.keep 0 additions, 0 deletionstest/Driver/Inputs/mips_cs_tree/bin/.keep
- test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/64/crtbegin.o 0 additions, 0 deletions...s/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/64/crtbegin.o
- test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/64/crtend.o 0 additions, 0 deletions...uts/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/64/crtend.o
- test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/crtbegin.o 0 additions, 0 deletions...puts/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/crtbegin.o
- test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/crtend.o 0 additions, 0 deletions...Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/crtend.o
- test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/el/64/crtbegin.o 0 additions, 0 deletions...ips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/el/64/crtbegin.o
- test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/el/64/crtend.o 0 additions, 0 deletions.../mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/el/64/crtend.o
- test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/el/crtbegin.o 0 additions, 0 deletions...s/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/el/crtbegin.o
- test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/el/crtend.o 0 additions, 0 deletions...uts/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/el/crtend.o
- test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/64/.keep 0 additions, 0 deletions..._tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/64/.keep
- test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/el/64/.keep 0 additions, 0 deletions...ee/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/el/64/.keep
- test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/micromips/el/.keep 0 additions, 0 deletions...gcc/mips-linux-gnu/4.6.3/include-fixed/micromips/el/.keep
- test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/micromips/soft-float/el/.keep 0 additions, 0 deletions...nux-gnu/4.6.3/include-fixed/micromips/soft-float/el/.keep
- test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/mips16/el/.keep 0 additions, 0 deletions...ib/gcc/mips-linux-gnu/4.6.3/include-fixed/mips16/el/.keep
- test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/mips16/soft-float/el/.keep 0 additions, 0 deletions...-linux-gnu/4.6.3/include-fixed/mips16/soft-float/el/.keep
- test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/soft-float/64/.keep 0 additions, 0 deletions...cc/mips-linux-gnu/4.6.3/include-fixed/soft-float/64/.keep
Loading
Please register or sign in to comment