Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2001 15:22:35 -0500 (EST)
From:      Robert Watson <rwatson@FreeBSD.ORG>
To:        Lyndon Nerenberg <lyndon@atg.aciworldwide.com>
Cc:        Giorgos Keramidas <charon@labs.gr>, arch@FreeBSD.ORG
Subject:   Re: GNU Compiler Symlinks
Message-ID:  <Pine.NEB.3.96L.1011029151306.39894D-100000@fledge.watson.org>
In-Reply-To: <200110291955.f9TJt40H005077@atg.aciworldwide.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Mon, 29 Oct 2001, Lyndon Nerenberg wrote:

> >>>>> "Giorgos" == Giorgos Keramidas <charon@labs.gr> writes:
> 
>     Giorgos> In that case, I stand corrected :) If the default will be
>     Giorgos> to still make a link cc -> gcc (and all their friends,
>     Giorgos> like c++, etc), then this does not soundn like a bad
>     Giorgos> idea.  Not bad at all.
> 
> Just to clarify, I am not proposing that /usr/bin/c{c,++} be
> changed in any way. What I'm proposing is (example only):
> 
> 
> --- /usr/src/gnu/usr.bin/cc/cc/Makefile    2001/10/29 19:35:26     1.1
> +++ Makefile    2001/10/29 19:40:03
> @@ -5,11 +5,14 @@
>  .PATH: ${GCCDIR}
>  
>  PROG=  cc
> -MAN=   gcc.1
> +MAN=   cc.1

This seems wrong to me.  The man page I get when I look at the current
cc man page is clearly the man page for gcc.

In my view, it should really be:

PROG=	gcc
MAN=	gcc.1
.if defined(GCC_IS_CC)
MLINKS=	cc.1
SYMLINKS=	cc
.endif

But that could just be me.

>  SRCS=  gcc.c gccspec.c
>  
> +.if !defined(NO_GNU_NAMES)
>  LINKS= ${BINDIR}/cc ${BINDIR}/gcc
> -MLINKS=        gcc.1 cc.1 gcc.1 c++.1 gcc.1 g++.1 gcc.1 CC.1
> +MLINKS=        cc.1 gcc.1 cc.1 g++.1
> +.endif
> +MLINKS+= cc.1 CC.1 cc.1 c++.1
>  
>  CFLAGS+= -DDEFAULT_TARGET_VERSION=\"$(version)\"
>  CFLAGS+= -DDEFAULT_TARGET_MACHINE=\"$(target)\"
> 
> 
> NO_GNU_NAMES=true simply disables the creation of links to the
> "GNUish" name variants where the GNU tool is installed as part of the
> base system This appears to only affect the gcc and g++ commands.

This seems backwards.  The GNU tools should be installed with the GNU
names.  Installing as "cc" and "cc.1" should be the optional bit, as you
might want to install an alternative compiler with those names, but retain
gcc since that's what the system is designed to build with.  The option
name should be GNU_CC_NOT_CC or the like.

> A couple of people have mentioned that the gcc name has become a defacto
> standard, so we should just live with it. I don't think that's true. 
> I've run stable for ages without these links, and the only breakage was
> in a couple of ports, and even those have since been fixed. A more
> important reason for removing the links is to help with application
> portability. If you're using FreeBSD as a primary development platform
> for portable applications, not having gratuitous GNUisms (be they names,
> or things like awk extensions) makes life easier.

Generally, my thoughts on this seem to be contrary to yours.  "cc" in my
mind is the name of the default C compiler to use on a system.  gcc is an
instance of a C compiler.  If I use "cc" in a Makefile, I want the
system's default compiler, be it gcc or another.  If I use "gcc" in a
Makefile, I want to us the GNU C compiler.

Interestingly, this is how it's done on the local Linux box, but not on
FreeBSD:

FreeBSD 5.0:
ls -l `which cc` `which gcc`
-r-xr-xr-x  2 root  wheel  131524 Oct 23 17:21 /usr/bin/cc*
-r-xr-xr-x  2 root  wheel  131524 Oct 23 17:21 /usr/bin/gcc*

Redhat 7.1:
ls -l `which cc` `which gcc`
lrwxrwxrwx    1 root     root            3 Aug  7 11:37 /usr/bin/cc -> gcc*
-rwxr-xr-x    2 root     root        79196 Apr  5  2001 /usr/bin/gcc*

Robert N M Watson             FreeBSD Core Team, TrustedBSD Project
robert@fledge.watson.org      NAI Labs, Safeport Network Services


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1011029151306.39894D-100000>