delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/07/14/13:45:18

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
From: "Dave Korn" <dk AT artimi DOT com>
To: "'cygwin mailing-list'" <cygwin AT cygwin DOT com>
Subject: HOWTO build debug version of the cygwin dll with no optimisation?
Date: Wed, 14 Jul 2004 18:43:25 +0100
MIME-Version: 1.0
Message-ID: <NUTMEG6KZmcK8r6beUz000008ab@NUTMEG.CAM.ARTIMI.COM>
X-OriginalArrivalTime: 14 Jul 2004 17:43:26.0156 (UTC) FILETIME=[10EE00C0:01C469CA]


  Ok, it doesn't mention how to do this in the user guide.  It doesn't say
how to do this in the FAQ.  It doesn't say how to do it on the website's
how-to-contribute page.  It doesn't say how to do this in the sources.  I've
searched at google.  I've searched at the list archive.  And the GNU
standard method (CFLAGS='-g -O0' ../src/configure) doesn't work.

  I found a post on the mailing list that suggests that you have to set
*three* environment variables, CFLAGS, CXXFLAGS, and LDFLAGS.

  I tried it and it didn't quite work properly.  My build logs are full of
stuff like...

make "AR_FLAGS=rc" 	"CC_FOR_BUILD=gcc" 	"CFLAGS=-O2 -g -O0"
"CFLAGS_FOR_BUILD=" 	"CFLAGS_FOR_TARGET=-O2 -g -O0" 	"LDFLAGS="
"LIBCFLAGS=-O2 -g -O0" 	"LIBCFLAGS_FOR_TARGET=-O2 -g -O0" 	"MAKE=make"
"MAKEINFO=makeinfo --split-size=5000000 " 	"PICFLAG="
"PICFLAG_FOR_TARGET=" 	"SHELL=/bin/sh" 	"EXPECT=expect"
"RUNTEST=runtest" 	"RUNTESTFLAGS="
"exec_prefix=/usr/build/install" 	"infodir=/usr/build/install/info"
"libdir=/usr/build/install/lib" 	"prefix=/usr/build/install"
"tooldir=/usr/build/install/i686-pc-cygwin"
"top_toollibdir=/usr/build/install/i686-pc-cygwin/lib" 	"AR=ar"
"AS=as" 	"CC=gcc -L/usr/build/obj/i686-pc-cygwin/winsup
-L/usr/build/obj/i686-pc-cygwin/winsup/cygwin
-L/usr/build/obj/i686-pc-cygwin/winsup/w32api/lib -isystem
/usr/build/src/winsup/include -isystem /usr/build/src/winsup/cygwin/include
-isystem /usr/build/src/winsup/w32api/include
-B/usr/build/obj/i686-pc-cygwin/newlib/ -isystem
/usr/build/obj/i686-pc-cygwin/newlib/targ-include -isystem
/usr/build/src/newlib/libc/include -L/usr/build/obj/ld"
"LD=/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygwin/bin/ld.
exe" 	"LIBCFLAGS=-O2 -g -O0" 	"NM=nm" 	"PICFLAG="
"RANLIB=ranlib" 	"DESTDIR=" all-recursive

...where you'll see that my flags have been combined with -O2 from somewhere
else.  Now this may well work, as the -O0 is after the -O2 on the command
line, and probably overrides it, but it seems a little risky in general, and
I suspect this isn't the correct way to do it, since the optimisation
settings seem to be held elsewhere and combined with the CFLAGS at a late
stage, and it's that somewhere-else that I really ought to be setting.

  So my questions are:  How is this supposed to be done, where is it
actually documented, and why not?

  Or have I just missed something in my searches?

    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....


--
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