[PATCH] [cmake/multilib] Teach llgo to respect the LLVM_LIBDIR_SUFFIX variable formultilib build and installs.
Chandler Carruth
chandlerc at gmail.com
Mon Dec 29 06:05:07 PST 2014
With this, I get the go subdirectory under the suffixed library which matches
the system's go subdirectory. However, when I run check-llgo everything fails
due to the linker being unable to find libgobegin-llgo or libgo-llgo. It
doesn't seem to be searching the lib64 directory where the libraries are.
Also, there are a *lot* of hard-coded 'lib' references in the gllgo code which
I feel are probably in need of multilib support as well.
So, sending this patch mostly as a starting point for folks to figure out how
to make llgo happy in a multilib world.
http://reviews.llvm.org/D6795
Files:
CMakeLists.txt
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -110,7 +110,7 @@
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${suffix}/libgo
INSTALL_DIR ${CMAKE_BINARY_DIR}
- CONFIGURE_COMMAND <SOURCE_DIR>/configure --disable-multilib --without-libatomic --prefix=<INSTALL_DIR> "CC=env REAL_CC=${CMAKE_BINARY_DIR}/bin/clang at SPACE@${cflags} ${CMAKE_BINARY_DIR}/bin/cc-wrapper" "GOC=${CMAKE_BINARY_DIR}/bin/llgo -no-prefix -fcompilerrt-prefix=${CMAKE_BINARY_DIR} ${gocflags}"
+ CONFIGURE_COMMAND <SOURCE_DIR>/configure --disable-multilib --without-libatomic --prefix=<INSTALL_DIR> --libdir=<INSTALL_DIR>/lib${LLVM_LIBDIR_SUFFIX} "CC=env REAL_CC=${CMAKE_BINARY_DIR}/bin/clang at SPACE@${cflags} ${CMAKE_BINARY_DIR}/bin/cc-wrapper" "GOC=${CMAKE_BINARY_DIR}/bin/llgo -no-prefix -fcompilerrt-prefix=${CMAKE_BINARY_DIR} ${gocflags}"
BUILD_COMMAND make -j${PROCESSOR_COUNT}
LOG_CONFIGURE 1
LOG_BUILD 1
@@ -142,15 +142,17 @@
add_libgo_variant("_dfsan" "-fsanitize=dataflow" "-fsanitize=dataflow" dfsan TRUE)
endif()
-install(FILES ${CMAKE_BINARY_DIR}/lib/libgo-llgo.a
- ${CMAKE_BINARY_DIR}/lib/libgo-llgo.so
- ${CMAKE_BINARY_DIR}/lib/libgo-llgo.so.6
- ${CMAKE_BINARY_DIR}/lib/libgo-llgo.so.6.0.0
- ${CMAKE_BINARY_DIR}/lib/libgobegin-llgo.a
- DESTINATION lib)
+set(LLGO_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})
-install(DIRECTORY ${CMAKE_BINARY_DIR}/lib/go
- DESTINATION lib)
+install(FILES ${LLGO_LIBRARY_DIR}/libgo-llgo.a
+ ${LLGO_LIBRARY_DIR}/libgo-llgo.so
+ ${LLGO_LIBRARY_DIR}/libgo-llgo.so.6
+ ${LLGO_LIBRARY_DIR}/libgo-llgo.so.6.0.0
+ ${LLGO_LIBRARY_DIR}/libgobegin-llgo.a
+ DESTINATION lib${LLVM_LIBDIR_SUFFIX})
+
+install(DIRECTORY ${LLGO_LIBRARY_DIR}/go
+ DESTINATION lib${LLVM_LIBDIR_SUFFIX})
add_custom_target(check-libgo
COMMAND make -C ${CMAKE_CURRENT_BINARY_DIR}/libgo -j${PROCESSOR_COUNT} check
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6795.17670.patch
Type: text/x-patch
Size: 2127 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141229/60492071/attachment.bin>
More information about the llvm-commits
mailing list