Le 06/01/2013 11:35, Pekka Jääskeläinen a écrit :
> On 01/06/2013 12:44 AM, Vincent Danjean wrote:
>> Here are the two patches I needed in order to build a Debian package.
>> You might want to add them in the next rc (directly or after
>> modifications).
> 
> Thanks. I'll apply them and roll a new RC (probably tomorrow).

Here are two more patches that you might want to consider:
- one for the ICD file. In the Debian package, I wont use the full
  libdir path but instead let the linker find the library throught the
  standard library paths. This allows to use the same icd file on all
  architectures (important for Debian multiarch).
  I do not think that this part of the patch must be applied
  upstream (there would be problems if libdir is not a standard path)
    However, this patch also set the library name to the full SONAME
  and not to the solink for development. Ie, I think that it would be
  better to put @libdir@/libpocl.so.1 instead of @libdir@/libpocl.so
  in pocl.icd.in upstream.
- the second patch try to remove superfluous linkage for various
  libraries and binaries. These have been detected by debian build
  tools (libraries and binaries link to libraries without using
  any of there symbols).
  Note that at several places, "llvm-config --ldflags" was used
  instead of linking to libllvm. "llvm-config --ldflags" are the
  flags used to build libllvm itself, not what you want to use
  when to want to link *to* libllvm.
  Note also that I only checked/looked at what is currently used
  in the Debian package (ie not tce, ...)

>> For each of them:
>> - is it intended that the user run them directly ?
> 
> Only the pocl-standalone which can be used to build kernels offline.
> This is used by TCE to build standalone OpenCL programs fully offline.

Then pocl-standalone will need a manpage in the Debian package.
If you can give me some text, I will create the manpage itself.

>> - are they invoked by libpocl ?
> 
> Others than pocl-standalone are.

They would be better placed into (a subdirectory of) pkglibdir

> This causes a known unsolved problem with the search paths. You, as
> a more experienced packager, might actually know the proper solution.
> 
> https://bugs.launchpad.net/pocl/+bug/1037932

I just added a comment.

> Also, Kalle has been working on a branch which avoids using the
> scripts by using the LLVM through its C++ APIs instead, but it
> didn't make it to the 0.7 release:
> 
> https://code.launchpad.net/~kraiskil/pocl/api

So, I will try to see if I can improve the scripts situation a
little bit but I wont do lots of things as it will be better fixed
later with Kalle work.

  Regards,
    Vincent

> This will also solve the "pocl requires fork()" issue:
> 
> https://bugs.launchpad.net/pocl/+bug/1039565
> 
Do not hardcode libdir on Debian (so this file is multi-arch aware)

Load the full soname (not the lib*.so that can be not installed because it is
in the -dev package)
--- a/pocl.icd.in
+++ b/pocl.icd.in
@@ -1 +1 @@
-@libdir@/libpocl.so
+libpocl.so.1
Description: remove most of superflous linkage
 Several binaries and libraries are linked with uneeded libraries. This patch
 remove most of them.
Author: Vincent Danjean <[email protected]>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/lib/poclu/Makefile.am
+++ b/lib/poclu/Makefile.am
@@ -29,3 +29,4 @@
 
 libpoclu_la_CPPFLAGS = -I$(top_srcdir)/fix-include -I$(top_srcdir)/include 
 libpoclu_la_LDFLAGS = --version-info ${LIB_VERSION}
+libpoclu_la_LIBADD = ../CL/libpocl.la
--- a/lib/llvmopencl/Makefile.am
+++ b/lib/llvmopencl/Makefile.am
@@ -25,7 +25,8 @@
 pkglib_LTLIBRARIES = llvmopencl.la
 
 AM_CXXFLAGS = -I@top_srcdir@/fix-include -I@top_srcdir@/include `@LLVM_CONFIG@ --cxxflags`
-AM_LDFLAGS = -module -export-dynamic -version-info ${KERNEL_COMPILER_LIB_VERSION} `@LLVM_CONFIG@ --ldflags` 
+AM_LDFLAGS = -module -export-dynamic -version-info ${KERNEL_COMPILER_LIB_VERSION}
+llvmopencl_la_LIBADD = -lLLVM-${LLVM_VERSION}
 
 llvmopencl_la_SOURCES = Barrier.h						\
                         BarrierBlock.h BarrierBlock.cc				\
@@ -45,4 +46,4 @@
 						BreakConstantGEPs.h BreakConstantGEPs.cpp \
 						WorkitemHandlerChooser.h WorkitemHandlerChooser.cc
 
-#llvmopencl_la_LIBADD = @LIBS_LLVMTRANSFORMUTILS@
+#llvmopencl_la_LIBADD += @LIBS_LLVMTRANSFORMUTILS@
--- a/tools/llvm-ld/Makefile.am
+++ b/tools/llvm-ld/Makefile.am
@@ -1,6 +1,6 @@
 bin_PROGRAMS = pocl-llvm-ld
 pocl_llvm_ld_SOURCES = llvm-ld.cpp Optimize.cpp
-pocl_llvm_ld_LDFLAGS = `@LLVM_CONFIG@ --ldflags` -lLLVM-`@LLVM_CONFIG@ --version`
+pocl_llvm_ld_LDFLAGS = -lLLVM-${LLVM_VERSION}
 pocl_llvm_ld_CXXFLAGS = `@LLVM_CONFIG@ --cxxflags`
 
 
--- a/configure.ac
+++ b/configure.ac
@@ -460,9 +460,14 @@
 AM_CONDITIONAL([TCE_AVAILABLE], test ! -z $TCE_AVAILABLE)
 
 # libtool dynamic library handling library
+old_LIBS="$LIBS"
+LIBS=
 AC_SEARCH_LIBS([lt_dlsym], [ltdl], [], [
 AC_MSG_ERROR([unable to find the libtool dl library (usually libltdl-dev)])
 ])
+LTDL_LIBS="$LIBS"
+AC_SUBST([LTDL_LIBS])
+LIBS="$old_LIBS"
 
 # Following checks are related to the build system for devices (clang and so),
 # and not for building the host code.
--- a/lib/CL/Makefile.am
+++ b/lib/CL/Makefile.am
@@ -135,7 +135,8 @@
 libpocl_la_LDFLAGS += -lstdc++ `@TCE_CONFIG@ --libs`
 endif
 
-libpocl_la_LIBADD = devices/libpocl-devices.la 
+libpocl_la_LIBADD = devices/libpocl-devices.la
+libpocl_la_LIBADD += ${LTDL_LIBS}
 
 if BUILD_SPU
 libpocl_la_LIBADD += -lspe2
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
pocl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pocl-devel

Reply via email to