-
Notifications
You must be signed in to change notification settings - Fork 24
Some minor issues and optimizations #17
base: master
Are you sure you want to change the base?
Conversation
Make supports recursive parallel build when using the ${MAKE} variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The libcxx-musl patch and -DCMAKE_BUILD_TYPE=RelWithDebInfo changes looks good.
CMAKE_MAKE_PROGRAM:="$(MAKE)" | ||
endif | ||
|
||
CLANG_VERSION_STRING=$(shell "${ROOT_DIR}/dist/bin/clang" --version | perl -ne '/clang version ([\d.]*)/ && print "$$1";') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think make will fail when dist/bin/clang is not (initially) exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it. It works...
When using VAR= syntax for assignment, make will evaluate it whenever it is used. If I were using VAR:=, then you would be right.
CLANG_VERSION_STRING=$(shell "${ROOT_DIR}/dist/bin/clang" --version | perl -ne '/clang version ([\d.]*)/ && print "$$1";') | ||
|
||
|
||
ifeq ($(shell test "${LLVM_VERSION}" -gt 7; echo $$?),0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to not support any versions below 8. The only reasonable LLVM version with all features needed for users is release of 8. Earlier versions might have incompatible object format or bugs (e.g. related to debug info)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Just leave it away.
-DLLVM_DEFAULT_TARGET_TRIPLE=$(WASM_TRIPLE) \ | ||
$(DEFAULT_SYSROOT_CFG) \ | ||
-DLLVM_EXTERNAL_CLANG_SOURCE_DIR=$(ROOT_DIR)/src/llvm-project/clang \ | ||
-DLLVM_EXTERNAL_LLD_SOURCE_DIR=$(ROOT_DIR)/src/llvm-project/lld \ | ||
-DLLVM_ENABLE_PROJECTS="lld;clang" \ | ||
$(ROOT_DIR)/src/llvm-project/llvm | ||
cd build/llvm; $(MAKE) -j 8 \ | ||
+cd build/llvm; "${CMAKE_MAKE_PROGRAM}" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFIAK the "-j" is 1 by default, the change will regress non-ninja build speed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you will have to put an appropriate -j on the command line when you invoke the top level make. This will allow the user to select the parallelism appropriate for his machine (which would be 16 for me) the + before the line ensures, that the parallelism is passed to sub make appropriately. Therefore leaving in the -j 8 will slow down the build on machines with more than 8 cores.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! Just found, that we need to add a
.NOTPARALLEL:
to the makefile, to actually make it work well, because make would also try to run the 'git clone' in parallel.
CMAKE_MAKE_PROGRAM:="${NINJA}" | ||
else | ||
CMAKE_GENERATOR:=Unix Makefiles | ||
CMAKE_MAKE_PROGRAM:="$(MAKE)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: not sure the CMAKE_MAKE_PROGRAM
is a good name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any suggestions?
No description provided.