Date: Sat, 18 Aug 2001 23:46:52 -0400 From: "Matthew Emmerton" <matt@gsicomp.on.ca> To: "Matthew Emmerton" <matt@gsicomp.on.ca>, <freebsd-ports@FreeBSD.ORG>, <freebsd-questions@FreeBSD.ORG> Subject: Re: [NOT] SOLVED: Problem with '-O -pipe' showing up in CFLAGS / CXXFLAGS Message-ID: <002b01c12861$95de5800$1200a8c0@gsicomp.on.ca> References: <001701c1285f$3c4a48f0$1200a8c0@gsicomp.on.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
Aargh! Further investigation would indicate that the problem is even deeper -- it's in bsd.port.mk where CFLAGS and CXXFLAGS get seeded with the default values provided by make. Does anyone know how to turn off make's defaults, aside from manually setting CFLAGS= in the environment? -- Matt Emmerton ----- Original Message ----- From: "Matthew Emmerton" <matt@gsicomp.on.ca> To: <freebsd-ports@FreeBSD.ORG>; <freebsd-questions@FreeBSD.ORG> Sent: Saturday, August 18, 2001 11:30 PM Subject: SOLVED: Problem with '-O -pipe' showing up in CFLAGS / CXXFLAGS > Over the past while I've seen a few people having troubles building ports > and/or kernels. I always thought it was people setting CFLAGS and/or > CXXFLAGS in their environment improperly or having /etc/make.conf configured > with '-O -pipe', as did many others. > > However, it finally happened to me, and I know I don't do either of these. > After a couple of hours of investigation, the culprit was found: BSD make > and improperly designed Makefiles. I'm posting my findings here in hopes > that others will find it useful. > > Take, for example, the Makefile for biology/xdrawchem, which contains the > following line: > > MAKE_ENV= CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" QTDIR="${X11BASE}" > > Looks innocent enough, right? After all, we want MAKE_ENV to have those > things set right. However, this is WRONG, on two counts. > > First, bsd.port.mk will pick up CXX and CXXFLAGS (and CC and CFLAGS) from > the environment so they don't need to be set explicitly here. > > Second, if CXX and CXXFLAGS are *not* set in the environment, make handily > supplies its own defaults, which are inappropriate: > > gabby# make -X -V CXXFLAGS > ${CXXINCLUDES} ${CFLAGS} > gabby# make -X -V CFLAGS > -O -pipe ${_CPUCFLAGS} > > This is why we end up with '-O -pipe' in CFLAGS/CXXFLAGS, and as many people > have indicated, throws many things for a loop. (In my case, g++ chews up > 100% of available memory and swap while trying to optimize one of the source > modules in xdrawchem.) > > -- > Matt Emmerton > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002b01c12861$95de5800$1200a8c0>