Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try llvm #157

Merged
merged 10 commits into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
try to build stuff
  • Loading branch information
wolfv committed Aug 7, 2022
commit 5ee2d842d01f26198a4908de2485d493d2403772
45 changes: 39 additions & 6 deletions recipes/recipes_emscripten/llvmdev/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/bash
set -x

# set -x

# Make osx work like linux.
Expand All @@ -21,10 +24,15 @@ cd build
# CFLAGS="$(echo $CFLAGS | sed 's/-fno-plt //g')"
# CXXFLAGS="$(echo $CXXFLAGS | sed 's/-fno-plt //g')"
# fi
export EMCC_FORCE_STDLIBS=1

# set initial memory to 200 Megabyte
export LDFLAGS="$LDFLAGS -sEMCC_FORCE_STDLIBS=1 -sTOTAL_MEMORY=200000000"

cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_BUILD_TYPE=Release \
-DHAVE_LIBEDIT=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DLLVM_HAVE_LIBXAR=OFF \
-DLLVM_ENABLE_LIBXML2=OFF \
-DLLVM_ENABLE_RTTI=ON \
Expand All @@ -34,13 +42,15 @@ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DLLVM_INCLUDE_DOCS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_INCLUDE_GO_TESTS=OFF \
-DLLVM_INCLUDE_TESTS=ON \
-DLLVM_INCLUDE_UTILS=ON \
-DLLVM_INSTALL_UTILS=ON \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_UTILS=OFF \
-DLLVM_INSTALL_UTILS=OFF \
-DLLVM_UTILS_INSTALL_DIR=libexec/llvm \
-DLLVM_BUILD_LLVM_DYLIB=yes \
-DLLVM_LINK_LLVM_DYLIB=yes \
-DLLVM_BUILD_LLVM_DYLIB=OFF \
-DLLVM_LINK_LLVM_DYLIB=OFF \
-DLLVM_BUILD_TOOLS=OFF \
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly \
-DLLVM_TABLEGEN=${BUILD_PREFIX}/bin/llvm-tblgen \
${CMAKE_ARGS} \
-GNinja \
../llvm
Expand All @@ -64,4 +74,27 @@ ninja -j${CPU_COUNT}

# cd ../llvm/test
# ../../build/bin/llvm-lit -vv Transforms ExecutionEngine Analysis CodeGen/X86
# fi
# fi

# cd build
ninja install

IFS='.' read -ra VER_ARR <<< "$PKG_VERSION"

# if [[ "${PKG_NAME}" == libllvm* ]]; then
# rm -rf $PREFIX/bin
# rm -rf $PREFIX/include
# rm -rf $PREFIX/share
# rm -rf $PREFIX/libexec
# mv $PREFIX/lib $PREFIX/lib2
# mkdir -p $PREFIX/lib
# mv $PREFIX/lib2/libLLVM-${VER_ARR[0]}${SHLIB_EXT} $PREFIX/lib
# mv $PREFIX/lib2/lib*.so.${VER_ARR[0]} $PREFIX/lib || true
# mv $PREFIX/lib2/lib*.${VER_ARR[0]}.dylib $PREFIX/lib || true
# rm -rf $PREFIX/lib2
# elif [[ "${PKG_NAME}" == "llvm-tools" ]]; then
# rm -rf $PREFIX/lib
# rm -rf $PREFIX/include
# rm $PREFIX/bin/llvm-config
# rm -rf $PREFIX/libexec
# fi
93 changes: 0 additions & 93 deletions recipes/recipes_emscripten/llvmdev/install_llvm.sh

This file was deleted.

147 changes: 68 additions & 79 deletions recipes/recipes_emscripten/llvmdev/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,25 @@ build:
number: 0

outputs:
# requirements:
# build:
# - "{{ compiler('cxx') }}"
# - cmake
# - ninja
# - python >=3
# - libcxx {{ cxx_compiler_version }} # [osx]
# host:
# - libcxx {{ cxx_compiler_version }} # [osx]
# - zlib
# - libxml2 # [win]

# Contains everything
- package:
name: llvmdev
build:
script: install_llvm.sh # [not win]
script: build.sh
activate_in_script: true
requirements:
build:
- "{{ compiler('cxx') }}"
- cmake <3.24
- ninja
- python >=3
- sel(build_platform != target_platform): llvm-tools {{ version }}
host:
- '{{ pin_subpackage("libllvm" + major_ver, exact=True) }}'
# - '{{ pin_subpackage("libllvm" + major_ver, exact=True) }}'
# - '{{ pin_subpackage("llvm-tools", exact=True) }}'
- zlib
run:
- '{{ pin_subpackage("libllvm" + major_ver, exact=True) }}'
# - '{{ pin_subpackage("libllvm" + major_ver, exact=True) }}'
# - {{ pin_subpackage("llvm-tools", exact=True) }}
- libcxx >={{ cxx_compiler_version }} # [osx]
# test:
Expand All @@ -60,72 +49,72 @@ outputs:
# - if not exist %LIBRARY_INC%\\llvm\\Pass.h exit 1 # [win]
# - if not exist "%LIBRARY_PREFIX%"\\libexec\llvm\not.exe exit 1 # [win]

# Contains the shared libraries. To make different LLVM libraries co-installable
# soversion is appended to the package name.
- package:
name: libllvm{{ major_ver }}
build:
# skip: true # [win and vc<14]
script: install_llvm.sh # [not win]
activate_in_script: true
# run_exports: # [not win]
# - {{ pin_subpackage("libllvm" + major_ver, max_pin="x.x") }} # [not win]
requirements:
build:
- "{{ compiler('cxx') }}"
- ninja # [not win]
- cmake <3.24 # [not win]
- python >=3 # [not win]
host:
# - libcxx >={{ cxx_compiler_version }} # [osx]
- zlib
# run:
# - libcxx >={{ cxx_compiler_version }} # [osx]
# test:
# commands:
# - test -f $PREFIX/lib/libLLVM-{{ major_ver }}${SHLIB_EXT} # [not win]
# # Contains the shared libraries. To make different LLVM libraries co-installable
# # soversion is appended to the package name.
# - package:
# name: libllvm{{ major_ver }}
# build:
# script: build.sh # [not win]
# activate_in_script: true
# # run_exports: # [not win]
# # - {{ pin_subpackage("libllvm" + major_ver, max_pin="x.x") }} # [not win]
# requirements:
# build:
# - "{{ compiler('cxx') }}"
# - ninja # [not win]
# - cmake <3.24 # [not win]
# - python >=3 # [not win]
# - sel(build_platform != target_platform): llvm-tools {{ version }}
# host:
# # - libcxx >={{ cxx_compiler_version }} # [osx]
# - zlib
# # run:
# # - libcxx >={{ cxx_compiler_version }} # [osx]
# # test:
# # commands:
# # - test -f $PREFIX/lib/libLLVM-{{ major_ver }}${SHLIB_EXT} # [not win]

# This is a meta package so that people can use the latest libllvm and also
# for run_exports
- package:
name: llvm
# build:
# skip: true # [(win and vc<14)]
# run_exports: # [not win]
# - '{{ pin_subpackage("libllvm" + major_ver, max_pin="x.x") }}' # [not win]
requirements:
host:
- '{{ pin_subpackage("libllvm" + major_ver, exact=True) }}' # [not win]
- zlib
run: # [not win]
- '{{ pin_subpackage("libllvm" + major_ver, exact=True) }}' # [not win]
run_constrained: # [not win]
- llvmdev {{ version }} # [not win]
# test:
# commands:
# - echo "Hello World!"
# # This is a meta package so that people can use the latest libllvm and also
# # for run_exports
# - package:
# name: llvm
# # build:
# # skip: true # [(win and vc<14)]
# # run_exports: # [not win]
# # - '{{ pin_subpackage("libllvm" + major_ver, max_pin="x.x") }}' # [not win]
# requirements:
# host:
# - '{{ pin_subpackage("libllvm" + major_ver, exact=True) }}' # [not win]
# - zlib
# run: # [not win]
# - '{{ pin_subpackage("libllvm" + major_ver, exact=True) }}' # [not win]
# run_constrained: # [not win]
# - llvmdev {{ version }} # [not win]
# # test:
# # commands:
# # - echo "Hello World!"

# # Contains LLVM tools
- package:
name: llvm-tools
# script: install_llvm.bat # [win]
build:
script: install_llvm.sh
activate_in_script: true
requirements:
build:
- "{{ compiler('cxx') }}"
- cmake <3.24
- ninja
- python >=3
host:
- '{{ pin_subpackage("libllvm" + major_ver, exact=True) }}'
- libxml2 # [win]
- zlib
run:
- '{{ pin_subpackage("libllvm" + major_ver, exact=True) }}'
run_constrained:
- llvmdev {{ version }}
# # # Contains LLVM tools
# - package:
# name: llvm-tools
# # script: build.bat # [win]
# build:
# script: build.sh
# activate_in_script: true
# requirements:
# build:
# - "{{ compiler('cxx') }}"
# - cmake <3.24
# - ninja
# - python >=3
# host:
# - '{{ pin_subpackage("libllvm" + major_ver, exact=True) }}'
# - libxml2 # [win]
# - zlib
# run:
# - '{{ pin_subpackage("libllvm" + major_ver, exact=True) }}'
# run_constrained:
# - llvmdev {{ version }}
# test:
# commands:
# - $PREFIX/bin/llc -version # [not win]
Expand Down