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

Update llvm to 19.1.1 #1366

Merged
merged 2 commits into from
Oct 7, 2024
Merged

Conversation

anutosh491
Copy link
Collaborator

No description provided.

@anutosh491
Copy link
Collaborator Author

This PR adds tests to the recipe too. I am trying to make sure it has some overlap with what @argentite needed for his build script (to use clang-repl in the browser). His build script looked like this

cmake_minimum_required(VERSION 3.20.0)
project(ClangWASMREPL)

find_package(LLVM REQUIRED CONFIG)
find_package(Clang REQUIRED CONFIG)
find_package(LLD REQUIRED CONFIG)

message(STATUS "Using ClangConfig.cmake in: ${Clang_DIR}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")

set (CMAKE_CXX_STANDARD 17)
add_compile_options(-Wall -pedantic -fPIC)

include_directories(include)

include_directories(${LLVM_INCLUDE_DIRS})
include_directories(${CLANG_INCLUDE_DIRS})
include_directories(${LLD_INCLUDE_DIRS})
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
add_definitions(${LLVM_DEFINITIONS_LIST})

add_executable(Compiler CompilerModule.cpp)

llvm_map_components_to_libnames(llvm_libs Core MC Support TargetParser WebAssembly)

# Link against LLVM libraries
target_link_libraries(Compiler embind)
target_link_libraries(Compiler lldWasm)
target_link_libraries(Compiler clangInterpreter)

target_link_options(Compiler PRIVATE
    -O1
    -sMODULARIZE
    -sEXPORT_ES6=1
    -sASSERTIONS
    -sALLOW_MEMORY_GROWTH=1
    -sINITIAL_MEMORY=128MB
    -sTOTAL_STACK=32MB
    -sMAIN_MODULE=1
    -sUSE_SDL=2
    -sEXPORTED_RUNTIME_METHODS=ccall,cwrap,stringToNewUTF8,getValue,setValue
    -sEXPORTED_FUNCTIONS=_malloc,_free,__ZTIN10emscripten3valE
    --preload-file ${EMSCRIPTEN_SYSROOT}/@/
    #--preload-file /media/hdstorage/builds/llvm-wasm-ems/lib/clang/19/include@/lib/clang/19/include
    #--preload-file /opt/emscripten-llvm/lib@/lib
)

@anutosh491
Copy link
Collaborator Author

@DerThorsten this should be ready.

@DerThorsten DerThorsten merged commit ff555ad into emscripten-forge:main Oct 7, 2024
1 check passed
@anutosh491 anutosh491 deleted the add_llvm_tests branch October 20, 2024 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants