public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@redhat.com>
To: Mark Mitchell <mark@codesourcery.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Installation proposal
Date: Wed, 27 Feb 2002 17:47:00 -0000	[thread overview]
Message-ID: <ord6yqe5wr.fsf@free.redhat.lsd.ic.unicamp.br> (raw)
In-Reply-To: Mark Mitchell's message of "Wed, 27 Feb 2002 09:56:28 -0800"

On Feb 27, 2002, Mark Mitchell <mark@codesourcery.com> wrote:

> 1. Create a subdirectory of the objdir called "install".

> 2. Treat install as if it were the final prefix during building --
>    put everything in there.  That means that there will be directories
>    like "install/bin", "install/lib", and so forth.  So, "make" would
>    just drop everything in these directories.

> 3. At install time, run a single script which copies everything in
>    install into prefix.

This will change the requirements imposed on exec_prefix.  According
to the GNU Coding Standards, the user should be able to modify prefix
and exec_prefix at install time.  Currently, GCC already fails to
follow this recommentation: it depends on exec_prefix being a
sub-directory of prefix, and on the relative pathname from exec_prefix
to prefix not changing from build to install time.  By doing an
installation with something as simple as cp -R or the tar or cpio
equivalents, you lose the ability to modify exec_prefix at all, even
if it follows the current requirements.

Not that I find this extremely important, but I thought I point it out
so that we may a conscious decision regarding breaking backward
compatibility with a feature that probably nobody uses (namely
exec_prefix from $prefix/foo at build time to $prefix/bar at install
time).

> 3. We would test that our installations are really location-independent,
>    which they supposedly are.

Not really.  At least not cross toolchains that use a shared glibc as
the C library, because glibc's libc.so is a linker script that
references full pathnames into the install tree.  Yet another problem
about which we must make a conscious decision.

> We can just have the top-level configure set the prefix for all of the
> child configures to "install".

And now you can't move your build tree any longer (because prefix has
to be a full pathname; relative pathnames are not rejected outright as
they should, but they don't work).

Also, you don't want to have installed programs looking for stuff in
the build tree; that's a security threat.  But that's what you'll get
if you configure the default prefix as something within the build
tree.  Also, on a number of some systems, when you don't specify
dynamic search paths when linking an executable or a shared library,
they'll use -L flags or the location of libraries at build time as the
default search path for libraries which, again, is a security threat.

Modifying the configured prefix is an absolute no-no.  Doing a DESTDIR
install is definitely a much saner approach, even though it doesn't
totally defeat the security threat related with default search paths.
To do that, you have to use different linking flags on different
platforms, when building both libraries and executables linking with
them, and you sometimes have to resort to relinking at install time,
as I wrote in another message in this thread.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

  parent reply	other threads:[~2002-02-28  1:45 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-27 10:11 Mark Mitchell
2002-02-27 10:25 ` H . J . Lu
2002-02-27 10:26 ` David Edelsohn
2002-02-27 10:59   ` Jim Wilson
2002-02-27 13:05   ` Michael Meissner
2002-02-27 10:50 ` Paul Koning
2002-02-27 11:02 ` Stan Shebs
2002-02-27 11:04 ` Joseph S. Myers
2002-02-27 11:25   ` Mark Mitchell
2002-02-27 12:10     ` Joseph S. Myers
2002-02-27 11:05 ` Joel Sherrill
2002-02-27 11:53   ` Joseph S. Myers
2002-02-27 11:07 ` Tom Tromey
2002-02-27 11:26   ` Mark Mitchell
2002-02-27 14:55   ` Richard Henderson
2002-02-27 17:38     ` Alexandre Oliva
2002-02-27 17:45       ` Richard Henderson
2002-02-27 18:27         ` Alexandre Oliva
2002-02-28  0:04           ` Richard Henderson
2002-02-28  2:02       ` Joseph S. Myers
2002-02-28  2:25         ` Alexandre Oliva
2002-02-27 11:13 ` Laurent Guerby
2002-02-27 12:11   ` Zack Weinberg
2002-02-27 12:17   ` Jim Wilson
2002-02-27 14:43     ` Laurent Guerby
2002-02-27 12:52   ` Neil Booth
2002-02-27 11:18 ` Jim Wilson
2002-02-27 14:56   ` Daniel Jacobowitz
2002-02-27 17:18   ` Mark Mitchell
2002-02-27 17:20     ` Richard Henderson
2002-02-27 17:59       ` Mark Mitchell
     [not found]       ` <mailpost.1014859095.10690@news-sj1-1>
2002-02-27 18:16         ` cgd
2002-02-27 11:23 ` Per Bothner
2002-02-28  1:39   ` Akim Demaille
2002-02-27 14:56 ` Nathan Sidwell
2002-02-27 16:11 ` Loren James Rittle
2002-02-27 17:47 ` Alexandre Oliva [this message]
2002-02-27 18:00   ` Daniel Jacobowitz
2002-02-28 14:06     ` Alexandre Oliva
2002-02-27 18:33   ` Mark Mitchell
2002-02-28  9:18     ` Per Bothner
2002-02-28  9:42       ` Mark Mitchell
2002-02-28  1:13   ` Akim Demaille
2002-02-27 10:48 Mark Mitchell
2002-02-27 11:07 Benjamin Kosnik
2002-02-27 13:22 mike stump
2002-02-28 11:51 mike stump
2002-02-28 12:56 ` Mark Mitchell
2002-02-28 14:04 ` Alexandre Oliva
2002-02-28 14:28   ` Per Bothner
2002-02-28 16:32   ` Richard Henderson

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=ord6yqe5wr.fsf@free.redhat.lsd.ic.unicamp.br \
    --to=aoliva@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=mark@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).