Skip to content

Commit

Permalink
Allow 32b Windows versions of bin2llvmir and llvmir2hll handle larger…
Browse files Browse the repository at this point in the history
… addresses (#73).

By default, they are only allowed to address 2 GB of virtual memory. By using
/LARGEADDRESSAWARE, they may address up to 4 GB of virtual memory.

For more details, see
https://docs.microsoft.com/en-us/cpp/build/reference/largeaddressaware-handle-large-addresses
  • Loading branch information
s3rvac committed Dec 31, 2017
1 parent 81af385 commit 6003462
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bin2llvmirtool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,11 @@ else() # Linux
target_link_libraries(bin2llvmirtool -Wl,--whole-archive bin2llvmir -Wl,--no-whole-archive)
endif()

# Allow the 32b version of bin2llvmir on Windows handle addresses larger than 2
# GB (up to 4 GB).
if(MSVC AND CMAKE_SIZEOF_VOID_P MATCHES "4")
set_property(TARGET bin2llvmirtool APPEND_STRING PROPERTY LINK_FLAGS " /LARGEADDRESSAWARE")
endif()

set_target_properties(bin2llvmirtool PROPERTIES OUTPUT_NAME "bin2llvmir")
install(TARGETS bin2llvmirtool RUNTIME DESTINATION bin)
6 changes: 6 additions & 0 deletions src/llvmir2hlltool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,11 @@ if(MSVC)
set_property(TARGET llvmir2hlltool APPEND_STRING PROPERTY LINK_FLAGS " /STACK:16777216")
endif()

# Allow the 32b version of llvmir2hll on Windows handle addresses larger than 2
# GB (up to 4 GB).
if(MSVC AND CMAKE_SIZEOF_VOID_P MATCHES "4")
set_property(TARGET llvmir2hlltool APPEND_STRING PROPERTY LINK_FLAGS " /LARGEADDRESSAWARE")
endif()

set_target_properties(llvmir2hlltool PROPERTIES OUTPUT_NAME "llvmir2hll")
install(TARGETS llvmir2hlltool RUNTIME DESTINATION bin)

0 comments on commit 6003462

Please sign in to comment.