[PATCH] you can use this patch to profile cygwin-2

jojelino jojelino@gmail.com
Sun Jul 31 09:25:00 GMT 2011

On 2011-07-31 PM 6:16, jojelino wrote:
 > # in i686-pc-cygwin/winsup/cygwin/Makefile, you should add CFLAGS '-pg
 > -finstrument-functions' , to make new profiling code effective.
 > and comment out ifneq "${filter -O%,$(CFLAGS)}" "" too. it would make
 > profiling code functional ( in cases you need to profile cygheap thread
 > etc...)
I missed important one.
Please find rule in Makefile and apply following.

# Rule to build cygwin.dll
$(LIBSERVER) $(LIBC) $(LIBM) $(API_VER) Makefile winver_stamp
	$(CXX) $(CXXFLAGS) -Wl,--gc-sections $(nostdlib) -Wl,-T$(firstword $^) \
	-Wl,--heap=0 -Wl,--out-implib,cygdll.a -shared -o $@ \
  -e $(DLL_ENTRY) $(DEF_FILE) gcrt1.o $(DLL_OFILES) version.o winver.o \
  $(MALLOC_OBJ) $(LIBSERVER) $(LIBM) $(LIBC) boundbuffer.o instrument.o 
gmon.o mcount.o profil.o /lib/w32api/libkernel32.a \
  -lgcc $(DLL_IMPORTS) -Wl,-Map,cygwin.map
  @$(word 2,$^) $(OBJDUMP) $(OBJCOPY) $@ ${patsubst %0.dll,%1.dbg,$@}
  @ln -f $@ new-$(DLL_NAME)

More information about the Cygwin-patches mailing list