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

Re: [PATCH 4/4] livepatch: differentiate between old and new build systems


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Tue, 8 Mar 2022 14:38:47 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OF7bA9OK9cexKqJFMgvhty+hNFt6bBzfp59jrkPuOMo=; b=ReRqBIEg2DDroVr/XCWPuhiJjwqLOTZyWL1AdRVOzXE4P96VFbghugbmLs9Lx3CFexSKdOt9eDSjjNUrehigRUEdIeHMrsqekzs640p7NodQgX+HNJias+6kFid/+uBSX6Y4SKawgt863a2hXHrcK/i2WuAP9/MitFWKxH4oQiNHnLh+3t4ppgCAWMoUZ0bGujvCY+6pCm1Qh9P90Xn7yEOapFNcGSX9GOF8LsJ6dSA5dfHeEBnoNPpPwlD5KFKRn5M5kEd25Mk1RsjPb8ddWFuOil9IRYUPj9vNn3TwU9CcPAqH3pTQmWBH+XN/hHEJ6Gfv13+HsDvq8u9MgiMF5g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N3HVZfxfi8LT09oY1KCbLmrmHKp/qqdkbIWcrw2NFM9pl/EjiVSh4W1vrZSYcrEcUl1uT+RdADLAX2FOQQ/IMNG7QY4KuWpjU4elq259Gfiud6Eg362v/tJTC/bx13nGiDhQ1LgeyRERKMhWiYYs3pPAUHBiMI4mmBQd8W6YoHPot1JJhJzrkkUeV02dgh+OWBfQPB4ZV/q9H61i2EA2JP0s5t/pRsiOfm+of0BkEKvK9Gy+0dtNSOKomW8C+J1Rrf0IU5YiQ+syZ6hqXn24v0tVFtSHHHrzTEyRrSEUanqgapFxrtSkBEghcfWt1oS+/K5lW5HuH2/khHZSBQ4z1w==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>, "konrad.wilk@xxxxxxxxxx" <konrad.wilk@xxxxxxxxxx>, "doebel@xxxxxxxxx" <doebel@xxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>
  • Delivery-date: Tue, 08 Mar 2022 14:39:10 +0000
  • Ironport-data: A9a23:OFzvKK8xHDJJtFJ9I2pXDrUDsX6TJUtcMsCJ2f8bNWPcYEJGY0x3z TBLD2qAbPaMazSme94ia4Tk8UNQ6JKGyYM2QQdoqi48E34SpcT7XtnIdU2Y0wF+jyHgoOCLy +1EN7Es+ehtFie0Si+Fa+Sn9T8mvU2xbuKU5NTsY0idfic5DnZ54f5fs7Rh2NQw2oDpW1nlV e7a+KUzBnf0g1aYDUpMg06zgEsHUCPa4W5wUvQWPJinjXeG/5UnJMt3yZKZdhMUdrJ8DO+iL 9sv+Znilo/vE7XBPfv++lrzWhVirrc/pmFigFIOM0SpqkAqSiDfTs/XnRfTAKtao2zhojx/9 DlCnabqUh4oB5SdosIUcRBhHhpPZ5VP1qCSdBBTseTLp6HHW37lwvEoB0AqJ4wIvO1wBAmi9 9RBdmpLNErawbvrnvTrEYGAhex6RCXvFKoZtmtt0nfyCvE+TIqYa67L+cVZzHE7gcUm8fP2O ZdGMWowM0qojxtnAlNGFpQaxdaUm1L4XmdI8mKkm6oL7D2GpOB2+Oe0a4eEEjCQfu1ZmUuSq 2bu9mHwEBYcctC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4cPFWAptkVfxqX0+kfQLh3gaSocGbqRNxLZvt3+9Pa1wVR4S0rpXWN WGzfuskMp+YBefdTTUr2NvyNujUjA6GQqHWFELvoiQ3yJNlH50wkMEzIhH901wua4VWt1B/a DJI65onLZBQosfar98Hv4IRY+yBnbWSRzBPWqOKRDsFb0BOXjKt5nriY9Frt2CadgN1t8/iZ 7BWFRXuSo7fF/vE9SH2NlR/hXEUAyGLELQIwFllu9EU5HHNcjW2He4OSMTeuOb0oAiPvE=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYLkHgSrb/iAL0mEi291/GjB3zE6y1l+sA
  • Thread-topic: [PATCH 4/4] livepatch: differentiate between old and new build systems

On 02/03/2022 14:27, Roger Pau Monne wrote:
> diff --git a/livepatch-build b/livepatch-build
> index 38a92be..656cdac 100755
> --- a/livepatch-build
> +++ b/livepatch-build
> @@ -98,14 +98,20 @@ function build_special()
>  
>      # Build with special GCC flags
>      cd "${SRCDIR}/xen" || die
> -    sed -i 's/CFLAGS += -nostdinc/CFLAGS += -nostdinc -ffunction-sections 
> -fdata-sections/' Rules.mk
> -    cp -p arch/x86/Makefile arch/x86/Makefile.bak
> -    sed -i 's/--section-alignment=0x200000/--section-alignment=0x1000/' 
> arch/x86/Makefile
> -    # Restore timestamps to prevent spurious rebuilding
> -    touch --reference=arch/x86/Makefile.bak arch/x86/Makefile
> -    make "-j$CPUS" $XEN_DEBUG &> "${OUTPUT}/build_${name}_compile.log" || die
> -    sed -i 's/CFLAGS += -nostdinc -ffunction-sections -fdata-sections/CFLAGS 
> += -nostdinc/' Rules.mk
> -    mv -f arch/x86/Makefile.bak arch/x86/Makefile
> +    if grep -q 'nostdinc' Rules.mk; then
> +         # Support for old build system, attempt to set 
> -f{function,data}-sections and rebuild
> +        sed -i 's/CFLAGS += -nostdinc/CFLAGS += -nostdinc 
> -ffunction-sections -fdata-sections/' Rules.mk
> +        cp -p arch/x86/Makefile arch/x86/Makefile.bak
> +        sed -i 's/--section-alignment=0x200000/--section-alignment=0x1000/' 
> arch/x86/Makefile
> +        # Restore timestamps to prevent spurious rebuilding
> +        touch --reference=arch/x86/Makefile.bak arch/x86/Makefile
> +        make "-j$CPUS" $XEN_DEBUG &> "${OUTPUT}/build_${name}_compile.log" 
> || die
> +        sed -i 's/CFLAGS += -nostdinc -ffunction-sections 
> -fdata-sections/CFLAGS += -nostdinc/' Rules.mk
> +        mv -f arch/x86/Makefile.bak arch/x86/Makefile
> +    else
> +        # -f{function,data}-sections set by CONFIG_LIVEPATCH
> +        make "-j$CPUS" $XEN_DEBUG &> "${OUTPUT}/build_${name}_compile.log" 
> || die
> +    fi

This really ought to be the other way around, by spotting the thing we
know is good, and then falling back to the heuristics.  In light of the
updates to the Xen side, something like:

if grep -q CC_SPLIT_SECTIONS Kconfig; then
    # -f{function,data}-sections set by CONFIG_LIVEPATCH
    make "-j$CPUS" $XEN_DEBUG &> "${OUTPUT}/build_${name}_compile.log"
|| die
else
    # Support for old build system, attempt to set
-f{function,data}-sections and rebuild
    ...
fi

?
~Andrew


 


Rackspace

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