tools/nolibc: always disable stack protector for tests
Subsystems (2)
Willy Tarreau
maintainercover tools/nolibc: always disable stack protector for tests
Hello Paul,
Thomas noticed that nolibc-test fails to build on compilers that enable stack protectors by default. Passing -fno-stack-protector when supported addresses the problem.
I verified that all supported archs continue to work after his patch is applied, and that it applies without conflict (and works) both on top of your latest dev tree and on top of Linus' master branch. Thus I think it can make sense to queue it with your next series of fixes and have it for 6.3 given that it addresses build issues for some developers.
Thanks!
Willy
---
Thomas Weißschuh (1):
tools/nolibc: always disable stack protector for tests
tools/testing/selftests/nolibc/Makefile | 3 +++ 1 file changed, 3 insertions(+)
Signature · 1 line
2.17.5
Willy Tarreau
maintainerPATCH 1/1 tools/nolibc: always disable stack protector for tests
From: Thomas Weißschuh <[email protected]>
Stack protectors need support from libc.
This support is not provided by nolibc which leads to compiler errors when stack protectors are enabled by default in a compiler:
CC nolibc-test
/usr/bin/ld: /tmp/ccqbHEPk.o: in function `stat':
nolibc-test.c:(.text+0x1d1): undefined reference to `__stack_chk_fail'
/usr/bin/ld: /tmp/ccqbHEPk.o: in function `poll.constprop.0':
nolibc-test.c:(.text+0x37b): undefined reference to `__stack_chk_fail'
/usr/bin/ld: /tmp/ccqbHEPk.o: in function `vfprintf.constprop.0':
nolibc-test.c:(.text+0x712): undefined reference to `__stack_chk_fail'
/usr/bin/ld: /tmp/ccqbHEPk.o: in function `pad_spc.constprop.0':
nolibc-test.c:(.text+0x80d): undefined reference to `__stack_chk_fail'
/usr/bin/ld: /tmp/ccqbHEPk.o: in function `printf':
nolibc-test.c:(.text+0x8c4): undefined reference to `__stack_chk_fail'
/usr/bin/ld: /tmp/ccqbHEPk.o:nolibc-test.c:(.text+0x12d4): more undefined references to `__stack_chk_fail' follow
collect2: error: ld returned 1 exit status
--- tools/testing/selftests/nolibc/Makefile | 3 +++ 1 file changed, 3 insertions(+)
tools/testing/selftests/nolibc/Makefile +3 -0
@@ -1,6 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for nolibc tests include ../../../scripts/Makefile.include +# We need this for the "cc-option" macro. +include ../../../build/Build.include # we're in ".../tools/testing/selftests/nolibc" ifeq ($(srctree),)
@@ -72,6 +74,7 @@ endif CFLAGS_s390 = -m64 CFLAGS ?= -Os -fno-ident -fno-asynchronous-unwind-tables $(CFLAGS_$(ARCH)) +CFLAGS += $(call cc-option,-fno-stack-protector) LDFLAGS := -s help:
Signature · 1 line
2.17.5
Paul E. McKenney
AppliedQuoted 11 lines · Willy Tarreau
Hello Paul,
Thomas noticed that nolibc-test fails to build on compilers that enable stack protectors by default. Passing -fno-stack-protector when supported addresses the problem.
I verified that all supported archs continue to work after his patch is applied, and that it applies without conflict (and works) both on top of your latest dev tree and on top of Linus' master branch. Thus I think it can make sense to queue it with your next series of fixes and have it for 6.3 given that it addresses build issues for some developers.
Queued and pushed, thank you both!
Just to make sure I understand, you would like me to add this to the serieses from Vincent, yourself, and Feiyang that are set up to go into the next merge window, correct?
If you instead would like me to push it to Linus directly into the v6.3 release as a regression fix late this coming week, please let me know.
Thanx, Paul
Quoted 12 lines
Thanks!
Willy
---
Thomas Weißschuh (1):
tools/nolibc: always disable stack protector for teststools/testing/selftests/nolibc/Makefile | 3 +++ 1 file changed, 3 insertions(+)Signature · 1 line
2.17.5
Willy Tarreau
maintainerHi Paul,
Quoted 1 line · Paul E. McKenney
Queued and pushed, thank you both!
Thank you!
Quoted 6 lines
Just to make sure I understand, you would like me to add this to the serieses from Vincent, yourself, and Feiyang that are set up to go into the next merge window, correct?
If you instead would like me to push it to Linus directly into the v6.3 release as a regression fix late this coming week, please let me know.
It would indeed be preferable for 6.3 as it fixes issues, but it's not critical at all, just an annoyance for some developers. So if you have a series of fixes pending to be sent soon, it would be nice to add it there.
Thanks!
Willy
Quoted 11 lines · Willy Tarreau
Hi Paul,
Quoted 1 line · Paul E. McKenney
Queued and pushed, thank you both!
Thank you!
Quoted 4 lines
Just to make sure I understand, you would like me to add this to the serieses from Vincent, yourself, and Feiyang that are set up to go into the next merge window, correct?
Quoted 6 lines
Quoted 2 lines
If you instead would like me to push it to Linus directly into the v6.3 release as a regression fix late this coming week, please let me know.
It would indeed be preferable for 6.3 as it fixes issues, but it's not critical at all, just an annoyance for some developers. So if you have a series of fixes pending to be sent soon, it would be nice to add it there.
Very well, here is what I currently have for nolibc, from newest to oldest:
7712ec32cbda selftests/nolibc: Adjust indentation for Makefile96218cfc79eb selftests/nolibc: Add support for LoongArchcab6bbd00f2a tools/nolibc: Add support for LoongArch496921e4724c tools/nolibc: Add statx() and make stat() rely on statx() if necessary 97a15c47b98c tools/nolibc: Include linux/fcntl.h and remove duplicate code de06f2fe1aac tools/nolibc: check for S_I* macros before defining them 7fb54b517d44 selftests/nolibc: skip the chroot_root and link_dir tests when not privileged 296659c6e551 tools/nolibc: add getuid() and geteuid()bd9a87d64994 tools/nolibc: add tests for the integer limits in stdint.h 2d1813a7ef67 tools/nolibc: enlarge column width of tests5dbcbb2da574 tools/nolibc: add integer types and integer limit macros 111bb94f67eb tools/nolibc: add stdint.h2dbf8575b2da tools/nolibc: Add gitignore to avoid git complaints about sysroot
I will take the new commit, rebase it to precede the first of the above, so that the stack will look like this:
7712ec32cbda selftests/nolibc: Adjust indentation for Makefile96218cfc79eb selftests/nolibc: Add support for LoongArchcab6bbd00f2a tools/nolibc: Add support for LoongArch496921e4724c tools/nolibc: Add statx() and make stat() rely on statx() if necessary 97a15c47b98c tools/nolibc: Include linux/fcntl.h and remove duplicate code de06f2fe1aac tools/nolibc: check for S_I* macros before defining them 7fb54b517d44 selftests/nolibc: skip the chroot_root and link_dir tests when not privileged 296659c6e551 tools/nolibc: add getuid() and geteuid()bd9a87d64994 tools/nolibc: add tests for the integer limits in stdint.h 2d1813a7ef67 tools/nolibc: enlarge column width of tests5dbcbb2da574 tools/nolibc: add integer types and integer limit macros 111bb94f67eb tools/nolibc: add stdint.h2dbf8575b2da tools/nolibc: Add gitignore to avoid git complaints about sysroot ???????????? tools/nolibc: always disable stack protector for tests
Then if tests, -next, and kernel test robot are kind, I will send a pull request to Linus for the "always disable stack protector for tests" commit. The rest I send for the upcoming merge window.
Please let me know if I am missing something.
Thanx, Paul
Willy Tarreau
maintainerQuoted 54 lines · Paul E. McKenney
Quoted 11 lines · Willy Tarreau
Hi Paul,
Quoted 1 line · Paul E. McKenney
Queued and pushed, thank you both!
Thank you!
Quoted 4 lines
Just to make sure I understand, you would like me to add this to the serieses from Vincent, yourself, and Feiyang that are set up to go into the next merge window, correct?
Quoted 6 lines
Quoted 2 lines
If you instead would like me to push it to Linus directly into the v6.3 release as a regression fix late this coming week, please let me know.
It would indeed be preferable for 6.3 as it fixes issues, but it's not critical at all, just an annoyance for some developers. So if you have a series of fixes pending to be sent soon, it would be nice to add it there.
Very well, here is what I currently have for nolibc, from newest to oldest:
7712ec32cbdaselftests/nolibc: Adjust indentation forMakefile96218cfc79ebselftests/nolibc: Add support for LoongArchcab6bbd00f2atools/nolibc: Add support for LoongArch496921e4724ctools/nolibc: Addstatx()and makestat()rely onstatx()if necessary97a15c47b98ctools/nolibc: Includelinux/fcntl.hand remove duplicate codede06f2fe1aactools/nolibc: check for S_I* macros before defining them7fb54b517d44selftests/nolibc: skip thechroot_rootandlink_dirtests when not privileged296659c6e551tools/nolibc: addgetuid()andgeteuid()bd9a87d64994tools/nolibc: add tests for the integer limits instdint.h2d1813a7ef67tools/nolibc: enlarge column width of tests5dbcbb2da574tools/nolibc: add integer types and integer limit macros111bb94f67ebtools/nolibc: addstdint.h2dbf8575b2datools/nolibc: Add gitignore to avoid git complaints about sysrootI will take the new commit, rebase it to precede the first of the above, so that the stack will look like this:
7712ec32cbdaselftests/nolibc: Adjust indentation forMakefile96218cfc79ebselftests/nolibc: Add support for LoongArchcab6bbd00f2atools/nolibc: Add support for LoongArch496921e4724ctools/nolibc: Addstatx()and makestat()rely onstatx()if necessary97a15c47b98ctools/nolibc: Includelinux/fcntl.hand remove duplicate codede06f2fe1aactools/nolibc: check for S_I* macros before defining them7fb54b517d44selftests/nolibc: skip thechroot_rootandlink_dirtests when not privileged296659c6e551tools/nolibc: addgetuid()andgeteuid()bd9a87d64994tools/nolibc: add tests for the integer limits instdint.h2d1813a7ef67tools/nolibc: enlarge column width of tests5dbcbb2da574tools/nolibc: add integer types and integer limit macros111bb94f67ebtools/nolibc: addstdint.h2dbf8575b2datools/nolibc: Add gitignore to avoid git complaints about sysroot ????????????tools/nolibc: always disable stack protector for tests
Quoted 5 lines
Then if tests, -next, and kernel test robot are kind, I will send a pull request to Linus for the "always disable stack protector for tests" commit. The rest I send for the upcoming merge window.
Please let me know if I am missing something.
This is perfect, thank you very much, Paul!
Willy
Quoted 55 lines · Willy Tarreau
Quoted 54 lines · Paul E. McKenney
Quoted 11 lines · Willy Tarreau
Hi Paul,
Quoted 1 line · Paul E. McKenney
Queued and pushed, thank you both!
Thank you!
Quoted 4 lines
Just to make sure I understand, you would like me to add this to the serieses from Vincent, yourself, and Feiyang that are set up to go into the next merge window, correct?
Quoted 6 lines
Quoted 2 lines
If you instead would like me to push it to Linus directly into the v6.3 release as a regression fix late this coming week, please let me know.
It would indeed be preferable for 6.3 as it fixes issues, but it's not critical at all, just an annoyance for some developers. So if you have a series of fixes pending to be sent soon, it would be nice to add it there.
Very well, here is what I currently have for nolibc, from newest to oldest:
7712ec32cbdaselftests/nolibc: Adjust indentation forMakefile96218cfc79ebselftests/nolibc: Add support for LoongArchcab6bbd00f2atools/nolibc: Add support for LoongArch496921e4724ctools/nolibc: Addstatx()and makestat()rely onstatx()if necessary97a15c47b98ctools/nolibc: Includelinux/fcntl.hand remove duplicate codede06f2fe1aactools/nolibc: check for S_I* macros before defining them7fb54b517d44selftests/nolibc: skip thechroot_rootandlink_dirtests when not privileged296659c6e551tools/nolibc: addgetuid()andgeteuid()bd9a87d64994tools/nolibc: add tests for the integer limits instdint.h2d1813a7ef67tools/nolibc: enlarge column width of tests5dbcbb2da574tools/nolibc: add integer types and integer limit macros111bb94f67ebtools/nolibc: addstdint.h2dbf8575b2datools/nolibc: Add gitignore to avoid git complaints about sysrootI will take the new commit, rebase it to precede the first of the above, so that the stack will look like this:
7712ec32cbdaselftests/nolibc: Adjust indentation forMakefile96218cfc79ebselftests/nolibc: Add support for LoongArchcab6bbd00f2atools/nolibc: Add support for LoongArch496921e4724ctools/nolibc: Addstatx()and makestat()rely onstatx()if necessary97a15c47b98ctools/nolibc: Includelinux/fcntl.hand remove duplicate codede06f2fe1aactools/nolibc: check for S_I* macros before defining them7fb54b517d44selftests/nolibc: skip thechroot_rootandlink_dirtests when not privileged296659c6e551tools/nolibc: addgetuid()andgeteuid()bd9a87d64994tools/nolibc: add tests for the integer limits instdint.h2d1813a7ef67tools/nolibc: enlarge column width of tests5dbcbb2da574tools/nolibc: add integer types and integer limit macros111bb94f67ebtools/nolibc: addstdint.h2dbf8575b2datools/nolibc: Add gitignore to avoid git complaints about sysroot ????????????tools/nolibc: always disable stack protector for tests
Quoted 7 lines
Quoted 5 lines
Then if tests, -next, and kernel test robot are kind, I will send a pull request to Linus for the "always disable stack protector for tests" commit. The rest I send for the upcoming merge window.
Please let me know if I am missing something.
This is perfect, thank you very much, Paul!
Done!
Thanx, Paul