Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Mar 2012 20:18:25 +0100
From:      Tijl Coosemans <tijl@coosemans.org>
To:        freebsd-ports@freebsd.org
Cc:        Gautam <list@execve.net>, bf1783@gmail.com
Subject:   Re: graphics/png does not build with lang/gcc
Message-ID:  <201203082018.30598.tijl@coosemans.org>
In-Reply-To: <CAD9pFYC4FWDojC4XDspGpSL5juJMwjbCRN9gfzqKTZoKKJAfnw@mail.gmail.com>
References:  <CAGFTUwPUFdP=Z20%2BbL59qFuh_V6R1R-GcyrK03dxESL6ZyGz7A@mail.gmail.com> <CAD9pFYA-y6u7bCkZvOk=863n4TA6c5tCosP_P%2BBEx5mXRDEprA@mail.gmail.com> <CAD9pFYC4FWDojC4XDspGpSL5juJMwjbCRN9gfzqKTZoKKJAfnw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart4254696.1vysY1lf3F
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

On Thursday 08 March 2012 11:10:42 Gautam wrote:
> On Thu, Mar 8, 2012 at 3:39 PM, Gautam <list@execve.net> wrote:
>> On Wed, Mar 7, 2012 at 5:41 PM, b. f. <bf1783@googlemail.com> wrote:
>>>> On Mon, Feb 27, 2012 at 9:51 PM, Gautam <list at execve.net> wrote:
>>>> Should I file a PR for this?
>>>=20
>>> 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=3D4.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.
>>=20
>> 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 st=
ill
>> 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                   =3D   up-to-date with port
>> mpc-0.9                             =3D   up-to-date with port
>> mpfr-3.1.0_2                        =3D   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
>>
>> =3D=3D=3D>  Cleaning for png-1.4.8_1
>>
>> vmboX# env USE_GCC=3D4.6 make
>>
>> =3D=3D=3D>  Vulnerability check disabled, database not found
>>
>> =3D=3D=3D>  License check disabled, port has not defined LICENSE
>> =3D=3D=3D>  Found saved configuration for png-1.4.8_1
>> =3D=3D=3D>  Extracting for png-1.4.8_1
>>
>> =3D> SHA256 Checksum OK for libpng-1.4.8.tar.xz.
>> =3D> 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
>> =3D=3D=3D>  Patching for png-1.4.8_1
>> =3D=3D=3D>  Applying extra patch
>> /usr/ports/graphics/png/work/libpng-1.4.8/libpng-1.4.8-apng.patch
>> =3D=3D=3D>  Applying FreeBSD patches for png-1.4.8_1
>> =3D=3D=3D>   png-1.4.8_1 depends on executable: gcc46 - found
>> =3D=3D=3D>   png-1.4.8_1 depends on file: /usr/local/bin/as - found
>> =3D=3D=3D>  Configuring for png-1.4.8_1
>> =3D=3D=3D>  Building for png-1.4.8_1
>> ( cat scripts/libpng-config-head.in;  echo prefix=3D\"/usr/local\";  echo
>> libdir=3D\"/usr/local/lib\";  echo ccopts=3D\"-O2 -pipe
>> -Wl,-rpath=3D/usr/local/lib/gcc46 -fno-strict-aliasing\";  echo
>> cppflags=3D\"\";  echo I_opts=3D\"-I/usr/local/include/libpng\";  echo
>> L_opts=3D\"-L/usr/local/lib\";  echo libs=3D\"-lpng -lz -lm\";  echo
>> ldopts=3D\"-Wl,-rpath=3D/usr/local/lib/gcc46\";  cat scripts/
>> libpng-config-body.in ) > libpng-config
>> chmod +x libpng-config
>> gcc46 -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46 -fno-strict-aliasing  =
=2DI.
>> -std=3Dgnu99 -fstack-protector  -c png.c
>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46
>> -fno-strict-aliasing  -I. -std=3Dgnu99 -fstack-protector  -c png.c -o pn=
g.So
>> gcc46 -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46 -fno-strict-aliasing  =
=2DI.
>> -std=3Dgnu99 -fstack-protector  -c pngset.c
>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46
>> -fno-strict-aliasing  -I. -std=3Dgnu99 -fstack-protector  -c pngset.c -o
>> pngset.So
>> gcc46 -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46 -fno-strict-aliasing  =
=2DI.
>> -std=3Dgnu99 -fstack-protector  -c pngget.c
>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46
>> -fno-strict-aliasing  -I. -std=3Dgnu99 -fstack-protector  -c pngget.c -o
>> pngget.So
>> gcc46 -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46 -fno-strict-aliasing  =
=2DI.
>> -std=3Dgnu99 -fstack-protector  -c pngrutil.c
>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46
>> -fno-strict-aliasing  -I. -std=3Dgnu99 -fstack-protector  -c pngrutil.c =
=2Do
>> pngrutil.So
>> gcc46 -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46 -fno-strict-aliasing  =
=2DI.
>> -std=3Dgnu99 -fstack-protector  -c pngtrans.c
>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46
>> -fno-strict-aliasing  -I. -std=3Dgnu99 -fstack-protector  -c pngtrans.c =
=2Do
>> pngtrans.So
>> gcc46 -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46 -fno-strict-aliasing  =
=2DI.
>> -std=3Dgnu99 -fstack-protector  -c pngwutil.c
>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46
>> -fno-strict-aliasing  -I. -std=3Dgnu99 -fstack-protector  -c pngwutil.c =
=2Do
>> pngwutil.So
>> gcc46 -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46 -fno-strict-aliasing  =
=2DI.
>> -std=3Dgnu99 -fstack-protector  -c pngread.c
>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46
>> -fno-strict-aliasing  -I. -std=3Dgnu99 -fstack-protector  -c pngread.c -o
>> pngread.So
>> gcc46 -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46 -fno-strict-aliasing  =
=2DI.
>> -std=3Dgnu99 -fstack-protector  -c pngrio.c
>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46
>> -fno-strict-aliasing  -I. -std=3Dgnu99 -fstack-protector  -c pngrio.c -o
>> pngrio.So
>> gcc46 -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46 -fno-strict-aliasing  =
=2DI.
>> -std=3Dgnu99 -fstack-protector  -c pngwio.c
>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46
>> -fno-strict-aliasing  -I. -std=3Dgnu99 -fstack-protector  -c pngwio.c -o
>> pngwio.So
>> gcc46 -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46 -fno-strict-aliasing  =
=2DI.
>> -std=3Dgnu99 -fstack-protector  -c pngwrite.c
>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46
>> -fno-strict-aliasing  -I. -std=3Dgnu99 -fstack-protector  -c pngwrite.c =
=2Do
>> pngwrite.So
>> gcc46 -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46 -fno-strict-aliasing  =
=2DI.
>> -std=3Dgnu99 -fstack-protector  -c pngrtran.c
>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46
>> -fno-strict-aliasing  -I. -std=3Dgnu99 -fstack-protector  -c pngrtran.c =
=2Do
>> pngrtran.So
>> gcc46 -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46 -fno-strict-aliasing  =
=2DI.
>> -std=3Dgnu99 -fstack-protector  -c pngwtran.c
>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46
>> -fno-strict-aliasing  -I. -std=3Dgnu99 -fstack-protector  -c pngwtran.c =
=2Do
>> pngwtran.So
>> gcc46 -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46 -fno-strict-aliasing  =
=2DI.
>> -std=3Dgnu99 -fstack-protector  -c pngmem.c
>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46
>> -fno-strict-aliasing  -I. -std=3Dgnu99 -fstack-protector  -c pngmem.c -o
>> pngmem.So
>> gcc46 -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46 -fno-strict-aliasing  =
=2DI.
>> -std=3Dgnu99 -fstack-protector  -c pngerror.c
>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46
>> -fno-strict-aliasing  -I. -std=3Dgnu99 -fstack-protector  -c pngerror.c =
=2Do
>> pngerror.So
>> gcc46 -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46 -fno-strict-aliasing  =
=2DI.
>> -std=3Dgnu99 -fstack-protector  -c pngpread.c
>> gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=3D/usr/local/lib/gcc46
>> -fno-strict-aliasing  -I. -std=3Dgnu99 -fstack-protector  -c pngpread.c =
=2Do
>> 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=3D/usr/local/lib/gcc46 -fno-strict-aliasing  =
=2DI.
>> -std=3Dgnu99 -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_loca=
l'
>> 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=3D4.6 WITHOUT_SSP=3Dyes make".

This has been fixed in GCC 4.7 but hasn't been backported to 4.6 yet.

--nextPart4254696.1vysY1lf3F
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iF4EABEIAAYFAk9ZBgYACgkQfoCS2CCgtitxoQD6A7jCbPept2ls6U7M9v38O0VB
1qvj4vBLG1jwde9Dw8oA/0dy5Yoao8fnTfJVQT4tASyMRzlhLIkIYHAaxxKogonF
=BsoM
-----END PGP SIGNATURE-----

--nextPart4254696.1vysY1lf3F--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203082018.30598.tijl>