Hi I have a problem now cross-compiling FLAC from latest git. With Ubuntu 12.04 and g++-mingw-w64-i686 (4.6.3-1ubuntu5+5ubuntu1). I think that the problem might have been introduced on 5 Mar 2013 with commit 05609d5 (configure.ac : Add hardening compile options.) Gives errors like this:- /home/user/FLAC_build/flac-05609d5/src/libFLAC/.libs/libFLAC.a(ogg_helper.o):ogg_helper.c:(.text+0x173): undefined reference to `___stack_chk_guard' /home/user/FLAC_build/flac-05609d5/src/libFLAC/.libs/libFLAC.a(ogg_helper.o):ogg_helper.c:(.text+0x45c): undefined reference to `___stack_chk_guard' /home/user/FLAC_build/flac-05609d5/src/libFLAC/.libs/libFLAC.a(ogg_helper.o):ogg_helper.c:(.text+0x463): undefined reference to `___stack_chk_fail' collect2: ld returned 1 exit status make[3]: *** [test_libFLAC++.exe] Error 1 make[3]: Leaving directory `/home/user/FLAC_build/flac-05609d5/src/test_libFLAC++' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/user/FLAC_build/flac-05609d5/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/user/FLAC_build/flac-05609d5' make: *** [all] Error 2 The previous commit 9d057c7 compiles OK for me. This is the (failed) build log for commit 05609d5 --> http://pastebin.com/SqWsJX3e This is the (good) build log for previous commit 9d057c7 --> http://pastebin.com/H4GLXEJB This is the (failed) build log for latest (8 Mar 2013) commit ae663c3 --> http://pastebin.com/39G6Tv4H
On 13-03-08 8:39 AM, bat guano wrote:> /home/user/FLAC_build/flac-05609d5/src/libFLAC/.libs/libFLAC.a(ogg_helper.o):ogg_helper.c:(.text+0x173): undefined reference to `___stack_chk_guard'I have a vague memory that -fstack-protector doesn't work in mingw, but the configure check passed. Maybe because it's via a library? Can you re-run with --disable-silent-rules and see if the linker is getting -fstack-protector, or add -lssp manually? My system's /usr/i686-w63-mingw32/sys-root/mingw/linux/libssp.a has a __stack_check_fail, but no __stack_check_guard. -r
---------------------------------------- ?Can you> re-run with --disable-silent-rulesHi I added "--disable-silent-rules" to config. Like this:- PKG_CONFIG_PATH="$HOME/FLAC_build/lib/pkgconfig" LDFLAGS="-L$HOME/FLAC_build/lib" CFLAGS="-I$HOME/FLAC_build/include" ./configure --prefix=$HOME/FLAC_build --host=i686-w64-mingw32 --enable-static --disable-shared --disable-dependency-tracking --disable-silent-rules The result is here --> http://pastebin.com/9t3q6kEk
bat guano wrote:> > Hi > I have a problem now cross-compiling FLAC from latest git. > With Ubuntu 12.04 and g++-mingw-w64-i686 (4.6.3-1ubuntu5+5ubuntu1). > > I think that the problem might have been introduced on 5 Mar 2013 > with commit 05609d5 (configure.ac : Add hardening compile options.)That was fixed with commit d5b03bcc36474ff1c9f2da2dcb5212e810208a6f Author: Erik de Castro Lopo <erikd at mega-nerd.com> Date: Sat Mar 9 08:55:37 2013 +1100 configure.ac : Don't enable stack protector for mingw* host_os. Cheers, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
----------------------------------------> > That was fixed with > > commit d5b03bcc36474ff1c9f2da2dcb5212e810208a6f > Author: Erik de Castro Lopo <erikd at mega-nerd.com> > Date: Sat Mar 9 08:55:37 2013 +1100 > > configure.ac : Don't enable stack protector for mingw* host_os. >Yes, it's fixed. Thanks. :-)
On 3/9/2013 06:20, Erik de Castro Lopo wrote:> bat guano wrote: > >> >> Hi >> I have a problem now cross-compiling FLAC from latest git. >> With Ubuntu 12.04 and g++-mingw-w64-i686 (4.6.3-1ubuntu5+5ubuntu1). >> >> I think that the problem might have been introduced on 5 Mar 2013 >> with commit 05609d5 (configure.ac : Add hardening compile options.) > > That was fixed with > > commit d5b03bcc36474ff1c9f2da2dcb5212e810208a6f > Author: Erik de Castro Lopo <erikd at mega-nerd.com> > Date: Sat Mar 9 08:55:37 2013 +1100 > > configure.ac : Don't enable stack protector for mingw* host_os. >Hi, Please do a link time test instead, I am not getting this error and would like to keep stack protector on. The test case below will trigger ___stack_chk_guard to emit. int main(){ int i = 0; char a[1000]; while(1){ a[i] = 0; i++; } } "i686-w64-mingw32-gcc -D_FORTIFY_SOURCE=2 -fstack-protector --param ssp-buffer-size=4 -v" shows that libssp is already added. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 834 bytes Desc: OpenPGP digital signature Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20130309/c6a28efe/attachment.pgp
On 3/9/2013 06:20, Erik de Castro Lopo wrote:> bat guano wrote: > >> >> Hi >> I have a problem now cross-compiling FLAC from latest git. >> With Ubuntu 12.04 and g++-mingw-w64-i686 (4.6.3-1ubuntu5+5ubuntu1). >> >> I think that the problem might have been introduced on 5 Mar 2013 >> with commit 05609d5 (configure.ac : Add hardening compile options.) >Resending, likely caught by filters. Hi, Please do a link time test instead, I am not getting this error and would like to keep stack protector on. The test case below will trigger ___stack_chk_guard to emit. int main(){ int i = 0; char a[1000]; while(1){ a[i] = 0; i++; } } "i686-w64-mingw32-gcc -D_FORTIFY_SOURCE=2 -fstack-protector --param ssp-buffer-size=4 -v" shows that libssp is already added. Alternatively, to include __stack_chk_fail, use: extern void __stack_chk_guard(); extern void __stack_chk_fail(); int main(){ void (*ssp[]) = { __stack_chk_guard, __stack_chk_fail }; return 0; } -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 834 bytes Desc: OpenPGP digital signature Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20130310/8430c1a5/attachment-0001.pgp