diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2013-05-18 18:18:22 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2013-05-18 18:18:22 +0000 |
commit | 3c3c4d030b8b5c68cf9a50961ecbd732d9ddb51d (patch) | |
tree | fe84da9dc80bb4d23c0cd609e499175232255367 /gnu | |
parent | 637af66958761c6b5e3a78f334fe7f41994b09d5 (diff) |
Build and install libgcov on gcc 4 platforms. Build machinery from FreeBSD.
This makes gcc -fprofile-arcs work again.
Regression reported by Azwaw OUSADOU on tech@, thanks for noticing and sorry
for the delay fixing this.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/cc/Makefile | 3 | ||||
-rw-r--r-- | gnu/usr.bin/cc/libgcov/Makefile | 87 |
2 files changed, 89 insertions, 1 deletions
diff --git a/gnu/usr.bin/cc/Makefile b/gnu/usr.bin/cc/Makefile index ff1b94503ab..67e41d9f378 100644 --- a/gnu/usr.bin/cc/Makefile +++ b/gnu/usr.bin/cc/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/gnu/usr.bin/cc/Makefile,v 1.41.8.1 2009/04/15 03:14:26 kensmith Exp $ -# $OpenBSD: Makefile,v 1.1 2009/10/15 20:50:19 robert Exp $ +# $OpenBSD: Makefile,v 1.2 2013/05/18 18:18:21 miod Exp $ .include <bsd.own.mk> @@ -13,6 +13,7 @@ SUBDIR+= cc1plus c++ c++filt SUBDIR+= cc1obj SUBDIR+= gcov SUBDIR+= libgcc +SUBDIR+= libgcov SUBDIR+= collect2 .include <bsd.subdir.mk> diff --git a/gnu/usr.bin/cc/libgcov/Makefile b/gnu/usr.bin/cc/libgcov/Makefile new file mode 100644 index 00000000000..c7d577786f4 --- /dev/null +++ b/gnu/usr.bin/cc/libgcov/Makefile @@ -0,0 +1,87 @@ +# $FreeBSD: src/gnu/lib/libgcov/Makefile,v 1.6 2009/06/21 01:54:47 kan Exp $ +# $OpenBSD: Makefile,v 1.1 2013/05/18 18:18:21 miod Exp $ + +.include <bsd.own.mk> + +GCCLIB= ${.CURDIR}/../../../gcc +GCCDIR= ${GCCLIB}/gcc + +.include "../Makefile.tgt" + +.if defined(CROSSDIR) +LD=${CROSSDIR}/usr/${GCC_TARGET}/bin/ld +RANLIB=${CROSSDIR}/usr/${GCC_TARGET}/bin/ranlib +.endif + +.if defined(CROSS_TARGET) +#Building cc for target, CC should already be the cross compiler +.elif ${.OBJDIR} != ${.CURDIR} +CC=${.OBJDIR}/../cc/cc -B ${.OBJDIR}/../cc1 +.else +CC=${.CURDIR}/../cc/cc -B ${.CURDIR}/../cc1 +.endif + +.include "${.CURDIR}/../Makefile.ver" + +LIB= gcov +NOPROFILE= Yes +NOPIC= Yes + +.include "${.CURDIR}/../Makefile.tgt" + +.PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR} + +CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED +CFLAGS+= -D_PTHREADS -DGTHREAD_USE_WEAK +CFLAGS+= -I${.CURDIR}/../../usr.bin/cc/cc_tools \ + -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. + +# Library members defined in libgcov.c. +# Defined in libgcov.c, included only in gcov library +SYMS = _gcov _gcov_merge_add _gcov_merge_single _gcov_merge_delta \ + _gcov_fork _gcov_execl _gcov_execlp _gcov_execle \ + _gcov_execv _gcov_execvp _gcov_execve \ + _gcov_interval_profiler _gcov_pow2_profiler _gcov_one_value_profiler + +OBJS= ${SYMS:S/$/.o/} +OBJS_T= ${SYMS:S/$/.o/} +OBJS_P= ${SYMS:S/$/.po/} +OBJS_S= ${SYMS:S/$/.So/} + +#----------------------------------------------------------------------- +# +# Helpful shortcuts for compiler invocations. +# +#HIDE = -fvisibility=hidden -DHIDE_EXPORTS +CC_T = ${CC} -c ${CFLAGS} ${HIDE} -fPIC +CC_P = ${CC} -c ${CFLAGS} ${HIDE} -p -fPIC +CC_S = ${CC} -c ${CFLAGS} ${PICFLAG} -DSHARED + +#----------------------------------------------------------------------- +# +# Generated headers +# +COMMONHDRS= tm.h tconfig.h gcov-iov.h options.h + +${COMMONHDRS}: ${.CURDIR}/../cc_tools/Makefile + ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET} + +CLEANFILES += ${COMMONHDRS} +CLEANFILES += cs-*.h option* + +${OBJS} beforedepend: ${COMMONHDRS} + +${OBJS_T}: libgcov.c + ${CC_T} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} + +.if !defined(NOPIC) +${OBJS_S}: libgcov.c + ${CC_S} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} +.endif + +.if !defined(NOPROFILE) +${OBJS_P}: libgcov.c + ${CC_P} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} +.endif + +.include <bsd.lib.mk> |