[OE-core] [PATCH] kexec-tools: Fix compilation with clang

Khem Raj raj.khem at gmail.com
Mon May 20 20:14:27 UTC 2019



On 5/16/19 1:32 AM, Oleksiy Obitotskyi -X (oobitots - GLOBALLOGIC INC at 
Cisco) via Openembedded-core wrote:
> Any comments?
> 

This is same as https://bugzilla.kernel.org/show_bug.cgi?id=177321

and I think the below should have helped.

https://github.com/kraj/meta-clang/blob/master/conf/nonclangable.conf#L152-L158

If thats not helping then I would like to understand why

So lets try to fix the problem upstream first and meanwhile make fixes 
in meta-clang.

> Regards,
> Oleksiy
> 
> On 16.04.19 18:29, Oleksiy Obitotskyy wrote:
>> clang assembler do not understand some directives e.g.
>>
>> ../kexec-tools-2.0.17/purgatory/arch/i386/entry32-16.S:23:2: error: unknown directive
>> .arch i386
>> ^ ../kexec-tools-2.0.17/purgatory/arch/i386/entry32-16.S:115:11: error: unknown token in expression
>> ljmp %cs:*(realdest - entry16)
>> ^
>>
>> Force external assembler for purgatory and tests.
>>
>> Upstream-Status: Pending
>> Signed-off-by: Oleksiy Obitotskyy <oobitots at cisco.com>
>> ---
>>   ..._64-Makefile-fix-assemble-with-clang.patch | 23 +++++++++++++++++++
>>   .../kexec/kexec-tools_2.0.19.bb               |  2 ++
>>   2 files changed, 25 insertions(+)
>>   create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-x86_64-Makefile-fix-assemble-with-clang.patch
>>
>> diff --git a/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-x86_64-Makefile-fix-assemble-with-clang.patch b/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-x86_64-Makefile-fix-assemble-with-clang.patch
>> new file mode 100644
>> index 0000000000..13f247982a
>> --- /dev/null
>> +++ b/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-x86_64-Makefile-fix-assemble-with-clang.patch
>> @@ -0,0 +1,23 @@
>> +--- a/purgatory/Makefile	2019-03-05 07:47:03.190429822 -0800
>> ++++ b/purgatory/Makefile	2019-03-05 07:42:52.167623612 -0800
>> +@@ -31,6 +31,9 @@ include $(srcdir)/purgatory/arch/x86_64/
>> +
>> + PURGATORY_SRCS+=$($(ARCH)_PURGATORY_SRCS)
>> +
>> ++PURGATORY_EXTRA_CFLAGS += -no-integrated-as
>> ++$(ARCH)_PURGATORY_EXTRA_CFLAGS += -no-integrated-as
>> ++
>> + PURGATORY_OBJS = $(call objify, $(PURGATORY_SRCS)) purgatory/sha256.o
>> + PURGATORY_DEPS = $(call depify, $(PURGATORY_OBJS))
>> +
>> +--- a/kexec_test/Makefile	2019-03-05 07:45:14.757353575 -0800
>> ++++ b/kexec_test/Makefile	2019-03-05 07:45:57.567173264 -0800
>> +@@ -17,6 +17,8 @@ endif
>> +
>> + ifeq ($(BUILD_KEXEC_TEST),yes)
>> +
>> ++CPPFLAGS += -no-integrated-as
>> ++
>> + KEXEC_TEST_OBJS = $(call objify, $(KEXEC_TEST_SRCS))
>> + KEXEC_TEST_DEPS = $(call depify, $(KEXEC_TEST_OBJS))
>> +
>> diff --git a/meta/recipes-kernel/kexec/kexec-tools_2.0.19.bb b/meta/recipes-kernel/kexec/kexec-tools_2.0.19.bb
>> index f65cd9f106..c229097d5b 100644
>> --- a/meta/recipes-kernel/kexec/kexec-tools_2.0.19.bb
>> +++ b/meta/recipes-kernel/kexec/kexec-tools_2.0.19.bb
>> @@ -20,6 +20,8 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz
>>              file://0001-Disable-PIE-during-link.patch \
>>              "
>>   
>> +SRC_URI_append_toolchain-clang = " file://0001-purgatory-x86_64-Makefile-fix-assemble-with-clang.patch"
>> +
>>   SRC_URI[md5sum] = "052458f0a35c2a3b0d2302caa3318e9f"
>>   SRC_URI[sha256sum] = "913c8dee918e5855a4ba60d609371390978144b4c8d15d6446ca0057b7bc5e58"
>>   
> 


More information about the Openembedded-core mailing list