On 02/03/2022 15:41, Doebel, Bjoern wrote:
> On 02.03.22 15:27, Roger Pau Monne wrote:
>> CAUTION: This email originated from outside of the organization. Do
>> not click links or open attachments unless you can confirm the sender
>> and know the content is safe.
>>
>>
>>
>> Do not attempt to modify the build system if CFLAGS are not set in
>> Rules.mk, and instead rely on CONFIG_LIVEPATCH already setting
>> -f{function,data}-sections.
>>
>> Signed-off-by: Roger Pau Monné <[email protected]>
>> ---
>> This depends on getting the patch to add -f{function,data}-sections
>> when using CONFIG_LIVEPATCH accepted.
>> ---
>> livepatch-build | 22 ++++++++++++++--------
>> 1 file changed, 14 insertions(+), 8 deletions(-)
>>
>> 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
>
> This means we are still breaking livepatch builds for all Xen versions
> between your recent patch and the original patch that moved CFLAGS to
> xen/Makefile (commit 2740d96efdd3009f8adb40aacdbcf05cfe8d1bbb, Fri Apr
> 24 14:57:10 2020 +0200).
>
> Is this acceptable? (I mean, no one seems to have noticed...)
So yeah - not putting this into OSSTest has had exactly the forseen outcome.
The steps now are to unbreak it by whatever means are necessary, then
get CI in place so we can't regress it again.
The tip of livepatch-build-tools should work with all versions of Xen.
If this means we need to backport fixes into the staging-* branches,
then so be it.
The downstream users of livepatching have patchqueues anyway, and these
breakages are not the kind of thing which could slip though even a token
testing attempt.
As far as this issue goes, I suggest that we do what we can to avoid
livepatch-build-tools needing to do surgery like that on the build
system, then backport it everywhere. The above is the kind of fragility
which really shouldn't exist :-/
~Andrew