|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 00/12] xen/arm: Add support to build with clang
Hi Artem, On 4/23/19 2:39 PM, Artem Mygaiev wrote: Hello Julien, Roger On Thu, 2019-04-18 at 19:33 +0100, Julien Grall wrote:(+ Roger) On 18/04/2019 12:15, Artem Mygaiev wrote:Hi Julien On Thu, 2019-04-18 at 11:43 +0100, Julien Grall wrote:On 18/04/2019 10:15, Artem Mygaiev wrote:Hello Julien, StefanoHi Artem,On Wed, 2019-04-17 at 10:42 +0100, Julien Grall wrote:Hi, On 16/04/2019 23:43, Stefano Stabellini wrote:On Fri, 29 Mar 2019, Julien Grall wrote:On 28/03/2019 11:27, Artem Mygaiev wrote:Hi Julien,Hi Artem,On Wed, 2019-03-27 at 18:45 +0000, Julien Grall wrote:Hi all, This series adds support to build Xen Arm with clang. This series was tested with clang 8.0. Note that I only did build for arm64. I still need to look at the arm32 build.I wonder if you have time to try the series with Arm Compiler 6? I am asking because AFAIK it is based on clang/llvm [1] and there's a safety-compliant version of it certified by TUV [2]. I don't have a license yet so cannot try it myself but maybe you have access.I gave a quick try to the Arm Compiler. I had to hack a bit config/StdGNU.mk to pass armclang and the appropriate target option. I also had a linking issue at the end where __2snprintf was not found. It seems the compiler replace snprintf with __2snprintf, I haven't figured out why yet.But after these changes, does it work?I haven't tried to fix the linking issues. I only gave a quick try because Artem asked. I have no plan at the moment to go further than that for now. Patches are welcomed to add support for armclang.I have implemented a bunch of HACKs [1] so can build Xen master with armclang 6.12. Not even "smoke"-tested, just trying to identify missing parameters and proper linker configuration.Thank you for looking at it. Some comments below.Not yet fixed section placement, lots of warnings from linker like: Warning: L6170W: Mapping symbol #40 '$x.20' in .altinstr_replacement(ns16550.o:42) identifies code, but is in a section not marked as executable.Instruction in the sections .altinstr_replacement are never meant to be executed. I guess this is coming from armlink? Any particular reason to use armlink and not ld as we do on clang?Yes, armlink has a "Safety-certified" version of it, while ld doesn't, unfortunately :(I am not sure if anyone tried to build Xen other than with ld so far. I have CCed Roger who might have a clue whether there are other blocker.Looking forward to hearing from Roger.Though I must mention that I do not have access to safety-certified version of arm compiler suite, it is not public. Thus checking only against the 30-day trial version of ARM DS 2019-0 which is shipped with compiler 6.12 I know :). I was pointed out how verbose it was compare to the lack of information regarding the internal fault. So far no reaction on my initial post in Arm Community. Playing with linker options I found that the error is caused by the use of "partial linking model" which is enabled by --partial that correspond to -r in Xen Makefiles, which is not documented but has similar effect. Do you mean the "Internal Fault"? [1] Diff below just for reference with xen master + Julien's clang patch series applied --- diff --git a/Config.mk b/Config.mk index 417039d7f6..0fc84293f9 100644 --- a/Config.mk +++ b/Config.mk @@ -221,7 +221,9 @@ CFLAGS += -Wall -Wstrict-prototypes$(call cc-option-add,HOSTCFLAGS,HOSTCC,-Wdeclaration-after- I think defining CC as below should do the trick: CC := armclang --target=aarch64-arm-none-eabi
As this always been the case? I know that for GCC it depends on the on distro/version of the compiler. [...]You would still need --target=.... but that's should depend on $CROSS_COMPILE (or any other name we decide).You're right, I forgot to mention - have not yet built for Arm32 so this is not checked. But, according to manual: For targets in AArch32 state (--target=arm-arm-none-eabi), there is no default. You must specify either -march (to target an architecture) or -mcpu (to target a processor)We actually pass -mcpu=cortex-a15 in arch/arm/Rules.mk (I admit that cortex-a15 is probably not the most suitable). If some options should applied to the tools as well, then we need to migrated them to config/arm32.mk.Yes, I do not think we shall specify the particular CPU, better to have lowest supported architecture defined. I vaguely remembered to try to replace cortex-a15 with something else in the past. IIRC, the problem was armv7-a does not necessarily include virt extension. Trying again today with -march=armv7-a instead of -mcpu=cortex-a15, I can see build error when using Linaro GCC 6.1-2016.80:
{standard input}: Assembler messages:
{standard input}:285: Error: selected processor does not support `smc
#0' in ARM mode
{standard input}:429: Error: selected processor does not support `smc
#0' in ARM mode
{standard input}:462: Error: selected processor does not support `smc
#0' in ARM mode
{standard input}:539: Error: selected processor does not support `smc
#0' in ARM mode
/home/julieng/works/xen/xen/Rules.mk:196: recipe for target
'cpuerrata.o' failed
make[3]: *** [cpuerrata.o] Error 1I think this one is solvable by specifying the secure extension. But it might be possible there are other issues with older compiler (i.e 4.6 & co). [100067_0612_00_en page 1-82] I will have a chat and let you know. 2) with vfp and simd enabled (linking fails) According to Arm compiler manual: --- For targets in AArch64 state (--target=aarch64-arm-none-eabi), unless you target a particular processor using -mcpu or a particular architecture using -march, the compiler defaults to -march=armv8-a, generating generic code for Armv8‑A in AArch64 state. [100067_0612_00_en page 1-82] --- You can prevent the use of floating-point instructions or floating- point registers for targets in AArch64 state with the -mcpu=name+nofp+nosimd option. Subsequent use of floating-point data types in this mode is unsupported. [100067_0612_00_en page 1-93] ---I assume that -mgeneral-regs-only does not work in your case?Nope :\ It would be interesting to know whether -march=armv8-a... works on all GCC version we support. Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |