Date: Mon, 7 Feb 2011 14:28:24 -0500 From: "b. f." <bf1783@googlemail.com> To: Ruslan Mahmatkhanov <cvs-src@yandex.ru> Cc: freebsd-ports@FreeBSD.org Subject: Re: How to not use OPTIMIZED_FLAGS properly Message-ID: <AANLkTikgqxBoTmvek0hHmbXtyeWCAKyJCHScGvgZY4x-@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
> 07.02.2011 20:50, Konstantin Tokarev =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > > > > > 07.02.2011, 20:34, "Ruslan Mahmatkhanov"<cvs-src at yandex.ru>: > >> Hello. > >> > >> I'm working on port that doesn't builds with "-O2 -pipe", that passed = to > >> Makefile by default (it exits with message about virtual memory is > >> exhausted). I can avoid this by setting CFLAGS=3D"" and CXXFLAGS=3D"" = in > >> CONFIGURE_ENV. But portlint is complaining like this: > >> > >> WARN: Makefile: CFLAGS/CXXFLAGS are not needed in CONFIGURE_ENV as the= y > >> are already added there in bsd.port.mk. > >> FATAL: Makefile: CFLAGS are clobbered in CONFIGURE_ENV. Alter CFLAGS = in > >> the Makefile with CFLAGS+=3D... instead > >> FATAL: Makefile: CXXFLAGS are clobbered in CONFIGURE_ENV. Alter > >> CXXFLAGS in the Makefile with CXXFLAGS+=3D... instead > >> > >> What is the right way to do the job? > >> > >> PS. If i set -O0 in CONFIGURE_ENV, it's later redefined to "-O2 -pipe"= . > > > > Have you tried CFLAGS+=3D-O0 as portlint suggested? > > As i said before i tried that. If i'm using +=3D-O0 then it changes to -O= 2 > -pipe. If i'm using =3D-O0, then all builds fine, but this make portlint > complaining. CFLAGS and CXXFLAGS are already passed by default in do-configure, as portlint states. Why aren't you simply defining them, by themselves and not as a part of CONFIGURE_ENV, in the port Makefile?: CFLAGS+=3D-O0 This seems pessimistic, by the way. Have you tried adding other compiler flags, like those to control the compiler's memory usage? Or using another compiler via USE_GCC, or patching the source code? b.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikgqxBoTmvek0hHmbXtyeWCAKyJCHScGvgZY4x->