delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/05/05/12:07:59

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Wed, 5 May 2004 12:07:37 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Ted Yu <ted_yu AT yahoo DOT com>
cc: cygwin AT cygwin DOT com
Subject: RE: DLL generation under Cygwin
In-Reply-To: <20040505154908.91567.qmail@web12108.mail.yahoo.com>
Message-ID: <Pine.GSO.4.56.0405051202310.1487@slinky.cs.nyu.edu>
References: <20040505154908 DOT 91567 DOT qmail AT web12108 DOT mail DOT yahoo DOT com>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.39

On Wed, 5 May 2004, Ted Yu wrote:

> Hi,
> I deleted .o files and compiled with -mno-cygwin.
> cygwin1.dll is still needed because it contains
> malloc() and free() which are used in my DLL.

So does MSVCRT.dll, which is what MinGW uses for its runtime.

> Here is my Makefile:
> OBJS = \
>         8d0.o 8d1.o 8d2.o \
>         8c0.o 8c1.o 8c2.o \
>         8r0.o 8r1.o 8r2.o \
>         8u0.o 8u1.o 8u2.o \
>         8v0.o 8v1.o 8v2.o \
>         4d0.o 4d1.o 4d2.o \
>         4c0.o 4c1.o 4c2.o \
>         4r0.o 4r1.o 4r2.o \
>         4u0.o 4u1.o 4u2.o \
>         4v0.o 4v1.o 4v2.o \
>         8sc.o 8sr.o 8mc.o 8mr.o \
>         4sc.o 4sr.o 4mc.o 4mr.o \
>         fftfreq.o djbfft2d.o /lib/libc.a
                               ^^^^^^^^^^^
Why are you linking in libc.a explicitly?  The appropriate version should
be automatically linked in by the compiler.

> CFLAGS = -O1 -fomit-frame-pointer -malign-double -mno-cygwin
> djbfft.dll: $(OBJS)
>         $(LD) -s --base-file fft.base --dll -o $(DLLNAME) $(OBJS) $(LIBS) -e 'fftEntry AT 12'
                                                 ^^^^^^^^^^         ^^^^^^^
What's LIBS set to?  What's DLLNAME set to?

>         dlltool --as=$(AS) --dllname $(DLLNAME) --def fft.def --base-file fft.base --output-exp fft.exp
                       ^^^^^
What's AS set to?

>         $(LD) -s --base-file fft.base fft.exp -dll -o $(DLLNAME) $(OBJS) $(LIBS) -e 'fftEntry AT 12'
>         dlltool --as=$(AS) --dllname $(DLLNAME) --def fft.def --base-file fft.base --output-exp fft.exp
>         $(LD) fft.exp --dll -o $(DLLNAME) $(OBJS) $(LIBS) -e 'fftEntry AT 12'
>         dlltool --def fft.def --dllname $(DLLNAME) --output-lib fft.lib

It also looks like you're using the Cygwin version of "ld", and dlltool
will probably invoke the Cygwin versions of tools, too.  Try adding
-mno-cygwin to CC rather than CFLAGS, i.e.,

CC = gcc -mno-cygwin
CFLAGS = -O1 -fomit-frame-pointer -malign-double
...

and using $(CC) to link instead of $(LD) (you can pass flags to ld via
the -Wl,... options, IIRC).
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

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

- Raw text -


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