Date: Sun, 17 Dec 2000 08:52:12 -0800 (PST) From: yakisoba@f2.dion.ne.jp To: freebsd-gnats-submit@FreeBSD.org Subject: gnu/23598: Merge libgcc_r with libgcc Message-ID: <200012171652.eBHGqCf10642@freefall.freebsd.org> Resent-Message-ID: <200012171700.eBHH01U11293@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 23598
>Category: gnu
>Synopsis: Merge libgcc_r with libgcc
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Dec 17 09:00:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Naohiko Tsuji
>Release: FreeBSD 4.2-STABLE i386
>Organization:
>Environment:
>Description:
Building "shared" libraries with pthread, we always need "-pthread" flag.
To avoid the flag "-pthread" ...
1. Create stubs and link it. This stubs for the library and "libgcc_r".
I thought "libgcc_r-stubs.c" needs for all "shared" libraries with pthread.
Stub, stub, stub ... I hate this way.
2. Add weak directive for the library, but cannot for "libgcc_r" without
hack FreeBSD source tree.
I found this problem, building libstdc++-v3 on MY make tree.
On merging GCC 3.0 I think this problem will happen.
>How-To-Repeat:
>Fix:
Checking ...
1. 2.2.0-RELEASE or later has weak directive.
2. "gthr-posix.h" is ready to make weak symbols.
If "ASM_WEAKEN_LABEL" is defined in Target Macro file,
"SUPPORTS_WEAK 1" is defined in "default.h".
Then "GTHREAD_USE_WEAK 1" is defined in "gthr.h".
So "gthr-posix.h" make weak symbols.
So we can merge "libgcc_r" with "libgcc". I think we should do that
like "gcc/Makefile" generated by configure script.
1. Add the next line into "config/freebsd.h".
#ifdef IN_LIBGCC2
#ifndef __GTHREAD_MUTEX_INIT_FUNCTION
#define __GTHREAD_MUTEX_INIT_FUNCTION(m) \
do { \
pthread_mutex_init (m, NULL) \
} while (0)
#endif
#endif /* IN_LIBGCC2 */
2. Improve "gnu/usr.bin/cc/cc_tools/freebsd-native.h"
#define LIBGCC_SPEC "libgcc%{shared:_pic}.a%s"
3. Create "gthr-default.h" in "gnu/usr.bin/cc/cc_tools" directory.
gthr-default.h:
#include "gthr-posix.h"
This header file is generated by configure script.
4. Add the next line into "gnu/usr.bin/lib/libgcc/Makefile".
CFLAGS += -DHAVE_GTHR_DEFAULT
CFLAGS += -DIN_LIBGCC2
This is same as "gcc/Makefile" generated by configure script.
5. Remove "libgcc_r" from "Makefile.inc1" and "gnu/lib/Makefile".
1 for "Native" and "Ports"
2-5 for "Native" only
P.S.
No need of my PR/23002 because of this PR. Please remove it.
See my PR/19327 for a.out and I hope to commit it together.
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200012171652.eBHGqCf10642>
