This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Add iSOFTLinux to GNU ToolChains X86Triple
AbandonedPublic

Authored by xiangzhai on Apr 19 2017, 10:01 PM.

Details

Summary

Hi LLVM developers,

I am a Linux engineer of operating system department at iSOFT, I want to add iSOFTLinux to GNU ToolChains X86Triple, please review my patch, thanks a lot!

Regards,
Leslie Zhai

Diff Detail

Repository
rL LLVM

Event Timeline

xiangzhai created this revision.Apr 19 2017, 10:01 PM
rsmith edited edge metadata.Apr 20 2017, 4:28 PM

Please add some test coverage for these triples.

xiangzhai updated this revision to Diff 96088.EditedApr 20 2017, 8:32 PM

Hi Richard,

Thanks for your review!

I updated my patch as you suggested: add some test coverage for these triples, and I run make check-clang-driver for verification, please point out my fault, thanks!

PS: my build option like this:

cmake .. -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_C_COMPILER=clang \
    -DCMAKE_CXX_COMPILER=clang++ \
    -DCMAKE_C_FLAGS="-fPIC" \
    -DCMAKE_CXX_FLAGS="-std=c++11 -fPIC" \
    -DLLVM_BUILD_LLVM_DYLIB=ON \
    -DLLVM_LINK_LLVM_DYLIB=ON \
    -DLLVM_INSTALL_UTILS=ON \
    -DLLVM_ENABLE_RTTI=ON \
    -DLLVM_ENABLE_FFI=ON \
    -DLLVM_ENABLE_EH=ON \
    -DLLVM_BUILD_TESTS=ON \
    -DLLVM_BUILD_DOCS=OFF \
    -DLLVM_ENABLE_SPHINX=OFF \
    -DLLVM_ENABLE_DOXYGEN=OFF \
    -DLLDB_DISABLE_LIBEDIT=1 \
    -DSPHINX_WARNINGS_AS_ERRORS=OFF \
    -DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \
    -DFFI_LIBRARY_DIR:PATH="$(pkg-config --variable=libdir libffi)" \
    -DLLVM_BINUTILS_INCDIR=/usr/include \
    -DLLVM_LIBDIR_SUFFIX= \
    -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=ON \
    -DLIBUNWIND_ENABLE_SHARED=ON \
    -DLIBCXXABI_USE_LLVM_UNWINDER=ON \
    -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="AVR" \
    -DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-isoft-linux" \
    -DCLANG_VENDOR="iSoft"

Regards,
Leslie Zhai

compnerd requested changes to this revision.Apr 24 2017, 5:40 PM

Is this to actually get the correct GCC search dir? Your test doesnt really test anything AFAICT, as it is just invoking clang with a target that it would accept anyways.

This revision now requires changes to proceed.Apr 24 2017, 5:40 PM

Hi Saleem,

Thanks for pointing out my fault, I will update my patch to add, for example:

-L[[SYSROOT]]/usr/lib/gcc/x86_64-isoft-linux/6.3.1

to the testcase.

Regards,
Leslie Zhai

xiangzhai updated this revision to Diff 96497.Apr 24 2017, 9:54 PM
xiangzhai edited edge metadata.

Hi Saleem,

Please check whether or not "the correct GCC search dir" for x86_64-isoft-linux firstly, please point out my fault, thanks!

And sysroot structure shown as:

$ tree clang/test/Driver/Inputs/isoft_linux_4_tree

├── lib
└── usr
    ├── lib
    │   └── gcc
    │       └── x86_64-isoft-linux
    │           └── 6.3.0
    │               ├── crtbegin.o
    │               ├── crtbeginT.o
    │               └── crtfastmath.o
    └── x86_64-isoft-linux
        └── lib

Regards,
Leslie Zhai

compnerd added inline comments.Jun 1 2017, 7:58 PM
test/Driver/linux-ld.c
467–471 ↗(On Diff #96497)

These only invoke clang, but don't actually test anything.

xiangzhai abandoned this revision.Sep 27 2017, 12:21 AM