From 1c08c0e128e3c672dfbf04ce3bfa1c126c6198da Mon Sep 17 00:00:00 2001
From: Nick Lewycky <nicholas@mxc.ca>
Date: Tue, 3 Mar 2009 03:36:50 +0000
Subject: Fix build on Cygwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65922 91177308-0d34-0410-b5e6-96231b3b80d8
---
 Makefile.rules | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'Makefile.rules')

diff --git a/Makefile.rules b/Makefile.rules
index 9f0e58c..21403e0 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -313,7 +313,7 @@ ifdef SHARED_LIBRARY
 endif
 
 ifeq ($(ENABLE_PIC),1)
-  ifeq ($(LLVM_ON_WIN32),1)
+  ifeq ($(OS), $(filter $(OS), Cygwin MingW))
     # Nothing. Win32 defaults to PIC and warns when given -fPIC
   else
     ifeq ($(OS),Darwin)
@@ -471,7 +471,13 @@ ifeq ($(OS),Darwin)
                     -mmacosx-version-min=$(DARWIN_VERSION)
   CompileCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
 else
-  SharedLinkOptions=-shared
+  ifeq ($(OS),Cygwin)
+    SharedLinkOptions=-shared -nostdlib -Wl,--export-all-symbols \
+                      -Wl,--enable-auto-import -Wl,--enable-auto-image-base \
+                      -Wl,--enable-runtime-pseudo-relocs
+  else
+    SharedLinkOptions=-shared
+  endif
 endif
 
 #----------------------------------------------------------
-- 
cgit v1.1