Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Mar 2012 10:51:52 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-questions@freebsd.org
Subject:   Re: on purpose or forgotten ? hardcoded compiler in basesystem-makefiles
Message-ID:  <4F549AC8.4030305@infracaninophile.co.uk>
In-Reply-To: <4F54919A.6050108@Haakh.de>
References:  <4F54919A.6050108@Haakh.de>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigC290EDA2F25A9BF2298A47FF
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

On 05/03/2012 10:12, Dr. A. Haakh wrote:
> a quick search revealed following usages:

Some of the instances you've found are legitimate, some are in upstream
code in contributed software -- the FreeBSD build process may not even
use the Makefiles concerned.  But, yes on the whole, I think you're on
to something that needs fixing here.

> FreeBSD abaton.Haakh.de 9.0-STABLE FreeBSD 9.0-STABLE #0: Wed Feb 29
> 13:49:36 CET 2012     toor@abaton.Haakh.de:/usr/obj/usr/src/sys/ABATON =

> i386
>=20
> ah@abaton:~$ find /usr/src/ -name Makefile\* -exec egrep
> '^[[:blank:]]+[gc+]{2,3}[[:blank:]]+..' {} \; -print

[...]

> /usr/src/usr.bin/make/Makefile.dist
>         gcc -M $(CFLAGS) $(SRC) >> Makefile.tmp

Although it doesn't seem to appear in the clang(1) man page, clang
supports the -M flag:

lucid-nonsense:/tmp:# clang -M hello.c
hello.o: hello.c /usr/include/stdio.h /usr/include/sys/cdefs.h \
  /usr/include/sys/_null.h /usr/include/sys/_types.h \
  /usr/include/machine/_types.h

No need for this sort of construct to be gcc specific.

> /usr/src/tools/test/dtrace/Makefile
>     c++ -o $@ $< -lpthread

Not sure about this -- the intent may be to test the default system
compiler -- as of this last weekend you can install clang(1) as
/usr/bin/cc in stable/9, so this isn't necessarily gcc specific.

> /usr/src/tools/regression/pthread/unwind/Makefile
>     gcc -c -o elftls.o ${.CURDIR}/elftls.S
>     gcc -c -o tls-test.o ${.CURDIR}/tls-test-lib.c
>     gcc $(CFLAGS) -rdynamic -o ttls3 ${.CURDIR}/tls-test.c

Whereas this looks like an oversight to me.

> /usr/src/crypto/openssl/demos/engines/ibmca/Makefile
>     cc -I../../include divtest.c -o divtest ../../libcrypto.a
>     cc -g -I../../include bnbug.c -o bnbug ../../libcrypto.a
>     gcc -I../../include -g2 -ggdb -o exptest exptest.c ../../libcrypto.=
a
>     gcc -I.. -g div.c ../../libcrypto.a

/usr/src/crypto holds raw sources imported from upstream; hard-coded
compiler names here is a problem the openssl project should address.

> /usr/src/contrib/ncurses/Makefile.os2
>     g++ -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION)
>     g++ -o $@ paranoia.o real.o $(LIBIBERTY)

Ditto /usr/src/contrib -- raw upstream sources.

> /usr/src/contrib/gcc/Makefile.in
>     gcc -o asyncwatch asyncwatch.c ${CFLAGS}
>     gcc -o devinfo devinfo.c ${CFLAGS}
>     gcc -o device_list device_list.c  ${CFLAGS}
>     gcc -o rc_pingpong rc_pingpong.c pingpong.c ${CFLAGS}
>     gcc -o srq_pingpong srq_pingpong.c pingpong.c ${CFLAGS}

=2E.. although gcc being hardwired in the gcc sources is probably
intentional and quite legitimate.

I suggest that you repost your question on freebsd-hackers@freebsd.org,
as that will bring it to the attention of the people both interested in
and capable of addressing this sort of problem.  Submitting a PR
wouldn't go amiss either.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew@infracaninophile.co.uk               Kent, CT11 9PW


--------------enigC290EDA2F25A9BF2298A47FF
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9UmtAACgkQ8Mjk52CukIwL1ACglEAniZtfy/PLnDiW2mloP3XC
hZEAn2ZVyAZKnW5DBrFYbbJTnS0INetb
=q+Xb
-----END PGP SIGNATURE-----

--------------enigC290EDA2F25A9BF2298A47FF--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F549AC8.4030305>