<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@宋体";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas","serif";}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Just build libcl.so and libgbeinterp.so in the old c/c++ environment, and use the offline compiler that built in mainstream c/c++ environment. It will make
 beignet workable with CL_EMBEDDED_PROFILE in the old c/c++ environment, please refer to my next two patches of this patch set.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> spring_wind [mailto:spring_wind@yeah.net]
<br>
<b>Sent:</b> Wednesday, December 31, 2014 4:30 PM<br>
<b>To:</b> Guo, Yejun<br>
<b>Cc:</b> beignet@lists.freedesktop.org<br>
<b>Subject:</b> Re:[Beignet] [PATCH 1/3] add option BUILD_STATIC_GBE_COMPILER to build static compiler<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.5pt;font-family:"Arial","sans-serif";color:black">Do you have plan to support to build libcl and libgbe_interp in static way? Only add static in CMakeList.txt will not work, because
 init function will not be called if we use libcl.a and libgbe_interp.a, but it works for libcl.so and libgbe_interp.so.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial","sans-serif";color:black"><o:p> </o:p></span></p>
<pre><span style="color:black"><br>At 2014-12-31 15:34:22, "Guo Yejun" <<a href="mailto:yejun.guo@intel.com">yejun.guo@intel.com</a>> wrote:<o:p></o:p></span></pre>
<pre><span style="color:black">>The offline compiler (gbe_bin_generater), depending on LLVM/clang,<o:p></o:p></span></pre>
<pre><span style="color:black">>could only be built with C++11 features. To make it workable within<o:p></o:p></span></pre>
<pre><span style="color:black">>old c/c++ version environment, add one CMAKE option to link against<o:p></o:p></span></pre>
<pre><span style="color:black">>all static libraries.<o:p></o:p></span></pre>
<pre><span style="color:black">><o:p> </o:p></span></pre>
<pre><span style="color:black">>Signed-off-by: Guo Yejun <<a href="mailto:yejun.guo@intel.com">yejun.guo@intel.com</a>><o:p></o:p></span></pre>
<pre><span style="color:black">>---<o:p></o:p></span></pre>
<pre><span style="color:black">> backend/src/CMakeLists.txt | 33 +++++++++++++++++++++++----------<o:p></o:p></span></pre>
<pre><span style="color:black">> 1 file changed, 23 insertions(+), 10 deletions(-)<o:p></o:p></span></pre>
<pre><span style="color:black">><o:p> </o:p></span></pre>
<pre><span style="color:black">>diff --git a/backend/src/CMakeLists.txt b/backend/src/CMakeLists.txt<o:p></o:p></span></pre>
<pre><span style="color:black">>index bec0d2a..118a745 100644<o:p></o:p></span></pre>
<pre><span style="color:black">>--- a/backend/src/CMakeLists.txt<o:p></o:p></span></pre>
<pre><span style="color:black">>+++ b/backend/src/CMakeLists.txt<o:p></o:p></span></pre>
<pre><span style="color:black">>@@ -117,22 +117,22 @@ set (GBE_SRC<o:p></o:p></span></pre>
<pre><span style="color:black">>     backend/gen8_encoder.cpp<o:p></o:p></span></pre>
<pre><span style="color:black">>     )<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">>+set (GBE_LINK_LIBRARIES<o:p></o:p></span></pre>
<pre><span style="color:black">>+    ${DRM_INTEL_LIBRARIES}<o:p></o:p></span></pre>
<pre><span style="color:black">>+    ${DRM_LIBRARIES}<o:p></o:p></span></pre>
<pre><span style="color:black">>+    ${CLANG_LIBRARIES}<o:p></o:p></span></pre>
<pre><span style="color:black">>+    ${LLVM_MODULE_LIBS}<o:p></o:p></span></pre>
<pre><span style="color:black">>+    ${LLVM_SYSTEM_LIBS}<o:p></o:p></span></pre>
<pre><span style="color:black">>+    ${CMAKE_THREAD_LIBS_INIT}<o:p></o:p></span></pre>
<pre><span style="color:black">>+    ${CMAKE_DL_LIBS}<o:p></o:p></span></pre>
<pre><span style="color:black">>+    )<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">> include_directories (.)<o:p></o:p></span></pre>
<pre><span style="color:black">> link_directories (${LLVM_LIBRARY_DIRS} ${DRM_LIBDIR})<o:p></o:p></span></pre>
<pre><span style="color:black">> include_directories(${LLVM_INCLUDE_DIRS})<o:p></o:p></span></pre>
<pre><span style="color:black">> add_library (gbe SHARED ${GBE_SRC})<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">>-<o:p></o:p></span></pre>
<pre><span style="color:black">>-target_link_libraries(<o:p></o:p></span></pre>
<pre><span style="color:black">>-                      gbe<o:p></o:p></span></pre>
<pre><span style="color:black">>-                      ${DRM_INTEL_LIBRARIES}<o:p></o:p></span></pre>
<pre><span style="color:black">>-                      ${DRM_LIBRARIES}<o:p></o:p></span></pre>
<pre><span style="color:black">>-                      ${CLANG_LIBRARIES}<o:p></o:p></span></pre>
<pre><span style="color:black">>-                      ${LLVM_MODULE_LIBS}<o:p></o:p></span></pre>
<pre><span style="color:black">>-                      ${LLVM_SYSTEM_LIBS}<o:p></o:p></span></pre>
<pre><span style="color:black">>-                      ${CMAKE_THREAD_LIBS_INIT}<o:p></o:p></span></pre>
<pre><span style="color:black">>-                      ${CMAKE_DL_LIBS})<o:p></o:p></span></pre>
<pre><span style="color:black">>+target_link_libraries(gbe ${GBE_LINK_LIBRARIES})<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">> add_library(gbeinterp SHARED gbe_bin_interpreter.cpp)<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">>@@ -149,8 +149,21 @@ if (LLVM_VERSION_NODOT VERSION_EQUAL 34)<o:p></o:p></span></pre>
<pre><span style="color:black">> endif(LLVM_VERSION_NODOT VERSION_EQUAL 34)<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">> link_directories (${LLVM_LIBRARY_DIR} ${DRM_LIBDIR})<o:p></o:p></span></pre>
<pre><span style="color:black">>+<o:p></o:p></span></pre>
<pre><span style="color:black">>+if (BUILD_STATIC_GBE_COMPILER STREQUAL "true")<o:p></o:p></span></pre>
<pre><span style="color:black">>+macro(remove_cxx_flag flag)<o:p></o:p></span></pre>
<pre><span style="color:black">>+  string(REPLACE "${flag}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")<o:p></o:p></span></pre>
<pre><span style="color:black">>+endmacro()<o:p></o:p></span></pre>
<pre><span style="color:black">>+<o:p></o:p></span></pre>
<pre><span style="color:black">>+remove_cxx_flag("-Wl,-E")<o:p></o:p></span></pre>
<pre><span style="color:black">>+ADD_EXECUTABLE(gbe_bin_generater gbe_bin_generater.cpp ${GBE_SRC})<o:p></o:p></span></pre>
<pre><span style="color:black">>+set_target_properties(gbe_bin_generater PROPERTIES LINK_FLAGS "-static")<o:p></o:p></span></pre>
<pre><span style="color:black">>+TARGET_LINK_LIBRARIES(gbe_bin_generater ${GBE_LINK_LIBRARIES})<o:p></o:p></span></pre>
<pre><span style="color:black">>+else (BUILD_STATIC_GBE_COMPILER STREQUAL "true")<o:p></o:p></span></pre>
<pre><span style="color:black">> ADD_EXECUTABLE(gbe_bin_generater gbe_bin_generater.cpp)<o:p></o:p></span></pre>
<pre><span style="color:black">> TARGET_LINK_LIBRARIES(gbe_bin_generater gbe)<o:p></o:p></span></pre>
<pre><span style="color:black">>+endif (BUILD_STATIC_GBE_COMPILER STREQUAL "true")<o:p></o:p></span></pre>
<pre><span style="color:black">>+<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">> install (TARGETS gbe LIBRARY DESTINATION ${BEIGNET_INSTALL_DIR})<o:p></o:p></span></pre>
<pre><span style="color:black">> install (TARGETS gbeinterp LIBRARY DESTINATION ${BEIGNET_INSTALL_DIR})<o:p></o:p></span></pre>
<pre><span style="color:black">>-- <o:p></o:p></span></pre>
<pre><span style="color:black">>1.9.1<o:p></o:p></span></pre>
<pre><span style="color:black">><o:p> </o:p></span></pre>
<pre><span style="color:black">>_______________________________________________<o:p></o:p></span></pre>
<pre><span style="color:black">>Beignet mailing list<o:p></o:p></span></pre>
<pre><span style="color:black">><a href="mailto:Beignet@lists.freedesktop.org">Beignet@lists.freedesktop.org</a><o:p></o:p></span></pre>
<pre><span style="color:black">><a href="http://lists.freedesktop.org/mailman/listinfo/beignet">http://lists.freedesktop.org/mailman/listinfo/beignet</a><o:p></o:p></span></pre>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
</div>
</body>
</html>