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

Re: [Xen-devel] [PATCH 01/12] xen: clang: Support correctly cross-compile



Hi,

On 28/03/2019 10:56, Jan Beulich wrote:
On 28.03.19 at 11:43, <andrew.cooper3@xxxxxxxxxx> wrote:
On 28/03/2019 10:28, Jan Beulich wrote:
On 28.03.19 at 11:14, <andrew.cooper3@xxxxxxxxxx> wrote:
Using -target is from the Clang instructions on cross compilation, which
say to do it this way.  https://clang.llvm.org/docs/CrossCompilation.html

The targets supported will depend on the configuration Clang was
compiled with, but Clang specifically opposes GCC's way of requiring the
user to recompile for every different target.  It is expected that a
packager of clang will enable all of the supported targets in the
package they distribute.
Are you sure a distro caring about, say, only x86 would indeed
enable Arm and all sorts of other architectures in the compiler,
just because it can be enabled? IOW I assume the need for an
override to the system default clang binaries would still exist.

I've just tried, and Ubuntu 16.04's default clang-3.8 is perfectly happy
compiling Aarch64, and makes a suitable looking elf object.  (I can't
actually disassemble it because objdump chokes, but .text is the
expected length)

As the cross-compilation documentation states, this is a deliberate
design decision which, amongst other things, prevents distros from
needing to maintain per-arch packages.

All understood, just that Ubuntu may not be a good example, as
there looks to be Ubuntu 16.04 for 64-bit Arm.

It occurs to me that other compiler may be based on clang/llvm but use a different name. For instance, the Arm Compiler is called armclang.

armclang only supports arm32 and arm64 and require to always pass the target triple using --target (Not the -- rather than -).

So we would need to cater different clang binary in the future.

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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