From owner-freebsd-bugs Sun Dec 17 9: 0: 6 2000 From owner-freebsd-bugs@FreeBSD.ORG Sun Dec 17 09:00:01 2000 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id D00D637B402 for ; Sun, 17 Dec 2000 09:00:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id eBHH01U11293; Sun, 17 Dec 2000 09:00:01 -0800 (PST) (envelope-from gnats) Resent-Date: Sun, 17 Dec 2000 09:00:01 -0800 (PST) Resent-Message-Id: <200012171700.eBHH01U11293@freefall.freebsd.org> Resent-From: gnats-admin@FreeBSD.org (GNATS Management) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: gnats-admin@FreeBSD.org, yakisoba@f2.dion.ne.jp Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id CABCE37B400 for ; Sun, 17 Dec 2000 08:52:12 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id eBHGqCf10642; Sun, 17 Dec 2000 08:52:12 -0800 (PST) (envelope-from nobody) Message-Id: <200012171652.eBHGqCf10642@freefall.freebsd.org> Date: Sun, 17 Dec 2000 08:52:12 -0800 (PST) From: yakisoba@f2.dion.ne.jp Sender: nobody@FreeBSD.org To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: gnu/23598: Merge libgcc_r with libgcc Resent-Sender: gnats@FreeBSD.org Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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