I found several configuration problems in all llvm ports: 1) In port's Makefile, the block marked as ' # keep in sync with /usr/src/lib/clang/clang.build.mk' is significantly out of sync with clang.build.mk :) 2) For ARM, llvm's cmake/config.guess doesn't return proper ABI. 3) CONFIGURE_TARGET is not a passed to real llvm cmake at all. (Look to default triple for llvm – it doesn’t contain 'portbld') All these issues causes that default llvm configuration is invalid (for ARM). Fix for 1) is trivial. Fix for 2) is also easy, but question is why we must explicitly specify ABI for armv6-portbld-freebsd12.0 target. Dimitry, please, can you comment this? One can expect that pure triple 'armv6-portbld-freebsd12.0' is enough for selecting right system's ABI (but I'm not sure). Point 3) is more interesting. Seems that 'CMAKE_ARGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=${CONFIGURE_TARGET}' fixes default triple for normal (driver based) compilation. But it looks like JIT compilers (an API based) doesn't uses it at all (is this bug or feature?) and 'CMAKE_ARGS+= -DLLVM_HOST_TRIPLE=${CONFIGURE_TARGET}' is also necessary. At this point I'm simply not sure if this is expected behavior – if yes, then fix is easy, but it depends on resolution of point 2). Can you, please, help me with proper resolution of remaining questionable points? Thanks, Michal
A commit references this bug: Author: brooks Date: Tue Sep 19 23:44:36 UTC 2017 New revision: 450176 URL: https://svnweb.freebsd.org/changeset/ports/450176 Log: Disable LLDB builds on 10.x as they don't link. Attempt to correct default targets. [0] Fix more references to clang-format50 and use a more future proof patching approach. [1] Build and install pp-trace with the EXTRAS target. PR: 219779 [0], 220995 [1], 222380 [2] Changes: head/devel/llvm50/Makefile head/devel/llvm50/files/clang-patch-tools_clang_tools_clang-format_clang-format-sublime.py head/devel/llvm50/files/clang-patch-tools_clang_tools_clang-format_clang-format.py head/devel/llvm50/files/clang-patch-tools_clang_tools_clang-format_git-clang-format head/devel/llvm50/pkg-plist
Created attachment 187046 [details] llvm40 patch - add support for ARMv7 - according to r450176 pass CONFIGURE_TARGET as LLVM_DEFAULT_TARGET_TRIPLE and LLVM_HOST_TRIPLE - for ARMv[67], use correct API when building CONFIGURE_TARGET
Created attachment 187075 [details] Updated patch I accidentally posted older(pre-armv7) version of patch, sorry for this.
I tested mmel's updated patch successfully, can we apply it?
I've got a build in progress and will commit shortly.
A commit references this bug: Author: brooks Date: Wed Oct 11 17:15:30 UTC 2017 New revision: 451764 URL: https://svnweb.freebsd.org/changeset/ports/451764 Log: - add support for ARMv7 - according to r450176 pass CONFIGURE_TARGET as LLVM_DEFAULT_TARGET_TRIPLE and LLVM_HOST_TRIPLE - for ARMv[67], use correct API when building CONFIGURE_TARGET PR: 219779 Submitted by: mmel Changes: head/devel/llvm40/Makefile
Can you also apply similar patch to devel/llvm50 which suffers from the same issues (no support for armv7 and wrong ABI)?
Created attachment 187108 [details] llvm 5 arm patch Similar llvm 5.0 patch
A commit references this bug: Author: brooks Date: Thu Oct 12 18:16:51 UTC 2017 New revision: 451923 URL: https://svnweb.freebsd.org/changeset/ports/451923 Log: - add support for ARMv7 - for ARMv[67], use correct API when building CONFIGURE_TARGET PR: 219779 Submitted by: Sylvain Garrigues <sylvain@sylvaingarrigues.com> Changes: head/devel/llvm50/Makefile
Thanks for commits.