head	1.15;
access;
symbols
	netbsd-11-0-RC4:1.15
	netbsd-11-0-RC3:1.15
	netbsd-11-0-RC2:1.15
	netbsd-11-0-RC1:1.15
	perseant-exfatfs-base-20250801:1.15
	netbsd-11:1.15.0.10
	netbsd-11-base:1.15
	netbsd-10-1-RELEASE:1.15
	perseant-exfatfs-base-20240630:1.15
	perseant-exfatfs:1.15.0.8
	perseant-exfatfs-base:1.15
	netbsd-8-3-RELEASE:1.14
	netbsd-9-4-RELEASE:1.14
	netbsd-10-0-RELEASE:1.15
	netbsd-10-0-RC6:1.15
	netbsd-10-0-RC5:1.15
	netbsd-10-0-RC4:1.15
	netbsd-10-0-RC3:1.15
	netbsd-10-0-RC2:1.15
	netbsd-10-0-RC1:1.15
	netbsd-10:1.15.0.6
	netbsd-10-base:1.15
	netbsd-9-3-RELEASE:1.14
	cjep_sun2x-base1:1.15
	cjep_sun2x:1.15.0.4
	cjep_sun2x-base:1.15
	cjep_staticlib_x-base1:1.15
	netbsd-9-2-RELEASE:1.14
	cjep_staticlib_x:1.15.0.2
	cjep_staticlib_x-base:1.15
	netbsd-9-1-RELEASE:1.14
	phil-wifi-20200421:1.14
	phil-wifi-20200411:1.14
	is-mlppp:1.14.0.20
	is-mlppp-base:1.14
	phil-wifi-20200406:1.14
	netbsd-8-2-RELEASE:1.14
	netbsd-9-0-RELEASE:1.14
	netbsd-9-0-RC2:1.14
	netbsd-9-0-RC1:1.14
	phil-wifi-20191119:1.14
	netbsd-9:1.14.0.18
	netbsd-9-base:1.14
	phil-wifi-20190609:1.14
	netbsd-8-1-RELEASE:1.14
	netbsd-8-1-RC1:1.14
	pgoyette-compat-merge-20190127:1.14
	pgoyette-compat-20190127:1.14
	pgoyette-compat-20190118:1.14
	pgoyette-compat-1226:1.14
	pgoyette-compat-1126:1.14
	pgoyette-compat-1020:1.14
	pgoyette-compat-0930:1.14
	pgoyette-compat-0906:1.14
	netbsd-7-2-RELEASE:1.13
	pgoyette-compat-0728:1.14
	netbsd-8-0-RELEASE:1.14
	phil-wifi:1.14.0.16
	phil-wifi-base:1.14
	pgoyette-compat-0625:1.14
	netbsd-8-0-RC2:1.14
	pgoyette-compat-0521:1.14
	pgoyette-compat-0502:1.14
	pgoyette-compat-0422:1.14
	netbsd-8-0-RC1:1.14
	pgoyette-compat-0415:1.14
	pgoyette-compat-0407:1.14
	pgoyette-compat-0330:1.14
	pgoyette-compat-0322:1.14
	pgoyette-compat-0315:1.14
	netbsd-7-1-2-RELEASE:1.13
	pgoyette-compat:1.14.0.14
	pgoyette-compat-base:1.14
	netbsd-7-1-1-RELEASE:1.13
	matt-nb8-mediatek:1.14.0.12
	matt-nb8-mediatek-base:1.14
	perseant-stdc-iso10646:1.14.0.10
	perseant-stdc-iso10646-base:1.14
	netbsd-8:1.14.0.8
	netbsd-8-base:1.14
	prg-localcount2-base3:1.14
	prg-localcount2-base2:1.14
	prg-localcount2-base1:1.14
	prg-localcount2:1.14.0.6
	prg-localcount2-base:1.14
	pgoyette-localcount-20170426:1.14
	bouyer-socketcan-base1:1.14
	pgoyette-localcount-20170320:1.14
	netbsd-7-1:1.13.0.8
	netbsd-7-1-RELEASE:1.13
	netbsd-7-1-RC2:1.13
	netbsd-7-nhusb-base-20170116:1.13
	bouyer-socketcan:1.14.0.4
	bouyer-socketcan-base:1.14
	pgoyette-localcount-20170107:1.14
	netbsd-7-1-RC1:1.13
	pgoyette-localcount-20161104:1.14
	netbsd-7-0-2-RELEASE:1.13
	localcount-20160914:1.14
	netbsd-7-nhusb:1.13.0.6
	netbsd-7-nhusb-base:1.13
	pgoyette-localcount-20160806:1.14
	pgoyette-localcount-20160726:1.14
	pgoyette-localcount:1.14.0.2
	pgoyette-localcount-base:1.14
	netbsd-7-0-1-RELEASE:1.13
	netbsd-7-0:1.13.0.4
	netbsd-7-0-RELEASE:1.13
	gcc-4-8-5-pre-gcc-old-import:1.13
	netbsd-7-0-RC3:1.13
	netbsd-7-0-RC2:1.13
	netbsd-7-0-RC1:1.13
	netbsd-6-0-6-RELEASE:1.6
	netbsd-6-1-5-RELEASE:1.6
	netbsd-7:1.13.0.2
	netbsd-7-base:1.13
	yamt-pagecache-base9:1.12
	yamt-pagecache-tag8:1.5.2.1
	netbsd-6-1-4-RELEASE:1.6
	netbsd-6-0-5-RELEASE:1.6
	tls-earlyentropy:1.12.0.2
	tls-earlyentropy-base:1.13
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.12
	riastradh-drm2-base3:1.12
	imported-to-gcc-old-20140227-0107:1.8
	netbsd-6-1-3-RELEASE:1.6
	netbsd-6-0-4-RELEASE:1.6
	netbsd-6-1-2-RELEASE:1.6
	netbsd-6-0-3-RELEASE:1.6
	netbsd-6-1-1-RELEASE:1.6
	riastradh-drm2-base2:1.7
	riastradh-drm2-base1:1.7
	riastradh-drm2:1.7.0.4
	riastradh-drm2-base:1.7
	netbsd-6-1:1.6.0.8
	netbsd-6-0-2-RELEASE:1.6
	netbsd-6-1-RELEASE:1.6
	netbsd-6-1-RC4:1.6
	netbsd-6-1-RC3:1.6
	agc-symver:1.7.0.6
	agc-symver-base:1.7
	netbsd-6-1-RC2:1.6
	netbsd-6-1-RC1:1.6
	yamt-pagecache-base8:1.7
	netbsd-6-0-1-RELEASE:1.6
	yamt-pagecache-base7:1.7
	matt-nb6-plus-nbase:1.6
	yamt-pagecache-base6:1.7
	netbsd-6-0:1.6.0.6
	netbsd-6-0-RELEASE:1.6
	netbsd-6-0-RC2:1.6
	tls-maxphys:1.7.0.2
	tls-maxphys-base:1.13
	matt-nb6-plus:1.6.0.4
	matt-nb6-plus-base:1.6
	netbsd-6-0-RC1:1.6
	yamt-pagecache-base5:1.7
	yamt-pagecache-base4:1.7
	netbsd-6:1.6.0.2
	netbsd-6-base:1.6
	yamt-pagecache-base3:1.5
	yamt-pagecache-base2:1.5
	yamt-pagecache:1.5.0.2
	yamt-pagecache-base:1.5;
locks; strict;
comment	@# @;


1.15
date	2021.04.25.23.12.54;	author christos;	state Exp;
branches;
next	1.14;
commitid	PQiL6Di09KHLgJQC;

1.14
date	2016.03.15.19.21.27;	author mrg;	state Exp;
branches;
next	1.13;
commitid	W4WgVTfnllxd0MYy;

1.13
date	2014.06.01.19.51.01;	author mrg;	state Exp;
branches;
next	1.12;
commitid	BOTK7lyw6Na69RCx;

1.12
date	2014.03.09.20.59.14;	author mrg;	state Exp;
branches
	1.12.2.1;
next	1.11;
commitid	EGixnXjVu36xe4sx;

1.11
date	2014.03.08.02.02.22;	author mrg;	state Exp;
branches;
next	1.10;
commitid	VP09zAUz8U3xYPrx;

1.10
date	2014.03.08.01.58.11;	author mrg;	state Exp;
branches;
next	1.9;
commitid	WGh8c251ErG5XPrx;

1.9
date	2014.03.01.10.00.31;	author mrg;	state Exp;
branches;
next	1.8;
commitid	ls1VzPCZSNtqQYqx;

1.8
date	2014.02.26.09.54.32;	author mrg;	state Exp;
branches;
next	1.7;
commitid	tog8WsTJJZVqTAqx;

1.7
date	2012.02.28.20.26.07;	author joerg;	state Exp;
branches
	1.7.2.1;
next	1.6;

1.6
date	2011.12.02.22.28.47;	author macallan;	state Exp;
branches;
next	1.5;

1.5
date	2011.07.01.05.07.46;	author mrg;	state Exp;
branches
	1.5.2.1;
next	1.4;

1.4
date	2011.07.01.01.24.53;	author mrg;	state Exp;
branches;
next	1.3;

1.3
date	2011.06.29.01.56.57;	author mrg;	state Exp;
branches;
next	1.2;

1.2
date	2011.06.23.11.47.12;	author mrg;	state Exp;
branches;
next	1.1;

1.1
date	2011.06.21.06.02.25;	author mrg;	state Exp;
branches;
next	;

1.12.2.1
date	2014.08.10.07.10.49;	author tls;	state Exp;
branches;
next	;
commitid	3hJZAsnr6L0lHMLx;

1.7.2.1
date	2014.08.19.23.56.36;	author tls;	state Exp;
branches;
next	;
commitid	jTnpym9Qu0o4R1Nx;

1.5.2.1
date	2012.04.17.00.04.17;	author yamt;	state Exp;
branches;
next	1.5.2.2;

1.5.2.2
date	2014.05.22.16.53.13;	author yamt;	state Exp;
branches;
next	;
commitid	v7BzuaTHWIjEuyBx;


desc
@@


1.15
log
@Add support for mipsn64 targets which build 64 bit binaries by default
on instead of n32
@
text
@#	$NetBSD: Makefile,v 1.14 2016/03/15 19:21:27 mrg Exp $

REQUIRETOOLS=	yes
NOLINT=		# defined
UNSUPPORTED_COMPILER.clang=	# defined

.include <bsd.init.mk>

# If using an external toolchain, we expect crtbegin/crtend to be
# supplied by that toolchain's run-time support.
.if !defined(EXTERNAL_TOOLCHAIN) && ${MKGCC} != "no"

DIST=		${GCCDIST}
GNUHOSTDIST=	${DIST}
GCCARCH=	${.CURDIR}/../../usr.bin/gcc/arch/${MACHINE_ARCH}

GALLCFLAGS=	${G_CRTSTUFF_CFLAGS} ${G_CRTSTUFF_T_CFLAGS}

CPPFLAGS+=	-I${GCCARCH} ${GALLCFLAGS:M-D*} ${GALLCFLAGS:M-I*:N-I.*}
CPPFLAGS+=	-I. -I${DIST}/libgcc -I${DIST}/gcc -I${DIST}/include
CPPFLAGS+=	-DIN_GCC
COPTS+=		-finhibit-size-directive \
		-fno-inline \
		-fno-exceptions \
		-fno-zero-initialized-in-bss \
		-fno-toplevel-reorder \
		-fno-tree-vectorize \
		-fno-omit-frame-pointer \
		-fno-asynchronous-unwind-tables

GCFLAGS=	${GALLCFLAGS:N-D*:N-I*:N-i*:N./*}

DPSRCS+=	${.CURDIR}/arch/${MACHINE_ARCH}.mk tconfig.h

.include "${.CURDIR}/arch/${MACHINE_ARCH}.mk"

SRCS+=		crtbegin.c crtend.c
OBJS+=		crtbegin.o crtend.o
.if ${MKPIC} != "no"
SRCS+=		crtbeginS.c crtendS.c
OBJS+=		crtbeginS.o crtendS.o	# for shared libraries
CPPFLAGS.crtbeginS.o+=	-fPIC -DPIC
CPPFLAGS.crtendS.o+=	-fPIC -DPIC
SRCS+=		crtbeginT.c
OBJS+=		crtbeginT.o		# for -static links
.endif

realall: ${OBJS}

FILES=${OBJS}
FILESDIR=${LIBDIR}

.PATH: ${DIST}/libgcc ${DIST}/libgcc/config

.include "../Makefile.tconfigh"
EXTRA_FAKEHEADERS= options.h libgcc_tm.h
.include "../Makefile.hacks"

${OBJS}: ${DPSRCS}

.include <bsd.prog.mk>

# Override the default .c -> .o rule.
.c.o:
	${_MKTARGET_COMPILE}
	${CC} ${CPPFLAGS} ${CPPFLAGS.${.TARGET}} ${GCFLAGS} ${COPTS} ${COPTS.${.TARGET}} ${CPUFLAGS} -c ${.IMPSRC} -o ${.TARGET}.o
	mv ${.TARGET}.o ${.TARGET}

.if ${MACHINE_MIPS64}
# Turn off as(1) warnings on MIPS, since warnings are fatal with WARNS>0
# and GCC configury passes -finhibit-size-directive which causes mips-gas
# to barf.  Don't know what the real fix for this is...
#
# XXX should be COPTS, but that's too early
CPUFLAGS+=-Wa,--no-warn
.endif

.else

.include <bsd.prog.mk>			# do nothing

.endif	# ! EXTERNAL_TOOLCHAIN && MKGCC != no
@


1.14
log
@fix the path for $GCCARCH.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.13 2014/06/01 19:51:01 mrg Exp $
d69 1
a69 1
.if (${MACHINE_ARCH} == "mips64eb") || (${MACHINE_ARCH} == "mips64el")
@


1.13
log
@port over 3 changes made here in the GCC 4.5 tree that we'll need
when GCC 4.8 becomes "gcc.old" eventually.

this tree still needs to be tested for more, but this should be the
bulk of the work.

----
Log Message:
prepare for moving GCC 4.5 into gcc.old:

- convert to using ${EXTERNAL_GCC_SUBDIR}
- define base-external-gpl3-gcc* subdir as GCC_SUBDIR
- use <bsd.init.mk> over <bsd.own.mk> for a bunch of places; mostly
  because it arranges for ../Makefile.inc to be included earlier, and
  don't bother including the latter if the former is already included.
- move all .PATH: settings after <bsd.{own,lib}.mk> so that all
  valid variables are set before it is evaluated
- rename mknative-gcc* to match their subdir name.

XXX the relationship between the Makefile.inc/Makefile.gcc_path files
    is kind of sketchy, it would be great if this was fixed.

----
Log Message:
oops, avoid re-setting DIST to something that might be wrong now.

----
Log Message:
fix another dated DIST.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.12 2014/03/09 20:59:14 mrg Exp $
d15 1
a15 1
GCCARCH=	${EXTERNAL_GCC_SUBDIR}/usr.bin/gcc/arch/${MACHINE_ARCH}
@


1.12
log
@find libgcc sources for GCC 4.8.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.11 2014/03/08 02:02:22 mrg Exp $
d7 1
a7 1
.include <bsd.own.mk>
d13 1
a13 1
DIST=		${NETBSDSRCDIR}/external/gpl3/gcc/dist
d15 1
a15 1
GCCARCH=	${NETBSDSRCDIR}/external/gpl3/gcc/usr.bin/gcc/arch/${MACHINE_ARCH}
@


1.12.2.1
log
@Rebase.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.13 2014/06/01 19:51:01 mrg Exp $
d7 1
a7 1
.include <bsd.init.mk>
d13 1
a13 1
DIST=		${GCCDIST}
d15 1
a15 1
GCCARCH=	${EXTERNAL_GCC_SUBDIR}/usr.bin/gcc/arch/${MACHINE_ARCH}
@


1.11
log
@create a fake libgcc_tm.h.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.10 2014/03/08 01:58:11 mrg Exp $
d20 2
a21 1
CPPFLAGS+=	-I. -I${DIST}/libgcc
d53 1
a53 1
.PATH: ${DIST}/gcc ${DIST}/gcc/config ${G_CONFIGDIR}
@


1.10
log
@crtstuff.c moved into libgcc.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.9 2014/03/01 10:00:31 mrg Exp $
d55 1
a55 1
EXTRA_FAKEHEADERS= options.h
@


1.9
log
@merge GCC 4.8 build.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.6 2011/12/02 22:28:47 macallan Exp $
d20 1
a20 1
CPPFLAGS+=	-I.
@


1.8
log
@prepare for moving GCC 4.5 into gcc.old:

- convert to using ${EXTERNAL_GCC_SUBDIR}
- define base-external-gpl3-gcc* subdir as GCC_SUBDIR
- use <bsd.init.mk> over <bsd.own.mk> for a bunch of places; mostly
  because it arranges for ../Makefile.inc to be included earlier, and
  don't bother including the latter if the former is already included.
- move all .PATH: settings after <bsd.{own,lib}.mk> so that all
  valid variables are set before it is evaluated
- rename mknative-gcc* to match their subdir name.

XXX the relationship between the Makefile.inc/Makefile.gcc_path files
    is kind of sketchy, it would be great if this was fixed.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.7 2012/02/28 20:26:07 joerg Exp $
d7 1
a7 1
.include <bsd.init.mk>
d13 1
a13 1
DIST=		${GCCDIST}
d15 1
a15 1
GCCARCH=	${EXTERNAL_GCC_SUBDIR}/usr.bin/gcc/arch/${MACHINE_ARCH}
@


1.7
log
@Don't use clang here.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.6 2011/12/02 22:28:47 macallan Exp $
d7 1
a7 1
.include <bsd.own.mk>
d13 1
a13 1
DIST=		${NETBSDSRCDIR}/external/gpl3/gcc/dist
d15 1
a15 1
GCCARCH=	${NETBSDSRCDIR}/external/gpl3/gcc/usr.bin/gcc/arch/${MACHINE_ARCH}
@


1.7.2.1
log
@Rebase to HEAD as of a few days ago.
@
text
@d1 1
a1 1
#	$NetBSD$
d7 1
a7 1
.include <bsd.init.mk>
d13 1
a13 1
DIST=		${GCCDIST}
d15 1
a15 1
GCCARCH=	${EXTERNAL_GCC_SUBDIR}/usr.bin/gcc/arch/${MACHINE_ARCH}
d20 1
a20 2
CPPFLAGS+=	-I. -I${DIST}/libgcc -I${DIST}/gcc -I${DIST}/include
CPPFLAGS+=	-DIN_GCC
d52 1
a52 1
.PATH: ${DIST}/libgcc ${DIST}/libgcc/config
d55 1
a55 1
EXTRA_FAKEHEADERS= options.h libgcc_tm.h
@


1.6
log
@actually pass $COPTS to the compiler
ok mrg@@
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.5 2011/07/01 05:07:46 mrg Exp $
d5 1
@


1.5
log
@declare options.h as an EXTRA_FAKE_HEADERS.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.4 2011/07/01 01:24:53 mrg Exp $
d64 1
a64 1
	${CC} ${CPPFLAGS} ${CPPFLAGS.${.TARGET}} ${GCFLAGS} ${CPUFLAGS} -c ${.IMPSRC} -o ${.TARGET}.o
@


1.5.2.1
log
@sync with head
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.5 2011/07/01 05:07:46 mrg Exp $
a4 1
UNSUPPORTED_COMPILER.clang=	# defined
d64 1
a64 1
	${CC} ${CPPFLAGS} ${CPPFLAGS.${.TARGET}} ${GCFLAGS} ${COPTS} ${COPTS.${.TARGET}} ${CPUFLAGS} -c ${.IMPSRC} -o ${.TARGET}.o
@


1.5.2.2
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.5.2.1 2012/04/17 00:04:17 yamt Exp $
d20 1
a20 2
CPPFLAGS+=	-I. -I${DIST}/libgcc -I${DIST}/gcc -I${DIST}/include
CPPFLAGS+=	-DIN_GCC
d52 1
a52 1
.PATH: ${DIST}/libgcc ${DIST}/libgcc/config
d55 1
a55 1
EXTRA_FAKEHEADERS= options.h libgcc_tm.h
@


1.4
log
@consolidate unwind.h and other hacks into a new Makefile.hacks that
everyone else can use
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.3 2011/06/29 01:56:57 mrg Exp $
d54 1
@


1.3
log
@consolidate the tconfig.h generation.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.2 2011/06/23 11:47:12 mrg Exp $
d54 1
a54 8

# these aren't necessary but are #include'd
FAKEHEADERS=options.h insn-flags.h insn-constants.h
${FAKEHEADERS}:
	${_MKTARGET_CREATE}
	touch ${.TARGET}
DPSRCS+=	${FAKEHEADERS}
CLEANFILES+=	${FAKEHEADERS}
@


1.2
log
@fix a bunch of paths to look in the right places for gcc 4.5.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.1 2011/06/21 06:02:25 mrg Exp $
d20 8
a31 1
CLEANFILES+=	cs-tconfig.h tconfig.h
d40 2
d53 1
a53 6
tconfig.h:
	${_MKTARGET_CREATE}
	TM_DEFINES="$(G_tm_defines)" \
	HEADERS="$(G_xm_file)" XM_DEFINES="$(G_xm_defines)" \
	TARGET_CPU_DEFAULT="" \
	${HOST_SH} $(GNUHOSTDIST)/gcc/mkconfig.sh tconfig.h
d70 1
a70 1
	${CC} ${CPPFLAGS} ${GCFLAGS} ${CPUFLAGS} -c ${.IMPSRC} -o ${.TARGET}.o
@


1.1
log
@*sigh* move these files into the directories i meant for them to exist in.
start actually porting to gcc 4.5 in the process.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.1.1.1 2011/06/21 02:48:27 mrg Exp $
d12 1
a12 1
DIST=		${NETBSDSRCDIR}/gnu/dist/gcc4
d14 1
a14 1
GCCARCH=	${NETBSDSRCDIR}/gnu/usr.bin/gcc4/arch/${MACHINE_ARCH}
@

