Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jun 2010 06:27:09 +0400
From:      Anonymous <swell.k@gmail.com>
To:        Doug Barton <dougb@FreeBSD.org>
Cc:        dinoex@FreeBSD.org, ports@FreeBSD.org
Subject:   Re: graphics/png does not compile with gcc 4.5.1
Message-ID:  <86zkydcl1e.fsf@gmail.com>
In-Reply-To: <alpine.BSF.2.00.1006290952200.23004@qbhto.arg> (Doug Barton's message of "Tue, 29 Jun 2010 09:54:36 -0700 (PDT)")
References:  <alpine.BSF.2.00.1006290952200.23004@qbhto.arg>

next in thread | previous in thread | raw e-mail | index | archive | help
Doug Barton <dougb@FreeBSD.org> writes:

> Tried doing the update today, but it failed:
>
> Full log at http://people.freebsd.org/~dougb/png-gcc451.log
>
> building static png library
> ranlib libpng.a
> building shared library libpng.so.6
> /usr/local/bin/gcc45 -pipe -g -march=native -g -g  -I. -g -std=gnu99
> -fstack-protector  -L. -static -o pngtest pngtest.o -lpng -lz -lm
> pngread.So: In function `png_create_read_struct_2':
> /usr/local/tmp/usr/local/ports/graphics/png/work/libpng-1.4.3/pngread.c:201:
> undefined reference to `__stack_chk_fail_local'
> pngrutil.So: In function `png_read_chunk_header':
> /usr/local/tmp/usr/local/ports/graphics/png/work/libpng-1.4.3/pngrutil.c:111:
> undefined reference to `__stack_chk_fail_local'
> pngrutil.So: In function `png_inflate':
> /usr/local/tmp/usr/local/ports/graphics/png/work/libpng-1.4.3/pngrutil.c:293:
> undefined reference to `__stack_chk_fail_local'
> pngrutil.So: In function `png_decompress_chunk':
> /usr/local/tmp/usr/local/ports/graphics/png/work/libpng-1.4.3/pngrutil.c:412:
> undefined reference to `__stack_chk_fail_local'
> pngrutil.So: In function `png_handle_IHDR':
> /usr/local/tmp/usr/local/ports/graphics/png/work/libpng-1.4.3/pngrutil.c:492:
> undefined reference to `__stack_chk_fail_local'
> pngrutil.So:/usr/local/tmp/usr/local/ports/graphics/png/work/libpng-1.4.3/pngrutil.c:928:
> more undefined references to `__stack_chk_fail_local' follow
> /usr/local/bin/ld: libpng.so.6: hidden symbol `__stack_chk_fail_local'
> isn't defined

Hmm, I can't reproduce this -fstack-protector error on

  $ uname -vm
  FreeBSD 9.0-CURRENT #0 r209581=f9b9ab9-dirty: Tue Jun 29 00:46:39 UTC 2010     holo@raphael.local:/a/objdir/a/dirty_build/sys/PHOENIX  amd64
  $ cc --version
  cc (GCC) 4.5.1 20100624 (prerelease)
  $ ld --version
  GNU gold (GNU Binutils 2.20.51.20100621) 1.9
  $ readelf -s libpng.so.6 | fgrep __stack_chk_fail_local
  $ readelf -s pngtest | fgrep -eNum: -e__stack_chk_fail_local
     Num:    Value          Size Type    Bind   Vis      Ndx Name
    1981: 000000000042f6a0    10 FUNC    WEAK   DEFAULT    1 __stack_chk_fail_local

Visibility and binding for that symbol are same here whether using gcc45 or basegcc.

You can try to build without -fstack-protector in bsd.sys.mk

  $ make SSP_CFLAGS=

> /usr/local/bin/ld: final link failed: Nonrepresentable section on output
> collect2: ld returned 1 exit status
> *** Error code 1
> 1



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