head	1.90;
access;
symbols
	RELENG_8_4:1.89.0.2
	RELENG_9_1_0_RELEASE:1.81.2.2.2.2
	RELENG_9_1:1.81.2.2.0.2
	RELENG_9_1_BP:1.81.2.2
	RELENG_8_3_0_RELEASE:1.66.2.3.2.1
	RELENG_8_3:1.66.2.3.0.2
	RELENG_8_3_BP:1.66.2.3
	RELENG_9_0_0_RELEASE:1.81.2.1.2.1
	RELENG_9_0:1.81.2.1.0.2
	RELENG_9_0_BP:1.81.2.1
	RELENG_9:1.81.0.2
	RELENG_9_BP:1.81
	RELENG_7_4_0_RELEASE:1.58.12.1
	RELENG_8_2_0_RELEASE:1.66.2.2.2.1
	RELENG_7_4:1.58.0.12
	RELENG_7_4_BP:1.58
	RELENG_8_2:1.66.2.2.0.2
	RELENG_8_2_BP:1.66.2.2
	RELENG_8_1_0_RELEASE:1.66.2.1.4.1
	RELENG_8_1:1.66.2.1.0.4
	RELENG_8_1_BP:1.66.2.1
	RELENG_7_3_0_RELEASE:1.58.10.1
	RELENG_7_3:1.58.0.10
	RELENG_7_3_BP:1.58
	RELENG_8_0_0_RELEASE:1.66.2.1.2.1
	RELENG_8_0:1.66.2.1.0.2
	RELENG_8_0_BP:1.66.2.1
	RELENG_8:1.66.0.2
	RELENG_8_BP:1.66
	RELENG_7_2_0_RELEASE:1.58.8.1
	RELENG_7_2:1.58.0.8
	RELENG_7_2_BP:1.58
	RELENG_7_1_0_RELEASE:1.58.6.1
	RELENG_6_4_0_RELEASE:1.54.2.1.6.1
	RELENG_7_1:1.58.0.6
	RELENG_7_1_BP:1.58
	RELENG_6_4:1.54.2.1.0.6
	RELENG_6_4_BP:1.54.2.1
	RELENG_7_0_0_RELEASE:1.58
	RELENG_6_3_0_RELEASE:1.54.2.1
	RELENG_7_0:1.58.0.4
	RELENG_7_0_BP:1.58
	RELENG_6_3:1.54.2.1.0.4
	RELENG_6_3_BP:1.54.2.1
	RELENG_7:1.58.0.2
	RELENG_7_BP:1.58
	RELENG_6_2_0_RELEASE:1.54.2.1
	RELENG_6_2:1.54.2.1.0.2
	RELENG_6_2_BP:1.54.2.1
	RELENG_5_5_0_RELEASE:1.52.2.1
	RELENG_5_5:1.52.2.1.0.4
	RELENG_5_5_BP:1.52.2.1
	RELENG_6_1_0_RELEASE:1.54
	RELENG_6_1:1.54.0.6
	RELENG_6_1_BP:1.54
	RELENG_6_0_0_RELEASE:1.54
	RELENG_6_0:1.54.0.4
	RELENG_6_0_BP:1.54
	RELENG_6:1.54.0.2
	RELENG_6_BP:1.54
	RELENG_5_4_0_RELEASE:1.52.2.1
	RELENG_5_4:1.52.2.1.0.2
	RELENG_5_4_BP:1.52.2.1
	RELENG_4_11_0_RELEASE:1.31.2.2
	RELENG_4_11:1.31.2.2.0.10
	RELENG_4_11_BP:1.31.2.2
	RELENG_5_3_0_RELEASE:1.52
	RELENG_5_3:1.52.0.4
	RELENG_5_3_BP:1.52
	RELENG_5:1.52.0.2
	RELENG_5_BP:1.52
	RELENG_4_10_0_RELEASE:1.31.2.2
	RELENG_4_10:1.31.2.2.0.8
	RELENG_4_10_BP:1.31.2.2
	RELENG_5_2_1_RELEASE:1.50
	RELENG_5_2_0_RELEASE:1.50
	RELENG_5_2:1.50.0.2
	RELENG_5_2_BP:1.50
	RELENG_4_9_0_RELEASE:1.31.2.2
	RELENG_4_9:1.31.2.2.0.6
	RELENG_4_9_BP:1.31.2.2
	RELENG_5_1_0_RELEASE:1.47
	RELENG_5_1:1.47.0.4
	RELENG_5_1_BP:1.47
	RELENG_4_8_0_RELEASE:1.31.2.2
	RELENG_4_8:1.31.2.2.0.4
	RELENG_4_8_BP:1.31.2.2
	RELENG_5_0_0_RELEASE:1.47
	RELENG_5_0:1.47.0.2
	RELENG_5_0_BP:1.47
	RELENG_4_7_0_RELEASE:1.31.2.2
	RELENG_4_7:1.31.2.2.0.2
	RELENG_4_7_BP:1.31.2.2
	RELENG_4_6_2_RELEASE:1.31.2.1
	RELENG_4_6_1_RELEASE:1.31.2.1
	RELENG_4_6_0_RELEASE:1.31.2.1
	RELENG_4_6:1.31.2.1.0.8
	RELENG_4_6_BP:1.31.2.1
	RELENG_4_5_0_RELEASE:1.31.2.1
	RELENG_4_5:1.31.2.1.0.6
	RELENG_4_5_BP:1.31.2.1
	WIP_GCC31:1.34.0.2
	WIP_GCC31_BP:1.34
	RELENG_4_4_0_RELEASE:1.31.2.1
	RELENG_4_4:1.31.2.1.0.4
	RELENG_4_4_BP:1.31.2.1
	RELENG_4_3_0_RELEASE:1.31.2.1
	RELENG_4_3:1.31.2.1.0.2
	RELENG_4_3_BP:1.31.2.1
	BEFORE_GCC_2_95_3:1.31.2.1
	BEFORE_GCC_2_95_3_TEST3:1.34
	RELENG_4_2_0_RELEASE:1.31
	RELENG_4_1_1_RELEASE:1.31
	PRE_SMPNG:1.33
	RELENG_4_1_0_RELEASE:1.31
	RELENG_4_0_0_RELEASE:1.31
	RELENG_4:1.31.0.2
	RELENG_4_BP:1.31
	EGCS_11x:1.29.0.2
	BEFORE_GCC_2_95_1:1.29
	old_RELENG_3_1_0_RELEASE:1.19
	old_RELENG_3:1.19.0.2
	old_RELENG_3_BP:1.19
	old_RELENG_2_2_8_RELEASE:1.13
	old_RELENG_3_0_0_RELEASE:1.18
	old_RELENG_2_2_7_RELEASE:1.13
	old_RELENG_2_2_6_RELEASE:1.13
	old_RELENG_2_2_5_RELEASE:1.13
	old_RELENG_2_2_2_RELEASE:1.13
	old_RELENG_2_2_1_RELEASE:1.13
	old_RELENG_2_2_0_RELEASE:1.13
	old_RELENG_2_1_7_RELEASE:1.8.4.2
	old_RELENG_2_1_6_1_RELEASE:1.8.4.2
	old_RELENG_2_1_6_RELEASE:1.8.4.2
	old_RELENG_2_2:1.13.0.2
	old_RELENG_2_2_BP:1.13
	old_gcc_2_6_3_final:1.10
	old_RELENG_2_1_5_RELEASE:1.8.4.2
	old_RELENG_2_1_0_RELEASE:1.8
	old_RELENG_2_1_0:1.8.0.4
	old_RELENG_2_1_0_BP:1.8
	old_RELENG_2_0_5_RELEASE:1.8
	old_RELENG_2_0_5:1.8.0.2
	old_RELENG_2_0_5_BP:1.8
	old_RELENG_2_0_5_ALPHA:1.8
	old_RELEASE_2_0:1.4
	old_BETA_2_0:1.4
	old_ALPHA_2_0:1.3.0.2
	old_gcc_2_6_0_bmake1:1.1.1.1
	old_gcc_2_6_0_bmake:1.1.1.1
	old_gnu:1.1.1;
locks; strict;
comment	@# @;


1.90
date	2013.04.21.00.46.56;	author svnexp;	state Exp;
branches;
next	1.89;

1.89
date	2013.03.17.04.32.46;	author svnexp;	state Exp;
branches
	1.89.2.1;
next	1.88;

1.88
date	2013.01.18.00.34.55;	author svnexp;	state Exp;
branches;
next	1.87;

1.87
date	2012.12.18.07.29.16;	author svnexp;	state Exp;
branches;
next	1.86;

1.86
date	2012.12.06.01.33.11;	author svnexp;	state Exp;
branches;
next	1.85;

1.85
date	2012.11.17.01.49.07;	author svnexp;	state Exp;
branches;
next	1.84;

1.84
date	2012.05.15.22.47.34;	author marius;	state Exp;
branches;
next	1.83;

1.83
date	2012.04.21.16.02.00;	author imp;	state Exp;
branches;
next	1.82;

1.82
date	2012.03.29.02.54.35;	author jmallett;	state Exp;
branches;
next	1.81;

1.81
date	2011.02.02.03.24.52;	author imp;	state Exp;
branches
	1.81.2.1;
next	1.80;

1.80
date	2011.01.29.10.32.00;	author jchandra;	state Exp;
branches;
next	1.79;

1.79
date	2011.01.27.14.16.12;	author jchandra;	state Exp;
branches;
next	1.78;

1.78
date	2011.01.07.20.26.33;	author imp;	state Exp;
branches;
next	1.77;

1.77
date	2010.12.29.17.12.05;	author kan;	state Exp;
branches;
next	1.76;

1.76
date	2010.11.14.01.50.40;	author imp;	state Exp;
branches;
next	1.75;

1.75
date	2010.11.12.15.52.27;	author ed;	state Exp;
branches;
next	1.74;

1.74
date	2010.11.11.15.48.27;	author ed;	state Exp;
branches;
next	1.73;

1.73
date	2010.11.11.15.24.57;	author ed;	state Exp;
branches;
next	1.72;

1.72
date	2010.11.10.06.39.49;	author imp;	state Exp;
branches;
next	1.71;

1.71
date	2010.07.10.02.29.22;	author nwhitehorn;	state Exp;
branches;
next	1.70;

1.70
date	2010.06.02.11.06.03;	author jmallett;	state Exp;
branches;
next	1.69;

1.69
date	2010.05.12.19.59.32;	author obrien;	state Exp;
branches;
next	1.68;

1.68
date	2010.01.08.23.11.23;	author imp;	state Exp;
branches;
next	1.67;

1.67
date	2009.12.14.01.51.23;	author kan;	state Exp;
branches;
next	1.66;

1.66
date	2009.07.14.21.19.13;	author kan;	state Exp;
branches
	1.66.2.1;
next	1.65;

1.65
date	2009.06.29.01.33.59;	author kan;	state Exp;
branches;
next	1.64;

1.64
date	2009.06.28.23.51.39;	author kan;	state Exp;
branches;
next	1.63;

1.63
date	2009.02.13.16.51.36;	author jkim;	state Exp;
branches;
next	1.62;

1.62
date	2008.09.19.03.09.36;	author imp;	state Exp;
branches;
next	1.61;

1.61
date	2008.09.19.01.35.34;	author imp;	state Exp;
branches;
next	1.60;

1.60
date	2008.09.01.18.46.03;	author obrien;	state Exp;
branches;
next	1.59;

1.59
date	2008.02.24.19.22.52;	author raj;	state Exp;
branches;
next	1.58;

1.58
date	2007.08.14.20.49.57;	author kan;	state Exp;
branches
	1.58.2.1
	1.58.6.1
	1.58.8.1
	1.58.10.1
	1.58.12.1;
next	1.57;

1.57
date	2007.05.19.04.25.55;	author kan;	state Exp;
branches;
next	1.56;

1.56
date	2006.10.12.16.43.15;	author cognet;	state Exp;
branches;
next	1.55;

1.55
date	2006.03.18.21.37.03;	author ru;	state Exp;
branches;
next	1.54;

1.54
date	2004.12.21.09.33.45;	author ru;	state Exp;
branches
	1.54.2.1;
next	1.53;

1.53
date	2004.10.24.15.32.24;	author ru;	state Exp;
branches;
next	1.52;

1.52
date	2004.08.04.03.13.51;	author kan;	state Exp;
branches
	1.52.2.1;
next	1.51;

1.51
date	2004.07.28.05.27.18;	author kan;	state Exp;
branches;
next	1.50;

1.50
date	2003.07.11.05.29.11;	author kan;	state Exp;
branches;
next	1.49;

1.49
date	2003.06.30.19.11.20;	author ru;	state Exp;
branches;
next	1.48;

1.48
date	2003.06.13.22.07.39;	author peter;	state Exp;
branches;
next	1.47;

1.47
date	2002.09.28.00.25.27;	author peter;	state Exp;
branches;
next	1.46;

1.46
date	2002.09.17.01.48.49;	author peter;	state Exp;
branches;
next	1.45;

1.45
date	2002.05.18.09.46.12;	author obrien;	state Exp;
branches;
next	1.44;

1.44
date	2002.05.18.09.21.42;	author phk;	state Exp;
branches;
next	1.43;

1.43
date	2002.05.17.08.59.13;	author peter;	state Exp;
branches;
next	1.42;

1.42
date	2002.05.17.04.18.33;	author obrien;	state Exp;
branches;
next	1.41;

1.41
date	2002.05.17.03.08.15;	author obrien;	state Exp;
branches;
next	1.40;

1.40
date	2002.05.12.14.05.58;	author obrien;	state Exp;
branches;
next	1.39;

1.39
date	2002.05.12.12.44.04;	author obrien;	state Exp;
branches;
next	1.38;

1.38
date	2002.05.10.09.32.39;	author obrien;	state Exp;
branches;
next	1.37;

1.37
date	2002.05.10.08.54.42;	author obrien;	state Exp;
branches;
next	1.36;

1.36
date	2002.04.20.01.27.28;	author obrien;	state Exp;
branches;
next	1.35;

1.35
date	2002.04.05.09.12.25;	author obrien;	state Exp;
branches;
next	1.34;

1.34
date	2001.01.06.06.16.25;	author obrien;	state Exp;
branches
	1.34.2.1;
next	1.33;

1.33
date	2000.06.04.06.56.21;	author obrien;	state Exp;
branches;
next	1.32;

1.32
date	2000.03.23.10.18.23;	author obrien;	state Exp;
branches;
next	1.31;

1.31
date	99.11.17.07.20.27;	author obrien;	state Exp;
branches
	1.31.2.1;
next	1.30;

1.30
date	99.11.15.04.16.17;	author obrien;	state Exp;
branches;
next	1.29;

1.29
date	99.11.15.00.49.35;	author obrien;	state Exp;
branches
	1.29.2.1;
next	1.28;

1.28
date	99.10.03.02.43.18;	author bde;	state Exp;
branches;
next	1.27;

1.27
date	99.08.27.23.32.48;	author peter;	state Exp;
branches;
next	1.26;

1.26
date	99.08.16.04.27.25;	author obrien;	state Exp;
branches;
next	1.25;

1.25
date	99.04.08.08.39.16;	author obrien;	state Exp;
branches;
next	1.24;

1.24
date	99.04.08.08.19.28;	author obrien;	state Exp;
branches;
next	1.23;

1.23
date	99.04.04.20.47.33;	author obrien;	state Exp;
branches;
next	1.22;

1.22
date	99.04.04.20.41.50;	author obrien;	state Exp;
branches;
next	1.21;

1.21
date	99.04.04.16.36.29;	author obrien;	state Exp;
branches;
next	1.20;

1.20
date	99.03.31.06.40.40;	author obrien;	state Exp;
branches;
next	1.19;

1.19
date	99.01.09.21.50.55;	author jdp;	state Exp;
branches;
next	1.18;

1.18
date	98.10.06.11.28.29;	author peter;	state Exp;
branches;
next	1.17;

1.17
date	98.07.08.00.45.50;	author bde;	state Exp;
branches;
next	1.16;

1.16
date	98.03.23.12.23.13;	author bde;	state Exp;
branches;
next	1.15;

1.15
date	97.02.22.15.45.08;	author peter;	state Exp;
branches;
next	1.14;

1.14
date	97.01.14.05.57.00;	author jkh;	state Exp;
branches;
next	1.13;

1.13
date	96.10.01.03.47.36;	author peter;	state Exp;
branches;
next	1.12;

1.12
date	96.09.21.14.27.38;	author peter;	state Exp;
branches;
next	1.11;

1.11
date	96.09.19.15.53.44;	author peter;	state Exp;
branches;
next	1.10;

1.10
date	96.05.28.00.34.38;	author phk;	state Exp;
branches;
next	1.9;

1.9
date	96.05.07.23.15.14;	author wosch;	state Exp;
branches;
next	1.8;

1.8
date	95.03.12.20.17.07;	author phk;	state Exp;
branches
	1.8.4.1;
next	1.7;

1.7
date	95.03.12.09.37.26;	author phk;	state Exp;
branches;
next	1.6;

1.6
date	95.03.06.12.17.49;	author jkh;	state Exp;
branches;
next	1.5;

1.5
date	95.03.06.08.04.05;	author phk;	state Exp;
branches;
next	1.4;

1.4
date	94.11.15.04.52.14;	author phk;	state Exp;
branches;
next	1.3;

1.3
date	94.11.07.04.40.26;	author phk;	state Exp;
branches;
next	1.2;

1.2
date	94.11.03.06.52.41;	author phk;	state Exp;
branches;
next	1.1;

1.1
date	94.08.02.20.15.34;	author phk;	state Exp;
branches
	1.1.1.1;
next	;

1.89.2.1
date	2013.03.17.04.32.46;	author svnexp;	state dead;
branches;
next	1.89.2.2;

1.89.2.2
date	2013.03.28.13.02.47;	author svnexp;	state Exp;
branches;
next	;

1.81.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.81.2.1.2.1;
next	1.81.2.2;

1.81.2.2
date	2012.05.25.17.20.00;	author marius;	state Exp;
branches
	1.81.2.2.2.1;
next	1.81.2.3;

1.81.2.3
date	2012.11.17.11.36.12;	author svnexp;	state Exp;
branches;
next	;

1.81.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.81.2.1.2.2;

1.81.2.1.2.2
date	2012.11.17.08.36.12;	author svnexp;	state Exp;
branches;
next	;

1.81.2.2.2.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.81.2.2.2.2;

1.81.2.2.2.2
date	2012.11.17.08.47.02;	author svnexp;	state Exp;
branches;
next	;

1.66.2.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches
	1.66.2.1.2.1
	1.66.2.1.4.1;
next	1.66.2.2;

1.66.2.2
date	2010.11.27.12.26.40;	author jchandra;	state Exp;
branches
	1.66.2.2.2.1;
next	1.66.2.3;

1.66.2.3
date	2011.12.08.00.47.22;	author gonzo;	state Exp;
branches
	1.66.2.3.2.1;
next	1.66.2.4;

1.66.2.4
date	2012.11.17.10.35.58;	author svnexp;	state Exp;
branches;
next	;

1.66.2.1.2.1
date	2009.10.25.01.10.29;	author kensmith;	state Exp;
branches;
next	;

1.66.2.1.4.1
date	2010.06.14.02.09.06;	author kensmith;	state Exp;
branches;
next	;

1.66.2.2.2.1
date	2010.12.21.17.09.25;	author kensmith;	state Exp;
branches;
next	;

1.66.2.3.2.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.66.2.3.2.2;

1.66.2.3.2.2
date	2012.11.17.08.24.39;	author svnexp;	state Exp;
branches;
next	;

1.58.2.1
date	2012.11.17.08.01.27;	author svnexp;	state Exp;
branches;
next	;

1.58.6.1
date	2008.11.25.02.59.29;	author kensmith;	state Exp;
branches;
next	;

1.58.8.1
date	2009.04.15.03.14.26;	author kensmith;	state Exp;
branches;
next	;

1.58.10.1
date	2010.02.10.00.26.20;	author kensmith;	state Exp;
branches;
next	;

1.58.12.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.58.12.2;

1.58.12.2
date	2012.11.17.08.16.38;	author svnexp;	state Exp;
branches;
next	;

1.54.2.1
date	2006.10.05.19.46.06;	author obrien;	state Exp;
branches
	1.54.2.1.6.1;
next	1.54.2.2;

1.54.2.2
date	2012.11.17.07.39.13;	author svnexp;	state Exp;
branches;
next	;

1.54.2.1.6.1
date	2008.10.02.02.57.24;	author kensmith;	state Exp;
branches;
next	;

1.52.2.1
date	2005.02.13.07.23.05;	author obrien;	state Exp;
branches;
next	;

1.34.2.1
date	2001.12.18.03.05.22;	author obrien;	state Exp;
branches;
next	1.34.2.2;

1.34.2.2
date	2002.04.05.09.20.49;	author obrien;	state Exp;
branches;
next	1.34.2.3;

1.34.2.3
date	2002.05.07.00.55.51;	author obrien;	state Exp;
branches;
next	1.34.2.4;

1.34.2.4
date	2002.05.10.08.52.41;	author obrien;	state Exp;
branches;
next	;

1.31.2.1
date	2001.01.06.23.16.54;	author obrien;	state Exp;
branches;
next	1.31.2.2;

1.31.2.2
date	2002.06.20.23.13.29;	author obrien;	state Exp;
branches;
next	1.31.2.3;

1.31.2.3
date	2012.11.17.07.22.52;	author svnexp;	state Exp;
branches;
next	;

1.29.2.1
date	2000.01.13.08.50.01;	author obrien;	state Exp;
branches;
next	;

1.8.4.1
date	96.05.29.22.33.01;	author jkh;	state Exp;
branches;
next	1.8.4.2;

1.8.4.2
date	96.06.05.02.39.36;	author jkh;	state Exp;
branches;
next	;

1.1.1.1
date	94.08.02.20.15.35;	author phk;	state Exp;
branches;
next	;


desc
@@


1.90
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/249702
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@# $FreeBSD: head/gnu/lib/libgcc/Makefile 249702 2013-04-20 14:44:28Z ed $

GCCDIR=	${.CURDIR}/../../../contrib/gcc
GCCLIB=	${.CURDIR}/../../../contrib/gcclibs

SHLIB_NAME=	libgcc_s.so.1
SHLIBDIR?=	/lib

.include <bsd.own.mk>
#
# libgcc is linked in last and thus cannot depend on ssp symbols coming
# from earlier libraries. Disable stack protection for this library.
#
MK_SSP=	no

.include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt"

.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
CFLAGS+=	-DTARGET_ARM_EABI
.endif

.PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR}/config ${GCCDIR}

CFLAGS+=	-DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \
		-DHAVE_GTHR_DEFAULT \
		-I${GCCLIB}/include \
		-I${GCCDIR}/config -I${GCCDIR} -I. \
		-I${.CURDIR}/../../usr.bin/cc/cc_tools

LDFLAGS+=	-nodefaultlibs
LDADD+=		-lc

OBJS=		# added to below in various ways depending on TARGET_CPUARCH

#---------------------------------------------------------------------------
#
# When upgrading GCC, get the following defintions straight from Makefile.in
#
# Library members defined in libgcc2.c.
LIB2FUNCS= _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 \
	_cmpdi2 _ucmpdi2 \
	_enable_execute_stack _trampoline __main _absvsi2 _absvdi2 _addvsi3 \
	_addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors \
	_ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab \
	_popcountsi2 _popcountdi2 _paritysi2 _paritydi2 _powisf2 _powidf2 \
	_powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3 \
	_divxc3 _divtc3
.if ${COMPILER_TYPE} != "clang" || ${TARGET_CPUARCH} != "arm"
LIB2FUNCS+= _clear_cache
.endif

# The floating-point conversion routines that involve a single-word integer.
.for mode in sf df xf
LIB2FUNCS+= _fixuns${mode}si
.endfor

# Likewise double-word routines.
.if ${TARGET_CPUARCH} != "arm" || ${MK_ARM_EABI} == "no"
# These are implemented in an ARM specific file but will not be filtered out
.for mode in sf df xf tf
LIB2FUNCS+= _fix${mode}di _fixuns${mode}di
LIB2FUNCS+= _floatdi${mode} _floatundi${mode}
.endfor
.endif

LIB2ADD = $(LIB2FUNCS_EXTRA)
LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA)

# Additional sources to handle exceptions; overridden by targets as needed.
LIB2ADDEH = unwind-dw2.c unwind-dw2-fde-glibc.c unwind-sjlj.c gthr-gnat.c \
	unwind-c.c
LIB2ADDEHSTATIC = $(LIB2ADDEH)
LIB2ADDEHSHARED = $(LIB2ADDEH)

# List of extra C and assembler files to add to static and shared libgcc2.
# Assembler files should have names ending in `.asm'.
LIB2FUNCS_EXTRA =

# List of extra C and assembler files to add to static libgcc2.
# Assembler files should have names ending in `.asm'.
LIB2FUNCS_STATIC_EXTRA =

# Defined in libgcc2.c, included only in the static library.
# KAN: Excluded _sf_to_tf and _df_to_tf as TPBIT_FUNCS are not
# built on any of our platforms.
LIB2FUNCS_ST = _eprintf __gcc_bcmp

FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
    _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
    _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \
    _sf_to_df _thenan_sf _sf_to_usi _usi_to_sf

DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
    _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \
    _lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \
    _df_to_sf _thenan_df _df_to_usi _usi_to_df

TPBIT_FUNCS = _pack_tf _unpack_tf _addsub_tf _mul_tf _div_tf \
    _fpcmp_parts_tf _compare_tf _eq_tf _ne_tf _gt_tf _ge_tf \
    _lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf \
    _tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf

# These might cause a divide overflow trap and so are compiled with
# unwinder info.
LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4

#-----------------------------------------------------------------------
#
#	Platform specific bits.
#	When upgrading GCC, get the following definitions from config/<cpu>/t-*
#
.if ${TARGET_CPUARCH} == "arm"
#	from config/arm/t-strongarm-elf
CFLAGS+=	-Dinhibit_libc -fno-inline
.if ${COMPILER_TYPE} == "clang"
CFLAGS+=	-fheinous-gnu-extensions
.endif

LIB1ASMSRC =	lib1funcs.asm
LIB1ASMFUNCS =  _dvmd_tls _bb_init_func
.if ${MK_ARM_EABI} != "no"
LIB2ADDEH =	unwind-arm.c libunwind.S pr-support.c unwind-c.c
# Some compilers generate __aeabi_ functions libgcc_s is missing
DPADD+=		${LIBGCC}
LDADD+=		-lgcc
.else
LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
.endif
.endif

.if ${TARGET_CPUARCH} == mips
LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
# ABIs other than o32 need this
.if ${TARGET_ARCH} != "mips" && ${TARGET_ARCH} != "mipsel"
LIB2FUNCS_EXTRA+= floatdidf.c fixunsdfsi.c
LIB2FUNCS_EXTRA+= floatdisf.c floatundidf.c
LIB2FUNCS_EXTRA+= fixsfdi.c floatundisf.c
LIB2FUNCS_EXTRA+= fixdfdi.c fixunssfsi.c
.endif
.endif

.if ${TARGET_CPUARCH} == "ia64"
#	from config/ia64/t-ia64
LIB1ASMSRC   = lib1funcs.asm
LIB1ASMFUNCS = __divxf3 __divdf3 __divsf3 \
	__divdi3 __moddi3 __udivdi3 __umoddi3 \
	__divsi3 __modsi3 __udivsi3 __umodsi3 __save_stack_nonlocal \
	__nonlocal_goto __restore_stack_nonlocal __trampoline \
	_fixtfdi _fixunstfdi _floatditf
LIB2ADDEH = unwind-ia64.c unwind-sjlj.c unwind-c.c
.endif

.if ${TARGET_ARCH} == "powerpc"
#	from config/rs6000/t-ppccomm
LIB2FUNCS_EXTRA = tramp.asm
LIB2FUNCS_STATIC_EXTRA = eabi.asm
.endif

.if ${TARGET_ARCH} == "powerpc64"
#	from config/rs6000/t-ppccomm
LIB2FUNCS_EXTRA = tramp.asm
.endif

.if ${TARGET_CPUARCH} == "sparc64"
#	from config/sparc/t-elf
LIB1ASMSRC =   lb1spc.asm
LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3
.endif

#-----------------------------------------------------------------------

# Remove any objects from LIB2FUNCS and LIB2_DIVMOD_FUNCS that are
# defined as optimized assembly code in LIB1ASMFUNCS.
.if defined(LIB1ASMFUNCS)
.for sym in ${LIB1ASMFUNCS}
LIB2FUNCS:=	${LIB2FUNCS:S/${sym}//g}
LIB2_DIVMOD_FUNCS:= ${LIB2_DIVMOD_FUNCS:S/${sym}//g}
.endfor
.endif

COMMONHDRS=	tm.h tconfig.h options.h unwind.h gthr-default.h

#-----------------------------------------------------------------------
#
# 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

#-----------------------------------------------------------------------
#
# Functions from libgcc2.c
#
STD_CFLAGS =
DIV_CFLAGS =	-fexceptions -fnon-call-exceptions

STD_FUNCS =	${LIB2FUNCS}
DIV_FUNCS =	${LIB2_DIVMOD_FUNCS}

STD_CFILE =	libgcc2.c
DIV_CFILE =	libgcc2.c

OBJ_GRPS =	STD DIV

#-----------------------------------------------------------------------
#
# Floating point emulation functions
#
.if ${TARGET_CPUARCH} == "armNOT_YET" || \
    ${TARGET_CPUARCH} == "powerpc" || ${TARGET_CPUARCH} == "sparc64"

FPBIT_CFLAGS =	-DFINE_GRAINED_LIBRARIES -DFLOAT
DPBIT_CFLAGS =	-DFINE_GRAINED_LIBRARIES

FPBIT_CFILE =	config/fp-bit.c
DPBIT_CFILE =	config/fp-bit.c

OBJ_GRPS +=	FPBIT DPBIT
.endif

#-----------------------------------------------------------------------
#
# Generic build rules for object groups defined above
#
.for T in ${OBJ_GRPS}
${T}_OBJS_T =	${${T}_FUNCS:S/$/.o/}
${T}_OBJS_P =	${${T}_FUNCS:S/$/.po/}
${T}_OBJS_S =	${${T}_FUNCS:S/$/.So/}
OBJS +=		${${T}_FUNCS:S/$/.o/}

${${T}_OBJS_T}: ${${T}_CFILE} ${COMMONHDRS}
	${CC_T} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
${${T}_OBJS_P}: ${${T}_CFILE} ${COMMONHDRS}
	${CC_P} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
${${T}_OBJS_S}: ${${T}_CFILE} ${COMMONHDRS}
	${CC_S} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
.endfor

#-----------------------------------------------------------------------
#
# Extra objects coming from separate files
#
.if !empty(LIB2ADD)
OBJS  +=	${LIB2ADD:R:S/$/.o/}
SOBJS +=	${LIB2ADD:R:S/$/.So/}
POBJS +=	${LIB2ADD:R:S/$/.po/}
.endif

#-----------------------------------------------------------------------
#
# Objects that should be in static library only.
#
SYMS_ST =	${LIB2FUNCS_ST}	${LIB2ADD_ST}
STAT_OBJS_T = 	${SYMS_ST:S/$/.o/}
STAT_OBJS_P = 	${SYMS_ST:S/$/.po/}
STATICOBJS  =	${SYMS_ST:S/$/.o/}

${STAT_OBJS_T}:	${STD_CFILE} ${COMMONHDRS}
	${CC_T} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
${STAT_OBJS_P}:	${STD_CFILE} ${COMMONHDRS}
	${CC_P} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}

#-----------------------------------------------------------------------
#
# Assembler files.
#
.if defined(LIB1ASMSRC)
ASM_T =		${LIB1ASMFUNCS:S/$/.o/}
ASM_P =		${LIB1ASMFUNCS:S/$/.po/}
ASM_S =		${LIB1ASMFUNCS:S/$/.So/}
ASM_V =		${LIB1ASMFUNCS:S/$/.vis/}
OBJS +=		${LIB1ASMFUNCS:S/$/.o/}

${ASM_T}: ${LIB1ASMSRC} ${.PREFIX}.vis
	${CC} -x assembler-with-cpp -c ${CFLAGS} -DL${.PREFIX} \
	    -o ${.TARGET} -include ${.PREFIX}.vis ${.ALLSRC:N*.h:N*.vis}
${ASM_P}: ${LIB1ASMSRC} ${.PREFIX}.vis
	${CC} -x assembler-with-cpp -p -c ${CFLAGS} -DL${.PREFIX} \
	    -o ${.TARGET} -include ${.PREFIX}.vis ${.ALLSRC:N*.h:N*.vis}
${ASM_S}: ${LIB1ASMSRC}
	${CC} -x assembler-with-cpp -c ${PICFLAG} ${CFLAGS} -DL${.PREFIX} \
	    -o ${.TARGET} ${.ALLSRC:N*.h}
${ASM_V}: ${LIB1ASMSRC}
	${CC} -x assembler-with-cpp -c ${CFLAGS} -DL${.PREFIX} \
	    -o ${.PREFIX}.vo ${.ALLSRC:N*.h}
	( ${NM} -pg ${.PREFIX}.vo | \
		awk 'NF == 3 && $$2 !~ /^[UN]$$/ { print "\t.hidden ", $$3 }'\
	) > ${.TARGET}

CLEANFILES += ${ASM_V} ${ASM_V:R:S/$/.vo/}
.endif

#-----------------------------------------------------------------------
#
# Exception handling / unwinding support.
#
EH_OBJS_T = ${LIB2ADDEHSTATIC:R:S/$/.o/}
EH_OBJS_P = ${LIB2ADDEHSTATIC:R:S/$/.po/}
EH_OBJS_S = ${LIB2ADDEHSHARED:R:S/$/.So/}
EH_CFLAGS = -fexceptions -D__GLIBC__=3 -DElfW=__ElfN
SOBJS    += ${EH_OBJS_S}

.for _src in ${LIB2ADDEHSTATIC}
${_src:R:S/$/.o/}: ${_src} ${COMMONHDRS}
	${CC_T} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC}
${_src:R:S/$/.po/}: ${_src} ${COMMONHDRS}
	${CC_P} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC}
.endfor
.for _src in ${LIB2ADDEHSHARED}
${_src:R:S/$/.So/}: ${_src} ${COMMONHDRS}
	${CC_S} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC}
.endfor


#-----------------------------------------------------------------------
#
# Generated headers
#
${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile
	${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}

CLEANFILES += ${COMMONHDRS}
CLEANFILES += cs-*.h option*

#-----------------------------------------------------------------------
#
# Build symbol version map
#
SHLIB_MKMAP      = ${GCCDIR}/mkmap-symver.awk
SHLIB_MKMAP_OPTS =
SHLIB_MAPFILES   = ${GCCDIR}/libgcc-std.ver
.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
SHLIB_MAPFILES  += ${GCCDIR}/config/arm/libgcc-bpabi.ver
.endif
VERSION_MAP      = libgcc.map

libgcc.map: ${SHLIB_MKMAP} ${SHLIB_MAPFILES} ${SOBJS} ${OBJS:R:S/$/.So/}
	(  ${NM} -pg ${SOBJS};echo %% ; \
	  cat ${SHLIB_MAPFILES} \
	    | sed -e '/^[   ]*#/d' \
	          -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \
	    | ${CC} ${CFLAGS} -E -xassembler-with-cpp -; \
	) | awk -f ${SHLIB_MKMAP} ${SHLIB_MKMAP_OPTS} > ${.TARGET}

CLEANFILES +=	libgcc.map

#-----------------------------------------------------------------------
#
# Build additional static libgcc_eh[_p].a libraries.
#
libgcc_eh.a:	${EH_OBJS_T}
	@@${ECHO} building static gcc_eh library
	@@rm -f ${.TARGET}
	@@${AR} ${ARFLAGS} ${.TARGET} `lorder ${EH_OBJS_T} | tsort -q`
	${RANLIB} ${.TARGET}

all:	libgcc_eh.a

.if ${MK_PROFILE} != "no"
libgcc_eh_p.a:	${EH_OBJS_P}
	@@${ECHO} building profiled gcc_eh library
	@@rm -f ${.TARGET}
	@@${AR} ${ARFLAGS} ${.TARGET} `lorder ${EH_OBJS_P} | tsort -q`
	${RANLIB} ${.TARGET}
all:	libgcc_eh_p.a
.endif

_libinstall: _lib-eh-install

_lib-eh-install:
.if ${MK_INSTALLLIB} != "no"
	${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
		${_INSTALLFLAGS} libgcc_eh.a ${DESTDIR}${LIBDIR}
.endif
.if ${MK_PROFILE} != "no"
	${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
		${_INSTALLFLAGS} libgcc_eh_p.a ${DESTDIR}${LIBDIR}
.endif

CLEANFILES+=	libgcc_eh.a libgcc_eh_p.a ${EH_OBJS_T} ${EH_OBJS_P}

.include <bsd.lib.mk>

.SUFFIXES: .vis .vo
@


1.89
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248401
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d1 1
a1 1
# $FreeBSD: head/gnu/lib/libgcc/Makefile 248401 2013-03-17 01:03:41Z andrew $
a21 4
.if ${TARGET_CPUARCH} == "mips"
LIB=		gcc
.endif

@


1.89.2.1
log
@file Makefile was added on branch RELENG_8_4 on 2013-03-28 13:02:47 +0000
@
text
@d1 390
@


1.89.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 364
# $FreeBSD: releng/8.4/gnu/lib/libgcc/Makefile 228337 2011-12-08 00:47:22Z gonzo $
GCCDIR=	${.CURDIR}/../../../contrib/gcc
GCCLIB=	${.CURDIR}/../../../contrib/gcclibs

LIB=		gcc
SHLIB_NAME=	libgcc_s.so.1
SHLIBDIR?=	/lib

.include <bsd.own.mk>
#
# libgcc is linked in last and thus cannot depend on ssp symbols coming
# from earlier libraries. Disable stack protection for this library.
#
MK_SSP=	no

.include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt"

.PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR}/config ${GCCDIR}

CFLAGS+=	-DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \
		-DHAVE_GTHR_DEFAULT \
		-I${GCCLIB}/include \
		-I${GCCDIR}/config -I${GCCDIR} -I. \
		-I${.CURDIR}/../../usr.bin/cc/cc_tools

LDFLAGS+=	-nodefaultlibs
LDADD+=		-lc

OBJS=		# added to below in various ways depending on TARGET_ARCH

#---------------------------------------------------------------------------
#
# When upgrading GCC, get the following defintions straight from Makefile.in
#
# Library members defined in libgcc2.c.
LIB2FUNCS= _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 \
	_cmpdi2 _ucmpdi2 _clear_cache \
	_enable_execute_stack _trampoline __main _absvsi2 _absvdi2 _addvsi3 \
	_addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors \
	_ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab \
	_popcountsi2 _popcountdi2 _paritysi2 _paritydi2 _powisf2 _powidf2 \
	_powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3 \
	_divxc3 _divtc3

# The floating-point conversion routines that involve a single-word integer.
.for mode in sf df xf
LIB2FUNCS+= _fixuns${mode}si
.endfor

# Likewise double-word routines.
.for mode in sf df xf tf
LIB2FUNCS+= _fix${mode}di _fixuns${mode}di
LIB2FUNCS+= _floatdi${mode} _floatundi${mode}
.endfor

LIB2ADD = $(LIB2FUNCS_EXTRA)
LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA)

# Additional sources to handle exceptions; overridden by targets as needed.
LIB2ADDEH = unwind-dw2.c unwind-dw2-fde-glibc.c unwind-sjlj.c gthr-gnat.c \
	unwind-c.c
LIB2ADDEHSTATIC = $(LIB2ADDEH)
LIB2ADDEHSHARED = $(LIB2ADDEH)

# List of extra C and assembler files to add to static and shared libgcc2.
# Assembler files should have names ending in `.asm'.
LIB2FUNCS_EXTRA =

# List of extra C and assembler files to add to static libgcc2.
# Assembler files should have names ending in `.asm'.
LIB2FUNCS_STATIC_EXTRA =

# Defined in libgcc2.c, included only in the static library.
# KAN: Excluded _sf_to_tf and _df_to_tf as TPBIT_FUNCS are not
# built on any of our platforms.
LIB2FUNCS_ST = _eprintf __gcc_bcmp

FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
    _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
    _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \
    _sf_to_df _thenan_sf _sf_to_usi _usi_to_sf

DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
    _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \
    _lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \
    _df_to_sf _thenan_df _df_to_usi _usi_to_df

TPBIT_FUNCS = _pack_tf _unpack_tf _addsub_tf _mul_tf _div_tf \
    _fpcmp_parts_tf _compare_tf _eq_tf _ne_tf _gt_tf _ge_tf \
    _lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf \
    _tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf

# These might cause a divide overflow trap and so are compiled with
# unwinder info.
LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4

#-----------------------------------------------------------------------
#
#	Platform specific bits.
#	When upgrading GCC, get the following definitions from config/<cpu>/t-*
#
.if ${TARGET_ARCH} == "arm"
#	from config/arm/t-strongarm-elf
CFLAGS+=	-Dinhibit_libc -fno-inline
LIB1ASMSRC =	lib1funcs.asm
LIB1ASMFUNCS =  _dvmd_tls _bb_init_func
LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c

# Not now
#LIB1ASMFUNCS =  _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func
#LIB1ASMFUNCS+=	_call_via_rX _interwork_call_via_rX \
#	_lshrdi3 _ashrdi3 _ashldi3 \
#	_negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
#	_truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
#	_fixsfsi _fixunssfsi _floatdidf _floatdisf
.endif

.if ${TARGET_ARCH} == "mips"
LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
.if defined(TARGET_ABI) && ${TARGET_ABI} != "o32"
LIB2FUNCS_EXTRA+= floatdidf.c fixunsdfsi.c
LIB2FUNCS_EXTRA+= floatdisf.c floatundidf.c
LIB2FUNCS_EXTRA+= fixsfdi.c floatundisf.c
LIB2FUNCS_EXTRA+= fixdfdi.c fixunssfsi.c
.endif
.endif

.if ${TARGET_ARCH} == "ia64"
#	from config/ia64/t-ia64
LIB1ASMSRC   = lib1funcs.asm
LIB1ASMFUNCS = __divxf3 __divdf3 __divsf3 \
	__divdi3 __moddi3 __udivdi3 __umoddi3 \
	__divsi3 __modsi3 __udivsi3 __umodsi3 __save_stack_nonlocal \
	__nonlocal_goto __restore_stack_nonlocal __trampoline \
	_fixtfdi _fixunstfdi _floatditf
LIB2ADDEH = unwind-ia64.c unwind-sjlj.c unwind-c.c
.endif

.if ${TARGET_ARCH} == "powerpc"
#	from config/rs6000/t-ppccomm
LIB2FUNCS_EXTRA = tramp.asm
LIB2FUNCS_STATIC_EXTRA = eabi.asm
.endif

.if ${TARGET_ARCH} == "sparc64"
#	from config/sparc/t-elf
LIB1ASMSRC =   lb1spc.asm
LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3
.endif

#-----------------------------------------------------------------------

# Remove any objects from LIB2FUNCS and LIB2_DIVMOD_FUNCS that are
# defined as optimized assembly code in LIB1ASMFUNCS.
.if defined(LIB1ASMFUNCS)
.for sym in ${LIB1ASMFUNCS}
LIB2FUNCS:=	${LIB2FUNCS:S/${sym}//g}
LIB2_DIVMOD_FUNCS:= ${LIB2_DIVMOD_FUNCS:S/${sym}//g}
.endfor
.endif

COMMONHDRS=	tm.h tconfig.h options.h unwind.h gthr-default.h

#-----------------------------------------------------------------------
#
# 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

#-----------------------------------------------------------------------
#
# Functions from libgcc2.c
#
STD_CFLAGS =
DIV_CFLAGS =	-fexceptions -fnon-call-exceptions

STD_FUNCS =	${LIB2FUNCS}
DIV_FUNCS =	${LIB2_DIVMOD_FUNCS}

STD_CFILE =	libgcc2.c
DIV_CFILE =	libgcc2.c

OBJ_GRPS =	STD DIV

#-----------------------------------------------------------------------
#
# Floating point emulation functions
#
.if ${TARGET_ARCH} == "armNOT_YET" || \
    ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "sparc64"

FPBIT_CFLAGS =	-DFINE_GRAINED_LIBRARIES -DFLOAT
DPBIT_CFLAGS =	-DFINE_GRAINED_LIBRARIES

FPBIT_CFILE =	config/fp-bit.c
DPBIT_CFILE =	config/fp-bit.c

OBJ_GRPS +=	FPBIT DPBIT
.endif

#-----------------------------------------------------------------------
#
# Generic build rules for object groups defined above
#
.for T in ${OBJ_GRPS}
${T}_OBJS_T =	${${T}_FUNCS:S/$/.o/}
${T}_OBJS_P =	${${T}_FUNCS:S/$/.po/}
${T}_OBJS_S =	${${T}_FUNCS:S/$/.So/}
OBJS +=		${${T}_FUNCS:S/$/.o/}

${${T}_OBJS_T}: ${${T}_CFILE} ${COMMONHDRS}
	${CC_T} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
${${T}_OBJS_P}: ${${T}_CFILE} ${COMMONHDRS}
	${CC_P} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
${${T}_OBJS_S}: ${${T}_CFILE} ${COMMONHDRS}
	${CC_S} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
.endfor

#-----------------------------------------------------------------------
#
# Extra objects coming from separate files
#
.if !empty(LIB2ADD)
OBJS  +=	${LIB2ADD:R:S/$/.o/}
SOBJS +=	${LIB2ADD:R:S/$/.So/}
POBJS +=	${LIB2ADD:R:S/$/.po/}
.endif

#-----------------------------------------------------------------------
#
# Objects that should be in static library only.
#
SYMS_ST =	${LIB2FUNCS_ST}	${LIB2ADD_ST}
STAT_OBJS_T = 	${SYMS_ST:S/$/.o/}
STAT_OBJS_P = 	${SYMS_ST:S/$/.po/}
STATICOBJS  =	${SYMS_ST:S/$/.o/}

${STAT_OBJS_T}:	${STD_CFILE} ${COMMONHDRS}
	${CC_T} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
${STAT_OBJS_P}:	${STD_CFILE} ${COMMONHDRS}
	${CC_P} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}

#-----------------------------------------------------------------------
#
# Assembler files.
#
.if defined(LIB1ASMSRC)
ASM_T =		${LIB1ASMFUNCS:S/$/.o/}
ASM_P =		${LIB1ASMFUNCS:S/$/.po/}
ASM_S =		${LIB1ASMFUNCS:S/$/.So/}
ASM_V =		${LIB1ASMFUNCS:S/$/.vis/}
OBJS +=		${LIB1ASMFUNCS:S/$/.o/}

${ASM_T}: ${LIB1ASMSRC} ${.PREFIX}.vis
	${CC} -x assembler-with-cpp -c ${CFLAGS} -DL${.PREFIX} \
	    -o ${.TARGET} -include ${.PREFIX}.vis ${.ALLSRC:N*.h:N*.vis}
${ASM_P}: ${LIB1ASMSRC} ${.PREFIX}.vis
	${CC} -x assembler-with-cpp -p -c ${CFLAGS} -DL${.PREFIX} \
	    -o ${.TARGET} -include ${.PREFIX}.vis ${.ALLSRC:N*.h:N*.vis}
${ASM_S}: ${LIB1ASMSRC}
	${CC} -x assembler-with-cpp -c ${PICFLAG} ${CFLAGS} -DL${.PREFIX} \
	    -o ${.TARGET} ${.ALLSRC:N*.h}
${ASM_V}: ${LIB1ASMSRC}
	${CC} -x assembler-with-cpp -c ${CFLAGS} -DL${.PREFIX} \
	    -o ${.PREFIX}.vo ${.ALLSRC:N*.h}
	( nm -pg ${.PREFIX}.vo | \
		awk 'NF == 3 && $$2 !~ /^[UN]$$/ { print "\t.hidden ", $$3 }'\
	) > ${.TARGET}

CLEANFILES += ${ASM_V} ${ASM_V:R:S/$/.vo/}
.endif

#-----------------------------------------------------------------------
#
# Exception handling / unwinding support.
#
EH_OBJS_T = ${LIB2ADDEHSTATIC:R:S/$/.o/}
EH_OBJS_P = ${LIB2ADDEHSTATIC:R:S/$/.po/}
EH_OBJS_S = ${LIB2ADDEHSHARED:R:S/$/.So/}
EH_CFLAGS = -fexceptions -D__GLIBC__=3 -DElfW=__ElfN
SOBJS    += ${EH_OBJS_S}

.for _src in ${LIB2ADDEHSTATIC}
${_src:R:S/$/.o/}: ${_src} ${COMMONHDRS}
	${CC_T} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC}
${_src:R:S/$/.po/}: ${_src} ${COMMONHDRS}
	${CC_P} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC}
.endfor
.for _src in ${LIB2ADDEHSHARED}
${_src:R:S/$/.So/}: ${_src} ${COMMONHDRS}
	${CC_S} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC}
.endfor


#-----------------------------------------------------------------------
#
# Generated headers
#
${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile
	${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}

CLEANFILES += ${COMMONHDRS}
CLEANFILES += cs-*.h option*

#-----------------------------------------------------------------------
#
# Build additional static libgcc_eh[_p].a librarries.
#
SHLIB_MKMAP      = ${GCCDIR}/mkmap-symver.awk
SHLIB_MKMAP_OPTS =
SHLIB_MAPFILES   = ${GCCDIR}/libgcc-std.ver
VERSION_MAP      = libgcc.map

libgcc.map: ${SHLIB_MKMAP} ${SHLIB_MAPFILES} ${SOBJS} ${OBJS:R:S/$/.So/}
	(  nm -pg ${SOBJS};echo %% ; \
	  cat ${SHLIB_MAPFILES} \
	    | sed -e '/^[   ]*#/d' \
	          -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \
	    | ${CC} ${CFLAGS} -E -xassembler-with-cpp -; \
	) | awk -f ${SHLIB_MKMAP} ${SHLIB_MKMAP_OPTS} > ${.TARGET}

CLEANFILES +=	libgcc.map

#-----------------------------------------------------------------------
#
# Build additional static libgcc_eh[_p].a librarries.
#
lib${LIB}_eh.a:	${EH_OBJS_T}
	@@${ECHO} building static ${LIB}_eh library
	@@rm -f ${.TARGET}
	@@${AR} cq ${.TARGET} `lorder ${EH_OBJS_T} | tsort -q`
	${RANLIB} ${.TARGET}

all:	lib${LIB}_eh.a

.if ${MK_PROFILE} != "no"
lib${LIB}_eh_p.a:	${EH_OBJS_P}
	@@${ECHO} building profiled ${LIB}_eh library
	@@rm -f ${.TARGET}
	@@${AR} cq ${.TARGET} `lorder ${EH_OBJS_P} | tsort -q`
	${RANLIB} ${.TARGET}
all:	lib${LIB}_eh_p.a
.endif

_libinstall: _lib-eh-install

_lib-eh-install:
.if ${MK_INSTALLLIB} != "no"
	${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
		${_INSTALLFLAGS} lib${LIB}_eh.a ${DESTDIR}${LIBDIR}
.endif
.if ${MK_PROFILE} != "no"
	${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
		${_INSTALLFLAGS} lib${LIB}_eh_p.a ${DESTDIR}${LIBDIR}
.endif

CLEANFILES+=	lib${LIB}_eh.a lib${LIB}_eh_p.a ${EH_OBJS_T} ${EH_OBJS_P}

.include <bsd.lib.mk>

.SUFFIXES: .vis .vo
@


1.88
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/245539
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d1 1
a1 1
# $FreeBSD: head/gnu/lib/libgcc/Makefile 245539 2013-01-17 05:56:28Z andrew $
a125 3
LIB1ASMFUNCS+=	_addsubdf3 _addsubsf3 _cmpdf2 _cmpsf2 _fixdfsi _fixsfsi \
		_fixunsdfsi _fixunsdfsi _muldivdf3 _muldivsf3 _udivsi3

d127 3
@


1.87
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/244382
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d1 1
a1 1
# $FreeBSD: head/gnu/lib/libgcc/Makefile 244382 2012-12-18 07:26:55Z andrew $
d18 4
d62 2
d68 1
d125 6
d132 1
a132 8

# Not now
#LIB1ASMFUNCS =  _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func
#LIB1ASMFUNCS+=	_call_via_rX _interwork_call_via_rX \
#	_lshrdi3 _ashrdi3 _ashldi3 \
#	_negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
#	_truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
#	_fixsfsi _fixunssfsi _floatdidf _floatdisf
d338 3
@


1.86
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/243933
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d1 1
a1 1
# $FreeBSD: head/gnu/lib/libgcc/Makefile 243933 2012-12-06 01:31:25Z eadler $
d41 1
a41 1
	_cmpdi2 _ucmpdi2 _clear_cache \
d48 3
d112 4
@


1.85
log
@Switching exporter and resync
@
text
@d1 1
a1 1
# $FreeBSD: head/gnu/lib/libgcc/Makefile 235487 2012-05-15 22:47:34Z marius $
d344 1
a344 1
	@@${AR} cq ${.TARGET} `lorder ${EH_OBJS_T} | tsort -q`
d353 1
a353 1
	@@${AR} cq ${.TARGET} `lorder ${EH_OBJS_P} | tsort -q`
@


1.84
log
@SVN rev 235487 on 2012-05-15 22:47:34Z by marius

Switch sparc64 to using libcompiler_rt; since r230021 we have a workaround
in place allowing it to be used there and since r235388 (see also r235486)
we also have usable div/mod optimizations like libgcc has.
@
text
@d1 1
a1 1
# $FreeBSD$
@


1.83
log
@SVN rev 234546 on 2012-04-21 16:02:00Z by imp

Replace a bare use of nm with ${NM} for easier cross compilation in
environments where nm is spelled differently.
@
text
@d18 1
a18 1
.if ${TARGET_CPUARCH} == "sparc64" || ${TARGET_CPUARCH} == "mips"
@


1.82
log
@SVN rev 233644 on 2012-03-29 02:54:35Z by jmallett

Assume a big-endian default on MIPS and drop the "eb" suffix from MACHINE_ARCH.
This makes our naming scheme more closely match other systems and the
expectations of much third-party software.  MIPS builds which are little-endian
should require and exhibit no changes.  Big-endian TARGET_ARCHes must be
changed:
	From:		To:
	mipseb		mips
	mipsn32eb	mipsn32
	mips64eb	mips64

An entry has been added to UPDATING and some foot-shooting protection (complete
with warnings which should become errors in the near future) to the top-level
base system Makefile.
@
text
@d279 1
a279 1
	( nm -pg ${.PREFIX}.vo | \
d328 1
a328 1
	(  nm -pg ${SOBJS};echo %% ; \
@


1.81
log
@SVN rev 218181 on 2011-02-02 03:24:52Z by imp

Revert last change now that the reason for it is no more...
MACHINE_ARCH is now always mipsel when building mips/mips.
@
text
@d125 1
a125 1
.if ${TARGET_ARCH:Mmipse[lb]} == ""
@


1.81.2.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.81.2.2
log
@SVN rev 236014 on 2012-05-25 17:20:00Z by marius

MFC: r235487

Switch sparc64 to using libcompiler_rt; since r230021 (MFC'ed to stable/9 in
r236012) we have a workaround in place allowing it to be used there and since
r235388 (MFC'ed to stable/9 in r236002) we also have usable div/mod
optimizations like libgcc has.
@
text
@d18 1
a18 1
.if ${TARGET_CPUARCH} == "mips"
@


1.81.2.3
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d1 1
a1 1
# $FreeBSD: stable/9/gnu/lib/libgcc/Makefile 236014 2012-05-25 17:20:00Z marius $
@


1.81.2.2.2.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.81.2.2.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.1/gnu/lib/libgcc/Makefile 236014 2012-05-25 17:20:00Z marius $
@


1.81.2.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.81.2.1.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.0/gnu/lib/libgcc/Makefile 218181 2011-02-02 03:24:52Z imp $
@


1.80
log
@SVN rev 218064 on 2011-01-29 10:32:00Z by jchandra

Rewrite the ARCH check another way for backward compatibility.

Compilation fails now, if TARGET_ARCH=mips instead of mipsel/mipseb.
@
text
@d125 1
a125 2
.if ${TARGET_ARCH:Mmips64*} != "" || \
    ${TARGET_ARCH:Mmipsn32*} != ""
@


1.79
log
@SVN rev 217942 on 2011-01-27 14:16:12Z by jchandra

Fix n32 compile.

These changes are needed to fix n32 compile after the recent change of
mips n32 MACHINE_ARCH to mipsn32eb/mipsn32el.

Reviewed by:	imp, bz (earlier version)
@
text
@d125 2
a126 1
.if ${TARGET_ARCH:Mmipse[lb]} == ""
@


1.78
log
@SVN rev 217123 on 2011-01-07 20:26:33Z by imp

Retire TARGET_ABI.

Implement MACHINE_ARCH=mips64e[lb] to build N64 images.  This replaces
MACHINE_ARCH=mipse[lb] TARGET_ABI=n64.

MACHINE_ARCH=mipsn32e[lb] has been added, but currently requires
WITHOUT_CDDL due to atomic issues in libzfs.  I've not investigated
this much, but implemented this to preserve as much of the TARGET_ABI
functionality that I could.  Since its presence doesn't affect the
working cases, I've kept it in for now.

Added mips64e[lb] to make universe, so more kernels build.

And I think this (finally) closes the curtain on the tbemd tree.
@
text
@d124 2
a125 2
# XXX do we need n32 here?
.if ${TARGET_ARCH:Mmips64*} != ""
@


1.77
log
@SVN rev 216804 on 2010-12-29 17:12:05Z by kan

Switch mips architectures back to libgcc.

MIPS64 n64 binaries are broken with libcompiler_rt at this time.
Switch mips back to libgcc until the cause of breakage is analyzed
and fixed.
@
text
@d122 1
a122 1
.if ${TARGET_CPUARCH} == "mips"
d124 2
a125 1
.if defined(TARGET_ABI) && ${TARGET_ABI} != "o32"
@


1.76
log
@SVN rev 215275 on 2010-11-14 01:50:40Z by imp

These two cases should be different...

Submitted by:	nathanw@@
@
text
@d18 1
a18 1
.if ${TARGET_CPUARCH} == "sparc64"
@


1.75
log
@SVN rev 215185 on 2010-11-12 15:52:27Z by ed

Revert to libgcc for sparc64.

I've had a report of a sparc64 system where cc1 generates illegal
instructions. We still have to diagnose this properly, but instead of
hosing all sparc64 boxes out there, fall back to libgcc to prevent more
damage.

Reported by:	Florian Smeets
@
text
@d143 1
a143 1
.if ${TARGET_CPUARCH} == "powerpc"
d149 1
a149 1
.if ${TARGET_CPUARCH} == "powerpc64"
@


1.74
log
@SVN rev 215127 on 2010-11-11 15:48:27Z by ed

Replace libgcc.a by libcompiler_rt.a.

libcompiler_rt.a is a BSD licensed C language runtime, which implements
many routines which are linked into binaries on architectures where
certain functionality is missing (e.g. 64 bits mul/div on i386).

Unfortunately, libcompiler_rt cannot replace libgcc entirely. Certain
features, such as an unwinder for exception handling, are missing.
That's why only libgcc.a is replaced for now, because this one does seem
to be complete.

Tested by:	rene (amd64), nwhitehorn (powerpc), droso (i386 exprun)
		and many others. Thanks!
Obtained from:	user/ed/compiler-rt
@
text
@d18 4
@


1.73
log
@SVN rev 215126 on 2010-11-11 15:24:57Z by ed

Don't use ${LIB} to obtain the library name.

Once we use libcompiler_rt, the LIB-line must go, to prevent libgcc.a
from being built. Therefore, just hardcode the name.

Obtained from:	user/ed/compiler-rt
@
text
@a5 1
LIB=		gcc
@


1.72
log
@SVN rev 215082 on 2010-11-10 06:39:49Z by imp

Complete the integration of tbemd branch into head.

TARGET_BIG_ENDIAN is now completely dead, except where it was
originally supposed to be used (internally in the toolchain building).

TARGET_ARCH has changed in three cases:
(1) Little endian mips has changed to mipsel.
(2) Big endian mips has changed to mipseb.
(3) Big endian arm has changed to armeb.

Some additional changes are needed to make 'make universe' work on arm
and mips after this change, so those are commented out for now.

UPDATING information will be forthcoming.  Any remaining rough edges
will be hammered out in -current.
@
text
@d337 2
a338 2
lib${LIB}_eh.a:	${EH_OBJS_T}
	@@${ECHO} building static ${LIB}_eh library
d343 1
a343 1
all:	lib${LIB}_eh.a
d346 2
a347 2
lib${LIB}_eh_p.a:	${EH_OBJS_P}
	@@${ECHO} building profiled ${LIB}_eh library
d351 1
a351 1
all:	lib${LIB}_eh_p.a
d359 1
a359 1
		${_INSTALLFLAGS} lib${LIB}_eh.a ${DESTDIR}${LIBDIR}
d363 1
a363 1
		${_INSTALLFLAGS} lib${LIB}_eh_p.a ${DESTDIR}${LIBDIR}
d366 1
a366 1
CLEANFILES+=	lib${LIB}_eh.a lib${LIB}_eh_p.a ${EH_OBJS_T} ${EH_OBJS_P}
@


1.71
log
@SVN rev 209867 on 2010-07-10 02:29:22Z by nwhitehorn

Teach our toolchain how to generate 64-bit PowerPC binaries. This fixes
a variety of bugs in binutils related to handling of 64-bit PPC ELF,
provides a GCC configuration for 64-bit PowerPC on FreeBSD, and
associated build systems tweaks.

Obtained from:	projects/ppc64
@
text
@d30 1
a30 1
OBJS=		# added to below in various ways depending on TARGET_ARCH
d103 1
a103 1
.if ${TARGET_ARCH} == "arm"
d119 1
a119 1
.if ${TARGET_ARCH} == "mips"
d129 1
a129 1
.if ${TARGET_ARCH} == "ia64"
d140 1
a140 1
.if ${TARGET_ARCH} == "powerpc"
d146 1
a146 1
.if ${TARGET_ARCH} == "powerpc64"
d151 1
a151 1
.if ${TARGET_ARCH} == "sparc64"
d198 2
a199 2
.if ${TARGET_ARCH} == "armNOT_YET" || \
    ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "sparc64"
@


1.70
log
@SVN rev 208737 on 2010-06-02 11:06:03Z by jmallett

Add/improve mips64r2, Octeon, n32 and n64 support in the toolchain.

o) Add TARGET_ABI to the MIPS toolchain build process.  This sets the default
   ABI to one of o32, n32 or n64.  If it is not set, o32 is assumed as that is
   the current default.
o) Set the default GCC cpu type to any specified TARGET_CPUTYPE.  This is
   necessary to have a working "cc" if e.g. mips64 is specified, as binutils
   will refuse to link objects using different ISAs in some cases.
o) Add support for n32 and n64 ABIs to binutils and GCC.
o) Add additional required libgcc2 stubs for n32 and n64.
o) Add support for the "mips64r2" architecture to GCC.  Add the "octeon"
o) When static linking, wrap default libraries in --start-group and
   --end-group.  This is required for static linking to work on n64 with the
   interdependencies between libraries there.  This is what other OSes that
   support n64 seem to do, as well.
o) Fix our GCC spec to define __mips64 for 64-bit targets, not __mips64__, the
   former being what libgcc, etc., check and the latter seemingly being a
   misspelling of a hand merge from a Linux spec.
o) When no TARGET_CPUTYPE is specified at build time, make GCC take the default
   ISA from the ABI.  Our old defaults were too liberal and assumed that 64-bit
   ABIs should default to the MIPS64 ISA and that 32-bit ABIs should default to
   the MIPS32 ISA, when we are supporting or will support some systems based on
   earlier 32-bit and 64-bit ISAs, most notably MIPS-III.
o) Merge a new opcode file (and support code) from a later version of binutils
   and add flags and code necessary to support Octeon-specific instructions.
   This should also make merging opcodes for other modern architectures easier.

Reviewed by:	imp
@
text
@d146 5
@


1.69
log
@SVN rev 207995 on 2010-05-12 19:59:32Z by obrien

Non-GCC gcc compatible compilers may provide the same multimedia intrinsic
headers as GCC, but of their own implementation.  So put the GCC ones into
their own header "namespace".

Requested by:	ed
@
text
@d121 6
@


1.68
log
@SVN rev 201852 on 2010-01-08 23:11:23Z by imp

Merge r195030 from project/mips into head by hand:

r195030 | gonzo | 2009-06-25 19:27:31 -0600 (Thu, 25 Jun 2009) | 4 lines
- Switch to libc softfloat from libgcc implementation. The problem
    with latter is that it is not complete, fpsetXXX/fpgetXXX
    functions are missing.
@
text
@d2 1
@


1.67
log
@SVN rev 200499 on 2009-12-14 01:51:23Z by kan

Fix one spelling and one copy&paste error in comments.
@
text
@d118 4
d186 1
a186 1
.if ${TARGET_ARCH} == "armNOT_YET" || ${TARGET_ARCH} == "mips" || \
@


1.66
log
@SVN rev 195697 on 2009-07-14 21:19:13Z by kan

Second attempt at eliminating .text relocations in shared libraries
compiled with stack protector.

Use libssp_nonshared library to pull __stack_chk_fail_local symbol into
each library that needs it instead of pulling it from libc. GCC
generates local calls to this function which result in absolute
relocations put into position-independent code segment, making dynamic
loader do extra work every time given shared library is being relocated
and making affected text pages non-shareable.

Reviewed by:        kib
Approved by:        re (kib)
@
text
@d300 1
a300 1
# Build additional static libgcc_eh[_p].a librarries.
d319 1
a319 1
# Build additional static libgcc_eh[_p].a librarries.
@


1.66.2.1
log
@SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)
@
text
@@


1.66.2.2
log
@SVN rev 215938 on 2010-11-27 12:26:40Z by jchandra

Merge MIPS platform support to 8-STABLE.

This commit merges the MIPS platform changes that was now stable in
-CURRENT into 8-STABLE. The MIPS changesets are too many (~400) to list
here. But the changesets merged in this commit that affect other platforms
are summarized below:

r204635 : (changes to sys/dev/hwpmc, lib/libpmc, sys/sys/pmc.h)
Add support for hwpmc(4) on the MIPS 24K, 32 bit, embedded processor.

r205845: (changes to sys/modules/Makefile)
Fix for building modules on mips and arm.

r204031: (changes to sys/kern/link_elf_obj.c)
printf fix, as part of kernel module support for MIPS.

r206404: (changes to sys/arm/include/bus.h)
Add BUS_SPACE_UNRESTRICTED and define it to be ~0, just like all the
other platforms - for arm and mips.

r206819: (changes to sys/vm/)
Add VMFS_TLB_ALIGNED_SPACE option and kmem_alloc_nofault_space(), which
is used to allocate kernel stack address on MIPS.

r208165, r211087: (sys/kern/subr_smp.c, sys/kern/sched_ule.c)
Enable ULE scheduler for MIPS, Fix for an issue in SMP when 32 cpus are
enabled.

r208659: (sys/{ia64/ia64,mips/mips,sun4v/sun4v}/pmap.c)
Simplify the inner loop of get_pv_entry()

r208794: (changes to sys/vm/)
Make vm_contig_grow_cache() extern, and use it when vm_phys_alloc_contig()
fails to allocate MIPS page table pages.

r210327:  (changes to sys/vm/)
Support for MIPS page table page allocation.  Add a new function 'vm_page_t
vm_page_alloc_freelist(int flind, int order, int req)' to vm/vm_page.c to
allocate a page from a specified freelist, and other related changes.

Reviewed by:	alc(vm changes only)
Approved by:	kib(re), alc(vm), imp(mips), jmallett(mips), gnn(mips pmc)
@
text
@a117 4
.if ${TARGET_ARCH} == "mips"
LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
.endif

d182 1
a182 1
.if ${TARGET_ARCH} == "armNOT_YET" || \
@


1.66.2.3
log
@SVN rev 228337 on 2011-12-08 00:47:22Z by gonzo

MFC r208737 (required by OCTEON* kernels):
  Add/improve mips64r2, Octeon, n32 and n64 support in the toolchain.

  o) Add TARGET_ABI to the MIPS toolchain build process.  This sets the default
     ABI to one of o32, n32 or n64.  If it is not set, o32 is assumed as that is
     the current default.
  o) Set the default GCC cpu type to any specified TARGET_CPUTYPE.  This is
     necessary to have a working "cc" if e.g. mips64 is specified, as binutils
     will refuse to link objects using different ISAs in some cases.
  o) Add support for n32 and n64 ABIs to binutils and GCC.
  o) Add additional required libgcc2 stubs for n32 and n64.
  o) Add support for the "mips64r2" architecture to GCC.  Add the "octeon"
  o) When static linking, wrap default libraries in --start-group and
     --end-group.  This is required for static linking to work on n64 with the
     interdependencies between libraries there.  This is what other OSes that
     support n64 seem to do, as well.
  o) Fix our GCC spec to define __mips64 for 64-bit targets, not __mips64__, the
     former being what libgcc, etc., check and the latter seemingly being a
     misspelling of a hand merge from a Linux spec.
  o) When no TARGET_CPUTYPE is specified at build time, make GCC take the default
     ISA from the ABI.  Our old defaults were too liberal and assumed that 64-bit
     ABIs should default to the MIPS64 ISA and that 32-bit ABIs should default to
     the MIPS32 ISA, when we are supporting or will support some systems based on
     earlier 32-bit and 64-bit ISAs, most notably MIPS-III.
  o) Merge a new opcode file (and support code) from a later version of binutils
     and add flags and code necessary to support Octeon-specific instructions.
     This should also make merging opcodes for other modern architectures easier.

No objections from:	imp, jmallet, jchandra
MFC after:	18 months
@
text
@a119 6
.if defined(TARGET_ABI) && ${TARGET_ABI} != "o32"
LIB2FUNCS_EXTRA+= floatdidf.c fixunsdfsi.c
LIB2FUNCS_EXTRA+= floatdisf.c floatundidf.c
LIB2FUNCS_EXTRA+= fixsfdi.c floatundisf.c
LIB2FUNCS_EXTRA+= fixdfdi.c fixunssfsi.c
.endif
@


1.66.2.4
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242909
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242909 | dim | 2012-11-12 07:47:19 +0000 (Mon, 12 Nov 2012) | 20 lines
## SVN ##
## SVN ## MFC r242625:
## SVN ##
## SVN ## Remove duplicate const specifiers in many drivers (I hope I got all of
## SVN ## them, please let me know if not).  Most of these are of the form:
## SVN ##
## SVN ## static const struct bzzt_type {
## SVN ##       [...list of members...]
## SVN ## } const bzzt_devs[] = {
## SVN ##       [...list of initializers...]
## SVN ## };
## SVN ##
## SVN ## The second const is unnecessary, as arrays cannot be modified anyway,
## SVN ## and if the elements are const, the whole thing is const automatically
## SVN ## (e.g. it is placed in .rodata).
## SVN ##
## SVN ## I have verified this does not change the binary output of a full kernel
## SVN ## build (except for build timestamps embedded in the object files).
## SVN ##
## SVN ## Reviewed by:	yongari, marius
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d1 1
a1 1
# $FreeBSD: stable/8/gnu/lib/libgcc/Makefile 228337 2011-12-08 00:47:22Z gonzo $
@


1.66.2.3.2.1
log
@SVN rev 232438 on 2012-03-03 06:15:13Z by kensmith

Copy stable/8 to releng/8.3 as part of 8.3-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.66.2.3.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/8.3/gnu/lib/libgcc/Makefile 228337 2011-12-08 00:47:22Z gonzo $
@


1.66.2.2.2.1
log
@SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)
@
text
@@


1.66.2.1.4.1
log
@SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)
@
text
@@


1.66.2.1.2.1
log
@SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)
@
text
@@


1.65
log
@SVN rev 195152 on 2009-06-29 01:33:59Z by kan

Back out previous revision until better tested fix is ready.

Approved by: re (impliciti, by approving previos check-in)
@
text
@d10 6
@


1.64
log
@SVN rev 195151 on 2009-06-28 23:51:39Z by kan

Eliminate .text relocations in shared libraries compiled with stack protector.

Use libssp_nonshared library to pull __stack_chk_fail_local symbol into
each library that needs it instead of pulling it from libc. GCC generates
local calls to this function which result in absolute relocations put into
position-independent code segment, making dynamic loader do extra work everys
time given shared library is being relocated and making affected text pages
non-shareable.

Reviewed by:        kib
Approved by:        re (kensmith)
@
text
@a8 6
#
# libgcc is linked in last and thus cannot depend on ssp symbols coming
# from earlier libraries. Disable stack protection for this library.
#
WITHOUT_SSP=	yes

d21 1
a21 1
LDADD+=		-lc -lssp_nonshared
@


1.63
log
@SVN rev 188583 on 2009-02-13 16:51:36Z by jkim

Honor WITHOUT_INSTALLLIB in some places.
@
text
@d9 6
d27 1
a27 1
LDADD+=		-lc
@


1.62
log
@SVN rev 183167 on 2008-09-19 03:09:36Z by imp

MFP4: Add mips to the list of soft-float platforms.
@
text
@d335 1
d338 1
@


1.61
log
@SVN rev 183165 on 2008-09-19 01:35:34Z by imp

Prefer the patch in p4 to the patch in svn as it properly sorts the
architectures alphabetically.
@
text
@d176 2
a177 2
.if ${TARGET_ARCH} == "armNOT_YET" || ${TARGET_ARCH} == "powerpc" || \
    ${TARGET_ARCH} == "sparc64"
@


1.60
log
@SVN rev 182627 on 2008-09-01 18:46:03Z by obrien

Add FreeBSD/MIPS support to GCC.
@
text
@d177 1
a177 1
    ${TARGET_ARCH} == "sparc64" || ${TARGET_ARCH} == "mips"
@


1.59
log
@Let PowerPC world optionally build with -msoft-float. For FPU-less PowerPC
variations (e500 currently), this provides a gcc-level FPU emulation and is an
alternative approach to the recently introduced kernel-level emulation
(FPU_EMU).

Approved by:	cognet (mentor)
MFp4:		e500
@
text
@d177 1
a177 1
    ${TARGET_ARCH} == "sparc64"
@


1.58
log
@Remove comment that was added by mistakes and which prevented _eprintf
and gcc_bcmp to be added to static libgcc.a.

Approved by:	re (kensmith)
@
text
@d125 1
a125 1
LIB2FUNCS_EXTRA = tramp.asm darwin-ldouble.c
@


1.58.2.1
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/7/gnu/lib/libgcc/Makefile 171846 2007-08-14 20:49:57Z kan $
@


1.58.12.1
log
@SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)
@
text
@@


1.58.12.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/7.4/gnu/lib/libgcc/Makefile 171846 2007-08-14 20:49:57Z kan $
@


1.58.10.1
log
@SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)
@
text
@@


1.58.8.1
log
@SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)
@
text
@@


1.58.6.1
log
@SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)
@
text
@@


1.57
log
@Update bmake glue to build GCC 4.2.

Also:
        Switch FreeBSD to use libgcc_s.so.1.

        Use dl_iterate_phdr to locate shared objects' exception frame
        info instead of depending on older register_frame_info machinery.
        This allows us to avoid depending on libgcc_s.so.1 in binaries
        that do not use exception handling directly. As an additional
        benefit it breaks circular libc <=> libgcc_s.so.1 dependency too.

        Build newly added libgomp.so.1 library, the runtime support
        bits for OpenMP.

        Build LGPLed libssp library. Our libc provides our own
        BSD-licensed SSP callbacks implementation, so this library
        is only built to benefit applications that have hadcoded
        knowledge of libssp.so and libssp_nonshared.a. When linked
        in from command line, these libraries override libc
        implementation.
@
text
@d220 1
a220 1
#SYMS_ST =	${LIB2FUNCS_ST}	${LIB2ADD_ST}
@


1.56
log
@Don't build the libgcc with functions already included in the libc to
unbreak the build.
We'll switch back to the libgcc functions and get rid of the libsoftfloat
later.
@
text
@d2 6
d12 1
a12 2
GCCDIR=	${.CURDIR}/../../../contrib/gcc
.PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR}
d14 5
a18 9
# allow to be overridden for the a.out case
.if !defined(LIB) || ${LIB} != "gcc_r"
LIB=	gcc
.endif

#SHLIB_MAJOR=	1

# We need to install libgcc_pic.a as well, for use by shared libs.
INSTALL_PIC_ARCHIVE=
d20 2
a21 22
#
# XXX This is a hack, but it seems to work.
# libgcc2.a is meant to be compiled by *this* version of gcc.
#
# Normally, this does not make any difference, since we only have gcc, but
# when bootstrapping from gcc-2.6.3, we have to use the freshly built 2.7.2
# compiler for some of the libgcc2.c __attribute__ stuff.
#
# We now depend on a bootstrap pass (normally in `make world') to build
# and install the new version of gcc before we get here.  This makes
# finding the new version (XCC) easy but may break finding the old version
# (CC).
#
XCC=	${CC}
XCXX=	${CXX}

CFLAGS+=	-fexceptions
CFLAGS+=	-DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \
		-DFINE_GRAINED_LIBRARIES
CFLAGS+=	-D_PTHREADS -DGTHREAD_USE_WEAK
CFLAGS+=	-I${.CURDIR}/../../usr.bin/cc/cc_tools \
		-I${GCCDIR}/config -I${GCCDIR} -I.
d30 2
a31 4
LIB2FUNCS = _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 \
	_cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi \
	_fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi \
	_floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf _clear_cache \
d35 31
a65 1
	_popcountsi2 _popcountdi2 _paritysi2 _paritydi2 
d68 2
d75 1
a75 1
    _sf_to_df _sf_to_tf _thenan_sf _sf_to_usi _usi_to_sf
d80 1
a80 1
    _df_to_sf _df_to_tf _thenan_df _df_to_usi _usi_to_df
a90 6
LIB2ADD = $(LIB2FUNCS_EXTRA)
LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA)

# Additional sources to handle exceptions; overridden by targets as needed.
LIB2ADDEH = unwind-dw2.c unwind-dw2-fde.c unwind-sjlj.c gthr-gnat.c unwind-c.c

d94 1
a94 1
#	When upgrading GCC, get the following defintions from config/<cpu>/t-*
a95 6

.if ${TARGET_ARCH} == "alpha"
#	from config/alpha/t-alpha
LIB2FUNCS_EXTRA = qrnnd.asm
.endif

d100 10
a109 5
LIB1ASMFUNCS =	_dvmd_tls _bb_init_func
OBJS+=	dp-bit.o fp-bit.o
# We want fine grained libraries, so use the new code to build the
# floating point emulation libraries.
XXX fix this: NEED_FP_EMULATION set to "yes" with different rules per platform
d114 7
a120 6
LIB1ASMSRC    = lib1funcs.asm
LIB1ASMFUNCS  = __divxf3 __divdf3 __divsf3 \
        __divdi3 __moddi3 __udivdi3 __umoddi3 \
        __divsi3 __modsi3 __udivsi3 __umodsi3 __save_stack_nonlocal \
        __nonlocal_goto __restore_stack_nonlocal __trampoline __compat
LIB2ADDEH = unwind-ia64.c unwind-sjlj.c unwind-c.c gthr-gnat.c
d125 1
a125 2
LIB2FUNCS_EXTRA = tramp.asm
# This one can't end up in shared libgcc
a126 3
# We want fine grained libraries, so use the new code to build the
# floating point emulation libraries.
OBJS+=	dp-bit.o fp-bit.o
d131 1
a131 3
# We want fine grained libraries, so use the new code to build the
# floating point emulation libraries.
LIB1ASMSRC = lb1spc.asm
a132 1
OBJS+=	dp-bit.o fp-bit.o
a134 18
dp-bit.o: config/fp-bit.c
	${XCC} -c ${CFLAGS} -o ${.TARGET} ${.ALLSRC:M*fp-bit*}

dp-bit.So: config/fp-bit.c
	${XCC} ${PICFLAG} -c ${CFLAGS} -o ${.TARGET} ${.ALLSRC:M*fp-bit*}

dp-bit.po: config/fp-bit.c
	${XCC} -p -c ${CFLAGS} -o ${.TARGET} ${.ALLSRC:M*fp-bit*}

fp-bit.o: config/fp-bit.c
	${XCC} -DFLOAT=1 -c ${CFLAGS} -o ${.TARGET} ${.ALLSRC:M*fp-bit*}

fp-bit.So: config/fp-bit.c
	${XCC} ${PICFLAG} -DFLOAT=1 -c ${CFLAGS} -o ${.TARGET} ${.ALLSRC:M*fp-bit*}

fp-bit.po: config/fp-bit.c
	${XCC} -p -DFLOAT=1 -c ${CFLAGS} -o ${.TARGET} ${.ALLSRC:M*fp-bit*}

d146 1
a146 21
ASM_T=		${LIB1ASMFUNCS:S/$/.o/}
ASM_P=		${LIB1ASMFUNCS:S/$/.po/}
ASM_S=		${LIB1ASMFUNCS:S/$/.So/}

SYMS=		${LIB2FUNCS}		\
		${LIB2_DIVMOD_FUNCS}
.if ${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "sparc64"
SYMS+=		${FPBIT_FUNCS} ${DPBIT_FUNCS}
.endif
SYMS_ST=	${LIB2FUNCS_ST}		\
		${LIB2ADD_ST}
OBJS+=		${SYMS:S/$/.o/} ${LIB1ASMFUNCS:S/$/.o/}
OBJS_T=		${SYMS:S/$/.o/}  ${SYMS_ST:S/$/.o/}
OBJS_P=		${SYMS:S/$/.po/} ${SYMS_ST:S/$/.po/}
OBJS_S=		${SYMS:S/$/.So/}
STATICOBJS=	${SYMS_ST:S/$/.o/}
SRCS=		${LIB2ADD} ${LIB2ADDEH}

COMMONHDRS=	tm.h tconfig.h
SRCS+=		${COMMONHDRS}
CLEANFILES+=	${COMMONHDRS}
d148 30
a177 2
${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile
	${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}
d179 2
a180 1
${OBJS} beforedepend: ${COMMONHDRS}
d182 2
a183 2
${OBJS_T}: libgcc2.c
	${XCC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
d185 1
a185 3
.if !defined(NO_PIC)
${OBJS_S}: libgcc2.c
	${XCC} -c ${PICFLAG} ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
d188 26
a213 3
.if ${MK_PROFILE} != "no"
${OBJS_P}: libgcc2.c
	${XCC} -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
d216 18
d235 14
a248 3
.for _lib1asmsrc in ${LIB1ASMSRC}
${ASM_T}: ${_lib1asmsrc}
	${XCC} -x assembler-with-cpp -c ${CFLAGS} -DL${.PREFIX} \
d250 6
d257 1
a257 4
.if !defined(NO_PIC)
${ASM_S}: ${_lib1asmsrc}
	${XCC} -x assembler-with-cpp -c ${PICFLAG} ${CFLAGS} -DL${.PREFIX} \
	    -o ${.TARGET} ${.ALLSRC:N*.h}
d260 63
d324 6
a329 3
${ASM_P}: ${_lib1asmsrc}
	${XCC} -x assembler-with-cpp -p -c ${CFLAGS} -DL${.PREFIX} \
	    -o ${.TARGET} ${.ALLSRC:N*.h}
d331 9
a339 1
.endfor
d342 2
d345 2
@


1.55
log
@Convert NO_PROFILE and NO_LIB32 to new style.
@
text
@d101 1
a101 1
LIB1ASMFUNCS =	_udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func
@


1.54
log
@NODOCCOMPRESS -> NO_DOCCOMPRESS
NOINFO -> NO_INFO
NOINFOCOMPRESS -> NO_INFOCOMPRESS
NOLINT -> NO_LINT
NOPIC -> NO_PIC
NOPROFILE -> NO_PROFILE
@
text
@d3 1
d201 1
a201 1
.if !defined(NO_PROFILE)
d218 1
a218 1
.if !defined(NO_PROFILE)
@


1.54.2.1
log
@ARM in its present state cannot handle the full LIB1ASMFUNCS and FP/DPBIT's
so build a limited set.

Approved by: re(KEN)
@
text
@d100 2
a101 4
LIB1ASMFUNCS =	_dvmd_tls _bb_init_func 
#LIB1ASMFUNCS+=	_fixunsdfsi _addsubsf3 _addsubdf3 \
#		_truncdfsf2 _fixdfsi _extendsfdf2 _fixsfsi _cmpdf2 _cmpsf2 \
#		_muldivdf3 _muldivsf3
d171 1
a171 1
.if ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "sparc64"
@


1.54.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/6/gnu/lib/libgcc/Makefile 163040 2006-10-05 19:46:06Z obrien $
@


1.54.2.1.6.1
log
@SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)
@
text
@@


1.53
log
@For variables that are only checked with defined(), don't provide
any fake value.
@
text
@d195 1
a195 1
.if !defined(NOPIC)
d200 1
a200 1
.if !defined(NOPROFILE)
d211 1
a211 1
.if !defined(NOPIC)
d217 1
a217 1
.if !defined(NOPROFILE)
@


1.52
log
@Add missing patch which was forgotten during GCC 3.4.2 import. libgcc.a
gets most of it content back now, when symbols from LIB2FUNCS are actually
compiled.

Noticed by: Steve Kargl <gk at troutmask dot apl dot washington dot edu>
Pointy hat to: kan
@
text
@d16 1
a16 1
INSTALL_PIC_ARCHIVE=    yes     
@


1.52.2.1
log
@MFC: For variables that are only checked with defined(), don't provide
     any fake value.
@
text
@d16 1
a16 1
INSTALL_PIC_ARCHIVE=
@


1.51
log
@Bmake glue for GCC 3.4.2-prerelease.
@
text
@d160 1
a160 2
LIB2FUNCS_1:=	${LIB2FUNCS_1:S/${sym}//g}
LIB2FUNCS_2:=	${LIB2FUNCS_2:S/${sym}//g}
d169 1
a169 2
SYMS=		${LIB2FUNCS_1}		\
		${LIB2FUNCS_2}		\
@


1.50
log
@Add unwind-c.c file required for -fexceptions in C sources.
@
text
@a46 1

d48 8
a55 8
# Variable length limited to 255 charactes when passed to a shell script.
LIB2FUNCS_1 = _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 _clz \
    _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi \
    _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi

LIB2FUNCS_2 = _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf \
    _clear_cache _trampoline __main _exit _absvsi2 _absvdi2 _addvsi3 \
    _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors
d58 1
a58 1
LIB2FUNCS_ST = _eprintf _bb __gcc_bcmp
d63 1
a63 1
    _sf_to_df _thenan_sf _sf_to_usi _usi_to_sf
d68 6
a73 1
    _df_to_sf _thenan_df _df_to_usi _usi_to_df
a78 2
MACHMODE_H = machmode.h machmode.def

d82 2
a83 2
# Additional sources to handle exceptions; overridden on ia64.
LIB2ADDEH = unwind-dw2.c unwind-dw2-fde.c unwind-sjlj.c unwind-c.c
d98 4
a101 2
LIB1ASMSRC = lib1funcs.asm
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func
d110 5
a114 5
LIB1ASMFUNCS  = __divtf3 __divdf3 __divsf3 \
	__divdi3 __moddi3 __udivdi3 __umoddi3 \
	__divsi3 __modsi3 __udivsi3 __umodsi3 __save_stack_nonlocal \
	__nonlocal_goto __restore_stack_nonlocal __trampoline
LIB2ADDEH = unwind-ia64.c unwind-sjlj.c unwind-c.c
d185 1
a185 1
COMMONHDRS=	tconfig.h
d189 1
a189 1
tconfig.h: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile
@


1.49
log
@Catch up with bsd.lib.mk,v 1.143.
@
text
@d81 1
a81 1
LIB2ADDEH = unwind-dw2.c unwind-dw2-fde.c unwind-sjlj.c
d110 1
a110 1
LIB2ADDEH = unwind-ia64.c unwind-sjlj.c
@


1.48
log
@Build/install the PIC version of libgcc (libcc_pic.a) for use by shared
libraries that do exception unwinding.
@
text
@a39 1
LDFLAGS=	-nostdlib
a191 2
	@@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}
a195 2
	@@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}
a200 2
	@@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}
a207 2
	@@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}
a212 2
	@@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}
a218 2
	@@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}
@


1.47
log
@Zap now-unused SHLIB_MINOR
@
text
@d15 3
@


1.46
log
@Initiate deorbit burn for the i386-only a.out related support.  Moves are
under way to move the remnants of the a.out toolchain to ports.  As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL.  It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha
@
text
@a13 1
#SHLIB_MINOR=	0
@


1.45
log
@Fix the sparc64 build and make the LIB1ASMSRC handling more robust.
@
text
@a15 5
.if ${OBJFORMAT} == aout
# Install libgcc_pic.a, since ld.so uses it.
INSTALL_PIC_ARCHIVE=  yes
.endif

a34 1
.if ${OBJFORMAT} != aout
a35 1
.endif
@


1.44
log
@Improve chances that we correctly compile LIB1ASMSRC on all architectures.

sparc64 looked for the nonexistent sparc64/lb1spc.asm file instead
of the sparc/lb1spc.asm file.

arm probably looked for arm/arm/lib1funcs.asm instead of arm/lib1funcs.asm
ia64 probably looked for ia64/ia64/lib1funcs.asm instead of ia64/lib1funcs.asm

i386 and alpha don't seen to use the LIB1ASMSRC.
@
text
@d102 1
a102 1
LIB1ASMSRC = arm/lib1funcs.asm
d111 1
a111 1
LIB1ASMSRC    = ia64/lib1funcs.asm
d133 1
a133 1
LIB1ASMSRC = sparc/lb1spc.asm
d216 4
a219 2
${ASM_T}: ${LIB1ASMSRC}
	${XCC} -x assembler-with-cpp -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${GCCDIR}/config/${LIB1ASMSRC}
d224 3
a226 2
${ASM_S}: ${LIB1ASMSRC}
	${XCC} -x assembler-with-cpp -c ${PICFLAG} ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${GCCDIR}/config/${LIB1ASMSRC}
d232 3
a234 2
${ASM_P}: ${LIB1ASMSRC}
	${XCC} -x assembler-with-cpp -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${GCCDIR}/config/${LIB1ASMSRC}
d238 1
@


1.43
log
@Move LIB1ASMFUNCS from the SYMS variable and explicitly add it to OBJS
later.  Otherwise make will try and build the supposedly assembler .o
files from libgcc2.c - which does not work too well (the .o's have no
content)

Reviewed by:	obrien
@
text
@d133 1
a133 1
LIB1ASMSRC = lb1spc.asm
d230 1
a230 1
	${XCC} -x assembler-with-cpp -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${GCCDIR}/config/${TARGET_ARCH}/${LIB1ASMSRC}
@


1.42
log
@Post rev 1.39, the PowerPC specific additions to OBJS was getting lost.
@
text
@d172 1
a172 2
SYMS=		${LIB1ASMFUNCS}		\
		${LIB2FUNCS_1}		\
d180 1
a180 1
OBJS+=		${SYMS:S/$/.o/}
@


1.41
log
@bsd.lib.mk now understands what to do with .asm files.
So we can refer to these files by their real name vs. playing tricks
renaming them during the build.
@
text
@d47 2
d181 1
a184 1
OBJS=		${SYMS:S/$/.o/}
@


1.40
log
@Properly build lb1spc.asm on Sparc64.
@
text
@d119 1
a119 1
LIB2FUNCS_EXTRA = tramp.S
d121 1
a121 1
LIB2FUNCS_STATIC_EXTRA = eabi.S
@


1.39
log
@I was not strict enough with my ordering of things to satisfy make(1) nieve
symbol evaluation which causes it to be very sensitive to macro ordering.
@
text
@d3 1
a3 1
TARGET_ARCH?=	${MACHINE_ARCH}
d6 1
a6 1
.PATH: ${GCCDIR}/config/${TARGET_ARCH} ${GCCDIR}
d131 1
a131 1
LIB1ASMSRC = sparc/lb1spc.asm
d166 4
d212 21
@


1.38
log
@[Ab]use LDFLAGS rather than CFLAGS.
BDE tells me POSIX pretends `ld' as a directly callable entity does not exist.
@
text
@a46 28
# Remove any objects from LIB2FUNCS and LIB2_DIVMOD_FUNCS that are
# defined as optimized assembly code in LIB1ASMFUNCS.
.if defined(LIB1ASMFUNCS)
.for sym in ${LIB1ASMFUNCS}
LIB2FUNCS_1=	${LIB2FUNCS_1:S/${sym}//g}
LIB2FUNCS_2=	${LIB2FUNCS_2:S/${sym}//g}
LIB2_DIVMOD_FUNCS= ${LIB2_DIVMOD_FUNCS:S/${sym}//g}
.endfor
.endif

SYMS=		${LIB1ASMFUNCS}		\
		${LIB2FUNCS_1}		\
		${LIB2FUNCS_2}		\
		${LIB2_DIVMOD_FUNCS}
.if ${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "sparc64"
SYMS+=		${FPBIT_FUNCS} ${DPBIT_FUNCS}
.endif
SYMS_ST=	${LIB2FUNCS_ST}		\
		${LIB2ADD_ST}
OBJS_T=		${SYMS:S/$/.o/}  ${SYMS_ST:S/$/.o/}
OBJS_P=		${SYMS:S/$/.po/} ${SYMS_ST:S/$/.po/}
OBJS_S=		${SYMS:S/$/.So/}
OBJS=		${SYMS:S/$/.o/}
STATICOBJS=	${SYMS_ST:S/$/.o/}
SRCS=		${LIB2ADD} ${LIB2ADDEH}



d155 26
@


1.37
log
@Bmake bits for Gcc 3.1.

Partially made possible by:	Wilko.Bulte@@compaq.com
@
text
@d37 1
a37 1
CFLAGS+=	-nostdlib -fexceptions
d45 1
@


1.36
log
@It is easier for me to debug with -I's at the rear.
@
text
@d3 1
a3 1
GCCDIR=	${.CURDIR}/../../../contrib/gcc.295
d5 2
a6 1
.PATH: ${GCCDIR}/cp ${GCCDIR}
d13 3
d22 2
a23 3
# XXX This is a hack, but it seems to work.  libgcc1.a is supposed to be
# compiled by the native compiler, and libgcc2.a is meant to be compiled
# by *this* version of gcc.
d37 41
a77 8
# Members of libgcc1.a.
LIB1FUNCS= _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
	   _lshrsi3 _ashrsi3 _ashlsi3 \
	   _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \
	   _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \
	   _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \
	   _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
	   _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
d80 25
a104 12
LIB2FUNCS= _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
	   _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 \
	   _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
	   _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
	   _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \
	   _fixtfdi _fixunstfdi _floatditf \
	   __gcc_bcmp _varargs __dummy _eprintf \
	   _bb _shtab _clear_cache _trampoline __main _exit _ctors \
	   _eh _pure

# Library members defined in new1.cc.
NEW1FUNCS= _op_new _op_newnt 
d106 1
a106 2
# Library members defined in new2.cc.
NEW2FUNCS= _op_vnew _op_vnewnt _op_delete _op_delnt _op_vdel _op_vdelnt 
d108 2
a109 1
SRCS=	frame.c tinfo.cc tinfo2.cc new.cc exception.cc
d111 31
a141 4
CFLAGS+=	-fexceptions
CFLAGS+=	-DIN_GCC
.if ${OBJFORMAT} != aout
CFLAGS+=	-D_PTHREADS -DGTHREAD_USE_WEAK
a142 3
CFLAGS+=	-I${GCCDIR}/config -I${GCCDIR} -I.
CXXFLAGS+=	-I${GCCDIR}/cp/inc
CXXFLAGS+=	-nostdinc++
d144 9
a152 3
COMMONHDRS=	config.h tconfig.h tm.h
CLEANFILES+=	${COMMONHDRS}
SRCS+=		${COMMONHDRS}
d154 7
a160 33
LIB1OBJS=	${LIB1FUNCS:S/$/.o/}
LIB2OBJS=	${LIB2FUNCS:S/$/.o/}
LIB1SOBJS=	${LIB1FUNCS:S/$/.So/}
LIB2SOBJS=	${LIB2FUNCS:S/$/.So/}
LIB1POBJS=	${LIB1FUNCS:S/$/.po/}
LIB2POBJS=	${LIB2FUNCS:S/$/.po/}
NEW1OBJS=	${NEW1FUNCS:S/$/.o/}
NEW2OBJS=	${NEW2FUNCS:S/$/.o/}
NEW1SOBJS=	${NEW1FUNCS:S/$/.So/}
NEW2SOBJS=	${NEW2FUNCS:S/$/.So/}
NEW1POBJS=	${NEW1FUNCS:S/$/.po/}
NEW2POBJS=	${NEW2FUNCS:S/$/.po/}

OBJS=	${LIB1OBJS} ${LIB2OBJS} ${NEW1OBJS} ${NEW2OBJS}

config.h:
	echo '#include <${MACHINE_ARCH}/xm-${MACHINE_ARCH}.h>'	> ${.TARGET}
	echo '#include <xm-freebsd.h>'				>> ${.TARGET}

tconfig.h:
	echo '#include "gansidecl.h"'				> ${.TARGET}
	echo '#include "${MACHINE_ARCH}/xm-${MACHINE_ARCH}.h"'	>> ${.TARGET}

#	KEEP THIS IN SYNC with src/gcc/usr.bin/cc/cc_tools/Makefile !!
tm.h:
	echo '#include "${MACHINE_ARCH}/${MACHINE_ARCH}.h"'	> ${.TARGET}
.if ${MACHINE_ARCH} == "i386"
	echo '#include "${MACHINE_ARCH}/att.h"'			>> ${.TARGET}
.endif
	echo '#include <freebsd.h>'				>> ${.TARGET}
	echo '#include "${MACHINE_ARCH}/freebsd.h"'		>> ${.TARGET}
.if ${MACHINE_ARCH} == "i386"
	echo '#include "${MACHINE_ARCH}/perform.h"'		>> ${.TARGET}
d163 5
a167 1
${OBJS}: ${COMMONHDRS}
d169 8
a176 4
${LIB1OBJS}: libgcc1.c
	${CC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
	@@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}
d178 2
a179 4
${LIB2OBJS}: libgcc2.c
	${XCC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
	@@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}
d181 1
a181 4
${NEW1OBJS}: new1.cc
	${XCXX} -c ${CXXFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.cc}
	@@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}
d183 3
a185 4
${NEW2OBJS}: new2.cc
	${CXX} -c ${CXXFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.cc}
	@@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}
d187 2
a188 5
.if !defined(NOPIC)
${LIB1SOBJS}: libgcc1.c
	${CC} -c ${PICFLAG} ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
	@@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}
d190 1
a190 4
${LIB2SOBJS}: libgcc2.c
	${XCC} -c ${PICFLAG} ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
	@@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}
d192 2
a193 2
${NEW1SOBJS}: new1.cc
	${XCXX} -c ${PICFLAG} ${CXXFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.cc}
d197 3
a199 2
${NEW2SOBJS}: new2.cc
	${CXX} -c ${PICFLAG} ${CXXFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.cc}
d205 1
a205 6
${LIB1POBJS}: libgcc1.c
	${CC} -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
	@@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}

${LIB2POBJS}: libgcc2.c
a206 10
	@@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}

${NEW1POBJS}: new1.cc
	${XCXX} -c -p ${CXXFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.cc}
	@@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}

${NEW2POBJS}: new2.cc
	${CXX} -c -p ${CXXFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.cc}
@


1.35
log
@Style reorg.  Also spell -fpic as determined by bsd.lib.mk.
@
text
@a61 1
CFLAGS+=	-I${GCCDIR}/config -I${GCCDIR} -I.
d67 1
@


1.34
log
@Use a unified libgcc rather than a seperate one for threaded and
non-threaded programs.  This provides threaded programs with the
needed exception frame symbols.

parts submitted by:	Max Khon <fjoe@@iclub.nsu.ru>
PR:	23252
@
text
@d1 1
a1 1
# $FreeBSD: src/gnu/lib/libgcc/Makefile,v 1.33 2000/06/04 06:56:21 obrien Exp $
a65 1
#CFLAGS+=	-D_PTHREADS -fPIC -DGTHREAD_USE_WEAK
d88 1
a88 1
OBJS=		${LIB1OBJS} ${LIB2OBJS} ${NEW1OBJS} ${NEW2OBJS}
d134 1
a134 1
	${CC} -c -fpic ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
d139 1
a139 1
	${XCC} -c -fpic ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
d144 1
a144 1
	${XCXX} -c -fpic ${CXXFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.cc}
d149 1
a149 1
	${CXX} -c -fpic ${CXXFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.cc}
@


1.34.2.1
log
@Working changes for GCC 3.0.2.
We now fake out the native libgcc.mk + GNU autoconf'ed Makefile.
This gives us the flexability we will need to support our new arches
(StrongARM, Sparc64, PowerPC, and IA-64).  If this new way proves to
be too much a hassle, I still have a close-to-being-finished version
that is more like the 2.95 version of this file.
@
text
@d1 1
a1 2
# $FreeBSD$
# ex:ts=8
d3 1
a3 1
GCCDIR=	${.CURDIR}/../../../contrib/gcc
d17 46
d64 1
a64 1
CFLAGS+=	-DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED
d66 1
a66 1
#CFLAGS+=	-fPIC -D_PTHREADS -DGTHREAD_USE_WEAK
d69 2
a70 18

all: lib${LIB}.a

lib${LIB}.a: libgcc_build.a
	cp -p ${.ALLSRC} ${.TARGET}

CLEANFILES+=	lib${LIB}.a

#
#	fake out to semi-follow what is done in GCC's Makefile.in
#
srcdir=		${GCCDIR}
GCC_FOR_TARGET=	${CC}
LIBGCC2_CFLAGS=	${CFLAGS}
INCLUDES=	-I${GCCDIR}/config \
		-I${GCCDIR} \
		-I. \
		-I${.CURDIR}/../../usr.bin/cc/cc_tools
d76 15
d92 1
a92 3
	echo '#include "auto-host.h"'				> ${.TARGET}
	echo '#include "gansidecl.h"'				>> ${.TARGET}
	echo '#include <${MACHINE_ARCH}/xm-${MACHINE_ARCH}.h>'	>> ${.TARGET}
a93 6
	echo '#include "defaults.h"'			>> ${.TARGET}
	echo '#include "hwint.h"'			>> ${.TARGET}
	echo '#ifndef POSIX'				>> ${.TARGET}
	echo '# define POSIX'				>> ${.TARGET}
	echo '#endif'					>> ${.TARGET}

d96 1
a96 1
	echo '#include "gansidecl.h"'			> ${.TARGET}
a97 2
	echo '#include "defaults.h"'			>> ${.TARGET}

d101 1
a101 2
	echo '#include "gansidecl.h"'				> ${.TARGET}
	echo '#include "${MACHINE_ARCH}/${MACHINE_ARCH}.h"'	>> ${.TARGET}
a104 1
	echo '#include <freebsd-native.h>'		>> ${.TARGET}
a105 3
.if exists(${MACHINE_ARCH}/config/${MACHINE_ARCH}/elf.h)
	echo '#include "${MACHINE_ARCH}/elf.h"'		>> ${.TARGET}
.endif
a109 1
	echo '#include "defaults.h"'			>> ${.TARGET}
d111 1
d113 63
a175 139
#
# XXX Make sure changes in GCC's Makefile.in are synced here !!
#

libgcc_build.a: ${COMMONHDRS} libgcc.mk
	$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
	  AR_FOR_TARGET="ar" \
	  AR_CREATE_FOR_TARGET="ar rc" \
	  AR_FLAGS_FOR_TARGET="" \
	  OLDCC="${CC}" CCLIBFLAGS="-O" \
	  CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
	  RANLIB_FOR_TARGET="ranlib" \
	  RANLIB_TEST_FOR_TARGET="true" \
	  NM_FOR_TARGET="nm" AWK="awk" \
	  LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
	  INCLUDES="$(INCLUDES)" MAYBE_USE_COLLECT2="$(MAYBE_USE_COLLECT2)" \
	  CONFIG_H="${COMMONHDRS}" MACHMODE_H="$(MACHMODE_H)" \
	  LIB1ASMSRC='$(LIB1ASMSRC)' \
	  -f libgcc.mk ./libgcc_build.a

#
# XXX Make sure changes in GCC's Makefile.in are synced here !!
#

libgcc.mk: mklibgcc
	objext='.o' \
	OLDCC='${CC}' \
	LIBGCC1='libgcc1.a' \
	LIB1FUNCS='$(LIB1FUNCS)' \
	LIB1ASMFUNCS='$(LIB1ASMFUNCS)' \
	LIB1FUNCS_EXTRA='$(LIB1FUNCS_EXTRA)' \
	LIB2FUNCS='$(LIB2FUNCS)' \
	LIB2FUNCS_ST='$(LIB2FUNCS_ST)' \
	LIB2ADD='$(LIB2ADD)' \
	LIB2ADDEH='$(LIB2ADDEH)' \
	LIB2ADDEHDEP='$(LIB2ADDEHDEP)' \
	LIB2ADD_ST='$(LIB2ADD_ST)' \
	FPBIT='$(FPBIT)' \
	FPBIT_FUNCS='$(FPBIT_FUNCS)' \
	DPBIT='$(DPBIT)' \
	DPBIT_FUNCS='$(DPBIT_FUNCS)' \
	MULTILIBS='.;' \
	EXTRA_MULTILIB_PARTS='$(EXTRA_MULTILIB_PARTS)' \
	SHLIB_LINK='$(SHLIB_LINK)' \
	SHLIB_INSTALL='$(SHLIB_INSTALL)' \
	SHLIB_EXT='$(SHLIB_EXT)' \
	SHLIB_MULTILIB='$(SHLIB_MULTILIB)' \
	SHLIB_MKMAP='$(SHLIB_MKMAP)' \
	SHLIB_MAPFILES='$(SHLIB_MAPFILES)' \
	SHLIB_NM_FLAGS='$(SHLIB_NM_FLAGS)' \
	  $(SHELL) mklibgcc > tmp-libgcc.mk
	echo ".PATH: ${GCCDIR}" > ${.TARGET}
	sed -e 's|libgcc/\./||g' tmp-libgcc.mk >> ${.TARGET}
	rm tmp-libgcc.mk
	touch config.status stmp-int-hdrs

mklibgcc: mklibgcc.in
	sed								\
	    -e 's|libgcc\.a|libgcc_build.a|g'				\
	    -e 's|@@srcdir@@|${GCCDIR}|g'					\
	    -e 's|@@build_canonical@@|${MACHINE_ARCH}-deo-freebsd5.0|g'	\
	    -e 's|@@target@@|${MACHINE_ARCH}-deo-freebsd5.0|g'		\
	    -e 's|@@enable_shared@@|no|g'					\
	    -e 's|@@NO_MINUS_C_MINUS_O@@||g'				\
	    ${.ALLSRC} > ${.TARGET}

CLEANFILES+=	mklibgcc libgcc.mk config.status \
		stmp-int-hdrs tmp-libgcc.mk stmp-dirs \
		libgcc_build.a

#
# XXX This is a hack, but it seems to work.
# When upgrading GCC, get the following defintions straight from Makefile.in
#

# Members of libgcc1.a.
LIB1FUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
   _lshrsi3 _ashrsi3 _ashlsi3 \
   _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \
   _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \
   _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \
   _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
   _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2

# Library members defined in libgcc2.c.
LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
     _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 _clz \
    _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
    _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
    _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \
    _fixtfdi _fixunstfdi _floatditf \
    _clear_cache _trampoline __main _exit \
    _absvsi2 _absvdi2 _addvsi3 _addvdi3 _subvsi3 _subvdi3 \
    _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 \
    _ctors

# Defined in libgcc2.c, included only in the static library.
LIB2FUNCS_ST = _eprintf _bb __gcc_bcmp 

FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
    _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
    _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \
    _sf_to_df _thenan_sf _sf_to_usi _usi_to_sf

DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
    _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \
    _lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \
    _df_to_sf _thenan_df _df_to_usi _usi_to_df

# Build libgcc.a.
LIB2ADD = $(LIB2FUNCS_EXTRA)
LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA)

# Additional sources to handle exceptions; overridden on ia64.
LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
  $(srcdir)/unwind-sjlj.c
LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h

MACHMODE_H = machmode.h machmode.def

# nm flags to list global symbols in libgcc object files.
SHLIB_NM_FLAGS = -pg

#
#	Bmake'ed tweaks for the GCC Makefile.in barrowed bits.
#

.for objfile in ${LIB1FUNCS} ${LIB2FUNCS} ${LIB2FUNCS_ST} ${FPBIT_FUNCS} \
    ${DPBIT_FUNCS}
CLEANFILES+=	${objfile}.o
.endfor

CLEANFILES+=	${LIB2ADDEH:S/.c/.o/g:S/$(srcdir)\///g}

CLEANDIRS+=	libgcc

#
#	Need to supply an `install' target as we aren't using bsd.lib.mk.
#
d177 1
a177 7
install:
	${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
	    ${_INSTALLFLAGS} lib${LIB}.a ${DESTDIR}${LIBDIR}

.include <bsd.dep.mk>
.include <bsd.obj.mk>
.include <bsd.sys.mk>
@


1.34.2.2
log
@MFC: reorg.
@
text
@d21 1
a26 1
CLEANFILES+=	lib${LIB}.a
d29 2
@


1.34.2.3
log
@Update for GCC 3.1.

Tested on:	alpha, sparc64, i386
@
text
@d2 1
d4 1
a4 1
TARGET_ARCH?=	${MACHINE_ARCH}
d6 1
a6 2
GCCDIR=	${.CURDIR}/../../../contrib/gcc
.PATH: ${GCCDIR}/config/${TARGET_ARCH} ${GCCDIR}
a12 3
SHLIB_MAJOR=	3.1
SHLIB_MINOR=	0

a17 17
#
# XXX This is a hack, but it seems to work.
# libgcc2.a is meant to be compiled by *this* version of gcc.
#
# Normally, this does not make any difference, since we only have gcc, but
# when bootstrapping from gcc-2.6.3, we have to use the freshly built 2.7.2
# compiler for some of the libgcc2.c __attribute__ stuff.
#
# We now depend on a bootstrap pass (normally in `make world') to build
# and install the new version of gcc before we get here.  This makes
# finding the new version (XCC) easy but may break finding the old version
# (CC).
#
XCC=	${CC}
XCXX=	${CXX}


d19 1
a19 2
CFLAGS+=	-DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \
		-DFINE_GRAINED_LIBRARIES
a22 2
CFLAGS+=	-I${.CURDIR}/../../usr.bin/cc/cc_tools \
		-I${GCCDIR}/config -I${GCCDIR} -I.
d24 1
a24 9
# Remove any objects from LIB2FUNCS and LIB2_DIVMOD_FUNCS that are
# defined as optimized assembly code in LIB1ASMFUNCS.
.if defined(LIB1ASMFUNCS)
.for sym in ${LIB1ASMFUNCS}
LIB2FUNCS_1=	${LIB2FUNCS_1:S/${sym}//g}
LIB2FUNCS_2=	${LIB2FUNCS_2:S/${sym}//g}
LIB2_DIVMOD_FUNCS= ${LIB2_DIVMOD_FUNCS:S/${sym}//g}
.endfor
.endif
d26 3
a28 15
SYMS=		${LIB1ASMFUNCS}		\
		${LIB2FUNCS_1}		\
		${LIB2FUNCS_2}		\
		${LIB2_DIVMOD_FUNCS}
.if ${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "sparc64"
SYMS+=		${FPBIT_FUNCS} ${DPBIT_FUNCS}
.endif
SYMS_ST=	${LIB2FUNCS_ST}		\
		${LIB2ADD_ST}
OBJS_T=		${SYMS:S/$/.o/}  ${SYMS_ST:S/$/.o/}
OBJS_P=		${SYMS:S/$/.po/} ${SYMS_ST:S/$/.po/}
OBJS_S=		${SYMS:S/$/.So/}
OBJS=		${SYMS:S/$/.o/}
STATICOBJS=	${SYMS_ST:S/$/.o/}
SRCS=		${LIB2ADD} ${LIB2ADDEH}
d30 10
d41 110
a151 1
#---------------------------------------------------------------------------
d153 1
d157 9
d167 10
a176 8
# Variable length limited to 255 charactes when passed to a shell script.
LIB2FUNCS_1 = _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 _clz \
    _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi \
    _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi

LIB2FUNCS_2 = _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf \
    _clear_cache _trampoline __main _exit _absvsi2 _absvdi2 _addvsi3 \
    _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors
d179 1
a179 1
LIB2FUNCS_ST = _eprintf _bb __gcc_bcmp
d191 1
a191 6
# These might cause a divide overflow trap and so are compiled with
# unwinder info.
LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4

MACHMODE_H = machmode.h machmode.def

d196 8
a203 1
LIB2ADDEH = unwind-dw2.c unwind-dw2-fde.c unwind-sjlj.c
a204 1
#-----------------------------------------------------------------------
d206 1
a206 2
#	Platform specific bits.
#	When upgrading GCC, get the following defintions from config/<cpu>/t-*
d209 4
a212 4
.if ${TARGET_ARCH} == "alpha"
#	from config/alpha/t-alpha
LIB2FUNCS_EXTRA = qrnnd.asm
.endif
d214 1
a214 9
.if ${TARGET_ARCH} == "arm"
#	from config/arm/t-strongarm-elf
LIB1ASMSRC = arm/lib1funcs.asm
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func
# We want fine grained libraries, so use the new code to build the
# floating point emulation libraries.
XXX fix this
NEED_FP_EMULATION set to "yes" with different rules per platform
.endif
d216 1
a216 9
.if ${TARGET_ARCH} == "ia64"
#	from config/ia64/t-ia64
LIB1ASMSRC    = ia64/lib1funcs.asm
LIB1ASMFUNCS  = __divtf3 __divdf3 __divsf3 \
	__divdi3 __moddi3 __udivdi3 __umoddi3 \
	__divsi3 __modsi3 __udivsi3 __umodsi3 __save_stack_nonlocal \
	__nonlocal_goto __restore_stack_nonlocal __trampoline
LIB2ADDEH = unwind-ia64.c unwind-sjlj.c
.endif
d218 3
a220 32
.if ${TARGET_ARCH} == "powerpc"
#	from config/rs6000/t-ppccomm
LIB2FUNCS_EXTRA = tramp.S
# This one can't end up in shared libgcc
LIB2FUNCS_STATIC_EXTRA = eabi.S
# We want fine grained libraries, so use the new code to build the
# floating point emulation libraries.
XXX fix this
NEED_FP_EMULATION set to "yes" with different rules per platform
OBJS+=	dp-bit.o fp-bit.o
.endif

.if ${TARGET_ARCH} == "sparc64"
#	from config/sparc/t-elf
# We want fine grained libraries, so use the new code to build the
# floating point emulation libraries.
LIB1ASMSRC = sparc/lb1spc.asm
LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3
OBJS+=	dp-bit.o fp-bit.o
.endif

dp-bit.o: config/fp-bit.c
	${XCC} -c ${CFLAGS} -o ${.TARGET} ${.ALLSRC:M*fp-bit*}

dp-bit.So: config/fp-bit.c
	${XCC} ${PICFLAG} -c ${CFLAGS} -o ${.TARGET} ${.ALLSRC:M*fp-bit*}

dp-bit.po: config/fp-bit.c
	${XCC} -p -c ${CFLAGS} -o ${.TARGET} ${.ALLSRC:M*fp-bit*}

fp-bit.o: config/fp-bit.c
	${XCC} -DFLOAT=1 -c ${CFLAGS} -o ${.TARGET} ${.ALLSRC:M*fp-bit*}
d222 3
a224 35
fp-bit.So: config/fp-bit.c
	${XCC} ${PICFLAG} -DFLOAT=1 -c ${CFLAGS} -o ${.TARGET} ${.ALLSRC:M*fp-bit*}

fp-bit.po: config/fp-bit.c
	${XCC} -p -DFLOAT=1 -c ${CFLAGS} -o ${.TARGET} ${.ALLSRC:M*fp-bit*}

#-----------------------------------------------------------------------

COMMONHDRS=	tconfig.h
SRCS+=		${COMMONHDRS}
CLEANFILES+=	${COMMONHDRS}

tconfig.h: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile
	${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}

${OBJS} beforedepend: ${COMMONHDRS}

${OBJS_T}: libgcc2.c
	${XCC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
	@@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}

.if !defined(NOPIC)
${OBJS_S}: libgcc2.c
	${XCC} -c ${PICFLAG} ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
	@@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}
.endif

.if !defined(NOPROFILE)
${OBJS_P}: libgcc2.c
	${XCC} -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
	@@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
	@@mv ${.TARGET}.tmp ${.TARGET}
.endif
d226 3
a228 1
.include <bsd.lib.mk>
@


1.34.2.4
log
@Need to build libgcc.so with -nostdlib -- otherwise we try linking with
ourself.
@
text
@d38 1
a38 1
CFLAGS+=	-nostdlib -fexceptions
@


1.33
log
@Scoot things over to the temporary *.295 source while I do major construction
on the mainline sources.
@
text
@d1 1
a1 1
# $FreeBSD: src/gnu/lib/libgcc/Makefile,v 1.32 2000/03/23 10:18:23 obrien Exp $
d7 1
d12 1
d15 1
d65 4
@


1.32
log
@Clean up the FreeBSD configuration files -- includes removing the usage
of svr4.h on the i386, and moving all the shared arch neutral bits into
the FreeBSD general config header.
@
text
@d1 1
a1 1
# $FreeBSD: src/gnu/lib/libgcc/Makefile,v 1.31 1999/11/17 07:20:27 obrien Exp $
d3 1
a3 1
GCCDIR=	${.CURDIR}/../../../contrib/gcc
@


1.31
log
@Pay attention to the "KEEP THIS IN SYNC" comment, and sync the `tm.h'
header with src/gcc/usr.bin/cc/cc_tools/Makefile.
@
text
@d1 1
a1 1
# $FreeBSD: src/gnu/lib/libgcc/Makefile,v 1.30 1999/11/15 04:16:17 obrien Exp $
a96 1
	echo '#include "svr4.h"'				>> ${.TARGET}
@


1.31.2.1
log
@MFC: use a unified libgcc and ensure strong references to pthread functions
     weakly referenced in libgcc.
@
text
@d1 1
a1 1
# $FreeBSD: src/gnu/lib/libgcc/Makefile,v 1.31 1999/11/17 07:20:27 obrien Exp $
a6 1
# allow to be overridden for the a.out case
a10 1
.if ${OBJFORMAT} == aout
a12 1
.endif
a61 3
.if ${OBJFORMAT} != aout
CFLAGS+=	-D_PTHREADS -fPIC -DGTHREAD_USE_WEAK
.endif
@


1.31.2.2
log
@MFC: update to Gcc 2.95.4
@
text
@d1 1
a1 1
# $FreeBSD$
d62 1
d66 1
a66 1
CFLAGS+=	-D_PTHREADS -DGTHREAD_USE_WEAK
a67 1
CFLAGS+=	-I${GCCDIR}/config -I${GCCDIR} -I.
d88 1
a88 1
OBJS=	${LIB1OBJS} ${LIB2OBJS} ${NEW1OBJS} ${NEW2OBJS}
d103 1
d135 1
a135 1
	${CC} -c ${PICFLAG} ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
d140 1
a140 1
	${XCC} -c ${PICFLAG} ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
d145 1
a145 1
	${XCXX} -c ${PICFLAG} ${CXXFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.cc}
d150 1
a150 1
	${CXX} -c ${PICFLAG} ${CXXFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.cc}
@


1.31.2.3
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/4/gnu/lib/libgcc/Makefile 98520 2002-06-20 23:13:31Z obrien $
@


1.30
log
@Cut over the system compiler from from EGCS 1.1.2 to GCC 2.95.2.
@
text
@d1 1
a1 1
# $FreeBSD: src/gnu/lib/libgcc/Makefile,v 1.29 1999/11/15 00:49:35 obrien Exp $
a99 3
.if ${MACHINE_ARCH} == "alpha"
	echo '#include "${MACHINE_ARCH}/freebsd4.h"'		>> ${.TARGET}
.else
a100 1
.endif
@


1.29
log
@Cosmetic change to match cc_tools/Makefile
@
text
@d1 1
a1 1
# $FreeBSD: src/gnu/lib/libgcc/Makefile,v 1.28 1999/10/03 02:43:18 bde Exp $
d3 1
a3 1
GCCDIR=	${.CURDIR}/../../../contrib/egcs/gcc
d89 2
a90 1
	echo '#include "${MACHINE_ARCH}/xm-${MACHINE_ARCH}.h"'	> ${.TARGET}
d92 1
d97 1
d99 4
d104 1
@


1.29.2.1
log
@Allow EGCS 1.1.2 to co-exist with the new compiler, for regression testing.
@
text
@d1 1
a1 1
# $FreeBSD: src/gnu/lib/libgcc/Makefile,v 1.29 1999/11/15 00:49:35 obrien Exp $
d3 1
a3 1
GCCDIR=	${.CURDIR}/../../../contrib/gcc
d7 2
a8 2
.if !defined(LIB) || ${LIB} != "egcc_r"
LIB=	egcc
@


1.28
log
@Fixed the hack for using "../libgcc/Makefile" in libgcc_r/Makefile.
${LIB} was wrong at dependency-parsing time, so dependencies for
libgcc_r*.a were wrong.  This somehow worked right, except libgcc_r*.a
were always out of date.
@
text
@d1 1
a1 1
# $FreeBSD: src/gnu/lib/libgcc/Makefile,v 1.27 1999/08/27 23:32:48 peter Exp $
d85 2
a86 2
	echo '#include <${MACHINE_ARCH}/xm-${MACHINE_ARCH}.h>' > ${.TARGET}
	echo '#include <xm-freebsd.h>' >> ${.TARGET}
d89 1
a89 1
	echo '#include "${MACHINE_ARCH}/xm-${MACHINE_ARCH}.h"' > ${.TARGET}
d92 1
a92 1
	echo '#include "${MACHINE_ARCH}/${MACHINE_ARCH}.h"' > ${.TARGET}
d94 1
a94 1
	echo '#include "${MACHINE_ARCH}/att.h"' >> ${.TARGET}
d96 1
a96 1
	echo '#include "${MACHINE_ARCH}/freebsd.h"' >> ${.TARGET}
d98 1
a98 1
	echo '#include "${MACHINE_ARCH}/perform.h"' >> ${.TARGET}
@


1.27
log
@$Id$ -> $FreeBSD$
@
text
@d1 1
a1 1
# $FreeBSD$
d7 1
d9 1
@


1.26
log
@Purely cosmetic changes -- fix Id's
@
text
@d1 1
a1 1
#	$Id: Makefile,v 1.25 1999/04/08 08:39:16 obrien Exp $
@


1.25
log
@alpha/freebsd-elf.h has been merged with alpha/freebsd.h
@
text
@d1 1
a1 3
#
# $Id: Makefile,v 1.24 1999/04/08 08:19:28 obrien Exp $
#
d5 1
a5 1
.PATH:  ${GCCDIR}/cp ${GCCDIR}
@


1.24
log
@Don't require gcc/config/${MACHINE_ARCH}/xm-freebsd.h when we already know
the contents of it.  Instead create it, so all arch's are consistent.
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.23 1999/04/04 20:47:33 obrien Exp $
a98 2
.elif ${MACHINE_ARCH} == "alpha"
	echo '#include "${MACHINE_ARCH}/freebsd-elf.h"' >> ${.TARGET}
@


1.23
log
@Conditionalize one more i386'ism.
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.22 1999/04/04 20:41:50 obrien Exp $
d85 2
a86 1
	echo '#include "${MACHINE_ARCH}/xm-freebsd.h"' > ${.TARGET}
@


1.22
log
@Attempt to creating the right ``tm.h'' file for the Alpha.
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.21 1999/04/04 16:36:29 obrien Exp $
d92 1
d94 1
@


1.21
log
@Minimum set of changes to switch from Gcc 2.7.2 (in contrib/gcc) to Egcs 1.1.2
(in contrib/egcs)
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.25 1999/03/14 21:30:05 obrien Exp $
d94 1
d96 3
@


1.20
log
@Add bits we were getting from gnu/usr.bin/cc/Makefile.inc.
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.19 1999/01/09 21:50:55 jdp Exp $
d5 2
a6 1
GCCDIR=	${.CURDIR}/../../../contrib/gcc
d29 1
d47 2
a48 3
	   __gcc_bcmp _varargs _eprintf _op_new _op_vnew _new_handler \
	   _op_delete \
	   _op_vdel _bb _shtab _clear_cache _trampoline __main _exit _ctors \
d51 14
a65 1
CFLAGS+=	-I${GCCDIR}/config -I.
d67 1
d75 6
d82 1
a82 1
OBJS=		${LIB1OBJS} ${LIB2OBJS}
d84 1
a84 1
config.h tconfig.h:
d87 3
d91 4
a94 1
	echo '#include "${MACHINE_ARCH}/freebsd.h"' > ${.TARGET}
d108 10
d128 10
d148 10
@


1.19
log
@Switch to using ".So" as the extension for PIC object files rather
than ".so".  The old extension conflicted with well-established
naming conventions for dynamically loadable modules.

The "clean" targets continue to remove ".so" files too, to deal with
old systems.
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.18 1998/10/06 11:28:29 peter Exp $
d5 3
d51 1
a51 1
CFLAGS+=	-I.
@


1.18
log
@Replace use of non-standard ld -O with a ld -o / mv combination as used
elsewhere in the tree.  Binutils doesn't support the -O hack^H^H^H^H
extension.  (actually, it ignores it for option compatability with some
other OS).
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.17 1998/07/08 00:45:50 bde Exp $
d53 2
a54 2
LIB1SOBJS=	${LIB1FUNCS:S/$/.so/}
LIB2SOBJS=	${LIB2FUNCS:S/$/.so/}
@


1.17
log
@Use a different hack for building libgcc2: `XCC= ${CC}' instead of
`XCC= <relative cc> -B<path to relative cc1> ...'.  This is equivalent
when cc and cc1, etc. have just been bootstrapped by `make world'.
The relative versions normally won't work if the target system is
not binary compatible.  Bootstrapping different versions of gcc
without going through `make world' is slightly more broken than
before.

Uniformized macro names (P1OBJS -> LIB1POBJS, etc.).

Don't give full paths to sources.
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.16 1998/03/23 12:23:13 bde Exp $
d70 2
a71 1
	@@${LD} -O ${.TARGET} -x -r ${.TARGET}
d75 2
a76 1
	@@${LD} -O ${.TARGET} -x -r ${.TARGET}
d81 2
a82 1
	@@${LD} -O ${.TARGET} -x -r ${.TARGET}
d86 2
a87 1
	@@${LD} -O ${.TARGET} -x -r ${.TARGET}
d93 2
a94 1
	@@${LD} -O ${.TARGET} -X -r ${.TARGET}
d98 2
a99 1
	@@${LD} -O ${.TARGET} -X -r ${.TARGET}
@


1.16
log
@Support building of libgcc.a without building all of gcc.  This is
useful for bootstrapping.  Compatible versions of gcc and cc1 should
should be installed before using this feature.
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.15 1997/02/22 15:45:08 peter Exp $
d17 1
a17 3
# compiler for some of the libgcc2.c __attribute__ stuff.  If there is no
# freshly built compiler in a relative obj directory, then `make world'
# must have recently installed it.
d19 6
a24 19
.if exists(${.OBJDIR}/../cc/cc)
XCC=	${.OBJDIR}/../cc/cc
.elif exists(${.CURDIR}/../cc/cc)
XCC=	${.CURDIR}/../cc/cc
.else
XCC=	cc
.endif

.if exists(${.OBJDIR}/../cc1/cc1)
XCC+=	-B${.OBJDIR}/../cc1/
.elif exists(${.CURDIR}/../cc1/cc1)
XCC+=	-B${.CURDIR}/../cc1/
.endif

.if exists(${.OBJDIR}/../cpp/cpp)
XCC+=	-B${.OBJDIR}/../cpp/
.elif exists(${.CURDIR}/../cpp/cpp)
XCC+=	-B${.CURDIR}/../cpp/
.endif
d55 2
a56 2
P1OBJS=		${LIB1FUNCS:S/$/.po/}
P2OBJS=		${LIB2FUNCS:S/$/.po/}
d60 1
a60 1
config.h:
a62 3
tconfig.h:
	echo '#include "${MACHINE_ARCH}/xm-freebsd.h"'  > tconfig.h

d69 1
a69 1
	${CC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${GCCDIR}/libgcc1.c
d73 1
a73 1
	${XCC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${GCCDIR}/libgcc2.c
d78 1
a78 1
	${CC} -c -fpic ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${GCCDIR}/libgcc1.c
d82 1
a82 1
	${XCC} -c -fpic ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${GCCDIR}/libgcc2.c
d87 2
a88 2
${P1OBJS}: libgcc1.c
	${CC} -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${GCCDIR}/libgcc1.c
d91 2
a92 2
${P2OBJS}: libgcc2.c
	${XCC} -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${GCCDIR}/libgcc2.c
@


1.15
log
@Revert $FreeBSD$ to $Id$
@
text
@d2 1
a2 1
# $Id$
d17 3
a19 1
# compiler for some of the libgcc2.c __attribute__ stuff.
d21 1
a21 1
.if exists(${.OBJDIR}/../cc)
d23 2
d26 1
a26 1
XCC=	${.CURDIR}/../cc/cc
d29 1
a29 1
.if exists(${.OBJDIR}/../cc1)
d31 1
a31 1
.else
d35 1
a35 1
.if exists(${.OBJDIR}/../cpp)
d37 1
a37 1
.else
d62 21
a82 6
LIB1OBJS=${LIB1FUNCS:T:S@@$@@.o@@}
LIB2OBJS=${LIB2FUNCS:T:S@@$@@.o@@}
LIB1SOBJS=${LIB1FUNCS:T:S@@$@@.so@@}
LIB2SOBJS=${LIB2FUNCS:T:S@@$@@.so@@}
P1OBJS=${LIB1FUNCS:T:S@@$@@.po@@}
P2OBJS=${LIB2FUNCS:T:S@@$@@.po@@}
d84 1
a84 1
OBJS= ${LIB1OBJS} ${LIB2OBJS}
@


1.14
log
@Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
@
text
@d2 1
a2 1
# $FreeBSD$
@


1.13
log
@Resync the libgcc functions list with the 2.7.2.1 tree.  We were building
a (now) defunct routine that no longer exists (causing an empty .o file),
and were missing some others.  Some of the ones we were missing are no-ops
on the i386, so there are now 4 empty .o files.

(It seems that libc/quad has got some defunct functions now)
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.12 1996/09/21 14:27:38 peter Exp $
@


1.12
log
@Remove the partial support for a shared -lcc_int, since it's been unusable
for a fair while.  cc1, cc1plus etc have been linked static for some time.
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.11 1996/09/19 15:53:44 peter Exp $
d37 27
a63 13

LIB1OBJS=       _mulsi3.o _umodsi3.o _modsi3.o _lshrsi3.o _lshlsi3.o \
		_ashrsi3.o _ashlsi3.o _divdf3.o _muldf3.o _negdf2.o _adddf3.o \
		_subdf3.o _fixsfsi.o _floatsidf.o _floatsisf.o _truncdfsf2.o \
		_extendsfdf2.o _addsf3.o _negsf2.o _subsf3.o _mulsf3.o \
		_divsf3.o _eqdf2.o _nedf2.o _gtdf2.o _gedf2.o _ltdf2.o \
		_ledf2.o _eqsf2.o _nesf2.o _gtsf2.o _gesf2.o _ltsf2.o \
		_lesf2.o
LIB2OBJS=	_ffsdi2.o _udiv_w_sdiv.o _udivmoddi4.o _fixunssfsi.o \
		_fixxfdi.o _fixunsxfdi.o _floatdixf.o _fixunsxfsi.o \
		__gcc_bcmp.o _varargs.o _eprintf.o _op_new.o _op_vnew.o \
		_new_handler.o _op_delete.o _op_vdel.o _bb.o _shtab.o \
		_clear_cache.o __main.o _exit.o _ctors.o _eh.o _pure.o
a65 4
LIB1SOBJS=${LIB1OBJS:.o=.so}
LIB2SOBJS=${LIB2OBJS:.o=.so}
P1OBJS=${LIB1OBJS:.o=.po}
P2OBJS=${LIB2OBJS:.o=.po}
@


1.11
log
@Man the lifeboats!  Tie down the hatches!  Red alert! Activate gcc-2.7.2.1!

(the old cc has been tagged with "gcc_2_6_3_final" so we have a reference
 point in case of unforseen disasters...)

This has the objc backend active, and I think I've managed to get the
f77 f2c support through in one piece, but I don't know fortran to test it.

A 'make world' change and libobjc commit will follow.

If you normally do 'make -DNOCLEAN world', do not do so this time, I know
it can fail with groff.

This version of gcc makes a **LOT** more warnings on our kernel.
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.9 1996/05/07 23:15:14 wosch Exp $
d6 2
@


1.10
log
@Make rules reentrant.
@
text
@d8 40
a47 2
LIB1OBJS=	_mulsi3.o _umodsi3.o _modsi3.o _lshrsi3.o _lshlsi3.o _ashrsi3.o _ashlsi3.o _divdf3.o _muldf3.o _negdf2.o _adddf3.o _subdf3.o _fixsfsi.o _floatsidf.o _floatsisf.o _truncdfsf2.o _extendsfdf2.o _addsf3.o _negsf2.o _subsf3.o _mulsf3.o _divsf3.o _eqdf2.o _nedf2.o _gtdf2.o _gedf2.o _ltdf2.o _ledf2.o _eqsf2.o _nesf2.o _gtsf2.o _gesf2.o _ltsf2.o _lesf2.o
LIB2OBJS=	_ffsdi2.o _udiv_w_sdiv.o _udivmoddi4.o _fixunssfsi.o _fixxfdi.o _fixunsxfdi.o _floatdixf.o _fixunsxfsi.o __gcc_bcmp.o _varargs.o _eprintf.o _op_new.o _op_vnew.o _new_handler.o _op_delete.o _op_vdel.o _bb.o _shtab.o _clear_cache.o __main.o _exit.o _ctors.o _eh.o _pure.o
d56 2
a57 3
	${CC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc1.c
	@@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@@mv -f ${.TARGET}.tmp ${.TARGET}
d60 2
a61 3
	${CC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc2.c
	@@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@@mv -f ${.TARGET}.tmp ${.TARGET}
d65 2
a66 1
	${CC} -c -fpic ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc1.c
d69 2
a70 1
	${CC} -c -fpic ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc2.c
d75 2
a76 1
	${CC} -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc1.c
d79 2
a80 1
	${CC} -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc2.c
a83 1

@


1.9
log
@``mv'' -> ``mv -f''
``rm'' -> ``rm -f''
so mv/rm may not ask for confirmation if you are not root
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.8 1995/03/12 20:17:07 phk Exp $
d19 2
a20 2
	@@${LD} -x -r ${.TARGET}
	@@mv -f a.out ${.TARGET}
d24 2
a25 2
	@@${LD} -x -r ${.TARGET}
	@@mv -f a.out ${.TARGET}
@


1.8
log
@Don't install shared libgcc, we can't do it this way.
I will uuencode and check in to a "compat20" area the 2.0-RELEASE version.
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.7 1995/03/12 09:37:26 phk Exp $
d20 1
a20 1
	@@mv a.out ${.TARGET}
d25 1
a25 1
	@@mv a.out ${.TARGET}
@


1.8.4.1
log
@Merge from HEAD, except:

	Clients that used gnumalloc still do, despite the merge.  We're not
	bringing phkmalloc over.

	Thread stuff left out.

	PCCARD support left out.
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.8 1995/03/12 20:17:07 phk Exp $
d20 1
a20 1
	@@mv -f a.out ${.TARGET}
d25 1
a25 1
	@@mv -f a.out ${.TARGET}
@


1.8.4.2
log
@This 3rd mega-commit should hopefully bring us back to where we were.
I can get it to `make world' succesfully, anyway!
@
text
@d20 1
a20 1
	@@mv a.out ${.TARGET}
d25 1
a25 1
	@@mv a.out ${.TARGET}
@


1.7
log
@Remove a bunch of funtions that are in libc already.
Add back the shared libgcc, now that we don't use it to link against.
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.6 1995/03/06 12:17:49 jkh Exp $
a6 2
SHLIB_MAJOR=    261
SHLIB_MINOR=    0           
@


1.6
log
@We can't bail out on generating the pic archive yet.
Submitted by:	bde
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.5 1995/03/06 08:04:05 phk Exp $
d7 2
d10 2
a11 2
LIB1OBJS=	_mulsi3.o _udivsi3.o _divsi3.o _umodsi3.o _modsi3.o _lshrsi3.o _lshlsi3.o _ashrsi3.o _ashlsi3.o _divdf3.o _muldf3.o _negdf2.o _adddf3.o _subdf3.o _fixdfsi.o _fixsfsi.o _floatsidf.o _floatsisf.o _truncdfsf2.o _extendsfdf2.o _addsf3.o _negsf2.o _subsf3.o _mulsf3.o _divsf3.o _eqdf2.o _nedf2.o _gtdf2.o _gedf2.o _ltdf2.o _ledf2.o _eqsf2.o _nesf2.o _gtsf2.o _gesf2.o _ltsf2.o _lesf2.o
LIB2OBJS=	_muldi3.o _divdi3.o _moddi3.o _udivdi3.o _umoddi3.o _negdi2.o _lshrdi3.o _lshldi3.o _ashldi3.o _ashrdi3.o _ffsdi2.o _udiv_w_sdiv.o _udivmoddi4.o _cmpdi2.o _ucmpdi2.o _floatdidf.o _floatdisf.o _fixunsdfsi.o _fixunssfsi.o _fixunsdfdi.o _fixdfdi.o _fixunssfdi.o _fixsfdi.o _fixxfdi.o _fixunsxfdi.o _floatdixf.o _fixunsxfsi.o _fixtfdi.o _fixunstfdi.o _floatditf.o __gcc_bcmp.o _varargs.o _eprintf.o _op_new.o _op_vnew.o _new_handler.o _op_delete.o _op_vdel.o _bb.o _shtab.o _clear_cache.o _trampoline.o __main.o _exit.o _ctors.o _eh.o _pure.o
@


1.5
log
@Don't make the shared libgcc.  I don't belive we need the libgcc_pic.a
anymore, so I killed that as well.
@
text
@d2 1
a2 1
# $Id: Makefile,v 1.4 1994/11/15 04:52:14 phk Exp $
d6 1
a6 1
NOPIC=	true
@


1.4
log
@Integrated GCC-2.6.1 -> GCC-2.6.2 changes.

Notice that the libgcc DOESN'T change number, because there are no
changes.

Also now the gnu2bmake stuff is synchronized again.

I commit this so that others can test too.

You might want to postpone any "make worlds" until tomorrow, to
avoid any problems I didn't see in the first pass.

Thanks to Bruce for rounding up our changes to gcc.
@
text
@d2 1
a2 1
# $Id$
d6 1
a6 3
INSTALL_PIC_ARCHIVE=	yes
SHLIB_MAJOR=	261
SHLIB_MINOR=	0
@


1.3
log
@As pointed out by Paul Traina, we need the libs to be 261.0 not 26.1.
@
text
@d2 1
a2 1
# $FreeBSD$
@


1.2
log
@----------------------------------
GCC-2.6.1 COMES TO FREEBSD-current
----------------------------------
Everybody needs to 'make world'.

Oakland, Nov 2nd 1994.  In a surprise move this sunny afternoon, the release-
engineer for the slightly delayed FreeBSD-2.0, Poul-Henning Kamp (28),
decided to pull in the new version 2.6.1 of the GNU C-compiler.
The new version of the compiler was release today at noon, and hardly 9
hours later it was committed into the FreeBSD-current source-repository.
"It's is simply because we have had too much trouble with the version 2.6.0
of the compiler" Poul-Henning told the FreeBSD-Gazette, "we took a gamble
when we decided to use that as our compiler for the 2.0 release, but it
seems to pay of in the end now" he concludes.
The move has not been discussed on the "core" list at all, and will come as
a surprise for most Poul-Hennings peers.  "I have only discussed it with
Jordan [J. K. Hubbard, the FreeBSD's resident humourist], and we agreed that
we needed to do it, so ... I did it!".  After a breath he added with a grin:
"My email will probably get an all time 'disk-full' now!".
This will bring quite a flag-day to the FreeBSD developers, the patch-file
is almost 1.4 Megabyte, and they will have to run "make world" to get
entirely -current again.  "Too bad, but we just had to do this."  Was
the only comment from Poul-Henning to these problems.
When asked how this move would impact the 2.0 release-date, Poul-Hennings
face grew dark, he mumbled some very Danish words while he moved his fingers
in strange geometrical patterns.  Immediately something ecclipsed the Sun, a
minor tremor shook the buildings, and the temperature fell significantly.
We decided not to pursure the question.

-----------
JOB-SECTION
-----------
Are you a dedicated GCC-hacker ?
We BADLY need somebody to look at the 'freebsd' OS in gcc, sanitize it and
carry the patches back to the GNU people.  In particular, we need to get
out of the "i386-only" spot we are in now.  I have the stuff to take a
gnu-dist into bmake-form, and will do that part.

Please apply to phk@@freebsd.org

No Novice Need Apply.
@
text
@d7 2
a8 2
SHLIB_MAJOR=	26
SHLIB_MINOR=	1
@


1.1
log
@Initial revision
@
text
@d8 1
a8 1
SHLIB_MINOR=	0
d11 1
a11 1
LIB2OBJS=	_muldi3.o _divdi3.o _moddi3.o _udivdi3.o _umoddi3.o _negdi2.o _lshrdi3.o _lshldi3.o _ashldi3.o _ashrdi3.o _ffsdi2.o _udiv_w_sdiv.o _udivmoddi4.o _cmpdi2.o _ucmpdi2.o _floatdidf.o _floatdisf.o _fixunsdfsi.o _fixunssfsi.o _fixunsdfdi.o _fixdfdi.o _fixunssfdi.o _fixsfdi.o _fixxfdi.o _fixunsxfdi.o _floatdixf.o _fixunsxfsi.o _fixtfdi.o _fixunstfdi.o _floatditf.o __gcc_bcmp.o _varargs.o _eprintf.o _op_new.o _op_vnew.o _new_handler.o _op_delete.o _op_vdel.o _bb.o _shtab.o _clear_cache.o _trampoline.o __main.o _exit.o _ctors.o
@


1.1.1.1
log
@Here comes the right import of gcc-2.6.0.
@
text
@@
