GNU/Weeb Mailing List <[email protected]>
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <[email protected]>
To: [email protected]
Cc: [email protected], [email protected], [email protected],
	"Thomas Weißschuh" <[email protected]>,
	"Willy Tarreau" <[email protected]>,
	"Paul E . McKenney" <[email protected]>
Subject: [PATCH nolibc 01/14] tools/nolibc: always disable stack protector for tests
Date: Mon, 20 Mar 2023 18:11:24 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <6a3206d0-e5cd-4990-9604-444a24a8207c@paulmck-laptop>

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

Signed-off-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Willy Tarreau <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
---
 tools/testing/selftests/nolibc/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index 8fe61d3e3cce..874d141da8c4 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -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:
-- 
2.40.0.rc2


  reply	other threads:[~2023-03-21  1:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21  1:11 [PATCH nolibc 0/14] nolibc updates for v6.4 Paul E. McKenney
2023-03-21  1:11 ` Paul E. McKenney [this message]
2023-03-21  1:11 ` [PATCH nolibc 02/14] tools/nolibc: Add gitignore to avoid git complaints about sysroot Paul E. McKenney
2023-03-21  1:11 ` [PATCH nolibc 03/14] tools/nolibc: add stdint.h Paul E. McKenney
2023-03-21  1:11 ` [PATCH nolibc 04/14] tools/nolibc: add integer types and integer limit macros Paul E. McKenney
2023-03-21  1:11 ` [PATCH nolibc 05/14] tools/nolibc: enlarge column width of tests Paul E. McKenney
2023-03-21  1:11 ` [PATCH nolibc 06/14] tools/nolibc: add tests for the integer limits in stdint.h Paul E. McKenney
2023-03-21  1:11 ` [PATCH nolibc 07/14] tools/nolibc: add getuid() and geteuid() Paul E. McKenney
2023-03-21  1:11 ` [PATCH nolibc 08/14] selftests/nolibc: skip the chroot_root and link_dir tests when not privileged Paul E. McKenney
2023-03-21  1:11 ` [PATCH nolibc 09/14] tools/nolibc: check for S_I* macros before defining them Paul E. McKenney
2023-03-21  1:11 ` [PATCH nolibc 10/14] tools/nolibc: Include linux/fcntl.h and remove duplicate code Paul E. McKenney
2023-03-21  1:11 ` [PATCH nolibc 11/14] tools/nolibc: Add statx() and make stat() rely on statx() if necessary Paul E. McKenney
2023-03-21  1:11 ` [PATCH nolibc 12/14] tools/nolibc: Add support for LoongArch Paul E. McKenney
2023-03-21  1:11 ` [PATCH nolibc 13/14] selftests/nolibc: " Paul E. McKenney
2023-03-21  1:11 ` [PATCH nolibc 14/14] selftests/nolibc: Adjust indentation for Makefile Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox