public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeffrey A Law <law@cygnus.com>
To: Teemu Torma <tot@trema.com>
Cc: Neal Becker <neal@ctd.comsat.com>, egcs@cygnus.com
Subject: Re: A patch for hppa1.1-hp-hpux10.20 w/ --enable-shared
Date: Wed, 03 Dec 1997 15:32:00 -0000	[thread overview]
Message-ID: <10535.881177357@cygnus.com> (raw)
In-Reply-To: <199712031633.RAA04897@baht.labs.trema.com>

  In message < 199712031633.RAA04897@baht.labs.trema.com >you write:
  >     From:  Neal Becker <neal@ctd.comsat.com>
  >     Date:  03 Dec 1997 11:23:30 -0500
  > 
  >     Actually, gcc-2.7.2.2 has this in the specs:
  >     
  >     *libgcc:
  >     %{!shared:-lgcc}
  >     
  >     which I guess is the same thing change you're recommending to egcs.
  >     Well it's been working fine for gcc-2.7.2.2, so I guess this is the
  >     Right Thing To Do.
  >     
  > Yes, that was the default in 2.7.2, and seems to have been changed
  > at Dec 4 1995 according to ChangeLog.10.
You have to link with libgcc when building a shared library so that hte
shared library has copies of any libgcc2 functions it may need.

Consider what happens if you build a shared library with gcc which needs
__muldi3 (64bit multiply from libgcc2).

If you don't link in libgcc, then the library has an undefined reference to
__muldi3.

Then consider what happens if a user tries to compile a program with "cc"
which links against the dynamic library with the undefined reference to
__muldi3.  The won't be any definition of __muldi3 available, and the program
will likely fail.

It's also possible to construct scenarios which involve only gcc compiled
code -- for example, consider the same library with an undefined reference
to __muldi3.

Then assume that the library is loaded at runtime via shl_load/dl_open call;
if the main program didn't reference __muldi3, then no definition of
__muldi3 is available and the program will likely fail.

The basic conclusion is the compilre must include any intrinsics in the 
shared library which are used by the shared library.  HP found this out the
hard way with their millicode routines, we shouldn't make the same mistake.

Jeff

  reply	other threads:[~1997-12-03 15:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-03  4:08 Teemu Torma
1997-12-03  6:21 ` Neal Becker
1997-12-03  8:23 ` Neal Becker
1997-12-03 10:32   ` Teemu Torma
1997-12-03 15:32     ` Jeffrey A Law [this message]
1997-12-03 12:54       ` Neal Becker
1997-12-03 12:54         ` Jeffrey A Law
1997-12-04  1:30       ` Teemu Torma
     [not found] ` <u967p6o0ot.fsf.cygnus.egcs@neal.ctd.comsat.com>
1997-12-03 12:54   ` Jason Merrill

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=10535.881177357@cygnus.com \
    --to=law@cygnus.com \
    --cc=egcs@cygnus.com \
    --cc=neal@ctd.comsat.com \
    --cc=tot@trema.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).