mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Samuelson <peter@cadcamlab.org>
To: kbuild-devel <kbuild-devel@lists.sourceforge.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [kbuild] Possibility to sanely link against off-directory .so
Date: Thu, 7 Nov 2002 12:52:06 -0600	[thread overview]
Message-ID: <20021107185206.GQ4182@cadcamlab.org> (raw)
In-Reply-To: <20021107152454.GH5219@pasky.ji.cz>


[Petr Baudis]
> I'm a bit lost here - the kernel uses tons of gcc extensions - how is
> another compiler supposed to understand them? And if it is
> specifically extended to understand them, isn't it likely that it'll
> understand the -shared switch in gcc-like way as well?

There is a difference between $(CC) and $(HOSTCC).  We have both of
them for a reason.  $(CC) specifies the compiler used to build the
kernel - it may or may not be your regular system compiler.  It can
even be for another architecture - for example, it may produce PowerPC
object files from the comfort (?) of your x86 PC.

$(HOSTCC) is specifically to build executables that are to run *on* the
build system itself - kconfig, for example.  If you're running on x86
and building a PowerPC kernel, you need an x86 version of kconfig, not
a PowerPC version.

So $(CC) *must* be a gcc (or a convincing facsimile) - but $(HOSTCC)
can be *any* C compiler on your system.  I don't think anyone tries to
use any gcc extensions with $(HOSTCC).

> And how likely is situation when someone want to configure a kernel
> with non-gcc compiler and actually build it with gcc?

Not very likely, but you take a lot for granted.  On many combinations
of Unix + gcc versions, `gcc -shared' doesn't work until you spend half
a day hand-tweaking the specs file whilst poring over the obscure flags
section of the `ld' manpage.  Try it for gcc 2.95 on AIX sometime, for
a bit of good clean fun.

My point was and is that while shared libraries are a (relative!)
breeze on Linux, they have always been a horrible portability headache;
furthermore, the kernel build system doesn't need them and ought to do
without.

Peter

      parent reply	other threads:[~2002-11-07 18:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-06 18:52 Petr Baudis
2002-11-06 21:29 ` Sam Ravnborg
2002-11-06 22:03   ` Petr Baudis
2002-11-07 10:00     ` Peter Samuelson
2002-11-07 10:57       ` Roman Zippel
2002-11-07 11:47         ` Peter Samuelson
2002-11-07 12:09           ` Roman Zippel
2002-11-07 12:37             ` Peter Samuelson
2002-11-07 13:04               ` Roman Zippel
2002-11-07 13:22                 ` Peter Samuelson
2002-11-07 13:45                   ` Roman Zippel
2002-11-07 13:59                     ` Peter Samuelson
2002-11-07 15:24                   ` Petr Baudis
2002-11-07 16:20                     ` [kbuild-devel] " Kenn Humborg
2002-11-07 18:52                     ` Peter Samuelson [this message]

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=20021107185206.GQ4182@cadcamlab.org \
    --to=peter@cadcamlab.org \
    --cc=kbuild-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®