delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/01/14/15:46:52

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <4B4F82B1.3080605@users.sourceforge.net>
Date: Thu, 14 Jan 2010 14:46:41 -0600
From: "Yaakov (Cygwin/X)" <yselkowitz AT users DOT sourceforge DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: dladdr and Dl_info
References: <3ab31ceedb33b3519257e07931dbdaf5 AT mail DOT smartmobili DOT com> <4B4F7C90 DOT 4030509 AT x-ray DOT at>
In-Reply-To: <4B4F7C90.4030509@x-ray.at>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------070206070608030406060804
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 14/01/2010 14:20, Reini Urban wrote:
>
> I have a working cygwin llvm and llvm-gcc,
> but had no time to produce a proper package yet.
> Attached are my cygport files and my local config.
> No patches were needed.
>
> But I haven't bothered to build clang yet,
> just the Clang llvmc plugin and llvm-gcc,
> which I thought is harder to build and gives us more gcc compatibility.

Here's what I have so far for llvm/clang 2.6; the .cygport may be 
missing something, it's been a few weeks since I've looked at it.


Yaakov

--------------070206070608030406060804
Content-Type: text/plain;
 name="llvm-2.6-1.cygport"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="llvm-2.6-1.cygport"

aW5oZXJpdCBjbWFrZQoKSE9NRVBBR0U9Imh0dHA6Ly93d3cubGx2bS5vcmcv
IgpTUkNfVVJJPSJodHRwOi8vd3d3Lmxsdm0ub3JnL3JlbGVhc2VzLyR7UFZ9
LyR7UH0udGFyLmd6CiAgICAgICAgIGh0dHA6Ly93d3cubGx2bS5vcmcvcmVs
ZWFzZXMvJHtQVn0vY2xhbmctJHtQVn0udGFyLmd6IgoKQ1lHUE9SVF9VU0Vf
VU5TVEFCTEVfQVBJPTEKc3JjX3VucGFja19ob29rKCkgewoJcm0gLWZyIHRv
b2xzL2NsYW5nCgltdiAuLi9jbGFuZy0ke1BWfSB0b29scy9jbGFuZwp9Cg==

--------------070206070608030406060804
Content-Type: text/x-patch;
 name="llvm-2.6-1.src.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="llvm-2.6-1.src.patch"

--- origsrc/llvm-2.6/CMakeLists.txt	2009-08-18 10:29:35.000000000 -0500
+++ src/llvm-2.6/CMakeLists.txt	2009-11-24 20:41:30.329796900 -0600
@@ -4,7 +4,7 @@ project(LLVM)
 cmake_minimum_required(VERSION 2.6.1)
 
 set(PACKAGE_NAME llvm)
-set(PACKAGE_VERSION 2.6svn)
+set(PACKAGE_VERSION 2.6)
 set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
 set(PACKAGE_BUGREPORT "llvmbugs AT cs DOT uiuc DOT edu")
 
@@ -144,6 +144,11 @@ if(WIN32)
   set(EXEEXT ".exe")
   # Maximum path length is 160 for non-unicode paths
   set(MAXPATHLEN 160)
+elseif(CYGWIN)
+  set(LLVM_ON_WIN32 0)
+  set(LLVM_ON_UNIX 1)
+  set(LTDL_SHLIB_EXT ".dll")
+  set(EXEEXT ".exe")
 else(WIN32)
   if(UNIX)
     set(LLVM_ON_WIN32 0)
--- origsrc/llvm-2.6/cmake/modules/AddLLVM.cmake	2009-08-16 04:44:27.000000000 -0500
+++ src/llvm-2.6/cmake/modules/AddLLVM.cmake	2009-11-24 20:17:16.218626500 -0600
@@ -54,8 +54,6 @@ endmacro(add_llvm_tool name)
 macro(add_llvm_example name)
 #  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_EXAMPLES_BINARY_DIR})
   add_llvm_executable(${name} ${ARGN})
-  install(TARGETS ${name}
-    RUNTIME DESTINATION examples)
 endmacro(add_llvm_example name)
 
 
--- origsrc/llvm-2.6/tools/clang/lib/Basic/Targets.cpp	2009-08-20 12:48:52.000000000 -0500
+++ src/llvm-2.6/tools/clang/lib/Basic/Targets.cpp	2009-11-25 01:41:58.357941200 -0600
@@ -897,6 +897,31 @@ public:
 } // end anonymous namespace
 
 namespace {
+// x86-32 Cygwin target
+class CygwinX86_32TargetInfo : public X86_32TargetInfo {
+public:
+  CygwinX86_32TargetInfo(const std::string& triple)
+    : X86_32TargetInfo(triple) {
+    TLSSupported = false;
+    WCharType = UnsignedShort;
+    WCharWidth = WCharAlign = 16;
+    DoubleAlign = LongLongAlign = 64;
+    DescriptionString = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-"
+                        "i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-"
+                        "a0:0:64-f80:32:32";
+  }
+  virtual void getTargetDefines(const LangOptions &Opts,
+                                std::vector<char> &Defines) const {
+    X86_32TargetInfo::getTargetDefines(Opts, Defines);
+    // This list is based off of the the list of things Cygwin GCC defines
+    DefineStd(Defines, "unix", Opts);
+    Define(Defines, "__CYGWIN__");
+    Define(Defines, "_X86_");
+  }
+};
+} // end anonymous namespace
+
+namespace {
 // x86-32 Windows target
 class WindowsX86_32TargetInfo : public X86_32TargetInfo {
 public:
@@ -1623,6 +1648,7 @@ TargetInfo* TargetInfo::CreateTargetInfo
     case llvm::Triple::Solaris:
       return new SolarisTargetInfo<X86_32TargetInfo>(T);
     case llvm::Triple::Cygwin:
+      return new CygwinX86_32TargetInfo(T);
     case llvm::Triple::MinGW32:
     case llvm::Triple::MinGW64:
     case llvm::Triple::Win32:
--- origsrc/llvm-2.6/tools/clang/lib/Frontend/InitHeaderSearch.cpp	2009-08-19 15:04:03.000000000 -0500
+++ src/llvm-2.6/tools/clang/lib/Frontend/InitHeaderSearch.cpp	2009-11-25 01:52:57.835661100 -0600
@@ -119,6 +119,27 @@ void InitHeaderSearch::AddDefaultSystemI
 
   // Mingw32 GCC version 4
   AddPath("C:/mingw/include", System, false, false, false);
+#elif defined(__CYGWIN__)
+  if (Lang.CPlusPlus) {
+    // Cygwin GCC version 4
+    AddPath("/usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++",
+            System, true, false, false);
+    AddPath("/usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/i686-pc-cygwin",
+            System, true, false, false);
+    AddPath("/usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/backward",
+            System, true, false, false);
+  }
+
+  if (Lang.ObjC1) {
+    // Cygwin GCC version 4
+    AddPath("/usr/lib/gcc/i686-pc-cygwin/4.3.4/include",
+            System, true, false, false);
+  }
+
+  // Cygwin GCC version 4
+  AddPath("/usr/local/include", System, false, false, false);
+  AddPath("/usr/include", System, false, false, false);
+  AddPath("/usr/include/w32api", System, false, false, false);
 #else
 
   if (Lang.CPlusPlus) {
--- origsrc/llvm-2.6/tools/clang/lib/Headers/stddef.h	2008-12-01 11:20:57.000000000 -0600
+++ src/llvm-2.6/tools/clang/lib/Headers/stddef.h	2009-11-25 01:04:28.309245700 -0600
@@ -30,6 +30,7 @@ typedef __typeof__(((int*)0)-((int*)0)) 
 typedef __typeof__(sizeof(int)) size_t;
 #ifndef __cplusplus
 typedef __typeof__(*L"") wchar_t;
+typedef __typeof__(sizeof(*L"")) wint_t;
 #endif
 
 #ifdef __cplusplus
--- origsrc/llvm-2.6/tools/clang/tools/driver/driver.cpp	2009-07-17 13:10:27.000000000 -0500
+++ src/llvm-2.6/tools/clang/tools/driver/driver.cpp	2009-11-25 00:26:05.638540500 -0600
@@ -190,7 +190,11 @@ int main(int argc, const char **argv) {
 
   Driver TheDriver(Path.getBasename().c_str(), Path.getDirname().c_str(),
                    llvm::sys::getHostTriple().c_str(),
+#if defined(__CYGWIN__)
+                   "a.exe", Diags);
+#else
                    "a.out", Diags);
+#endif
 
   llvm::OwningPtr<Compilation> C;
 


--------------070206070608030406060804
Content-Type: text/plain; charset=us-ascii

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
--------------070206070608030406060804--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019