Created attachment 920618 [details] build.log None of the current dev-lang/swift packages (5.10.1-r# and 6.0.3) currently respect the "-j" flags, and maybe other flags too. Those flags are set in COMMON_FLAGS in /etc/portage/make.conf. On one one my computer, -j flag is set to -j4 instead of -j6, but -j6 is used and on another one, -j flag is set to -j8 instead of -j16, but -j16 is used. See this for e.g.: + env /usr/bin/cmake --build /var/tmp/portage/dev-lang/swift-6.0.3/work/build/buildbot_linux/cmark-linux-x86_64 --config Release -- -j6 all + env DISTCC_HOSTS=localhost,lzo,cpp env /usr/bin/cmake -G Ninja -DCMAKE_C_COMPILER:PATH=/usr/lib64/swift-5.10.1/usr/bin/clang -DCMAKE_CXX_COMPILER:PATH=/usr/lib64/swift-5.10.1/usr/bin/clang++ -DCMAKE_Swift_COMPILER:PATH=/usr/lib64/swift-5.10.1/usr/bin/swiftc -DCMAKE_LIBTOOL:PATH=/usr/bin/libtool -DCMAKE_AR:PATH=/usr/bin/ar -DCMAKE_RANLIB:PATH=/usr/bin/ranlib -DLLVM_VERSION_MAJOR:STRING=17 -DLLVM_VERSION_MINOR:STRING=0 -DLLVM_VERSION_PATCH:STRING=0 -DCLANG_VERSION_MAJOR:STRING=17 -DCLANG_VERSION_MINOR:STRING=0 -DCLANG_VERSION_PATCH:STRING=0 -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja -DLLVM_ENABLE_ASSERTIONS:BOOL=FALSE -DLLVM_TARGETS_TO_BUILD=host -DLLVM_TOOL_COMPILER_RT_BUILD:BOOL=TRUE -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=TRUE '-DLLVM_LIT_ARGS=-v --time-tests --param color_output -j 6' -DCOVERAGE_DB= '-DCROSS_TOOLCHAIN_FLAGS_LLVM_NATIVE=-DCMAKE_C_COMPILER=clang;-DCMAKE_CXX_COMPILER=clang++;-DCLANG_DEFAULT_LINKER=gold' -DCLANG_DEFAULT_LINKER=gold -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINTERNAL_INSTALL_PREFIX=local -DCMAKE_TOOLCHAIN_FILE:PATH=/var/tmp/portage/dev-lang/swift-6.0.3/work/build/buildbot_linux/llvm-linux-x86_64/BuildScriptToolchain.cmake '-DCMAKE_C_FLAGS=-Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector' '-DCMAKE_CXX_FLAGS=-Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector' '-DCMAKE_C_FLAGS_RELWITHDEBINFO=-O2 -DNDEBUG' '-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-O2 -DNDEBUG' -DCMAKE_BUILD_TYPE:STRING=Release -DLLVM_TOOL_SWIFT_BUILD:BOOL=FALSE -DLLVM_TOOL_LLD_BUILD:BOOL=TRUE -DLLVM_INCLUDE_DOCS:BOOL=TRUE -DLLVM_ENABLE_LTO:STRING= -DCOMPILER_RT_INTERCEPT_LIBDISPATCH=ON '-DLLVM_ENABLE_PROJECTS=clang;compiler-rt;clang-tools-extra;lld' -ULLVM_ENABLE_RUNTIMES -DLLVM_USE_LINKER:STRING=lld -DBUILD_TESTING:BOOL=NO -DSWIFT_INCLUDE_TESTS:BOOL=NO -DSWIFT_INCLUDE_TEST_BINARIES:BOOL=NO -DCOMPILER_RT_BUILD_ORC:BOOL=NO -DPython3_FIND_UNVERSIONED_NAMES:STRING=FIRST -USWIFT_DARWIN_SUPPORTED_ARCHS -DSWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE:PATH=/var/tmp/portage/dev-lang/swift-6.0.3/work/swift-syntax -DSWIFT_BUILD_SWIFT_SYNTAX:BOOL=TRUE /var/tmp/portage/dev-lang/swift-6.0.3/work/llvm-project/llvm I also attached the full build logs.
Created attachment 920619 [details] emerge --info emerge --info of this bug report. p.s.: In that case, the build is failing, see this bug report: https://bugs.gentoo.org/show_bug.cgi?id=951183
Yeah, Swift's build system overwrites all flags — I happen to have a fix in flight, just need to confirm things build on the LLVM profile.
> Yeah, Swift's build system overwrites all flags If it also overwrites -march, -mcpu and -mtune that might cause runtime issues on certain computers (for e.g. usage of unsupported CPU instruction sets).