Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - gcc -fstack-proctector problem?: (8 Items)
   
gcc -fstack-proctector problem?  
This is on 6.4.1

I can see i386-pc-nto-qnx6.4.0 is compiled with -disable-libssp, but how come the gcc -c successed? 

One of my project is using “gcc -c -fstack-protector" to test in configure, leads to mistakely allow that flag...

$ gcc --version
gcc (GCC) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ cat sp.c
int main()
{
}

$ gcc -c -fstack-protector sp.c
$ echo $?
0
$ gcc -o sp -fstack-protector sp.c
/usr/qnx641/host/qnx6/x86/usr/bin/ntox86-ld: cannot find -lssp_nonshared
collect2: ld returned 1 exit status
Re: gcc -fstack-proctector problem?  
It would seem that the specs is still trying to bring in the libssp_nonshared when linking

Xiaodan Tang wrote:
> This is on 6.4.1
> 
> I can see i386-pc-nto-qnx6.4.0 is compiled with -disable-libssp, but how come the gcc -c successed? 
> 
> One of my project is using “gcc -c -fstack-protector" to test in configure, leads to mistakely allow that flag...
> 
> $ gcc --version
> gcc (GCC) 4.3.3
> Copyright (C) 2008 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> $ cat sp.c
> int main()
> {
> }
> 
> $ gcc -c -fstack-protector sp.c
> $ echo $?
> 0
> $ gcc -o sp -fstack-protector sp.c
> /usr/qnx641/host/qnx6/x86/usr/bin/ntox86-ld: cannot find -lssp_nonshared
> collect2: ld returned 1 exit status
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post32389

-- 
cburgess@qnx.com
Re: gcc -fstack-proctector problem?  
Xiaodan Tang wrote:
> This is on 6.4.1
> 
> I can see i386-pc-nto-qnx6.4.0 is compiled with -disable-libssp, but how come the gcc -c successed? 
> 
> One of my project is using “gcc -c -fstack-protector" to test in configure, leads to mistakely allow that flag...

--disable-libssp only disables the building of the SSP runtime libraries 
but it does not disable SSP altogether. The proper conf test should be 
to link the executable.

What are you trying to build?

Regards,

Ryan Mansfield
RE: gcc -fstack-proctector problem?  
I am trying to build "cups" (pkgsrc/HEAD_641/print/cups), and was
confused about the failure of the linker.

If I took away the "-fstack-protector" in linking, you can see all those
_stack_guard/_stack_available function unresolved. 

Looking at the configure, it test weather it should add this flag or
not, but do a "gcc -c -fstack-protector", which successed.

As of now, I am patching the configure to force it off to get going, but
thought this worth to mention.

-xtang

> -----Original Message-----
> From: Ryan Mansfield [mailto:community-noreply@qnx.com]
> Sent: June 23, 2009 9:20 PM
> To: general-toolchain
> Subject: Re: gcc -fstack-proctector problem?
> 
> Xiaodan Tang wrote:
> > This is on 6.4.1
> >
> > I can see i386-pc-nto-qnx6.4.0 is compiled with -disable-libssp, but
how
> come the gcc -c successed?
> >
> > One of my project is using "gcc -c -fstack-protector" to test in
> configure, leads to mistakely allow that flag...
> 
> --disable-libssp only disables the building of the SSP runtime
libraries
> but it does not disable SSP altogether. The proper conf test should be
> to link the executable.
> 
> What are you trying to build?
> 
> Regards,
> 
> Ryan Mansfield
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post32392
Re: gcc -fstack-proctector problem?  
Xiaodan Tang wrote:
> I am trying to build "cups" (pkgsrc/HEAD_641/print/cups), and was
> confused about the failure of the linker.
> 
> If I took away the "-fstack-protector" in linking, you can see all those
> _stack_guard/_stack_available function unresolved. 
> 
> Looking at the configure, it test weather it should add this flag or
> not, but do a "gcc -c -fstack-protector", which successed.
> 
> As of now, I am patching the configure to force it off to get going, but
> thought this worth to mention.

Looks like someone has already proposed a fix to cups:

http://lists.busybox.net/pipermail/buildroot/2009-May/027475.html

Regards,

Ryan Mansfield
>> -----Original Message-----
>> From: Ryan Mansfield [mailto:community-noreply@qnx.com]
>> Sent: June 23, 2009 9:20 PM
>> To: general-toolchain
>> Subject: Re: gcc -fstack-proctector problem?
>>
>> Xiaodan Tang wrote:
>>> This is on 6.4.1
>>>
>>> I can see i386-pc-nto-qnx6.4.0 is compiled with -disable-libssp, but
> how
>> come the gcc -c successed?
>>> One of my project is using "gcc -c -fstack-protector" to test in
>> configure, leads to mistakely allow that flag...
>>
>> --disable-libssp only disables the building of the SSP runtime
> libraries
>> but it does not disable SSP altogether. The proper conf test should be
>> to link the executable.
>>
>> What are you trying to build?
>>
>> Regards,
>>
>> Ryan Mansfield
>>
>> _______________________________________________
>> General
>> http://community.qnx.com/sf/go/post32392
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post32394
> 
RE: gcc -fstack-proctector problem?  
Cool, this is exactly what I am trying to do :)

-xtang

> -----Original Message-----
> From: Ryan Mansfield [mailto:community-noreply@qnx.com]
> Sent: June 23, 2009 9:26 PM
> To: general-toolchain
> Subject: Re: gcc -fstack-proctector problem?
> 
> Xiaodan Tang wrote:
> > I am trying to build "cups" (pkgsrc/HEAD_641/print/cups), and was
> > confused about the failure of the linker.
> >
> > If I took away the "-fstack-protector" in linking, you can see all
those
> > _stack_guard/_stack_available function unresolved.
> >
> > Looking at the configure, it test weather it should add this flag or
> > not, but do a "gcc -c -fstack-protector", which successed.
> >
> > As of now, I am patching the configure to force it off to get going,
but
> > thought this worth to mention.
> 
> Looks like someone has already proposed a fix to cups:
> 
> http://lists.busybox.net/pipermail/buildroot/2009-May/027475.html
> 
> Regards,
> 
> Ryan Mansfield
> >> -----Original Message-----
> >> From: Ryan Mansfield [mailto:community-noreply@qnx.com]
> >> Sent: June 23, 2009 9:20 PM
> >> To: general-toolchain
> >> Subject: Re: gcc -fstack-proctector problem?
> >>
> >> Xiaodan Tang wrote:
> >>> This is on 6.4.1
> >>>
> >>> I can see i386-pc-nto-qnx6.4.0 is compiled with -disable-libssp,
but
> > how
> >> come the gcc -c successed?
> >>> One of my project is using "gcc -c -fstack-protector" to test in
> >> configure, leads to mistakely allow that flag...
> >>
> >> --disable-libssp only disables the building of the SSP runtime
> > libraries
> >> but it does not disable SSP altogether. The proper conf test should
be
> >> to link the executable.
> >>
> >> What are you trying to build?
> >>
> >> Regards,
> >>
> >> Ryan Mansfield
> >>
> >> _______________________________________________
> >> General
> >> http://community.qnx.com/sf/go/post32392
> >
> > _______________________________________________
> > General
> > http://community.qnx.com/sf/go/post32394
> >
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post32395
Re: gcc -fstack-proctector problem?  
Ryan how is the libssp implemented?

Xiaodan Tang wrote:
> Cool, this is exactly what I am trying to do :)
> 
> -xtang
> 
>> -----Original Message-----
>> From: Ryan Mansfield [mailto:community-noreply@qnx.com]
>> Sent: June 23, 2009 9:26 PM
>> To: general-toolchain
>> Subject: Re: gcc -fstack-proctector problem?
>>
>> Xiaodan Tang wrote:
>>> I am trying to build "cups" (pkgsrc/HEAD_641/print/cups), and was
>>> confused about the failure of the linker.
>>>
>>> If I took away the "-fstack-protector" in linking, you can see all
> those
>>> _stack_guard/_stack_available function unresolved.
>>>
>>> Looking at the configure, it test weather it should add this flag or
>>> not, but do a "gcc -c -fstack-protector", which successed.
>>>
>>> As of now, I am patching the configure to force it off to get going,
> but
>>> thought this worth to mention.
>> Looks like someone has already proposed a fix to cups:
>>
>> http://lists.busybox.net/pipermail/buildroot/2009-May/027475.html
>>
>> Regards,
>>
>> Ryan Mansfield
>>>> -----Original Message-----
>>>> From: Ryan Mansfield [mailto:community-noreply@qnx.com]
>>>> Sent: June 23, 2009 9:20 PM
>>>> To: general-toolchain
>>>> Subject: Re: gcc -fstack-proctector problem?
>>>>
>>>> Xiaodan Tang wrote:
>>>>> This is on 6.4.1
>>>>>
>>>>> I can see i386-pc-nto-qnx6.4.0 is compiled with -disable-libssp,
> but
>>> how
>>>> come the gcc -c successed?
>>>>> One of my project is using "gcc -c -fstack-protector" to test in
>>>> configure, leads to mistakely allow that flag...
>>>>
>>>> --disable-libssp only disables the building of the SSP runtime
>>> libraries
>>>> but it does not disable SSP altogether. The proper conf test should
> be
>>>> to link the executable.
>>>>
>>>> What are you trying to build?
>>>>
>>>> Regards,
>>>>
>>>> Ryan Mansfield
>>>>
>>>> _______________________________________________
>>>> General
>>>> http://community.qnx.com/sf/go/post32392
>>> _______________________________________________
>>> General
>>> http://community.qnx.com/sf/go/post32394
>>>
>> _______________________________________________
>> General
>> http://community.qnx.com/sf/go/post32395
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post32396
> 

-- 
cburgess@qnx.com
Re: gcc -fstack-proctector problem?  
Colin Burgess wrote:
> Ryan how is the libssp implemented?

It sets random guard values at end of the stack frame, and then checks 
to make sure they haven't been clobbered. The Linux implementations uses 
routines provided by glibc (__stack_chk_guard/__pointer_chk_guard)

Regards,

Ryan Mansfield

> Xiaodan Tang wrote:
>> Cool, this is exactly what I am trying to do :)
>>
>> -xtang
>>
>>> -----Original Message-----
>>> From: Ryan Mansfield [mailto:community-noreply@qnx.com]
>>> Sent: June 23, 2009 9:26 PM
>>> To: general-toolchain
>>> Subject: Re: gcc -fstack-proctector problem?
>>>
>>> Xiaodan Tang wrote:
>>>> I am trying to build "cups" (pkgsrc/HEAD_641/print/cups), and was
>>>> confused about the failure of the linker.
>>>>
>>>> If I took away the "-fstack-protector" in linking, you can see all
>> those
>>>> _stack_guard/_stack_available function unresolved.
>>>>
>>>> Looking at the configure, it test weather it should add this flag or
>>>> not, but do a "gcc -c -fstack-protector", which successed.
>>>>
>>>> As of now, I am patching the configure to force it off to get going,
>> but
>>>> thought this worth to mention.
>>> Looks like someone has already proposed a fix to cups:
>>>
>>> http://lists.busybox.net/pipermail/buildroot/2009-May/027475.html
>>>
>>> Regards,
>>>
>>> Ryan Mansfield
>>>>> -----Original Message-----
>>>>> From: Ryan Mansfield [mailto:community-noreply@qnx.com]
>>>>> Sent: June 23, 2009 9:20 PM
>>>>> To: general-toolchain
>>>>> Subject: Re: gcc -fstack-proctector problem?
>>>>>
>>>>> Xiaodan Tang wrote:
>>>>>> This is on 6.4.1
>>>>>>
>>>>>> I can see i386-pc-nto-qnx6.4.0 is compiled with -disable-libssp,
>> but
>>>> how
>>>>> come the gcc -c successed?
>>>>>> One of my project is using "gcc -c -fstack-protector" to test in
>>>>> configure, leads to mistakely allow that flag...
>>>>>
>>>>> --disable-libssp only disables the building of the SSP runtime
>>>> libraries
>>>>> but it does not disable SSP altogether. The proper conf test should
>> be
>>>>> to link the executable.
>>>>>
>>>>> What are you trying to build?
>>>>>
>>>>> Regards,
>>>>>
>>>>> Ryan Mansfield
>>>>>
>>>>> _______________________________________________
>>>>> General
>>>>> http://community.qnx.com/sf/go/post32392
>>>> _______________________________________________
>>>> General
>>>> http://community.qnx.com/sf/go/post32394
>>>>
>>> _______________________________________________
>>> General
>>> http://community.qnx.com/sf/go/post32395
>>
>> _______________________________________________
>> General
>> http://community.qnx.com/sf/go/post32396
>>
>