[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/2] Add scripts/oss-fuzz/build.sh


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
  • Date: Thu, 18 Jul 2024 08:54:33 -0400
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=tklengyel.com; spf=pass smtp.mailfrom=tamas@xxxxxxxxxxxxx; dmarc=pass header.from=<tamas@xxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721307312; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=/g1XCDSkX+zAx8JMyTemfy7xvWBSiTXpZZV8FhTzvJ8=; b=OExPKR2QBaI8wPvPBhVZeLlzaV2GhvQ+vZ0ZxGVHgUOGQ0V9bSQrQaBWq7UnHVesOtYtF/y+h9Cg4thGHusYQSiHw+EgRFOpz+tKx/Vx6iyKtyMyGKjKBydysRl42KyFfa7bU0MuB1NdrzZZ0bVCCiKZ9R3Y6vJTkJcWKzLpfFY=
  • Arc-seal: i=1; a=rsa-sha256; t=1721307312; cv=none; d=zohomail.com; s=zohoarc; b=CuO++IG2VsboEd2MMA9+QjzzuLOsDHgQtrO/Cs95ZNgrkVb9EizxaF5SQio4hFty4BZlgFUxw66yw3h7k15aohteLL6tlqLgeNHoN03UFL4zsor1xmqwtxmfzCluh45eWfSWSa4xNAjPVH+QjoCsprjzC/v1JCpRRL2sfbTBKpI=
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 18 Jul 2024 12:55:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Jul 18, 2024 at 7:17 AM Jan Beulich <jbeulich@xxxxxxxx> wrote:
>
> On 26.06.2024 00:47, Tamas K Lengyel wrote:
> > --- /dev/null
> > +++ b/scripts/oss-fuzz/build.sh
> > @@ -0,0 +1,23 @@
> > +#!/bin/bash -eu
> > +# SPDX-License-Identifier: Apache-2.0
>
> Hmm. Aiui this line is supposed to make unnecessary ...
>
> > +# Copyright 2024 Google LLC
> > +#
> > +# Licensed under the Apache License, Version 2.0 (the "License");
> > +# you may not use this file except in compliance with the License.
> > +# You may obtain a copy of the License at
> > +#
> > +#      http://www.apache.org/licenses/LICENSE-2.0
> > +#
> > +# Unless required by applicable law or agreed to in writing, software
> > +# distributed under the License is distributed on an "AS IS" BASIS,
> > +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> > +# See the License for the specific language governing permissions and
> > +# limitations under the License.
>
> ... all of this text, provided an entry is first put in ./LICENSES/.
>
> > +################################################################################
> > +
> > +cd xen
>
> This looks to suggest that the expectation is for the script to be invoked
> from the root of a xen.git clone. Imo something like
>
> cd $(dirname $0)/../../xen
>
> would be more flexible.

No, it will be invoked after a git clone is made, so you have to enter
the xen folder that was just cloned.

>
> > +./configure --disable-stubdom --disable-pvshim --disable-docs --disable-xen
>
> Going forward we mean to no longer bundle e.g. qemu in release tarballs,
> yet I wonder whether passing a couple of --with-system-...= here wouldn't
> be better nevertheless.

It largely doesn't matter as long as the configure script completes
successfully since we aren't going to compile QEMU. But sure, I can
add it.

>
> > +make clang=y -C tools/include
> > +make clang=y -C tools/fuzz/x86_instruction_emulator libfuzzer-harness
>
> In how far is it a requirement to have "clang=y" here? Wasn't this question
> even asked before? I'm not even sure whether mid- or long-term we mean to
> retain that functionality. Overrides of tool chain (components) may better
> be done using CC= and friends. Plus perhaps by whoever is invoking this
> script?

It is an absolute requirement to use clang=y here as oss-fuzz uses a
specific clang as compiler for C/C++ projects. The CC environment
variables are already set by the oss-fuzz docker environment but it's
insufficient for a successful clang build. Without clang=y the
following error is encountered:

gcc: error: unrecognized debug output level 'line-tables-only'
gcc: error: unrecognized argument to '-fsanitize=' option: 'fuzzer-no-link'

Tamas



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.