Date: Sun, 30 Jun 2019 14:56:12 +0000 (UTC) From: Niclas Zeising <zeising@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r505425 - in head: Mk devel/libclc devel/libclc/files graphics/libosmesa graphics/mesa-dri graphics/mesa-dri/files graphics/mesa-libs lang/beignet lang/beignet/files lang/clover Message-ID: <201906301456.x5UEuCdg037342@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: zeising Date: Sun Jun 30 14:56:12 2019 New Revision: 505425 URL: https://svnweb.freebsd.org/changeset/ports/505425 Log: Switch mesa and related ports to llvm80 Switch mesa over to use llvm80 instead of llvm60. Make it use the global LLVM_DEFAULT instead of deciding for ourself which llvm version to use. [1] Fix build of lang/beginet [1] Add patch from upstream to fix build of devel/libclc. The patch is taken from the git mirror of devel/libclc rather than the SVN repo, for convenience. Add a patch from mesa upstream preventing certain error messages when using amdgpu [2] Add a notice to bsd.default-versions.mk asking that the graphics team be informed before the llvm version is changed. Enable llvm and gallium on MIPS. As far as I can tell, this used to be the default before this change. Bump portrevisions since dependencies changed. PR: 230789 [1], [2] Submitted by: jbeich [1], tobik [2] Obtained from: FreeBSD Graphics Team development repo https://github.com/FreeBSDDesktop/freebsd-ports/commits/feature/mesa-llvm80 Sponsored by: B3 Init (zeising) Added: head/devel/libclc/files/patch-62a9191.c (contents, props changed) head/graphics/mesa-dri/files/patch-9cab8cc.c (contents, props changed) head/lang/beignet/files/patch-llvm8 (contents, props changed) Modified: head/Mk/bsd.default-versions.mk head/devel/libclc/Makefile head/graphics/libosmesa/Makefile head/graphics/mesa-dri/Makefile head/graphics/mesa-dri/Makefile.common head/graphics/mesa-libs/Makefile head/lang/beignet/Makefile head/lang/clover/Makefile Modified: head/Mk/bsd.default-versions.mk ============================================================================== --- head/Mk/bsd.default-versions.mk Sun Jun 30 14:44:14 2019 (r505424) +++ head/Mk/bsd.default-versions.mk Sun Jun 30 14:56:12 2019 (r505425) @@ -59,6 +59,8 @@ LINUX_DEFAULT?= c6_64 LINUX_DEFAULT?= c6 .endif # Possible values: 60, 70, 80, -devel (to be used when non-base compiler is required) +# Please give notice to the Graphics Team (x11@FreeBSD.org) in advance before +# bumping the LLVM version. LLVM_DEFAULT?= 80 # Possible values: 5.1, 5.2, 5.3 LUA_DEFAULT?= 5.2 Modified: head/devel/libclc/Makefile ============================================================================== --- head/devel/libclc/Makefile Sun Jun 30 14:44:14 2019 (r505424) +++ head/devel/libclc/Makefile Sun Jun 30 14:56:12 2019 (r505425) @@ -3,7 +3,7 @@ PORTNAME= libclc DISTVERSION= 0.3.0.20180518 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= devel MAINTAINER= x11@FreeBSD.org @@ -13,7 +13,7 @@ LICENSE= BSD3CLAUSE MIT LICENSE_COMB= dual LICENSE_FILE= ${WRKSRC}/LICENSE.TXT -BUILD_DEPENDS= llvm${LLVMVER}>=4.0:devel/llvm${LLVMVER} \ +BUILD_DEPENDS= llvm${LLVM_DEFAULT}>=4.0:devel/llvm${LLVM_DEFAULT} \ libedit>=0:devel/libedit USE_GITHUB= yes @@ -24,9 +24,6 @@ GH_TAGNAME= a2118d5 USES= gmake python:2.7,build gmake USE_LDCONFIG= yes MAKE_ENV= MAKE=${GMAKE} DESTDIR=${STAGEDIR} - -LLVMVER= ${MESA_LLVM_VER:U60} - ALL_TARGET= post-patch: @@ -37,7 +34,7 @@ post-patch: do-configure: @cd ${WRKSRC} && ${PYTHON_CMD} configure.py ${CONFIGURE_ARGS} -g make \ - --with-llvm-config=${LOCALBASE}/bin/llvm-config${LLVMVER} \ + --with-llvm-config=${LOCALBASE}/bin/llvm-config${LLVM_DEFAULT} \ --pkgconfigdir=${PREFIX}/libdata/pkgconfig \ --prefix=${PREFIX} Added: head/devel/libclc/files/patch-62a9191.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/libclc/files/patch-62a9191.c Sun Jun 30 14:56:12 2019 (r505425) @@ -0,0 +1,73 @@ +From 62a9191b606abdab8e2607d945628fa90d9664c1 Mon Sep 17 00:00:00 2001 +From: Jan Vesely <jan.vesely@rutgers.edu> +Date: Fri, 3 Aug 2018 15:14:08 +0000 +Subject: [PATCH] amdgcn: Use __constant AS for amdgcn builtins. + +Fixes build after clang r338707. +Reviewer: Matthew.Arsenault@amd.com +Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> + +git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@338898 91177308-0d34-0410-b5e6-96231b3b80d8 +--- + amdgcn-amdhsa/lib/workitem/get_global_size.cl | 4 +++- + amdgcn-amdhsa/lib/workitem/get_local_size.cl | 4 +++- + amdgcn/lib/workitem/get_global_offset.cl | 4 +++- + amdgcn/lib/workitem/get_work_dim.cl | 4 +++- + 4 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/amdgcn-amdhsa/lib/workitem/get_global_size.cl b/amdgcn-amdhsa/lib/workitem/get_global_size.cl +index 2289615..392cd08 100644 +--- amdgcn-amdhsa/lib/workitem/get_global_size.cl ++++ amdgcn-amdhsa/lib/workitem/get_global_size.cl +@@ -1,6 +1,8 @@ + #include <clc/clc.h> + +-#if __clang_major__ >= 7 ++#if __clang_major__ >= 8 ++#define CONST_AS __constant ++#elif __clang_major__ >= 7 + #define CONST_AS __attribute__((address_space(4))) + #else + #define CONST_AS __attribute__((address_space(2))) +diff --git a/amdgcn-amdhsa/lib/workitem/get_local_size.cl b/amdgcn-amdhsa/lib/workitem/get_local_size.cl +index 034c6d9..64d1cf4 100644 +--- amdgcn-amdhsa/lib/workitem/get_local_size.cl ++++ amdgcn-amdhsa/lib/workitem/get_local_size.cl +@@ -1,6 +1,8 @@ + #include <clc/clc.h> + +-#if __clang_major__ >= 7 ++#if __clang_major__ >= 8 ++#define CONST_AS __constant ++#elif __clang_major__ >= 7 + #define CONST_AS __attribute__((address_space(4))) + #else + #define CONST_AS __attribute__((address_space(2))) +diff --git a/amdgcn/lib/workitem/get_global_offset.cl b/amdgcn/lib/workitem/get_global_offset.cl +index 0c2b948..0a87cd2 100644 +--- amdgcn/lib/workitem/get_global_offset.cl ++++ amdgcn/lib/workitem/get_global_offset.cl +@@ -1,6 +1,8 @@ + #include <clc/clc.h> + +-#if __clang_major__ >= 7 ++#if __clang_major__ >= 8 ++#define CONST_AS __constant ++#elif __clang_major__ >= 7 + #define CONST_AS __attribute__((address_space(4))) + #else + #define CONST_AS __attribute__((address_space(2))) +diff --git a/amdgcn/lib/workitem/get_work_dim.cl b/amdgcn/lib/workitem/get_work_dim.cl +index 8eb81ba..3add9b6 100644 +--- amdgcn/lib/workitem/get_work_dim.cl ++++ amdgcn/lib/workitem/get_work_dim.cl +@@ -1,6 +1,8 @@ + #include <clc/clc.h> + +-#if __clang_major__ >= 7 ++#if __clang_major__ >= 8 ++#define CONST_AS __constant ++#elif __clang_major__ >= 7 + #define CONST_AS __attribute__((address_space(4))) + #else + #define CONST_AS __attribute__((address_space(2))) Modified: head/graphics/libosmesa/Makefile ============================================================================== --- head/graphics/libosmesa/Makefile Sun Jun 30 14:44:14 2019 (r505424) +++ head/graphics/libosmesa/Makefile Sun Jun 30 14:56:12 2019 (r505425) @@ -3,7 +3,7 @@ PORTNAME= libosmesa PORTVERSION= ${MESAVERSION} -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= graphics COMMENT= Off-Screen Mesa implementation of the OpenGL API @@ -18,7 +18,7 @@ CONFIGURE_ARGS+= --disable-dri --disable-egl --disable MESA_BUILD_WRKSRC= src/util src/compiler src/mapi src/mesa LDFLAGS_i386= -Wl,-znotext -.if "${MESA_LLVM_VER}" != "" +.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marm*} || ${ARCH} == i386 || ${ARCH:Mmips*} || ${ARCH:Mpowerpc*} CONFIGURE_ARGS+= --enable-osmesa-gallium MESA_BUILD_WRKSRC+= src/gallium MESA_INSTALL_WRKSRC= src/gallium/state_trackers/osmesa src/gallium/targets/osmesa Modified: head/graphics/mesa-dri/Makefile ============================================================================== --- head/graphics/mesa-dri/Makefile Sun Jun 30 14:44:14 2019 (r505424) +++ head/graphics/mesa-dri/Makefile Sun Jun 30 14:56:12 2019 (r505425) @@ -3,7 +3,7 @@ PORTNAME= mesa-dri PORTVERSION= ${MESAVERSION} -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= graphics COMMENT= OpenGL hardware acceleration drivers for DRI2+ @@ -33,7 +33,7 @@ ALL_GALLIUM_DRIVERS= FREEDRENO R300 R600 RADEONSI SVGA ALL_VULKAN_DRIVERS= INTEL RADEON DRI_DRIVERS= SWRAST # classic swrast -.if "${MESA_LLVM_VER}" != "" +.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marm*} || ${ARCH} == i386 || ${ARCH:Mmips*} || ${ARCH:Mpowerpc*} GALLIUM_DRIVERS= SWRAST # llvmpipe .else GALLIUM_DRIVERS= "" @@ -43,15 +43,8 @@ VULKAN_DRIVERS= # .if ${ARCH} == amd64 || ${ARCH} == i386 \ || ${ARCH} == powerpc || ${ARCH} == powerpc64 DRI_DRIVERS+= RADEON R200 -GALLIUM_DRIVERS+= R600 -. if "${MESA_LLVM_VER}" != "" && (${ARCH} == amd64 || ${ARCH} == i386) -# https://cgit.freedesktop.org/mesa/mesa/commit/?id=58952675f6d4 -GALLIUM_DRIVERS+= R300 -. endif -. if "${MESA_LLVM_VER}" != "" # until PPC gets LLVM in base -GALLIUM_DRIVERS+= RADEONSI +GALLIUM_DRIVERS+= R300 R600 RADEONSI VULKAN_DRIVERS+= RADEON -. endif .endif .if ${ARCH} == amd64 || ${ARCH} == i386 DRI_DRIVERS+= I915 I965 Modified: head/graphics/mesa-dri/Makefile.common ============================================================================== --- head/graphics/mesa-dri/Makefile.common Sun Jun 30 14:44:14 2019 (r505424) +++ head/graphics/mesa-dri/Makefile.common Sun Jun 30 14:56:12 2019 (r505425) @@ -74,19 +74,13 @@ INSTALL_TARGET= install-strip .include <bsd.port.pre.mk> -# need LLVM for libEGL wherever possible, but mixing GCC and LLVM breaks Gallium -.if ${CHOSEN_COMPILER_TYPE} == clang \ - || (${COMPONENT} == libs && ${ARCH} != sparc64) # no working LLVM -MESA_LLVM_VER?= 60 -.endif - -.if "${MESA_LLVM_VER}" != "" -BUILD_DEPENDS+= llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER} +.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marm*} || ${ARCH} == i386 || ${ARCH:Mmips*} || ${ARCH:Mpowerpc*} +BUILD_DEPENDS+= llvm${LLVM_DEFAULT}>=3.9.0_4:devel/llvm${LLVM_DEFAULT} .if ${COMPONENT} != libs -RUN_DEPENDS+= llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER} +RUN_DEPENDS+= llvm${LLVM_DEFAULT}>=3.9.0_4:devel/llvm${LLVM_DEFAULT} .endif -CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER} -LDFLAGS+= -Wl,-rpath=${LOCALBASE}/llvm${MESA_LLVM_VER}/lib +CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${LLVM_DEFAULT} +LDFLAGS+= -Wl,-rpath=${LOCALBASE}/llvm${LLVM_DEFAULT}/lib CONFIGURE_ARGS+= --enable-llvm .else CONFIGURE_ARGS+= --disable-llvm Added: head/graphics/mesa-dri/files/patch-9cab8cc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/graphics/mesa-dri/files/patch-9cab8cc.c Sun Jun 30 14:56:12 2019 (r505425) @@ -0,0 +1,17 @@ +amd: Make vgpr-spilling depend on llvm version + +https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230789#c14 +diff --git a/src/amd/common/ac_llvm_util.c b/src/amd/common/ac_llvm_util.c +index 69d9f7b9f3fe9e5feb07b32c35cbcf1206a14ca8..dc9b684e9dd287d5bb558d9ad3868a9d0975228d 100644 +--- src/amd/common/ac_llvm_util.c ++++ src/amd/common/ac_llvm_util.c +@@ -153,7 +153,8 @@ static LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family, + LLVMTargetRef target = ac_get_llvm_target(triple); + + snprintf(features, sizeof(features), +- "+DumpCode,+vgpr-spilling,-fp32-denormals,+fp64-denormals%s%s%s%s", ++ "+DumpCode,-fp32-denormals,+fp64-denormals%s%s%s%s%s", ++ HAVE_LLVM >= 0x0800 ? "" : ",+vgpr-spilling", + tm_options & AC_TM_SISCHED ? ",+si-scheduler" : "", + tm_options & AC_TM_FORCE_ENABLE_XNACK ? ",+xnack" : "", + tm_options & AC_TM_FORCE_DISABLE_XNACK ? ",-xnack" : "", Modified: head/graphics/mesa-libs/Makefile ============================================================================== --- head/graphics/mesa-libs/Makefile Sun Jun 30 14:44:14 2019 (r505424) +++ head/graphics/mesa-libs/Makefile Sun Jun 30 14:56:12 2019 (r505425) @@ -3,6 +3,7 @@ PORTNAME= mesa-libs PORTVERSION= ${MESAVERSION} +PORTREVISION= 1 CATEGORIES= graphics COMMENT= OpenGL libraries that support GLX and EGL clients Modified: head/lang/beignet/Makefile ============================================================================== --- head/lang/beignet/Makefile Sun Jun 30 14:44:14 2019 (r505424) +++ head/lang/beignet/Makefile Sun Jun 30 14:56:12 2019 (r505425) @@ -4,7 +4,7 @@ PORTNAME= beignet DISTVERSION= 1.3.2 DISTVERSIONSUFFIX= -source -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= lang MASTER_SITES= https://01.org/sites/default/files/ @@ -14,12 +14,12 @@ COMMENT= OpenCL library for Intel GPUs LICENSE= LGPL21+ LICENSE_FILE= ${WRKSRC}/COPYING -BUILD_DEPENDS= clang${LLVMVER}:devel/llvm${LLVMVER} \ +BUILD_DEPENDS= clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT} \ opencl>=0:devel/opencl LIB_DEPENDS= libOpenCL.so:devel/ocl-icd \ libdrm.so:graphics/libdrm RUN_DEPENDS= opencl>=0:devel/opencl \ - clang${LLVMVER}:devel/llvm${LLVMVER} + clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT} WRKSRC= ${WRKDIR}/Beignet-${DISTVERSION}-Source @@ -29,12 +29,11 @@ USE_GL= gl egl USE_LDCONFIG= ${LOCALBASE}/lib/${PORTNAME} SHEBANG_FILES= src/git_sha1.sh backend/kernels/compile.sh ALL_TARGET= all -LLVMVER= ${MESA_LLVM_VER:U60} -CMAKE_ARGS= -DCLANG_EXECUTABLE:FILEPATH=${LOCALBASE}/bin/clang${LLVMVER} \ - -DLLVM_AS_EXECUTABLE:FILEPATH=${LOCALBASE}/bin/llvm-as${LLVMVER} \ - -DLLVM_CONFIG_EXECUTABLE:FILEPATH=${LOCALBASE}/bin/llvm-config${LLVMVER} \ - -DLLVM_LINK_EXECUTABLE:FILEPATH=${LOCALBASE}/bin/llvm-link${LLVMVER} +CMAKE_ARGS= -DCLANG_EXECUTABLE:FILEPATH=${LOCALBASE}/bin/clang${LLVM_DEFAULT} \ + -DLLVM_AS_EXECUTABLE:FILEPATH=${LOCALBASE}/bin/llvm-as${LLVM_DEFAULT} \ + -DLLVM_CONFIG_EXECUTABLE:FILEPATH=${LOCALBASE}/bin/llvm-config${LLVM_DEFAULT} \ + -DLLVM_LINK_EXECUTABLE:FILEPATH=${LOCALBASE}/bin/llvm-link${LLVM_DEFAULT} ONLY_FOR_ARCHS= i386 amd64 ONLY_FOR_ARCHS_REASON= Beignet needs a graphics driver supported by the Intel KMS driver @@ -53,8 +52,8 @@ OCL20_CMAKE_BOOL= ENABLE_OPENCL_20 TEST_ALL_TARGET= flat_address_space utest_run post-patch: - @${REINPLACE_CMD} -e 's|llvm-dis|llvm-dis${LLVMVER}|g; \ - s|clang |clang${LLVMVER} |g' \ + @${REINPLACE_CMD} -e 's|llvm-dis|llvm-dis${LLVM_DEFAULT}|g; \ + s|clang |clang${LLVM_DEFAULT} |g' \ ${WRKSRC}/backend/kernels/compile.sh # XXX bug 213732: compiler_device_enqueue() Interrupt signal (SIGSEGV) received. Added: head/lang/beignet/files/patch-llvm8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/beignet/files/patch-llvm8 Sun Jun 30 14:56:12 2019 (r505425) @@ -0,0 +1,51 @@ +Regressed by https://github.com/llvm/llvm-project/commit/721d95713a9e + +unable to load /usr/local/lib/beignet//libgbeinterp.so which is part of the driver, please check! +ld-elf.so.1: /usr/local/lib/beignet//libgbeinterp.so: Undefined symbol "_ZN4llvm24DisableABIBreakingChecksE" + +Regressed by https://github.com/llvm/llvm-project/commit/4a2d58e16acc + +backend/src/llvm/llvm_gen_backend.cpp:3076:5: error: + unknown type name 'TerminatorInst' + TerminatorInst *term = bb->getTerminator(); + ^ +backend/src/llvm/llvm_gen_backend.cpp:3083:5: error: + unknown type name 'TerminatorInst' + TerminatorInst *term = bb->getTerminator(); + ^ + +--- backend/src/CMakeLists.txt.orig 2017-09-22 08:05:22 UTC ++++ backend/src/CMakeLists.txt +@@ -168,6 +168,7 @@ add_dependencies(gbe beignet_bitcode) + endif (NOT (USE_STANDALONE_GBE_COMPILER STREQUAL "true")) + + add_library(gbeinterp SHARED gbe_bin_interpreter.cpp) ++target_link_libraries(gbeinterp ${LLVM_MODULE_LIBS}) + + if (LLVM_VERSION_NODOT VERSION_EQUAL 34) + find_library(TERMINFO NAMES tinfo ncurses) +--- backend/src/llvm/llvm_gen_backend.cpp.orig 2017-10-24 06:04:48 UTC ++++ backend/src/llvm/llvm_gen_backend.cpp +@@ -3073,14 +3073,22 @@ namespace gbe + + + static unsigned getChildNo(BasicBlock *bb) { ++#if LLVM_VERSION_MAJOR < 8 + TerminatorInst *term = bb->getTerminator(); ++#else ++ Instruction *term = bb->getTerminator(); ++#endif + return term->getNumSuccessors(); + } + + // return NULL if index out-range of children number + static BasicBlock *getChildPossible(BasicBlock *bb, unsigned index) { + ++#if LLVM_VERSION_MAJOR < 8 + TerminatorInst *term = bb->getTerminator(); ++#else ++ Instruction *term = bb->getTerminator(); ++#endif + unsigned childNo = term->getNumSuccessors(); + BasicBlock *child = NULL; + if(index < childNo) { Modified: head/lang/clover/Makefile ============================================================================== --- head/lang/clover/Makefile Sun Jun 30 14:44:14 2019 (r505424) +++ head/lang/clover/Makefile Sun Jun 30 14:56:12 2019 (r505425) @@ -2,7 +2,7 @@ PORTNAME= clover PORTVERSION= ${MESAVERSION} -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= lang COMMENT= Mesa "Clover" OpenCL library @@ -31,9 +31,9 @@ MESA_INSTALL_WRKSRC= src/gallium/targets/opencl src/ga .include "${MASTERDIR}/Makefile.targets" pre-configure: - @if [ -e ${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER} ] && \ - ! [ -e ${LOCALBASE}/bin/clang${MESA_LLVM_VER} ]; then \ - ${ECHO_MSG} "Your llvm${MESA_LLVM_VER} is not built with clang support, which is required."; \ + @if [ -e ${LOCALBASE}/bin/llvm-config${LLVM_DEFAULT} ] && \ + ! [ -e ${LOCALBASE}/bin/clang${LLVM_DEFAULT} ]; then \ + ${ECHO_MSG} "Your llvm${LLVM_DEFAULT} is not built with clang support, which is required."; \ ${FALSE}; \ fi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906301456.x5UEuCdg037342>