From unknown Fri Mar 29 10:35:33 2024 X-Loop: git-admin@x2go.org Subject: Bug#84: Hardcoded -O3 in CFLAGS Reply-To: Reinhard Tartler , 84@bugs.x2go.org Resent-From: Reinhard Tartler Resent-To: x2go-dev@lists.berlios.de Resent-CC: X2Go Developers X-Loop: git-admin@x2go.org Resent-Date: Wed, 09 Jan 2013 14:33:01 +0000 Resent-Message-ID: Resent-Sender: git-admin@x2go.org X-X2Go-PR-Message: followup 84 X-X2Go-PR-Package: nx-libs X-X2Go-PR-Keywords: Received: via spool by 84-submit@bugs.x2go.org id=B84.135774126331946 (code B ref 84); Wed, 09 Jan 2013 14:33:01 +0000 Received: (at 84) by bugs.x2go.org; 9 Jan 2013 14:21:03 +0000 Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com [209.85.214.181]) by ymir (Postfix) with ESMTPS id CAF815DB0A for <84@bugs.x2go.org>; Wed, 9 Jan 2013 15:21:02 +0100 (CET) Received: by mail-ob0-f181.google.com with SMTP id oi10so2239648obb.12 for <84@bugs.x2go.org>; Wed, 09 Jan 2013 06:21:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=wXzX6+U//Iqr94rDo/9x8RduYrJXNg7k6wwxXAKUIf0=; b=TiIa32NyN1AN/XfFmswjzMz91l8Uksy7z2zbtHx1N71mRWfbsY61x3KLL8cR7E+u6U 8hHe9Wbod7QNo86gNX01YApw+VUg7ZMZwXoeiEO+pRuFL+AXlxfX+EYYE18CJMWHjjli dEL4dPyuSTFh8aqqcwqguRVGtjLtkzHC+nls6d0qUMCwi5ZWixOn2VY3/3m4HxczDXs4 KJ4OQBlqwGav0N3A5Ho32VmIomXSNNoLWJbmtLV5rjykdpKqSQ3A7LiOGKpXWuH5dPgH KR0Mw4LjGdOvH+qZWSo94k9IlHqMBN4HpQA+Ivm+4M0euCULPN5NvZy9KabqDlBMkQGZ Bx8Q== MIME-Version: 1.0 Received: by 10.60.170.242 with SMTP id ap18mr38112535oec.97.1357741261413; Wed, 09 Jan 2013 06:21:01 -0800 (PST) Received: by 10.60.25.71 with HTTP; Wed, 9 Jan 2013 06:21:01 -0800 (PST) In-Reply-To: References: <20130109010011.4f92023b@enterprise.cafarelli.fr> Date: Wed, 9 Jan 2013 15:21:01 +0100 Message-ID: From: Reinhard Tartler To: 84@bugs.x2go.org Cc: Bernard Cafarelli , Jan Engelhardt Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Jan 9, 2013 at 3:16 PM, Jan Engelhardt wrote: > On Wednesday 2013-01-09 01:00, Bernard Cafarelli wrote: > >>Le Tue, 8 Jan 2013 17:07:12 +0100 (CET) >>Jan Engelhardt a =E9crit: >>> Why would autoreconf be rerun if you use ./configure CFLAGS=3D-O2 >>> CXXFLAGS=3D-O2? >> >>I meant, without first removing the "-O3" from configure.in (before >>autoreconf) >> >>With current configure.in, setting CXXFLAGS to "-O2" will give this: >>nxcomp $ autoreconf && ./configure && make >>[...] >>g++ -c -O2 -O3 -fno-rtti -fno-exceptions -I../nx-X11/exports/include >>-Wmissing-declarations -fPIC -DIN_ADDR_T=3Din_addr_t -DVERSION=3D\"3.5.0\= " >>-DPACKAGE_NAME=3D\"\" -DPACKAGE_TARNAME=3D\"\" -DPACKAGE_VERSION=3D\"\" >>-DPACKAGE_STRING=3D\"\" -DPACKAGE_BUGREPORT=3D\"\" -DPACKAGE_URL=3D\"\" -= Wall >>-Wpointer-arith EncodeBuffer.cpp > > I tried the following, but it's not taking any effect. Must be some > !@#$%^& going on. > > <<<< > > Give user-specified CXXFLAGS/CFLAGS/LDFLAGS/LIBS higher precedence. > > --- > nxcomp/Makefile.in | 6 ++---- > nxcompext/Makefile.in | 14 +++++++------- > nxcompshad/Makefile.in | 5 ++--- > nxproxy/Makefile.in | 4 ++-- > 4 files changed, 13 insertions(+), 16 deletions(-) > > Index: nx-libs-3.5.0.17/nxcomp/Makefile.in > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- nx-libs-3.5.0.17.orig/nxcomp/Makefile.in > +++ nx-libs-3.5.0.17/nxcomp/Makefile.in > @@ -36,8 +36,7 @@ LIBVERSION=3D@LIBVERSION@ > # > > CXX =3D @CXX@ > -CXXFLAGS =3D @CXXFLAGS@ @X_CFLAGS@ @DEFS@ \ > - -Wall -Wpointer-arith > +CXXFLAGS =3D @X_CFLAGS@ @DEFS@ -Wall -Wpointer-arith @CXXFLAGS@ > CXXINCLUDES =3D > CXXDEFINES =3D > > @@ -46,8 +45,7 @@ CXXDEFINES =3D > # > > CC =3D @CC@ > -CCFLAGS =3D @CFLAGS@ @X_CFLAGS@ @DEFS@ \ > - -Wall -Wpointer-arith > +CCFLAGS =3D @X_CFLAGS@ @DEFS@ -Wall -Wpointer-arith @CFLAGS@ > CCINCLUDES =3D > CCDEFINES =3D > > Index: nx-libs-3.5.0.17/nxcompext/Makefile.in > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- nx-libs-3.5.0.17.orig/nxcompext/Makefile.in > +++ nx-libs-3.5.0.17/nxcompext/Makefile.in > @@ -28,26 +28,26 @@ LIBVERSION=3D@LIBVERSION@ > # > > CXX =3D @CXX@ > -CXXFLAGS =3D @CXXFLAGS@ @X_CFLAGS@ @DEFS@ \ > +CXXFLAGS =3D @X_CFLAGS@ @DEFS@ \ > -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-protot= ypes \ > - -Wmissing-declarations -Wnested-externs > + -Wmissing-declarations -Wnested-externs @CXXFLAGS@ > CXXINCLUDES =3D -I. -I../nxcomp > CXXDEFINES =3D > > CC =3D @CC@ > -CCFLAGS =3D @CFLAGS@ @X_CFLAGS@ @DEFS@ \ > +CCFLAGS =3D @X_CFLAGS@ @DEFS@ \ > -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-protot= ypes \ > - -Wmissing-declarations -Wnested-externs > + -Wmissing-declarations -Wnested-externs @CFLAGS@ > CCINCLUDES =3D -I. -I../nxcomp > CCDEFINES =3D > > -LDFLAGS =3D @LDFLAGS@ -L../nxcomp > -LIBS =3D @LIBS@ -lz -lNX_X11 -lXcomp > +LDFLAGS =3D -L../nxcomp @LDFLAGS@ > +LIBS =3D -lz -lNX_X11 -lXcomp @LIBS@ > > # > # Only if THREADS is defined > # > -# LIBS =3D @LIBS@ -lz -ljpeg -lpthread -lNX_X11 -lXcomp > +# LIBS =3D -lz -ljpeg -lpthread -lNX_X11 -lXcomp @LIBS@ > # > > srcdir =3D @srcdir@ > Index: nx-libs-3.5.0.17/nxcompshad/Makefile.in > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- nx-libs-3.5.0.17.orig/nxcompshad/Makefile.in > +++ nx-libs-3.5.0.17/nxcompshad/Makefile.in > @@ -31,8 +31,7 @@ LIBVERSION=3D@LIBVERSION@ > # > > CXX =3D @CXX@ > -CXXFLAGS =3D @CXXFLAGS@ @X_CFLAGS@ @DEFS@ \ > - -Wall -Wpointer-arith > +CXXFLAGS =3D @X_CFLAGS@ @DEFS@ -Wall -Wpointer-arith @CXXFLAGS@ > CXXINCLUDES =3D > CXXDEFINES =3D > > @@ -48,7 +47,7 @@ CCINCLUDES =3D > CCDEFINES =3D > > LDFLAGS =3D @LDFLAGS@ > -LIBS =3D @LIBS@ -lNX_X11 > +LIBS =3D -lNX_X11 @LIBS@ > > # > # Only if THREADS is defined. > Index: nx-libs-3.5.0.17/nxproxy/Makefile.in > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- nx-libs-3.5.0.17.orig/nxproxy/Makefile.in > +++ nx-libs-3.5.0.17/nxproxy/Makefile.in > @@ -11,9 +11,9 @@ LIBVERSION=3D@LIBVERSION@ > # -Wredundant-decls > # > CXX =3D @CXX@ > -CXXFLAGS =3D @CXXFLAGS@ @X_CFLAGS@ @DEFS@ \ > +CXXFLAGS =3D @X_CFLAGS@ @DEFS@ \ > -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototype= s \ > - -Wmissing-declarations -Wnested-externs > + -Wmissing-declarations -Wnested-externs @CXXFLAGS@ > > CXXINCLUDES =3D -I. -I../nxcomp AFAIUI, this is not a fix. Instead of replacing the hardcoded values, this patch ensures that all options end behind the hardcoded values. This makes it impossible to drop compiler flags that are specified within. This may be fair when your goal is to only change the optimization level, but may be insufficient when the goal is a hardened build. --=20 regards, Reinhard