public inbox for buildbot@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: buildbot@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>, Simon Marchi <simark@simark.ca>
Subject: [PATCH] Add GDB sanitize builder
Date: Mon, 30 Oct 2023 00:35:12 +0100	[thread overview]
Message-ID: <20231029233512.729668-1-mark@klomp.org> (raw)

Just the address sanitizer for now. Building with undefined sanitizer
doesn't work. Disable sim because it doesn't build with address sanitizer.

Suggested-by: Simon Marchi <simark@simark.ca>
---
 builder/master.cfg | 59 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/builder/master.cfg b/builder/master.cfg
index 681d9cc..fa22282 100644
--- a/builder/master.cfg
+++ b/builder/master.cfg
@@ -854,6 +854,7 @@ gdb_scheduler = schedulers.SingleBranchScheduler(
         reason="binutils-gdb project master branch gdb files update",
         builderNames=["gdb-centos-x86_64",
                       "gdb-fedora-x86_64",
+                      "gdb-fedora-sanitize-x86_64",
                       "gdb-rawhide-x86_64",
                       "gdb-debian-testing-x86_64",
                       "gdb-debian-armhf",
@@ -878,6 +879,7 @@ gdb_try_scheduler = schedulers.AnyBranchScheduler(
         onlyImportant=True,
         reason="binutils-gdb project users try branch gdb files update",
         builderNames=["gdb-try-fedora-x86_64",
+                      "gdb-try-fedora-sanitize-x86_64",
                       "gdb-try-rawhide-x86_64",
                       "gdb-try-debian-testing-x86_64",
                       "gdb-try-fedora-arm64",
@@ -2798,6 +2800,18 @@ gdb_configure_32_step = steps.Configure(
         name='configure',
         haltOnFailure=True,
         logfiles={"config.log": "config.log"})
+# Use only address sanitizer, code doesn't build with undefined sanitizer.
+# Disable sim since it doesn't even build with address sanitizer,
+gdb_configure_sanitize_step = steps.Configure(
+        workdir='gdb-build',
+        command=['../binutils-gdb/configure',
+                 '--enable-targets=all', '--disable-sim',
+                 'CFLAGS="-fsanitize=address -O2 -g"',
+                 'CXXFLAGS="-fsanitize=address -O2 -g"',
+                 'LDFLAGS="-fsanitize=address"'],
+        name='configure',
+        haltOnFailure=True,
+        logfiles={"config.log": "config.log"})
 gdb_make_step = steps.Compile(
         workdir='gdb-build',
         command=addOutputSync.withArgs(['make',
@@ -2947,6 +2961,32 @@ gdb_factory_make_only.addSteps(bunsen_logfile_upload_steps([ # no tests being ru
         (["../gdb-build/gdb/config.log"],"gdb")]))
 gdb_factory_make_only.addStep(gdb_rm_step)
 
+# Used for sanitizer builds (only x86_64 for now)
+gdb_factory_sanitize = util.BuildFactory()
+gdb_factory_sanitize.addStep(gdb_git_step)
+gdb_factory_sanitize.addStep(gdb_rm_step)
+gdb_factory_sanitize.addStep(gdb_configure_sanitize_step)
+gdb_factory_sanitize.addStep(gdb_make_step)
+gdb_factory_sanitize.addStep(make_gdb_check_step())
+gdb_factory_sanitize.addSteps(bunsen_logfile_upload_cpio_steps(
+        ["*.sum", "*.log"],
+        workdir='gdb-build',
+        tagsuffix='/native'))
+
+gdb_factory_sanitize.addStep(make_gdb_check_step('--target_board=native-gdbserver'))
+gdb_factory_sanitize.addSteps(bunsen_logfile_upload_cpio_steps(
+        ["*.sum", "*.log"],
+        workdir='gdb-build',
+        tagsuffix='/gdbserver'))
+
+gdb_factory_sanitize.addStep(make_gdb_check_step('--target_board=native-extended-gdbserver'))
+gdb_factory_sanitize.addSteps(bunsen_logfile_upload_cpio_steps(
+        ["*.sum", "*.log"],
+        workdir='gdb-build',
+        tagsuffix='/extended-gdbserver'))
+gdb_factory_sanitize.addStep(gdb_rm_step)
+
+
 gdb_centos_x86_64_builder = util.BuilderConfig(
 	name="gdb-centos-x86_64",
         workernames=["centos-x86_64"],
@@ -2981,6 +3021,25 @@ gdb_try_fedora_x86_64_builder = util.BuilderConfig(
         factory=gdb_black_factory)
 c['builders'].append(gdb_try_fedora_x86_64_builder)
 
+gdb_fedora_x86_64_sanitize_builder = util.BuilderConfig(
+	name="gdb-fedora-sanitize-x86_64",
+	properties={'container-file':
+		    readContainerFile('fedora-latest')},
+	workernames=vm_workers,
+        tags=["gdb", "fedora", "x86_64"],
+        factory=gdb_factory_sanitize)
+c['builders'].append(gdb_fedora_x86_64_sanitize_builder)
+
+gdb_try_fedora_x86_64_sanitize_builder = util.BuilderConfig(
+	name="gdb-try-fedora-sanitize-x86_64",
+        collapseRequests=True,
+	properties={'container-file':
+		    readContainerFile('fedora-latest')},
+	workernames=vm_workers,
+        tags=["gdb-try", "fedora", "x86_64"],
+        factory=gdb_factory_sanitize)
+c['builders'].append(gdb_try_fedora_x86_64_sanitize_builder)
+
 gdb_debian_armhf_builder = util.BuilderConfig(
 	name="gdb-debian-armhf",
         workernames=["debian-armhf"],
-- 
2.39.3


                 reply	other threads:[~2023-10-30  0:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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 \
    --in-reply-to=20231029233512.729668-1-mark@klomp.org \
    --to=mark@klomp.org \
    --cc=buildbot@sourceware.org \
    --cc=simark@simark.ca \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).