graphics/png does not compile with gcc 4.5.1

Anonymous swell.k at gmail.com
Wed Jun 30 02:27:28 UTC 2010


Doug Barton <dougb at 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 at 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


More information about the freebsd-ports mailing list