on purpose or forgotten ? hardcoded compiler in basesystem-makefiles

Matthew Seaman m.seaman at infracaninophile.co.uk
Mon Mar 5 10:52:05 UTC 2012


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 at abaton.Haakh.de:/usr/obj/usr/src/sys/ABATON 
> i386
> 
> ah at 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}

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

I suggest that you repost your question on freebsd-hackers at 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

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20120305/3ceaaffe/signature.pgp


More information about the freebsd-questions mailing list