public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: Thomas Pfaff <tpfaff@gmx.net>
To: MinGW-users@lists.sourceforge.net, <pthreads-win32@sources.redhat.com>
Subject: mingw32 DLLs, threads and exceptions HOWTO (Update)
Date: Mon, 21 Jan 2002 00:23:00 -0000	[thread overview]
Message-ID: <Pine.WNT.4.40.0201210841270.152-101000@algeria.intern.net> (raw)

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1150 bytes --]


This is an update of my HOWTO that i have posted about an year ago
(see http://www.geocrawler.com/archives/3/6013/2000/12/100/4789494 ).
After some discussion with Danny i think that he is right with his
solution to not touch libgcc.a (see
http://www.geocrawler.com/archives/3/6013/2001/4/250/5485779 ) and
create a replacement libmingthrd.a instead. I have modified his Makefile a
little to create a import library named libmingthrd.a directly so you must
not edit the specs file.

The advantages are:

1. libgcc.a remains unchanged.
2. There is only one dll left, mingwm10.dll is not needed anymore.

The instructions are simple:

Create a directory with libgcc.a, the attached Makefile and mthr.c,
mthr_init.c and crtmt.c from the mingw runtime sources. To avoid memory
leaks you should use runtime 1.2 or above.

After running make the directory will build a new libmingthrd.a and
gcc-mt-2.95.3.dll (the replacement for mingwm10.dll).
libmingthrd.a should be copied to the mingw32\lib directory (rename the
original libmingthrd.a first), the dll should be copied somewhere in your
Path (the mingw32\bin directory for example).

Regards,

Thomas

[-- Attachment #2: Type: APPLICATION/octet-stream, Size: 1308 bytes --]

CMD_PREFIX = 
# CMD_PREFIX = i386-mingw32-

DO_STRIP = 1

GCC_MT_DLL     = gcc-mt-2.95.3.dll
GCC_MT_LIB     = libmingwthrd.a
GCC_MT_DEF     = libmingwthrd.def
GCC_STATIC_LIB = libgcc.a

CC		= $(CMD_PREFIX)gcc
AR		= $(CMD_PREFIX)ar
RANLIB	= $(CMD_PREFIX)ranlib
STRIP	= $(CMD_PREFIX)strip
DLLTOOL	= $(CMD_PREFIX)dlltool
DLLWRAP	= $(CMD_PREFIX)dllwrap

RM		= rm -f

CFLAGS = -O2 -s
# CFLAGS = -O2 -s -DDEBUG

MTHR_OBJS = mthr.o mthr_init.o

CRT_OBJS = crtmt.o

LIBGCC_MT_OBJS = _eh.o exception.o frame.o new.o opdel.o opdelnt.o opnew.o opnewnt.o \
                 opvdel.o opvdelnt.o opvnew.o opvnewnt.o tinfo.o tinfo2.o

.c.o:;		 $(CC) -c -o $@ $(CFLAGS) $<

all: $(GCC_MT_DLL)

$(GCC_MT_DLL): $(GCC_MT_LIB) $(CRT_OBJS) $(MTHR_OBJS) $(LIBGCC_MT_OBJS)
		$(DLLWRAP) --dllname=$@ --def=$(GCC_MT_DEF) $(CRT_OBJS) $(MTHR_OBJS) $(LIBGCC_MT_OBJS)
ifneq ($(DO_STRIP),0)
		$(STRIP) $@
endif

$(GCC_MT_LIB): $(LIBGCC_MT_OBJS)
		$(DLLTOOL) --dllname=$(GCC_MT_DLL) --output-def=$(GCC_MT_DEF) --output-lib=$@ --export-all-symbols $(LIBGCC_MT_OBJS)
ifneq ($(DO_STRIP),0)
		$(STRIP) --strip-debug $@
endif

$(LIBGCC_MT_OBJS) : $(GCC_STATIC_LIB)
		$(AR) x $(GCC_STATIC_LIB) $(LIBGCC_MT_OBJS)

clean: buildclean
		$(RM) $(GCC_MT_LIB) $(GCC_MT_DLL)

buildclean:
		$(RM) $(GCC_MT_DEF) $(CRT_OBJS) $(MTHR_OBJS) $(LIBGCC_MT_OBJS)

                 reply	other threads:[~2002-01-21  8:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.WNT.4.40.0201210841270.152-101000@algeria.intern.net \
    --to=tpfaff@gmx.net \
    --cc=MinGW-users@lists.sourceforge.net \
    --cc=pthreads-win32@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).