[flac-dev] Can't cross-compile from git now.

JonY 10walls at gmail.com
Fri Mar 8 17:47:46 PST 2013


On 3/9/2013 09:41, JonY wrote:
> 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.
> 
> 

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/20130309/8e8089eb/attachment.pgp 


More information about the flac-dev mailing list