On Thu, Mar 08, 2018 at 02:02:45AM +1100, Jonathan Gray wrote:
> In trying to build rust on a system with a llvm package built with
> LLVM_ENABLE_FFI that includes a shared libLLVM linked against libffi
> 
> https://marc.info/?l=3Dopenbsd-ports&m=3D151870701912987&w=3D2

LLVM_ENABLE_FFI was previously False not True.  As I see no need to
enable it I'll likely commit this after verifying llvm and rust build.

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/llvm/Makefile,v
retrieving revision 1.172
diff -u -p -r1.172 Makefile
--- Makefile    2 Feb 2018 13:33:11 -0000       1.172
+++ Makefile    8 Mar 2018 14:07:09 -0000
@@ -18,7 +18,7 @@ DISTNAME =    llvm-${LLVM_V}.src
 PKGNAME =      llvm-${LLVM_V}
 PKGNAME-main = llvm-${LLVM_V}
 PKGNAME-python =       py-llvm-${LLVM_V}
-REVISION-main =        1
+REVISION-main =        2
 CATEGORIES =   devel
 DISTFILES =    llvm-${LLVM_V}.src${EXTRACT_SUFX} \
                cfe-${LLVM_V}.src${EXTRACT_SUFX} \
@@ -57,8 +57,10 @@ LIB_DEPENDS-python = ${BUILD_PKGPATH},-m
 SEPARATE_BUILD =       Yes
 CONFIGURE_ARGS =       -DLLVM_ENABLE_FFI:Bool=False \
                        -DLLVM_ENABLE_TERMINFO:Bool=False \
-                       -DLLVM_REQUIRES_RTTI:Bool=True \
+                       -DLLVM_ENABLE_RTTI:Bool=True \
                        -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2:Bool=True \
+                       -DLLVM_LINK_LLVM_DYLIB:Bool=True \
+                       -DLLVM_BUILD_LLVM_DYLIB:Bool=True \
                        -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND \
                        -DBacktrace_LIBRARY=''
 
Index: patches/patch-tools_llvm-shlib_CMakeLists_txt
===================================================================
RCS file: patches/patch-tools_llvm-shlib_CMakeLists_txt
diff -N patches/patch-tools_llvm-shlib_CMakeLists_txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-tools_llvm-shlib_CMakeLists_txt       8 Mar 2018 14:07:09 
-0000
@@ -0,0 +1,26 @@
+$OpenBSD$
+
+fix symbols not getting added to shared library
+
+Index: tools/llvm-shlib/CMakeLists.txt
+--- tools/llvm-shlib/CMakeLists.txt.orig
++++ tools/llvm-shlib/CMakeLists.txt
+@@ -37,15 +37,15 @@ endif()
+ add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES})
+ 
+ list(REMOVE_DUPLICATES LIB_NAMES)
+-if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU) OR 
("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") OR ("${CMAKE_SYSTEM_NAME}" STREQUAL 
"DragonFly")) # FIXME: It should be "GNU ld for elf"
++if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
++  set(LIB_NAMES -Wl,-all_load ${LIB_NAMES})
++else()
+   configure_file(
+   ${CMAKE_CURRENT_SOURCE_DIR}/simple_version_script.map.in
+   ${LLVM_LIBRARY_DIR}/tools/llvm-shlib/simple_version_script.map)
+ 
+   # GNU ld doesn't resolve symbols in the version script.
+   set(LIB_NAMES 
-Wl,--version-script,${LLVM_LIBRARY_DIR}/tools/llvm-shlib/simple_version_script.map
 -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
+-elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
+-  set(LIB_NAMES -Wl,-all_load ${LIB_NAMES})
+ endif()
+ 
+ target_link_libraries(LLVM PRIVATE ${LIB_NAMES})
Index: pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/devel/llvm/pkg/PLIST-main,v
retrieving revision 1.5
diff -u -p -r1.5 PLIST-main
--- pkg/PLIST-main      8 Sep 2017 05:58:19 -0000       1.5
+++ pkg/PLIST-main      8 Mar 2018 14:07:10 -0000
@@ -1939,6 +1939,9 @@ lib/cmake/llvm/LLVMInstallSymlink.cmake
 lib/cmake/llvm/LLVMProcessSources.cmake
 lib/cmake/llvm/TableGen.cmake
 lib/cmake/llvm/VersionFromVCS.cmake
+lib/libLLVM-${LLVM_V}.so
+lib/libLLVM-5.0.so
+lib/libLLVM.so
 lib/libLLVMAArch64AsmParser.a
 lib/libLLVMAArch64AsmPrinter.a
 lib/libLLVMAArch64CodeGen.a

Reply via email to