Libssp support
PATCH 1/1 Libssp support
Hello,
I tried to activate gcc's -fstack-protector flag, but the compiler was looking for libssp:
.../toolchain/bin/arceb-linux-gcc -O2 -o stack_overrun stack_overrun.c -fstack-protector .../arceb-ezchip-linux-uclibc/bin/ld: cannot find -lssp_nonshared .../arceb-ezchip-linux-uclibc/bin/ld: cannot find -lssp
collect2: error: ld returned 1 exit status
Building libssp seems to be disabled with no option to enable it in package/gcc.mk by using the --disable-libssp flag for configuring gcc. Applying the patch below enables the usage of libssp. Of course, it could be conditional with some configuration symbol, to save place when libssp is not needed. Any thoughts on it?
It seems to be related to this bug:
https://bugs.busybox.net/show_bug.cgi?id=4039
Thanks
Guy Benyei
package/gcc/gcc-final/gcc-final.mk +9 -0
@@ -147,6 +147,15 @@ endef HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_LIBATOMIC +define HOST_GCC_FINAL_INSTALL_LIBSSP + -cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/libssp* \ + $(STAGING_DIR)/lib/ + -cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/libssp* \ + $(TARGET_DIR)/lib/ +endef + +HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_LIBSSP + # Handle the installation of libraries in /usr/lib HOST_GCC_FINAL_USR_LIBS =
package/gcc/gcc.mk +0 -1
@@ -90,7 +90,6 @@ HOST_GCC_COMMON_CONF_OPTS = \ --with-sysroot=$(STAGING_DIR) \ --disable-__cxa_atexit \ --with-gnu-ld \ - --disable-libssp \ --disable-multilib \ --with-gmp=$(HOST_DIR)/usr \ --with-mpc=$(HOST_DIR)/usr \
PATCH 1/1 Libssp support
Hi Guy,
Quoted 7 lines · Guy Benyei
I tried to activate gcc's -fstack-protector flag, but the compiler was looking for libssp:
.../toolchain/bin/arceb-linux-gcc -O2 -o
stack_overrunstack_overrun.c-fstack-protector .../arceb-ezchip-linux-uclibc/bin/ld: cannot find -lssp_nonshared .../arceb-ezchip-linux-uclibc/bin/ld: cannot find -lssp
collect2: error: ld returned 1 exit status
What code are you trying to build? Is this part of a Buildroot package?
A sane build system must check whether the compiler supports -fstack-protector before attempting to use it.
Quoted 6 lines
Building libssp seems to be disabled with no option to enable it in
package/gcc.mkby using the --disable-libssp flag for configuring gcc. Applying the patch below enables the usage of libssp. Of course, it could be conditional with some configuration symbol, to save place when libssp is not needed.
Any thoughts on it?
The internal toolchain that package/gcc/gcc.mk builds relies on ssp support from the C library. In your case this is seems to be uClibc. You need to enable BR2_TOOLCHAIN_BUILDROOT_USE_SSP (under "uClibc Options") for stack smashing protection support.
Quoted 2 lines
It seems to be related to this bug:
https://bugs.busybox.net/show_bug.cgi?id=4039
This bug is about external toolchains. Unrelated to gcc.mk that only deals with the internal toolchain.
baruch
Quoted 30 lines
package/gcc/gcc-final/gcc-final.mk +9
-0@@ -147,6 +147,15 @@ endef HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_LIBATOMIC +define HOST_GCC_FINAL_INSTALL_LIBSSP + -cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/libssp* \ + $(STAGING_DIR)/lib/ + -cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/libssp* \ + $(TARGET_DIR)/lib/ +endef + +HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_LIBSSP + # Handle the installation of libraries in /usr/lib HOST_GCC_FINAL_USR_LIBS =package/gcc/gcc.mk +0
-1@@ -90,7 +90,6 @@ HOST_GCC_COMMON_CONF_OPTS = \ --with-sysroot=$(STAGING_DIR) \ --disable-__cxa_atexit \ --with-gnu-ld \ - --disable-libssp \ --disable-multilib \ --with-gmp=$(HOST_DIR)/usr \ --with-mpc=$(HOST_DIR)/usr \
Signature · 3 lines
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -PATCH 1/1 Libssp support
Hi Baruch,
The code I'm trying to build is not part of the buildroot package - it's a sample program I tried to compile to test the availability of the SSP feature in the GCC built by buildroot (arc/nps400 target). This feature is supported by GCC, pretty simple and useful, and apparently just needs the related libssp to be available. I understand, that also uClibc can support SSP, but I'd prefer not to add anything to uClibc if I don't have to. Having libssp available seems to do a reasonable job for this case, without changing anything else.
Thanks
Guy
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
unsigned int __stack_chk_guard = 0xDEADBEEF;
__attribute__((noreturn))
void __stack_chk_fail(void)
{
printf("The canary died!\n");
exit(0);
}__attribute__((noinline)) void foo(const char* str)
{
char buffer[16];
strcpy(buffer, str);
}int main(int argc, char *argv[]) {
if (argc!=2) {
printf("Expected single command line option string to copy!\n");
return -1;
}
/* if argv[1] is at least 16 character long (17 including the trailing \0)
a buffer overrun will occur, and the __stack_chk_fail handler will be called */
foo(argv[1]);
return -1;
}-----Original Message-----
From: Baruch Siach [mailto:baruch at tkos.co.il]
Sent: Wednesday, June 7, 2017 11:13 PM
To: Guy Benyei <[email protected]>
Cc: buildroot at busybox.net
Subject: Re: [Buildroot] [PATCH]Libssp support
Hi Guy,
Quoted 8 lines · Guy Benyei
I tried to activate gcc's -fstack-protector flag, but the compiler was looking for libssp:
.../toolchain/bin/arceb-linux-gcc -O2 -o
stack_overrunstack_overrun.c-fstack-protector .../arceb-ezchip-linux-uclibc/bin/ld: cannot find -lssp_nonshared .../arceb-ezchip-linux-uclibc/bin/ld: cannot find -lssp
collect2: error: ld returned 1 exit status
What code are you trying to build? Is this part of a Buildroot package?
A sane build system must check whether the compiler supports -fstack-protector before attempting to use it.
Quoted 6 lines
Building libssp seems to be disabled with no option to enable it in
package/gcc.mkby using the --disable-libssp flag for configuring gcc. Applying the patch below enables the usage of libssp. Of course, it could be conditional with some configuration symbol, to save place when libssp is not needed.
Any thoughts on it?
The internal toolchain that package/gcc/gcc.mk builds relies on ssp support from the C library. In your case this is seems to be uClibc. You need to enable BR2_TOOLCHAIN_BUILDROOT_USE_SSP (under "uClibc Options") for stack smashing protection support.
Quoted 2 lines
It seems to be related to this bug:
https://bugs.busybox.net/show_bug.cgi?id=4039
This bug is about external toolchains. Unrelated to gcc.mk that only deals with the internal toolchain.
baruch
Quoted 33 lines
package/gcc/gcc-final/gcc-final.mk +9
-0@@ -147,6 +147,15 @@ endef HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_LIBATOMIC +define HOST_GCC_FINAL_INSTALL_LIBSSP + -cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/libssp* \ + $(STAGING_DIR)/lib/ + -cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/libssp* \ + $(TARGET_DIR)/lib/ +endef + +HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_LIBSSP + # Handle the installation of libraries in /usr/lib
HOST_GCC_FINAL_USR_LIBS=package/gcc/gcc.mk index renamed from package/gcc/gcc.mk +0
-0b52f945..cca3847 100644
package/gcc/gcc.mk +0
-1@@ -90,7 +90,6 @@ HOST_GCC_COMMON_CONF_OPTS = \ --with-sysroot=$(STAGING_DIR) \ --disable-__cxa_atexit \ --with-gnu-ld \ - --disable-libssp \ --disable-multilib \ --with-gmp=$(HOST_DIR)/usr \ --with-mpc=$(HOST_DIR)/usr \
Signature · 3 lines
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -PATCH 1/1 Libssp support
Hi Guy,
Quoted 8 lines · Guy Benyei
The code I'm trying to build is not part of the buildroot package - it's a sample program I tried to compile to test the availability of the SSP feature in the GCC built by buildroot (arc/nps400 target). This feature is supported by GCC, pretty simple and useful, and apparently just needs the related libssp to be available.
I understand, that also uClibc can support SSP, but I'd prefer not to add anything to uClibc if I don't have to. Having libssp available seems to do a reasonable job for this case, without changing anything else.
Well, you are changing the toolchain, but at the gcc end instead of the libc one. Your suggested patch can't be accepted as is since it does not handle BR2_TOOLCHAIN_HAS_SSP, for example, but there is probably more to it that I'm not aware of. A complete solution would inevitably be more complex. I believe you'll need to make a more convincing case for Buildroot maintainers to accept this added complexity.
Why do you prefer the gcc change over the libc one?
baruch
Quoted 106 lines
#include <
stdio.h>
#include <stdlib.h>
#include <string.h>unsigned int
__stack_chk_guard=0xDEADBEEF;__attribute__((noreturn))
void__stack_chk_fail(void){ printf("The canary died!\n"); exit(0); }__attribute__((noinline)) void
foo(const char* str){ char buffer[16]; strcpy(buffer, str); }int main(int argc, char *argv[]) { if (argc!=2) { printf("Expected single command line option string to copy!\n"); return -1; } /* if argv[1] is at least 16 character long (17 including the trailing \0) a buffer overrun will occur, and the __stack_chk_fail handler will be called */ foo(argv[1]); return -1; }-----Original Message-----
From: Baruch Siach [mailto:baruch at tkos.co.il]
Sent: Wednesday, June 7, 2017 11:13 PM
To: Guy Benyei <[email protected]>
Cc: buildroot at busybox.net
Subject: Re: [Buildroot] [PATCH]Libssp supportHi Guy,
Quoted 8 lines · Guy Benyei
I tried to activate gcc's -fstack-protector flag, but the compiler was looking for libssp:
.../toolchain/bin/arceb-linux-gcc -O2 -o
stack_overrunstack_overrun.c-fstack-protector .../arceb-ezchip-linux-uclibc/bin/ld: cannot find -lssp_nonshared .../arceb-ezchip-linux-uclibc/bin/ld: cannot find -lssp
collect2: error: ld returned 1 exit statusWhat code are you trying to build? Is this part of a Buildroot package?
A sane build system must check whether the compiler supports -fstack-protector before attempting to use it.
Quoted 6 lines
Building libssp seems to be disabled with no option to enable it in
package/gcc.mkby using the --disable-libssp flag for configuring gcc. Applying the patch below enables the usage of libssp. Of course, it could be conditional with some configuration symbol, to save place when libssp is not needed.
Any thoughts on it?The internal toolchain that
package/gcc/gcc.mkbuilds relies on ssp support from the C library. In your case this is seems to be uClibc. You need to enableBR2_TOOLCHAIN_BUILDROOT_USE_SSP(under "uClibc Options") for stack smashing protection support.Quoted 2 lines
It seems to be related to this bug:
https://bugs.busybox.net/show_bug.cgi?id=4039This bug is about external toolchains. Unrelated to gcc.mk that only deals with the internal toolchain.
baruch
Quoted 33 lines
package/gcc/gcc-final/gcc-final.mk +9
-0@@ -147,6 +147,15 @@ endef HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_LIBATOMIC +define HOST_GCC_FINAL_INSTALL_LIBSSP + -cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/libssp* \ + $(STAGING_DIR)/lib/ + -cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/libssp* \ + $(TARGET_DIR)/lib/ +endef + +HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_LIBSSP + # Handle the installation of libraries in /usr/lib
HOST_GCC_FINAL_USR_LIBS=package/gcc/gcc.mk index renamed from package/gcc/gcc.mk +0
-0b52f945..cca3847 100644
package/gcc/gcc.mk +0
-1@@ -90,7 +90,6 @@ HOST_GCC_COMMON_CONF_OPTS = \ --with-sysroot=$(STAGING_DIR) \ --disable-__cxa_atexit \ --with-gnu-ld \ - --disable-libssp \ --disable-multilib \ --with-gmp=$(HOST_DIR)/usr \ --with-mpc=$(HOST_DIR)/usr \
Signature · 3 lines
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -PATCH 1/1 Libssp support
Hi Baruch,
I don't change the gcc end - the ssp support is implemented in gcc anyway, the compiler built with or without the "--disable-libssp" is the same compiler. This change only adds the libssp library, so the ssp feature can be activated. The reason I prefer this over building uClibc with ssp support is that in this case I may choose whether to add the libssp binaries to my image. Changing uClibc, or creating an alternative uClibc with ssp support would require a bigger uClibc or two different builds. I agree, that the patch should be enhanced in order to take in account the buildroot configuration, probably by adding a separate configuration item. Of course, I'am ready to do this work, but as you said, I'll have to convince the maintainers that this feature is worth to be added.
Thanks
Guy
-----Original Message-----
From: Baruch Siach [mailto:baruch at tkos.co.il]
Sent: Thursday, June 8, 2017 3:12 PM
To: Guy Benyei <[email protected]>
Cc: buildroot at busybox.net
Subject: Re: [Buildroot] [PATCH]Libssp support
Hi Guy,
Quoted 8 lines · Guy Benyei
The code I'm trying to build is not part of the buildroot package - it's a sample program I tried to compile to test the availability of the SSP feature in the GCC built by buildroot (arc/nps400 target). This feature is supported by GCC, pretty simple and useful, and apparently just needs the related libssp to be available.
I understand, that also uClibc can support SSP, but I'd prefer not to add anything to uClibc if I don't have to. Having libssp available seems to do a reasonable job for this case, without changing anything else.
Well, you are changing the toolchain, but at the gcc end instead of the libc one. Your suggested patch can't be accepted as is since it does not handle BR2_TOOLCHAIN_HAS_SSP, for example, but there is probably more to it that I'm not aware of. A complete solution would inevitably be more complex. I believe you'll need to make a more convincing case for Buildroot maintainers to accept this added complexity.
Why do you prefer the gcc change over the libc one?
baruch
Quoted 106 lines
#include <
stdio.h>
#include <stdlib.h>
#include <string.h>unsigned int
__stack_chk_guard=0xDEADBEEF;__attribute__((noreturn))
void__stack_chk_fail(void){ printf("The canary died!\n"); exit(0); }__attribute__((noinline)) void foo(const char* str) { char buffer[16]; strcpy(buffer, str); }int main(int argc, char *argv[]) { if (argc!=2) { printf("Expected single command line option string to copy!\n"); return -1; } /* if argv[1] is at least 16 character long (17 including the trailing \0) a buffer overrun will occur, and the __stack_chk_fail handler will be called */ foo(argv[1]); return -1; }-----Original Message-----
From: Baruch Siach [mailto:baruch at tkos.co.il]
Sent: Wednesday, June 7, 2017 11:13 PM
To: Guy Benyei <[email protected]>
Cc: buildroot at busybox.net
Subject: Re: [Buildroot] [PATCH]Libssp supportHi Guy,
Quoted 8 lines · Guy Benyei
I tried to activate gcc's -fstack-protector flag, but the compiler was looking for libssp:
.../toolchain/bin/arceb-linux-gcc -O2 -o
stack_overrunstack_overrun.c-fstack-protector .../arceb-ezchip-linux-uclibc/bin/ld: cannot find -lssp_nonshared .../arceb-ezchip-linux-uclibc/bin/ld: cannot find -lssp
collect2: error: ld returned 1 exit statusWhat code are you trying to build? Is this part of a Buildroot package?
A sane build system must check whether the compiler supports -fstack-protector before attempting to use it.
Quoted 6 lines
Building libssp seems to be disabled with no option to enable it in
package/gcc.mkby using the --disable-libssp flag for configuring gcc. Applying the patch below enables the usage of libssp. Of course, it could be conditional with some configuration symbol, to save place when libssp is not needed.
Any thoughts on it?The internal toolchain that
package/gcc/gcc.mkbuilds relies on ssp support from the C library. In your case this is seems to be uClibc. You need to enableBR2_TOOLCHAIN_BUILDROOT_USE_SSP(under "uClibc Options") for stack smashing protection support.Quoted 2 lines
It seems to be related to this bug:
https://bugs.busybox.net/show_bug.cgi?id=4039This bug is about external toolchains. Unrelated to gcc.mk that only deals with the internal toolchain.
baruch
Quoted 34 lines
package/gcc/gcc-final/gcc-final.mk +0
-0@@ -147,6 +147,15 @@ endef HOST_GCC_FINAL_POST_INSTALL_HOOKS +=
HOST_GCC_FINAL_INSTALL_LIBATOMICpackage/gcc/gcc-final/gcc-final.mk +9
-0+define HOST_GCC_FINAL_INSTALL_LIBSSP + -cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/libssp* \ + $(STAGING_DIR)/lib/ + -cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/libssp* \ + $(TARGET_DIR)/lib/ +endef + +HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_LIBSSP + # Handle the installation of libraries in /usr/lib
HOST_GCC_FINAL_USR_LIBS=package/gcc/gcc.mk index renamed from package/gcc/gcc.mk +0
-0b52f945..cca3847 100644
package/gcc/gcc.mk +0
-1@@ -90,7 +90,6 @@ HOST_GCC_COMMON_CONF_OPTS = \ --with-sysroot=$(STAGING_DIR) \ --disable-__cxa_atexit \ --with-gnu-ld \ - --disable-libssp \ --disable-multilib \ --with-gmp=$(HOST_DIR)/usr \ --with-mpc=$(HOST_DIR)/usr \
Signature · 3 lines
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -PATCH 1/1 Libssp support
Hello,
Quoted 4 lines · Guy Benyei
I don't change the gcc end - the ssp support is implemented in gcc anyway, the compiler built with or without the "--disable-libssp" is the same compiler. This change only adds the libssp library, so the ssp feature can be activated. The reason I prefer this over building
Quoted 8 lines
uClibc with ssp support is that in this case I may choose whether to add the libssp binaries to my image. Changing uClibc, or creating an alternative uClibc with ssp support would require a bigger uClibc or two different builds. I agree, that the patch should be enhanced in order to take in account the buildroot configuration, probably by adding a separate configuration item. Of course, I'am ready to do this work, but as you said, I'll have to convince the maintainers that this feature is worth to be added.
On my side, as long as there is a proper patch to support SSP support at the compiler level, in addition to at the C library, I think I'd be fine with applying it.
However, it has to be a proper patch, that makes sure SSP support can only be enabled either at the compiler level *or* at the C library level. For example, I'm not sure if you can disable SSP support in musl or glibc, and what happens if you have SSP support in both the C library and gcc's libssp. All those questions have to be answered in the commit log of such a patch.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 1/1 Libssp support
Hi Thomas,
I checked the issue, and here are my findings:
Libssp is used by gcc, only when the gcc_cv_libc_provides_ssp gcc configuration flag is set to "no". In buildroot, this flag is set as:
HOST_GCC_COMMON_MAKE_OPTS = \ gcc_cv_libc_provides_ssp=$(if $(BR2_TOOLCHAIN_HAS_SSP),yes,no)
For glibc SSP support is enabled by default, and BR2_TOOLCHAIN_HAS_SSP is set. Same goes for musl, except for some specific architectures. uClibc sets BR2_TOOLCHAIN_HAS_SSP only is it's configured to support SSP. All in all, it only makes sense to build and install libssp if the C library doesn't support SSP, i.e.: BR2_TOOLCHAIN_HAS_SSP is set to "n". I'll send out an updated patch soon.
Thanks
Guy
-----Original Message-----
From: Thomas Petazzoni [mailto:thomas.petazzoni at free-electrons.com]
Sent: Friday, June 9, 2017 12:15 AM
To: Guy Benyei <[email protected]>
Cc: Baruch Siach <[email protected]>; buildroot at busybox.net
Subject: Re: [Buildroot] [PATCH]Libssp support
Hello,
Quoted 4 lines · Guy Benyei
I don't change the gcc end - the ssp support is implemented in gcc anyway, the compiler built with or without the "--disable-libssp" is the same compiler. This change only adds the libssp library, so the ssp feature can be activated. The reason I prefer this over building
Quoted 8 lines
uClibc with ssp support is that in this case I may choose whether to add the libssp binaries to my image. Changing uClibc, or creating an alternative uClibc with ssp support would require a bigger uClibc or two different builds. I agree, that the patch should be enhanced in order to take in account the buildroot configuration, probably by adding a separate configuration item. Of course, I'am ready to do this work, but as you said, I'll have to convince the maintainers that this feature is worth to be added.
On my side, as long as there is a proper patch to support SSP support at the compiler level, in addition to at the C library, I think I'd be fine with applying it.
However, it has to be a proper patch, that makes sure SSP support can only be enabled either at the compiler level *or* at the C library level. For example, I'm not sure if you can disable SSP support in musl or glibc, and what happens if you have SSP support in both the C library and gcc's libssp. All those questions have to be answered in the commit log of such a patch.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
PATCH 1/1 Libssp support
Hi Guy,
[Please don't top-post, but reply in-line, like I do now.]
Quoted 11 lines · Guy Benyei
Hi Thomas,
I checked the issue, and here are my findings:
Libssp is used by gcc, only when thegcc_cv_libc_provides_sspgcc configuration flag is set to "no". In buildroot, this flag is set as:HOST_GCC_COMMON_MAKE_OPTS = \ gcc_cv_libc_provides_ssp=$(if $(BR2_TOOLCHAIN_HAS_SSP),yes,no)For glibc SSP support is enabled by default, and
BR2_TOOLCHAIN_HAS_SSPis set. Same goes for musl, except for some specific architectures. uClibc setsBR2_TOOLCHAIN_HAS_SSPonly is it's configured to support SSP.All in all, it only makes sense to build and install libssp if the C library doesn't support SSP, i.e.:
BR2_TOOLCHAIN_HAS_SSPis set to "n".
It's a little more complicated than that - BR2_TOOLCHAIN_HAS_SSP should be set
when -fstack-protector works with this toolchain. In other words, if you make a patch that uses gcc's libssp, then this symbol should be selected.
So you need to introduce a new symbol (e.g. BR2_LIBC_HAS_SSP) that is set by
the libc, and use gcc's libssp if it is not set. The internal toolchain should then always set BR2_TOOLCHAIN_HAS_SSP.
All in all, a fairly complicated patch, I'm afraid. When you post something
we'll provice feedback on how it should be improved.
Regards,
Arnout
Quoted 1 line
I'll send out an updated patch soon.
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 1/1 Libssp support
Hi Arnout,
Quoted 3 lines · Arnout Vandecappelle
Hi Guy,
[Please don't top-post, but reply in-line, like I do now.]
Will do.
Quoted 11 lines
It's a little more complicated than that -
BR2_TOOLCHAIN_HAS_SSPshould be
set when -fstack-protector works with this toolchain. In other words, if you make a patch that uses gcc's libssp, then this symbol should be selected.So you need to introduce a new symbol (e.g.
BR2_LIBC_HAS_SSP) that is set by
the libc, and use gcc's libssp if it is not set. The internal toolchain should then always setBR2_TOOLCHAIN_HAS_SSP.All in all, a fairly complicated patch, I'm afraid. When you post something we'll
provice feedback on how it should be improved.
Thanks for your feedback. Sending new patch right away.
Thanks
Guy