From owner-freebsd-arch@FreeBSD.ORG Mon Apr 18 13:42:56 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFF091065672; Mon, 18 Apr 2011 13:42:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 5073D8FC1B; Mon, 18 Apr 2011 13:42:56 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:adc5:19f9:a31a:3bcd] (unknown [IPv6:2001:7b8:3a7:0:adc5:19f9:a31a:3bcd]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 495B85C59; Mon, 18 Apr 2011 15:42:55 +0200 (CEST) Message-ID: <4DAC3FD9.1060603@FreeBSD.org> Date: Mon, 18 Apr 2011 15:42:49 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110415 Lanikai/3.1.11pre MIME-Version: 1.0 To: "arch@freebsd.org" , "current@freebsd.org" Content-Type: multipart/mixed; boundary="------------000008000402090004000307" Cc: Subject: Removal of ICC (intel compiler) bits from mk X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2011 13:42:57 -0000 This is a multi-part message in MIME format. --------------000008000402090004000307 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reviving an old thread(*), I would like to propose to finally remove the Intel C Compiler support from share/mk and other places. As mentioned in that thread, the ICC bits simply do not work anymore, and no one has volunteered to fix it for many years. Please review the attached patch, which cleans up the ICC bits. *) http://lists.freebsd.org/pipermail/freebsd-current/2010-August/019179.html --------------000008000402090004000307 Content-Type: text/plain; name="remove-icc-1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="remove-icc-1.diff" diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index 99c28aa..0670bff 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -91,31 +91,6 @@ _CPUCFLAGS = -march=prescott . else _CPUCFLAGS = -march=${CPUTYPE} . endif # GCC on 'i386' -. if ${CPUTYPE} == "crusoe" -_ICC_CPUCFLAGS = -tpp6 -xiM -. elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \ - ${CPUTYPE} == "athlon-4" -_ICC_CPUCFLAGS = -tpp6 -xiMK -. elif ${CPUTYPE} == "athlon-tbird" || ${CPUTYPE} == "athlon" -_ICC_CPUCFLAGS = -tpp6 -xiM -. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2" || ${CPUTYPE} == "k6" -_ICC_CPUCFLAGS = -tpp6 -xi -. elif ${CPUTYPE} == "k5" -_ICC_CPUCFLAGS = -tpp5 -. elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" -_ICC_CPUCFLAGS = -tpp7 -xiMKW -. elif ${CPUTYPE} == "pentium3" || ${CPUTYPE} == "pentium3m" || \ - ${CPUTYPE} == "pentium-m" -_ICC_CPUCFLAGS = -tpp6 -xiMK -. elif ${CPUTYPE} == "pentium2" || ${CPUTYPE} == "pentiumpro" -_ICC_CPUCFLAGS = -tpp6 -xiM -. elif ${CPUTYPE} == "pentium-mmx" -_ICC_CPUCFLAGS = -tpp5 -xM -. elif ${CPUTYPE} == "pentium" -_ICC_CPUCFLAGS = -tpp5 -. else -_ICC_CPUCFLAGS = -. endif # ICC on 'i386' . elif ${MACHINE_CPUARCH} == "amd64" _CPUCFLAGS = -march=${CPUTYPE} . elif ${MACHINE_CPUARCH} == "arm" @@ -242,9 +217,5 @@ CFLAGS += -G0 # NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk .if !defined(NO_CPU_CFLAGS) -. if ${CC} == "icc" -CFLAGS += ${_ICC_CPUCFLAGS} -. else CFLAGS += ${_CPUCFLAGS} -. endif .endif diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 459a9c3..c452528 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -125,13 +125,8 @@ depend: beforedepend ${DEPENDFILE} afterdepend # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. -.if ${CC:T:Micc} == "icc" -MKDEP_CFLAGS= ${CFLAGS:M-X*} ${CFLAGS:M-[BIDU]*} -MKDEP_CXXFLAGS= ${CXXFLAGS:M-X*} ${CXXFLAGS:M-[BIDU]*} -.else MKDEP_CFLAGS= ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BIDU]*} MKDEP_CXXFLAGS= ${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BIDU]*} -.endif DPSRCS+= ${SRCS} ${DEPENDFILE}: ${DPSRCS} diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 9d655b6..943010c 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -65,11 +65,7 @@ PICFLAG=-fpic .endif .endif -.if ${CC:T:Micc} == "icc" -PO_FLAG=-p -.else PO_FLAG=-pg -.endif .c.po: ${CC} ${PO_FLAG} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index fc5ec40..796d169 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -11,20 +11,18 @@ # the default is gnu99 for now CSTD ?= gnu99 -.if ${CC:T:Micc} != "icc" -. if ${CSTD} == "k&r" +.if ${CSTD} == "k&r" CFLAGS += -traditional -. elif ${CSTD} == "c89" || ${CSTD} == "c90" +.elif ${CSTD} == "c89" || ${CSTD} == "c90" CFLAGS += -std=iso9899:1990 -. elif ${CSTD} == "c94" || ${CSTD} == "c95" +.elif ${CSTD} == "c94" || ${CSTD} == "c95" CFLAGS += -std=iso9899:199409 -. elif ${CSTD} == "c99" +.elif ${CSTD} == "c99" CFLAGS += -std=iso9899:1999 -. else +.else CFLAGS += -std=${CSTD} -. endif .endif -.if !defined(NO_WARNS) && ${CC:T:Micc} != "icc" +.if !defined(NO_WARNS) # -pedantic is problematic because it also imposes namespace restrictions #CFLAGS += -pedantic . if defined(WARNS) @@ -82,9 +80,8 @@ CWARNFLAGS += -Wno-format CWARNFLAGS += -Wno-unknown-pragmas .endif -.if ${MK_SSP} != "no" && ${CC:T:Micc} != "icc" && \ - ${MACHINE_CPUARCH} != "ia64" && \ - ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" +.if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \ + ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" # Don't use -Wstack-protector as it breaks world with -Werror. SSP_CFLAGS ?= -fstack-protector CFLAGS += ${SSP_CFLAGS} diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 01b1438..1e58378 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -6,14 +6,9 @@ # Note that the newly added -Wcast-qual is responsible for generating # most of the remaining warnings. Warnings introduced with -Wall will # also pop up, but are easier to fix. -.if ${CC:T:Micc} == "icc" -#CWARNFLAGS= -w2 # use this if you are terribly bored -CWARNFLAGS= -.else CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ -Wundef -Wno-pointer-sign -fformat-extensions -.endif # # The following flags are next up for working on: # -W @@ -29,7 +24,7 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ # operations inside the kernel itself. These operations are exclusively # reserved for user applications. # -.if ${MACHINE_CPUARCH} == "i386" && ${CC:T:Micc} != "icc" +.if ${MACHINE_CPUARCH} == "i386" .if ${CC:T:Mclang} != "clang" CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 .endif @@ -100,22 +95,13 @@ INLINE_LIMIT?= 8000 # GCC 3.0 and above like to do certain optimizations based on the # assumption that the program is linked against libc. Stop this. # -.if ${CC:T:Micc} == "icc" -CFLAGS+= -nolib_inline -.else CFLAGS+= -ffreestanding -.endif - -.if ${CC:T:Micc} == "icc" -CFLAGS+= -restrict -.endif # # GCC SSP support. # -.if ${MK_SSP} != "no" && ${CC:T:Micc} != "icc" && \ - ${MACHINE_CPUARCH} != "ia64" && ${MACHINE_CPUARCH} != "arm" && \ - ${MACHINE_CPUARCH} != "mips" +.if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \ + ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" CFLAGS+= -fstack-protector .endif diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index 4deaea8..db244c4 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -23,38 +23,25 @@ NM?= nm OBJCOPY?= objcopy SIZE?= size -.if ${CC:T:Micc} == "icc" -COPTFLAGS?= -O -.else -. if defined(DEBUG) +.if defined(DEBUG) _MINUS_O= -O CTFFLAGS+= -g -. else +.else _MINUS_O= -O2 -. endif -. if ${MACHINE_CPUARCH} == "amd64" +.endif +.if ${MACHINE_CPUARCH} == "amd64" COPTFLAGS?=-O2 -frename-registers -pipe -. else +.else COPTFLAGS?=${_MINUS_O} -pipe -. endif -. if !empty(COPTFLAGS:M-O[23s]) && empty(COPTFLAGS:M-fno-strict-aliasing) +.endif +.if !empty(COPTFLAGS:M-O[23s]) && empty(COPTFLAGS:M-fno-strict-aliasing) COPTFLAGS+= -fno-strict-aliasing -. endif .endif .if !defined(NO_CPU_COPTFLAGS) -. if ${CC:T:Micc} == "icc" -COPTFLAGS+= ${_ICC_CPUCFLAGS:C/(-x[^M^K^W]+)[MKW]+|-x[MKW]+/\1/} -. else COPTFLAGS+= ${_CPUCFLAGS} -. endif .endif -.if ${CC:T:Micc} == "icc" -C_DIALECT= -NOSTDINC= -X -.else C_DIALECT= -std=c99 NOSTDINC= -nostdinc -.endif INCLUDES= ${NOSTDINC} ${INCLMAGIC} -I. -I$S @@ -89,36 +76,31 @@ INCLUDES+= -I$S/dev/cxgb -I$S/dev/cxgbe CFLAGS= ${COPTFLAGS} ${C_DIALECT} ${DEBUG} ${CWARNFLAGS} CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -.if ${CC:T:Micc} != "icc" .if ${CC:T:Mclang} != "clang" CFLAGS+= -fno-common -finline-limit=${INLINE_LIMIT} -.if ${MACHINE_CPUARCH} != "mips" +. if ${MACHINE_CPUARCH} != "mips" CFLAGS+= --param inline-unit-growth=100 CFLAGS+= --param large-function-growth=1000 -.else +. else # XXX Actually a gross hack just for Octeon because of the Simple Executive. CFLAGS+= --param inline-unit-growth=10000 CFLAGS+= --param large-function-growth=100000 CFLAGS+= --param max-inline-insns-single=10000 -.endif +. endif .endif WERROR?= -Werror -.endif # XXX LOCORE means "don't declare C stuff" not "for locore.s". ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1 -.if ${CC:T:Micc} == "icc" -.error "Profiling doesn't work with icc" -.endif CFLAGS+= -DGPROF -falign-functions=16 -.if ${PROFLEVEL} >= 2 +. if ${PROFLEVEL} >= 2 CFLAGS+= -DGPROF4 -DGUPROF PROF= -pg -mprofiler-epilogue -.else +. else PROF= -pg -.endif +. endif .endif DEFINED_PROF= ${PROF} diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 2239d66..6d22e41 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -88,25 +88,17 @@ __KLD_SHARED=yes __KLD_SHARED=no .endif -.if ${CC:T:Micc} == "icc" -CFLAGS:= ${CFLAGS:C/(-x[^M^K^W]+)[MKW]+|-x[MKW]+/\1/} -.else -. if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing) +.if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing) CFLAGS+= -fno-strict-aliasing -. endif +.endif WERROR?= -Werror -.endif CFLAGS+= ${WERROR} CFLAGS+= -D_KERNEL CFLAGS+= -DKLD_MODULE # Don't use any standard or source-relative include directories. -.if ${CC:T:Micc} == "icc" -NOSTDINC= -X -.else CSTD= c99 NOSTDINC= -nostdinc -.endif CFLAGS:= ${CFLAGS:N-I*} ${NOSTDINC} ${INCLMAGIC} ${CFLAGS:M-I*} .if defined(KERNBUILDDIR) CFLAGS+= -DHAVE_KERNEL_OPTION_HEADERS -include ${KERNBUILDDIR}/opt_global.h @@ -121,7 +113,7 @@ CFLAGS+= -I. -I@ # for example. CFLAGS+= -I@/contrib/altq -.if ${CC:T:Micc} != "icc" && ${CC:T:Mclang} != "clang" +.if ${CC:T:Mclang} != "clang" CFLAGS+= -finline-limit=${INLINE_LIMIT} CFLAGS+= --param inline-unit-growth=100 CFLAGS+= --param large-function-growth=1000 @@ -129,9 +121,7 @@ CFLAGS+= --param large-function-growth=1000 # Disallow common variables, and if we end up with commons from # somewhere unexpected, allocate storage for them in the module itself. -.if ${CC:T:Micc} != "icc" CFLAGS+= -fno-common -.endif LDFLAGS+= -d -warn-common CFLAGS+= ${DEBUG_FLAGS} diff --git a/sys/dev/aic7xxx/aicasm/Makefile b/sys/dev/aic7xxx/aicasm/Makefile index c077285..b8352d6 100644 --- a/sys/dev/aic7xxx/aicasm/Makefile +++ b/sys/dev/aic7xxx/aicasm/Makefile @@ -24,12 +24,7 @@ WARNS?= 5 DEPENDFILE= .depend_aicasm .endif -.if ${CC:T:Micc} == "icc" -CFLAGS+= -restrict -NOSTDINC= -X -.else NOSTDINC= -nostdinc -.endif CFLAGS+= ${NOSTDINC} -I/usr/include -I. .ifdef MAKESRCPATH CFLAGS+= -I${MAKESRCPATH} --------------000008000402090004000307--