Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Feb 2012 09:45:49 +0530
From:      Gautam <list@execve.net>
To:        freebsd-ports@freebsd.org
Subject:   Re: graphics/png does not build with lang/gcc
Message-ID:  <CAD9pFYDS06WWU%2BwB%2Bs15iOYzCuDC_9HmirTZw19g1-kCgJHVhA@mail.gmail.com>
In-Reply-To: <CAD9pFYAY0Lu9v7ApS0zt4WjYOKMrTMrJ0nTq4viCEAJY1MJzpQ@mail.gmail.com>
References:  <CAD9pFYAY0Lu9v7ApS0zt4WjYOKMrTMrJ0nTq4viCEAJY1MJzpQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

Reminder - any pointers on this one?
Including Doug who had posted similar problem in 2010.

On Sat, Feb 18, 2012 at 4:17 PM, Gautam <list@execve.net> wrote:

> Hi,
>
> I am running GENERIC on
>
> FreeBSD  9.0-STABLE FreeBSD 9.0-STABLE #2: Mon Jan 30 04:18:20 IST 2012
>
> with the tree csupped just before the build.
>
> I setup lang/gcc as per
> http://www.freebsd.org/doc/en/articles/custom-gcc/article.html
>
> added following to /etc/make.conf
> CC=gcc46
> CXX=g++46
> CPP=cpp46
>
> and the following to /etc/libmap.config
> libgcc_s.so.1   gcc46/libgcc_s.so.1
> libgomp.so.1    gcc46/libgomp.so.1
> libobjc.so.3    gcc46/libobjc.so.2
> libssp.so.0     gcc46/libssp.so.0
> libstdc++.so.6  gcc46/libstdc++.so.6
>
>
> When I tried to rebuild some ports, I found a problem with linking
> graphics/png.
>
> I found a similar problem mentioned in
> http://lists.freebsd.org/pipermail/freebsd-ports/2010-June/062166.html*
> *but no conclusion to the same.
>
> # idprio 31 make
> ===>  License check disabled, port has not defined LICENSE
> ===>  Found saved configuration for png-1.4.8
> ===>  Extracting for png-1.4.8
> => SHA256 Checksum OK for libpng-1.4.8.tar.xz.
> => SHA256 Checksum OK for libpng-1.4.8-apng.patch.gz.
> .....
> gcc46 -fpic -DPIC -O2 -pipe -march=pentium4 -fno-strict-aliasing
> -march=pentium4 -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 -march=pentium4 -fno-strict-aliasing -march=pentium4 -I.
> -std=gnu99 -fstack-protector  -c pngtest.c
> building static png library
> building shared library libpng.so.6
> ranlib libpng.a
> pngread.So: In function `png_create_read_struct_2':
> pngread.c:(.text+0x4e7): undefined reference to `__stack_chk_fail_local'
> pngrutil.So: In function `png_inflate':
> pngrutil.c:(.text+0x166): undefined reference to `__stack_chk_fail_local'
> pngrutil.So: In function `png_decompress_chunk':
> pngrutil.c:(.text+0x6e6): undefined reference to `__stack_chk_fail_local'
> pngrutil.So: In function `.L69':
> pngrutil.c:(.text+0x90f): undefined reference to `__stack_chk_fail_local'
> pngrutil.So: In function `png_handle_cHRM':
> pngrutil.c:(.text+0x1431): undefined reference to `__stack_chk_fail_local'
> pngrutil.So:pngrutil.c:(.text+0x19d9): more undefined references to
> `__stack_chk_fail_local' follow
> collect2: ld returned 1 exit status
> *** Error code 1
> gcc46 -O2 -pipe -march=pentium4 -fno-strict-aliasing -march=pentium4 -I.
> -std=gnu99 -fstack-protector  -L. -static -o pngtest pngtest.o -lpng -lz -lm
> 1 error
> *** Error code 1
>
> Stop in /usr/ports/graphics/png.
> *** Error code 1
>
> Stop in /usr/ports/graphics/png.
> ---
>

I have seen different workarounds for this online
for e.g, SSP_CFLAGS= in /etc/make.conf
or patching /etc/rc.d/ldconfig to pick up /usr/local/lib/gcc46 first

but somehow these do not seem clean enough. Or is it a straightforward port
specific problem -- that needs to be fixed in graphics/png. I suspect that
I am not alone in wanting to build ports with lang/gcc, so how are others
avoiding this situation?

Thanks in advance!
Gautam



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAD9pFYDS06WWU%2BwB%2Bs15iOYzCuDC_9HmirTZw19g1-kCgJHVhA>