From owner-freebsd-ports@FreeBSD.ORG Fri Mar 9 00:10:17 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BADA9106567A for ; Fri, 9 Mar 2012 00:10:17 +0000 (UTC) (envelope-from bf1783@googlemail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4528D8FC14 for ; Fri, 9 Mar 2012 00:10:17 +0000 (UTC) Received: by werl4 with SMTP id l4so973480wer.13 for ; Thu, 08 Mar 2012 16:10:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=vQcc49dpuS9C2TojNFPlEwWfYDHAp0L6TUxYHQpCXx0=; b=wocXqSN7BsVa8GBLXZORfQQmvk2/G6p0MGY65pgpAVEyoO0eKl/fZF+uYSydwkhEs2 LH0VcBxjASp3Kns9OdM/S/walBKSBvGEnkFDiS9gcjQUBShf0HNlF36/b0grPAsWdbPd DCxHKViigIrbT8j0eJAmanKYF/gBUbouxriVKfhzUUAgg8yltHr/ln3DXXyTgqOpT5jf vmnRdStktgc2ddjjcO58IVkPU3LOBQAZsgFlWZlrM3qdyJZq/DHgbDTvFERJ/rECFDdL +OKaEF6qwP2fTeOsGH21yVC5PsbQgHHS64HM/it51sE7AOLCwD90bC+r6hlnULRi3ya/ S83g== MIME-Version: 1.0 Received: by 10.216.135.141 with SMTP id u13mr69083wei.79.1331251816169; Thu, 08 Mar 2012 16:10:16 -0800 (PST) Received: by 10.180.94.42 with HTTP; Thu, 8 Mar 2012 16:10:16 -0800 (PST) In-Reply-To: <201203082018.30598.tijl@coosemans.org> References: <201203082018.30598.tijl@coosemans.org> Date: Fri, 9 Mar 2012 00:10:16 +0000 Message-ID: From: "b. f." To: Tijl Coosemans Content-Type: text/plain; charset=ISO-8859-1 Cc: Gautam , freebsd-ports@freebsd.org Subject: Re: graphics/png does not build with lang/gcc X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bf1783@gmail.com List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 00:10:17 -0000 On 3/8/12, Tijl Coosemans wrote: > On Thursday 08 March 2012 11:10:42 Gautam wrote: >> On Thu, Mar 8, 2012 at 3:39 PM, Gautam wrote: >>> On Wed, Mar 7, 2012 at 5:41 PM, b. f. wrote: >>>>> On Mon, Feb 27, 2012 at 9:51 PM, Gautam wrote: >>>>> Should I file a PR for this? >>>> >>>> There are some unresolved problems with stack protection, but you >>>> should not have to encounter them when building this port. The custom >>>> gcc article that you are attempting to use was written at a time when >>>> some of the related port Makefiles had some shortcomings that no >>>> longer exist, and is not the recommended way to use lang/gcc* for >>>> ports. For all but a handful of ports that lang/gcc* depends upon, or >>>> those that don't respect the toolchain-related variables, you can just >>>> install lang/gcc or lang/gcc46 and set USE_GCC=4.6 in your build >>>> environment, an included Makefile, or on the command line. I have been >>>> building graphics/png in this way for years. You can and should >>>> dispense with the libmap.conf additions, the hardcoded CC, CXX, and >>>> CPP in make.conf, etc. >>> >>> Thanks for your comments. I now tried this on the fresh 9.0-REL system I >>> created, -- I cleared out make.conf, deleted libmap.conf. The problem >>> still >>> exists. Any pointers? >>> >>> Here is the log: >>> >>> uname -a >>> >>> FreeBSD vmboX 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:15:25 UTC >>> 2012 root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >>> vmboX# pkg_version -0v [K [Kv >>> >>> binutils-2.22 < needs updating (port has 2.22_1) >>> gcc-4.6.2 < needs updating (port has 4.6.2_1) >>> gmp-5.0.2 < needs updating (port has 5.0.3) >>> libiconv-1.13.1_1 = up-to-date with port >>> mpc-0.9 = up-to-date with port >>> mpfr-3.1.0_2 = up-to-date with port >>> vmboX# cd /etc >>> >>> vmboX# cat /etc/make.conf >>> >>> vmboX# cat /etc/liba [Kmap.conf >>> >>> cat: /etc/libmap.conf: No such file or directory >>> >>> vmboX# cd /usr/ports/graphics/png >>> >>> vmboX# make clean >>> >>> ===> Cleaning for png-1.4.8_1 >>> >>> vmboX# env USE_GCC=4.6 make >>> >>> ===> Vulnerability check disabled, database not found >>> >>> ===> License check disabled, port has not defined LICENSE >>> ===> Found saved configuration for png-1.4.8_1 >>> ===> Extracting for png-1.4.8_1 >>> >>> => SHA256 Checksum OK for libpng-1.4.8.tar.xz. >>> => SHA256 Checksum OK for libpng-1.4.8-apng.patch.gz. >>> /bin/cp /usr/ports/distfiles//libpng-1.4.8-apng.patch.gz >>> /usr/ports/graphics/png/work/libpng-1.4.8/ >>> /usr/bin/gzip -nf -9 -d >>> /usr/ports/graphics/png/work/libpng-1.4.8/libpng-1.4.8-apng.patch.gz >>> ===> Patching for png-1.4.8_1 >>> ===> Applying extra patch >>> /usr/ports/graphics/png/work/libpng-1.4.8/libpng-1.4.8-apng.patch >>> ===> Applying FreeBSD patches for png-1.4.8_1 >>> ===> png-1.4.8_1 depends on executable: gcc46 - found >>> ===> png-1.4.8_1 depends on file: /usr/local/bin/as - found >>> ===> Configuring for png-1.4.8_1 >>> ===> Building for png-1.4.8_1 >>> ( cat scripts/libpng-config-head.in; echo prefix=\"/usr/local\"; echo >>> libdir=\"/usr/local/lib\"; echo ccopts=\"-O2 -pipe >>> -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing\"; echo >>> cppflags=\"\"; echo I_opts=\"-I/usr/local/include/libpng\"; echo >>> L_opts=\"-L/usr/local/lib\"; echo libs=\"-lpng -lz -lm\"; echo >>> ldopts=\"-Wl,-rpath=/usr/local/lib/gcc46\"; cat scripts/ >>> libpng-config-body.in ) > libpng-config >>> chmod +x libpng-config >>> gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. >>> -std=gnu99 -fstack-protector -c png.c >>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 >>> -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c png.c -o >>> png.So >>> gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. >>> -std=gnu99 -fstack-protector -c pngset.c >>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 >>> -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngset.c -o >>> pngset.So >>> gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. >>> -std=gnu99 -fstack-protector -c pngget.c >>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 >>> -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngget.c -o >>> pngget.So >>> gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. >>> -std=gnu99 -fstack-protector -c pngrutil.c >>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 >>> -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngrutil.c -o >>> pngrutil.So >>> gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. >>> -std=gnu99 -fstack-protector -c pngtrans.c >>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 >>> -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngtrans.c -o >>> pngtrans.So >>> gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. >>> -std=gnu99 -fstack-protector -c pngwutil.c >>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 >>> -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngwutil.c -o >>> pngwutil.So >>> gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. >>> -std=gnu99 -fstack-protector -c pngread.c >>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 >>> -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngread.c -o >>> pngread.So >>> gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. >>> -std=gnu99 -fstack-protector -c pngrio.c >>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 >>> -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngrio.c -o >>> pngrio.So >>> gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. >>> -std=gnu99 -fstack-protector -c pngwio.c >>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 >>> -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngwio.c -o >>> pngwio.So >>> gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. >>> -std=gnu99 -fstack-protector -c pngwrite.c >>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 >>> -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngwrite.c -o >>> pngwrite.So >>> gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. >>> -std=gnu99 -fstack-protector -c pngrtran.c >>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 >>> -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngrtran.c -o >>> pngrtran.So >>> gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. >>> -std=gnu99 -fstack-protector -c pngwtran.c >>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 >>> -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngwtran.c -o >>> pngwtran.So >>> gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. >>> -std=gnu99 -fstack-protector -c pngmem.c >>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 >>> -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngmem.c -o >>> pngmem.So >>> gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. >>> -std=gnu99 -fstack-protector -c pngerror.c >>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 >>> -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngerror.c -o >>> pngerror.So >>> gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. >>> -std=gnu99 -fstack-protector -c pngpread.c >>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 >>> -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngpread.c -o >>> pngpread.So >>> >>> gzip -cn libpng.3 > libpng.3.gz >>> gzip -cn libpngpf.3 > libpngpf.3.gz >>> gzip -cn png.5 > png.5.gz >>> gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. >>> -std=gnu99 -fstack-protector -c pngtest.c >>> building static png library >>> /usr/local/bin/ranlib libpng.a >>> building shared library libpng.so.6 >>> pngread.So: In function `png_create_read_struct_2': >>> pngread.c:(.text+0x4da): undefined reference to `__stack_chk_fail_local' >>> pngrutil.So: In function `png_inflate': >>> pngrutil.c:(.text+0x168): undefined reference to `__stack_chk_fail_local' >>> pngrutil.So: In function `png_decompress_chunk': >>> pngrutil.c:(.text+0x79c): undefined reference to `__stack_chk_fail_local' >>> pngrutil.So: In function `.L72': >>> pngrutil.c:(.text+0x9cb): undefined reference to `__stack_chk_fail_local' >>> pngrutil.So: In function `png_handle_cHRM': >>> pngrutil.c:(.text+0x15fe): undefined reference to >>> `__stack_chk_fail_local' >>> pngrutil.So:pngrutil.c:(.text+0x1b99): more undefined references to >>> `__stack_chk_fail_local' follow >>> >>> collect2: ld returned 1 exit status >>> *** Error code 1 >>> 1 error >>> *** Error code 1 >>> >>> Stop in /usr/ports/graphics/png. >>> *** Error code 1 >>> >>> Stop in /usr/ports/graphics/png. >>> vmboX# > > It's /usr/share/bsd.sys.mk that is adding the -fstack-protector flag. > You can disable it with "env USE_GCC=4.6 WITHOUT_SSP=yes make". > > This has been fixed in GCC 4.7 but hasn't been backported to 4.6 yet. > Yes, thanks, I told him that off-list, shortly after his earlier message. I had forgotten that that workaround was necessary in some cases. I was a bit surprised to learn that gcc r183670 and allied changes hadn't been merged to the 4.6 branch in some form before the new release. b.