This is the mail archive of the cygwin-developers mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
----Original Message---- >From: Christopher Faylor >Sent: 02 September 2005 15:53 > I haven't tried this from outside of the winsup/cygwin directory so > maybe your problem is due to building from a higher level directory. Bingo! Spot on. Wow, was I ever in a whole world of tls-related pain, owing to some modules having been recompiled since the cygtls structure changed but not others! Typical compile line when building the whole lot from top-level: c++ [ ... SNIP ... ] -c -nostdinc++ -DHAVE_CONFIG_H -g -O2 -Wall -Wwrite-strings -fno-common -pipe -fbuiltin -fmessage-length=0 [ ... SNIP ... ] -fno-rtti -fno-exceptions -o ./fhandler_netdrive.o /usr/build/src/winsup/cygwin/fhandler_netdrive.cc ... and when building from a cleaned lower-level dir: c++ [ ... SNIP ... ] -c -nostdinc++ -DHAVE_CONFIG_H -O2 -g -O2 -MMD -fomit-frame-pointer -fmerge-constants -ftracer -Wall -Wwrite-strings -fno-common -pipe -fbuiltin -fmessage-length=0 [ ... SNIP ... ] -fno-rtti -fno-exceptions -o ./fhandler_netdrive.o /usr/build/src/winsup/cygwin/fhandler_netdrive.cc [ SNIPs represent long lists of -I and related options that are identical in both. ] This can be seen more easily by running make clean in the i686.../winsup/cygwin dir, then running "make -n all" at that level and "make -n all-target-winsup" at toplevel and comparing the c++ command lines it outputs. I think it's because there's a commandline FLAGS definition passed down from toplevel: here's an extract from the generated Makefile in i686-pc-cygwin/winsup/cygwin: # # --enable options from configure # MT_SAFE:=@MT_SAFE@ DEFS:=-DHAVE_CONFIG_H CCEXTRA:= 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 # FIXME: Which is it, CC or CC_FOR_TARGET? CC_FOR_TARGET:=$(CC) CFLAGS=-O2 -g -O2 override CFLAGS+=-MMD ${$(*F)_CFLAGS} -fmerge-constants -ftracer $(CCEXTRA) CXX= c++ -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 CXXFLAGS=$(CFLAGS) I believe the CXXFLAGS setting needs an override command as well. That makes it work for me. Patch attached. Tested by makeing clean in i686.../winsup/cygwin, then returning to toplevel and making all and counting the number of .o and .d files. Also by then blowing away and reconfiguring from scratch my entire objdir and seeing that it did the right thing this time as opposed to this morning. I haven't tested it for interactions with supplying C*FLAGS on the commandline yet, so there may conceivably be unforeseen consequences, but then they would already apply to plain C files and at least I'm fixing an asymmetry between the handling of the flags that I don't believe should be there, given that the intent seems to be to use the same set of flags for compiling C++ sources as for C sources. src/winsup/cygwin/ChangeLog 2005-09-02 Dave Korn <dave.korn@artimi.com> * Makefile.in (CXXFLAGS): Add 'override' command to correctly set flags to generate dependencies when invoked from top-level make. cheers, DaveK -- Can't think of a witty .sigline today....
Attachment:
cyg-toplevel-make-cxxflags-deps-problem-patch.diff
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |