public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Ralf Habacker" <Ralf.Habacker@freenet.de>
To: <cygwin@cygwin.com>
Subject: RE: duplicate regexec/regcomp functions detected
Date: Sat, 29 Dec 2001 16:40:00 -0000	[thread overview]
Message-ID: <003201c1909e$0cef0cb0$0e6307d5@BRAMSCHE> (raw)
In-Reply-To: <20011228174956.GA30625@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 768 bytes --]

Ralf Habacker wrote
>The patch for creating libpthread.a is appended. It contains a script names "speclib" and an
additional rule >in the src/winsup/cygwin/Makefile.in.

I have recognized yet a little problem with the speclib script. I have checked this from the
cygwin build dir without any errors. If someone was in the winsup dir and does a make cygwin
or make, than some command in speclib does not found the input files. The problem is that ar
does not have an -o option for an output dir, so the hack to emulate that does not work.
Perhaps it is better to use the absolute path of the input library, but currently I have no
idea, how to solve this. :-(
Perhaps anyone else have an idea ?

speclib

...
cd $tmpdir
$ar x $PWD/$inlib $FILES
cd ..
...

Regards
Ralf

[-- Attachment #2: Makefile.in.dif --]
[-- Type: application/octet-stream, Size: 2728 bytes --]

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/Makefile.in,v
retrieving revision 1.75
diff -u -b -B -p -r1.75 Makefile.in
--- Makefile.in 2001/12/26 05:02:07     1.75
+++ Makefile.in 2001/12/29 18:54:24
@@ -100,6 +100,9 @@ DLL_ENTRY:=@DLL_ENTRY@
 LIBGMON_A:=libgmon.a
 GMON_START:=gcrt0.o

+LIBPTHREAD_A:=libpthread.a
+
+
 # Some things want these from libc, but they have their own static
 # data which apps can get to, which is a pain in the dll, so we
 # include them directly into the library.
@@ -152,7 +155,7 @@ install_host=@install_host@

 all: all_target $(all_host)

-all_target: $(LIB_NAME) automode.o binmode.o textmode.o $(LIBGMON_A)
+all_target: $(LIB_NAME) automode.o binmode.o textmode.o $(LIBGMON_A) $(LIBPTHREAD_A)

 all_host: new-$(LIB_NAME) cygrun.exe

@@ -160,9 +163,9 @@ force:

 install: install-libs install-headers install-man $(install_host) $(install_target)

-install-libs: $(LIB_NAME)
+install-libs: $(LIB_NAME) $(LIBPTHREAD_A)
        $(INSTALL_DATA) new-$(DLL_NAME) $(bindir)/$(DLL_NAME); \
-       for i in $(LIB_NAME) $(GMON_START) $(LIBGMON_A) automode.o binmode.o textmode.o ; do \
+       for i in $(LIB_NAME) $(LIBPTHREAD_A) $(GMON_START) $(LIBGMON_A) automode.o binmode.o textmode.o; do \
            $(INSTALL_DATA) $$i $(tooldir)/lib/$$i ; \
        done

@@ -202,7 +205,8 @@ maintainer-clean realclean: clean


 # Rule to build cygwin.dll
-new-$(DLL_NAME): $(LDSCRIPT) $(DLL_OFILES) $(DEF_FILE) $(DLL_IMPORTS) $(LIBC) $(LIBM) Makefile winver_stamp
+new-$(DLL_NAME): $(LDSCRIPT) $(DLL_OFILES) $(DEF_FILE) $(DLL_IMPORTS) $(LIBC) $(LIBM) winver_stamp
+#new-$(DLL_NAME): $(LDSCRIPT) $(DLL_OFILES) $(DEF_FILE) $(DLL_IMPORTS) $(LIBC) $(LIBM) Makefile winver_stamp
        $(CXX) $(CXXFLAGS) -nostdlib -Wl,-T$(firstword $^) -Wl,--out-implib,cygdll.a -shared -o $@ \
        -e $(DLL_ENTRY) $(DEF_FILE) $(DLL_OFILES) version.o winver.o \
        $(DLL_IMPORTS) $(MALLOC_OBJ) $(LIBM) $(LIBC) \
@@ -213,6 +217,11 @@ $(LIB_NAME): rmsym newsym new-$(DLL_NAME
        /bin/sh ${word 1,$^} ./cygdll.a "$(NM)" "$(AR)" "$(RANLIB)" $(OBSOLETE_FUNCTIONS) || exit 0
        /bin/sh ${word 2,$^} ./cygdll.a "$(AS)" "$(AR)" "$(RANLIB)" $(NEW_FUNCTIONS) || exit 0
        (echo create $(LIB_NAME); echo addmod $(LIBCOS); echo addlib cygdll.a; echo save) | $(AR) -M
+
+# Rule to build lib_pthread.a
+$(LIBPTHREAD_A): speclib new-$(DLL_NAME)
+       /bin/sh ${word 1,$^} cygdll.a pthread.o $@ "$(NM)" "$(AR)" "$(RANLIB)" || exit 0
+       @echo create $(LIBPTHREAD_A)

 # Rule to make stub library used by testsuite
 # dependency set to $(LIB_NAME) to accommodate make -j2.

[-- Attachment #3: speclib --]
[-- Type: application/octet-stream, Size: 760 bytes --]

#!/bin/sh
#
# create specific link library for libpthread using symbols from libcygwin.a
# 
inlib=$1; shift
reflib=$1; shift
outlib=$1; shift
nm=$1; shift
ar=$1; shift
ranlib=$1; shift

tmpdir=slibtmp.dir

# awk script for extracing related object files 
SYMBOLS=`nm $reflib | grep "[TD] _" | gawk '{ print $3 }'`

SCRIPT='$1 ~ /^d00/ { file = $1; gsub(":","",file); }'

for i in $SYMBOLS; do 
	SCRIPT="$SCRIPT \$3 ~ /^$i/ { print file; }"
done

# remove previous link library 
rm -f $outlib

# extract related object files 
FILES=`$nm $PWD/$inlib | gawk "$SCRIPT"`
mkdir $tmpdir
cd $tmpdir
$ar x $PWD/$inlib $FILES
cd ..

# create new link library for pthread
$ar cru $PWD/$outlib $tmpdir/*.o
$ranlib $PWD/$outlib 

# remove temporay files 
rm -fr $tmpdir




[-- Attachment #4: Type: text/plain, Size: 214 bytes --]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

  parent reply	other threads:[~2001-12-29 19:24 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-13 12:48 Ralf Habacker
2001-12-14  2:40 ` Corinna Vinschen
2001-12-27 10:20   ` Ralf Habacker
2001-12-27 10:21     ` Christopher Faylor
2001-12-28  5:21       ` Ralf Habacker
2001-12-28  5:22         ` Robert Collins
2001-12-28 10:17         ` Christopher Faylor
2001-12-29 12:43           ` Ralf Habacker
2001-12-30  5:03             ` Christopher Faylor
2001-12-30  7:34               ` Ralf Habacker
2001-12-30 11:56                 ` Christopher Faylor
2001-12-31 11:19                   ` Ralf Habacker
2002-01-01  7:07                     ` Corinna Vinschen
2002-01-01 16:00                       ` Ralf Habacker
2002-01-02  2:04                         ` Corinna Vinschen
2002-01-02  2:11                           ` Ralf Habacker
2001-12-29 14:15           ` Ralf Habacker
2001-12-29 16:40           ` Ralf Habacker [this message]
2001-12-30 14:35             ` Christopher Faylor
2001-12-30 16:42               ` Christopher Faylor
2001-12-31  1:16                 ` Christopher Faylor
2001-12-31  2:42               ` Ralf Habacker
2001-12-31 11:06                 ` Christopher Faylor
2001-12-31 12:04                   ` Ralf Habacker
2001-12-31 14:12                     ` Christopher Faylor
     [not found] <01df01c19259$1cbb8300$0200a8c0@lifelesswks>
2002-01-01  6:27 ` Ralf Habacker
2002-01-01  9:26   ` Christopher Faylor
2002-01-01  9:53     ` Corinna Vinschen
2002-01-01 10:30       ` Christopher Faylor
2002-01-01 13:56     ` Ralf Habacker

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='003201c1909e$0cef0cb0$0e6307d5@BRAMSCHE' \
    --to=ralf.habacker@freenet.de \
    --cc=cygwin@cygwin.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).