Skip to content
This repository has been archived by the owner on Sep 29, 2022. It is now read-only.

Commit

Permalink
llvm: Lots more work on installation
Browse files Browse the repository at this point in the history
  • Loading branch information
mingwandroid committed Aug 13, 2017
1 parent 3b78008 commit 8ad60f9
Show file tree
Hide file tree
Showing 12 changed files with 143 additions and 50 deletions.
48 changes: 39 additions & 9 deletions cross-compilers/llvm/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
#!/bin/bash

# TODO :: Install licenses:
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/bootstrap/include/llvm/Support/LICENSE.TXT
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/include/llvm/Support/LICENSE.TXT
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/lib/Target/ARM/LICENSE.TXT
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/LICENSE.TXT
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/prefix/include/llvm/Support/LICENSE.TXT
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/projects/compiler-rt/LICENSE.TXT
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/projects/libcxx/LICENSE.TXT
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/projects/libcxx/utils/google-benchmark/LICENSE
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/projects/libcxxabi/LICENSE.TXT
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/projects/openmp/LICENSE.txt
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/projects/openmp/testsuite/LICENSE
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/projects/tapi/LICENSE.TXT
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/test/YAMLParser/LICENSE.txt
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/tools/clang/LICENSE.TXT
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/tools/polly/lib/External/isl/LICENSE
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/tools/polly/lib/JSON/LICENSE.txt
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/tools/polly/LICENSE.txt
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/tools/polly/tools/GPURuntime/LICENSE.TXT
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/utils/unittest/googlemock/LICENSE.txt
# /Users/vagrant/conda/automated-build/bootstrap/mcf-x-build/cross-compiler/work/utils/unittest/googletest/LICENSE.TXT
# TODO :: Install llvm cmake support files:
# install -d "${PREFIX}"/share/llvm/cmake/{modules,platforms}
# install -Dm644 "${SRC_DIR}"/cmake/modules/*.cmake "${PREFIX}"/share/llvm/cmake/modules/
# install -Dm644 "${SRC_DIR}"/cmake/platforms/*.cmake "${PREFIX}"/share/llvm/cmake/platforms/
# TODO :: Check OpenMP and polly work correctly.
# TODO :: Check for and eliminate any overlapping files (can conda-build have a feature?)

VERBOSE_CM="VERBOSE=1"
VERBOSE_AT="V=1"

# Ensure we do not end up linking to a shared libz
rm -f "${PREFIX}"/lib/libz*${SHLIB_EXT}
# .. if this doesn't work we will need to pass LLVM_ENABLE_ZLIB
Expand All @@ -14,17 +45,16 @@ if [[ -f llvm_build_final/projects/cmake_install.cmake.orig ]]; then
fi

pushd cctools
autoreconf -vfi
# Yuck, sorry.
[[ -d include/macho-o ]] || mkdir -p include/macho-o
cp ld64/src/other/prune_trie.h include/mach-o/prune_trie.h
cp ld64/src/other/prune_trie.h libprunetrie/prune_trie.h
cp ld64/src/other/PruneTrie.cpp libprunetrie/PruneTrie.cpp
if [[ ! -f configure ]]; then
autoreconf -vfi
# Yuck, sorry.
[[ -d include/macho-o ]] || mkdir -p include/macho-o
cp ld64/src/other/prune_trie.h include/mach-o/prune_trie.h
cp ld64/src/other/prune_trie.h libprunetrie/prune_trie.h
cp ld64/src/other/PruneTrie.cpp libprunetrie/PruneTrie.cpp
fi
popd

VERBOSE_CM="VERBOSE=1"
VERBOSE_AT="V=1"

# We need to be careful to avoid linking to any shared libs.
# I have seen ncurses and zlib linked to the final binaries.
find ${PREFIX}/lib -name "*${SHLIB_EXT}"
Expand Down
11 changes: 7 additions & 4 deletions cross-compilers/llvm/install-cctools-ld64.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/bash

DEST=${PWD}/install-cctools-ld64
. activate "${PREFIX}"
cd "${SRC_DIR}"

DEST="${PWD}"/install-cctools-ld64
pushd cctools_build_final
make install DESTDIR=${DEST}
make install DESTDIR="${DEST}"
popd
pushd ${DEST}/${PWD}/prefix
cp -Rf * ${PREFIX}
pushd "${DEST}"/"${PWD}"/prefix
cp -Rf * "${PREFIX}"
popd
16 changes: 10 additions & 6 deletions cross-compilers/llvm/install-clang.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#!/bin/bash

DEST=${PWD}/install-clang
. activate "${PREFIX}"
cd "${SRC_DIR}"

DEST="${PWD}"/install-clang
pushd llvm_build_final/tools/clang
make install DESTDIR=${DEST}
make install DESTDIR="${DEST}"
popd
pushd ${DEST}/${PWD}/prefix
cp -Rf * ${PREFIX}
install -Dm644 LICENSE.TXT "${PREFIX}"/share/licenses/clang/LICENSE
pushd "${DEST}"/"${PWD}"/prefix
cp -Rf * "${PREFIX}"
rm "${PREFIX}"/bin/clang++
find . -name "LICENSE*"
cp LICENSE.TXT "${PREFIX}"/share/licenses/clang/LICENSE
popd
rm -f ${PREFIX}/bin/clang++
3 changes: 3 additions & 0 deletions cross-compilers/llvm/install-clangxx.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

. activate "${PREFIX}"
cd "${SRC_DIR}"

pushd ${PREFIX}/bin
ln -s clang clang++
popd
11 changes: 7 additions & 4 deletions cross-compilers/llvm/install-compiler-rt.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/bash

DEST=${PWD}/install-compiler-rt
. activate "${PREFIX}"
cd "${SRC_DIR}"

DEST="${PWD}"/install-compiler-rt
pushd llvm_build_final/projects/compiler-rt
make install DESTDIR=${DEST}
make install DESTDIR="${DEST}"
popd
pushd ${DEST}/${PWD}/prefix
cp -Rf * ${PREFIX}
pushd "${DEST}"/"${PWD}"/prefix
cp -Rf * "${PREFIX}"
popd
11 changes: 7 additions & 4 deletions cross-compilers/llvm/install-libcxx.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/bash

DEST=${PWD}/install-libcxx
. activate "${PREFIX}"
cd "${SRC_DIR}"

DEST="${PWD}"/install-libcxx
pushd llvm_build_final/projects/libcxx
make install DESTDIR=${DEST}
make install DESTDIR="${DEST}"
popd
pushd ${DEST}/${PWD}/prefix
cp -Rf * ${PREFIX}
pushd "${DEST}"/"${PWD}"/prefix
cp -Rf * "${PREFIX}"
popd
11 changes: 7 additions & 4 deletions cross-compilers/llvm/install-libcxxabi.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/bash

DEST=${PWD}/install-libcxxabi
. activate "${PREFIX}"
cd "${SRC_DIR}"

DEST="${PWD}"/install-libcxxabi
pushd llvm_build_final/projects/libcxxabi
make install DESTDIR=${DEST}
make install DESTDIR="${DEST}"
popd
pushd ${DEST}/${PWD}/prefix
cp -Rf * ${PREFIX}
pushd "${DEST}"/"${PWD}"/prefix
cp -Rf * "${PREFIX}"
popd
11 changes: 7 additions & 4 deletions cross-compilers/llvm/install-libunwind.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/bash

DEST=${PWD}/install-libunwind
. activate "${PREFIX}"
cd "${SRC_DIR}"

DEST="${PWD}"/install-libunwind
pushd llvm_build_final/projects/libunwind
make install DESTDIR=${DEST}
make install DESTDIR="${DEST}"
popd
pushd ${DEST}/${PWD}/prefix
cp -Rf * ${PREFIX}
pushd "${DEST}"/"${PWD}"/prefix
cp -Rf * "${PREFIX}"
popd
15 changes: 9 additions & 6 deletions cross-compilers/llvm/install-llvm-lto-tapi.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/bin/bash

DEST=${PWD}/install-llvm-lto-tapi
pushd llvm_build_finald/tools/lto
make install DESTDIR=${DEST}
. activate "${PREFIX}"
cd "${SRC_DIR}"

DEST="${PWD}"/install-llvm-lto-tapi
pushd llvm_build_final/tools/lto
make install DESTDIR="${DEST}"
popd
pushd llvm_build_final/projects/tapi
make install DESTDIR=${DEST}
make install DESTDIR="${DEST}"
popd
pushd ${DEST}/${PWD}/prefix
cp -Rf * ${PREFIX}
pushd "${DEST}"/"${PWD}"/prefix
cp -Rf * "${PREFIX}"
popd
15 changes: 6 additions & 9 deletions cross-compilers/llvm/install-llvm.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#!/bin/bash

. activate "${PREFIX}"
cd "${SRC_DIR}"

DEST=${PWD}/install-llvm
DEST="${PWD}"/install-llvm
pushd llvm_build_final
make install DESTDIR=${DEST}
make install DESTDIR="${DEST}"
popd
pushd ${DEST}/${PWD}/prefix
cp -Rf * ${PREFIX}
install -Dm644 LICENSE.TXT "${PREFIX}"/share/licenses/llvm/LICENSE
# Install CMake stuff
install -d "${PREFIX}"/share/llvm/cmake/{modules,platforms}
install -Dm644 "${SRC_DIR}"/cmake/modules/*.cmake "${PREFIX}"/share/llvm/cmake/modules/
install -Dm644 "${SRC_DIR}"/cmake/platforms/*.cmake "${PREFIX}"/share/llvm/cmake/platforms/
pushd "${DEST}"/"${PWD}"/prefix
cp -Rf * "${PREFIX}"
popd
12 changes: 12 additions & 0 deletions cross-compilers/llvm/install-polly.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

. activate "${PREFIX}"
cd "${SRC_DIR}"

DEST="${PWD}"/install-polly
pushd llvm_build_final/tools/polly
make install DESTDIR="${DEST}"
popd
pushd "${DEST}"/"${PWD}"/prefix
cp -Rf * "${PREFIX}"
popd
29 changes: 29 additions & 0 deletions cross-compilers/llvm/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ source:
patches:
- 0001-cmake-Cache-results-of-find_darwin_sdk_dir.patch
- 0002-compiler-rt-Determine-COMPILER_RT_SUPPORTED_ARCH-eve.patch
- url: http://releases.llvm.org/{{ version }}/libunwind-{{ version }}.src.tar.xz
folder: projects/libunwind
- url: http://releases.llvm.org/{{ version }}/libcxx-{{ version }}.src.tar.xz
folder: projects/libcxx
- url: http://releases.llvm.org/{{ version }}/libcxxabi-{{ version }}.src.tar.xz
Expand Down Expand Up @@ -132,15 +134,22 @@ outputs:
- name: cctools-ld64
script: install-cctools-ld64.sh
requirements:
build:
- {{ pin_subpackage('llvm-lto-tapi', exact=True) }}
run:
- {{ pin_subpackage('llvm-lto-tapi', exact=True) }}

- name: llvm
script: install-llvm.sh
requirements:
run:
- {{ pin_subpackage('llvm-lto-tapi', exact=True) }}

- name: clang
script: install-clang.sh
requirements:
build:
- cmake
run:
- {{ pin_subpackage('llvm', exact=True) }}
- {{ pin_subpackage('cctools-ld64', exact=True) }}
Expand All @@ -151,29 +160,49 @@ outputs:
- name: clangxx
script: install-clangxx.sh
requirements:
# Need clang present during build otherwise we have a dangling symlink
build:
- {{ pin_subpackage('clang', exact=True) }}
run:
- {{ pin_subpackage('clang', exact=True) }}
run_exports:
- {{ pin_subpackage('libcxx_' ~ cross_target_platform) }}

- name: polly
script: install-polly.sh
requirements:
build:
- cmake
run:
- {{ pin_subpackage('llvm', exact=True) }}

- name: libcxx_{{ cross_target_platform }}
script: install-libcxx.sh
target: {{ cross_target_platform }}
requirements:
build:
- cmake
run:
- {{ pin_subpackage('libcxxabi_' ~ cross_target_platform, exact=True) }}

- name: libcxxabi_{{ cross_target_platform }}
script: install-libcxxabi.sh
target: {{ cross_target_platform }}
requirements:
build:
- cmake
run:
- {{ pin_subpackage('libunwind_' ~ cross_target_platform, exact=True) }}

- name: libunwind_{{ cross_target_platform }}
script: install-libunwind.sh
target: {{ cross_target_platform }}
build:
- cmake

- name: compiler-rt_{{ cross_target_platform }}
script: install-compiler-rt.sh
target: {{ cross_target_platform }}
requirements:
build:
- cmake

0 comments on commit 8ad60f9

Please sign in to comment.