public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Geoffrey Keating <geoffk@geoffk.org>
To: Zack Weinberg <zack@codesourcery.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Darwin assert.h / shared libgcc mess
Date: Mon, 15 Nov 2004 22:42:00 -0000	[thread overview]
Message-ID: <m2brdy21jg.fsf@greed.local> (raw)
In-Reply-To: <87oehyq1km.fsf@codesourcery.com>

Zack Weinberg <zack@codesourcery.com> writes:

> 1) Ship a *correct* assert.h, as a replace-entire-file fixincludes
>    edit, which recognizes the broken Darwin /usr/include/assert.h.  If
>    I can swing it, it will also subsume the buggy
>    broken_assert_{stdio,stdlib} fixes.  This corrected assert.h will
>    continue to use __eprintf.  Alternatively, if people prefer, it
>    could use the more recent convention of __assert, per, eg. FreeBSD
>    /usr/include/assert.h.  (The advantage of this is there aren't
>    copies of the "%s:%d:%s: assertion failed: %s" string constant
>    everywhere that uses assert.)

This sounds like a good idea.  Be sure that the fixincludes only
triggers on the broken assert.h (looking for __eprintf is good enough
on Darwin; or for the absence of __func__).

> 2) Put __eprintf back into the shared libgcc, as an exported symbol,
>    for all !inhibit_libc targets, so that fixincludes can rely on its
>    being there.  (If we instead use __assert, then __eprintf will
>    remain a static-library-only backward compatibility symbol.)

Is this really necessary?  I'd rather have __eprintf linked into only
those apps that need it.

> 3) For the sake of future flexibility, move the hardwired list of
>    static-and-shared functions from mklibgcc.in to the Makefile so
>    that it can be adjusted in t-fragments.
> 
> 4) Add the ability to add a leading underscore to all symbol names to
>    mkmap-flat.awk and mkmap-symver.awk.  Also add the ability to
>    delete symbols from the list, in a target-specific .ver file.
>    Update Darwin and SH target configuration to match, and delete the
>    out-of-sync libgcc-darwin.ver and config/sh/libgcc-std.ver.
> 
> 5) Determine for certain whether or not Darwin ld supports symbol
>    versioning.  Correct t-slibgcc-darwin to use the appropriate mkmap
>    file and to actually apply the map to the generated libgcc.dylib.

The Darwin ld does not support symbol versioning.  You can safely delete
any versioning files for Darwin (so long as it doesn't break the makefiles).

> i) Nudzh the Darwin developers to put __assert in libSystem and
>    provide a correct /usr/include/assert.h (y'all can just copy it
>    from FreeBSD!  Only with attribute noreturn, please).

In Tiger, /usr/include/assert.h will be provided by Libc, not the
compiler, and it will use __assert.

  reply	other threads:[~2004-11-15 22:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-15 21:43 Zack Weinberg
2004-11-15 22:42 ` Geoffrey Keating [this message]
2004-11-16  3:49   ` Zack Weinberg
2004-11-22 22:50     ` Geoff Keating
2004-11-22 23:57       ` Zack Weinberg

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=m2brdy21jg.fsf@greed.local \
    --to=geoffk@geoffk.org \
    --cc=gcc@gcc.gnu.org \
    --cc=zack@codesourcery.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).