diff mbox

[v1] libxl: Make an ACPI support build for ARM64 configurable.

Message ID 20161123142949.GD23528@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Liu Nov. 23, 2016, 2:29 p.m. UTC
On Wed, Nov 23, 2016 at 04:12:28PM +0200, Andrii Anisov wrote:
> > But before you write any code, let me try to understand the real issue
> > first: you're trying to cross-build ARM tools on x86, but x86
> > iasl doesn't support ARM ACPI definition(s), right?
> Well, as I stated here [1], I'm pretty far from ACPI and understanding
> of what's going wrong with the compilation. But I have a strong
> feeling that this option should be optional.
> 
> [1] https://lists.xenproject.org/archives/html/xen-devel/2016-11/msg01903.html

What is the exact rune you got when compiling mk_dsdt ?

If everything it set up properly you should be using a cross-build gcc
which should have the correct architecture?

Can you try this (untested) patch?



> 
> Sincerely,
> Andrii Anisov.

Comments

Julien Grall Nov. 23, 2016, 2:34 p.m. UTC | #1
Hi Wei,

On 23/11/16 14:29, Wei Liu wrote:
> On Wed, Nov 23, 2016 at 04:12:28PM +0200, Andrii Anisov wrote:
>>> But before you write any code, let me try to understand the real issue
>>> first: you're trying to cross-build ARM tools on x86, but x86
>>> iasl doesn't support ARM ACPI definition(s), right?
>> Well, as I stated here [1], I'm pretty far from ACPI and understanding
>> of what's going wrong with the compilation. But I have a strong
>> feeling that this option should be optional.
>>
>> [1] https://lists.xenproject.org/archives/html/xen-devel/2016-11/msg01903.html
>
> What is the exact rune you got when compiling mk_dsdt ?
>
> If everything it set up properly you should be using a cross-build gcc
> which should have the correct architecture?
>
> Can you try this (untested) patch?
>
>
> diff --git a/tools/libacpi/Makefile b/tools/libacpi/Makefile
> index ccc32c9..2b9d5b8 100644
> --- a/tools/libacpi/Makefile
> +++ b/tools/libacpi/Makefile
> @@ -44,7 +44,7 @@ $(H_SRC): $(ACPI_BUILD_DIR)/%.h: %.asl iasl
>  	rm -f $(addprefix $(ACPI_BUILD_DIR)/, $*.aml $*.hex)
>
>  $(MK_DSDT): mk_dsdt.c
> -	$(HOSTCC) $(HOSTCFLAGS) $(CFLAGS_xeninclude) -D__XEN_TOOLS__ -o $@ mk_dsdt.c
> +	$(CC) $(CFLAGS) $(CFLAGS_xeninclude) -D__XEN_TOOLS__ -o $@ mk_dsdt.c

That will not work, CC will build an ARM binary. However mk_dsdt is used 
to generate the static ACPI table integrated in the libxl, so mk_dsdt 
needs to be built with HOSTCC.

I think the code should use CONFIG_ARM_64/CONFIG_ARM_32 rather than 
__*__ one.

Regards,
Wei Liu Nov. 23, 2016, 2:37 p.m. UTC | #2
On Wed, Nov 23, 2016 at 02:34:04PM +0000, Julien Grall wrote:
> Hi Wei,
> 
> On 23/11/16 14:29, Wei Liu wrote:
> >On Wed, Nov 23, 2016 at 04:12:28PM +0200, Andrii Anisov wrote:
> >>>But before you write any code, let me try to understand the real issue
> >>>first: you're trying to cross-build ARM tools on x86, but x86
> >>>iasl doesn't support ARM ACPI definition(s), right?
> >>Well, as I stated here [1], I'm pretty far from ACPI and understanding
> >>of what's going wrong with the compilation. But I have a strong
> >>feeling that this option should be optional.
> >>
> >>[1] https://lists.xenproject.org/archives/html/xen-devel/2016-11/msg01903.html
> >
> >What is the exact rune you got when compiling mk_dsdt ?
> >
> >If everything it set up properly you should be using a cross-build gcc
> >which should have the correct architecture?
> >
> >Can you try this (untested) patch?
> >
> >
> >diff --git a/tools/libacpi/Makefile b/tools/libacpi/Makefile
> >index ccc32c9..2b9d5b8 100644
> >--- a/tools/libacpi/Makefile
> >+++ b/tools/libacpi/Makefile
> >@@ -44,7 +44,7 @@ $(H_SRC): $(ACPI_BUILD_DIR)/%.h: %.asl iasl
> > 	rm -f $(addprefix $(ACPI_BUILD_DIR)/, $*.aml $*.hex)
> >
> > $(MK_DSDT): mk_dsdt.c
> >-	$(HOSTCC) $(HOSTCFLAGS) $(CFLAGS_xeninclude) -D__XEN_TOOLS__ -o $@ mk_dsdt.c
> >+	$(CC) $(CFLAGS) $(CFLAGS_xeninclude) -D__XEN_TOOLS__ -o $@ mk_dsdt.c
> 
> That will not work, CC will build an ARM binary. However mk_dsdt is used to
> generate the static ACPI table integrated in the libxl, so mk_dsdt needs to
> be built with HOSTCC.

Yes, you're right.

> 
> I think the code should use CONFIG_ARM_64/CONFIG_ARM_32 rather than __*__
> one.
> 

That might work -- provided they are defined even in a cross-build.

> Regards,
> 
> -- 
> Julien Grall
diff mbox

Patch

diff --git a/tools/libacpi/Makefile b/tools/libacpi/Makefile
index ccc32c9..2b9d5b8 100644
--- a/tools/libacpi/Makefile
+++ b/tools/libacpi/Makefile
@@ -44,7 +44,7 @@  $(H_SRC): $(ACPI_BUILD_DIR)/%.h: %.asl iasl
 	rm -f $(addprefix $(ACPI_BUILD_DIR)/, $*.aml $*.hex)
  
 $(MK_DSDT): mk_dsdt.c
-	$(HOSTCC) $(HOSTCFLAGS) $(CFLAGS_xeninclude) -D__XEN_TOOLS__ -o $@ mk_dsdt.c
+	$(CC) $(CFLAGS) $(CFLAGS_xeninclude) -D__XEN_TOOLS__ -o $@ mk_dsdt.c
 
 $(ACPI_BUILD_DIR)/dsdt_anycpu_qemu_xen.asl: dsdt.asl dsdt_acpi_info.asl $(MK_DSDT)
 	# Remove last bracket