[edk2-devel] [PATCH v1 0/3] Compile AML bytecode array into OBJ file

PierreGondois posted 3 patches 18 weeks ago
Failed in applying to current master (apply log)
BaseTools/BinWrappers/PosixLike/{AmlToHex => AmlToC}               | 28 +++----
BaseTools/BinWrappers/WindowsLike/{AmlToHex.bat => AmlToC.bat}     |  0
BaseTools/Conf/build_rule.template                                 | 15 +++-
BaseTools/Source/Python/{AmlToHex/AmlToHex.py => AmlToC/AmlToC.py} | 82 ++++++++------------
BaseTools/Source/Python/AutoGen/GenMake.py                         |  6 ++
BaseTools/Source/Python/AutoGen/ModuleAutoGen.py                   | 40 +++++-----
6 files changed, 86 insertions(+), 85 deletions(-)
rename BaseTools/BinWrappers/PosixLike/{AmlToHex => AmlToC} (97%)
rename BaseTools/BinWrappers/WindowsLike/{AmlToHex.bat => AmlToC.bat} (100%)
rename BaseTools/Source/Python/{AmlToHex/AmlToHex.py => AmlToC/AmlToC.py} (52%)

[edk2-devel] [PATCH v1 0/3] Compile AML bytecode array into OBJ file

Posted by PierreGondois 18 weeks ago
Following the BZ at https://bugzilla.tianocore.org/show_bug.cgi?id=2425
This patch serie is a another way to solve the dependency
of C files over ASL files. With this new method, the
dependency is resolved at the linking stage.

The last method to solve this dependency was to add
the possibility to modify INF files to depict such a
dependency. This method was not accepted. The discussion
is available at https://edk2.groups.io/g/devel/topic/72655342#56658

The last patch modifying the INF specification and INF
parsing are available at:
https://edk2.groups.io/g/devel/topic/72655342#56658
https://edk2.groups.io/g/devel/topic/72656060#56662

Pierre Gondois (3):
  BaseTools: Generate multiple rules when multiple output files
  BaseTools: Rename AmlToHex script to AmlToC
  BaseTools: Compile AML bytecode arrays into .obj file

 BaseTools/BinWrappers/PosixLike/{AmlToHex => AmlToC}               | 28 +++----
 BaseTools/BinWrappers/WindowsLike/{AmlToHex.bat => AmlToC.bat}     |  0
 BaseTools/Conf/build_rule.template                                 | 15 +++-
 BaseTools/Source/Python/{AmlToHex/AmlToHex.py => AmlToC/AmlToC.py} | 82 ++++++++------------
 BaseTools/Source/Python/AutoGen/GenMake.py                         |  6 ++
 BaseTools/Source/Python/AutoGen/ModuleAutoGen.py                   | 40 +++++-----
 6 files changed, 86 insertions(+), 85 deletions(-)
 rename BaseTools/BinWrappers/PosixLike/{AmlToHex => AmlToC} (97%)
 rename BaseTools/BinWrappers/WindowsLike/{AmlToHex.bat => AmlToC.bat} (100%)
 rename BaseTools/Source/Python/{AmlToHex/AmlToHex.py => AmlToC/AmlToC.py} (52%)

-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#59746): https://edk2.groups.io/g/devel/message/59746
Mute This Topic: https://groups.io/mt/74291745/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v1 0/3] Compile AML bytecode array into OBJ file

Posted by Ard Biesheuvel 14 weeks ago
On 5/18/20 4:11 PM, PierreGondois via groups.io wrote:
> Following the BZ at https://bugzilla.tianocore.org/show_bug.cgi?id=2425
> This patch serie is a another way to solve the dependency
> of C files over ASL files. With this new method, the
> dependency is resolved at the linking stage.
> 
> The last method to solve this dependency was to add
> the possibility to modify INF files to depict such a
> dependency. This method was not accepted. The discussion
> is available at https://edk2.groups.io/g/devel/topic/72655342#56658
> 
> The last patch modifying the INF specification and INF
> parsing are available at:
> https://edk2.groups.io/g/devel/topic/72655342#56658
> https://edk2.groups.io/g/devel/topic/72656060#56662
> 
> Pierre Gondois (3):
>    BaseTools: Generate multiple rules when multiple output files
>    BaseTools: Rename AmlToHex script to AmlToC
>    BaseTools: Compile AML bytecode arrays into .obj file
> 


Hello Pierre,

I have no comments on this series, but I noticed that AmlToHex was 
checked into the repository with CRLF line endings:

$ file BaseTools/BinWrappers/PosixLike/AmlToHex
Bourne-Again shell script, ASCII text executable, with CRLF line terminators

resulting in Build output like

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20181213
Copyright (c) 2000 - 2018 Intel Corporation

ASL Input: 
/home/ard/build/edk2-workspace/Build/ArmVirtQemuKernel-ARM/RELEASE_CLANG38/ARM/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe/OUTPUT/./RamDisk.iiii 
- 42 lines, 305 bytes, 6 keywords
AML Output: 
/home/ard/build/edk2-workspace/Build/ArmVirtQemuKernel-ARM/RELEASE_CLANG38/ARM/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe/OUTPUT/./RamDisk.aml 
- 124 bytes, 5 named objects, 1 executable opcodes

Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 0 Optimizations
/usr/bin/env: ‘bash\r’: No such file or directory


Note that this platform has no use for the hex-dumped output of the AML, 
so it would be better if we only call AmlToHex when necessary.

Thanks,
Ard.

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#61235): https://edk2.groups.io/g/devel/message/61235
Mute This Topic: https://groups.io/mt/74291745/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v1 0/3] Compile AML bytecode array into OBJ file

Posted by PierreGondois 14 weeks ago
Hello Ard and Bob,

I also noticed the line ending is incorrect for BaseTools/BinWrappers/PosixLike/AmlToHex. The patch "[PATCH v1 2/3] BaseTools: Rename AmlToHex script to AmlToC" is correcting the line ending. This script is generating an optional output file and doesn't prevent edk2 from building, due to the dash present at the beginning of the command line in Conf/build_rule.txt.
Do you want the line ending to be fixed as soon as possible, or can it wait a bit to go with this patch serie?

About the fact that the file generated by AmlToHex is not need by all platforms:
A solution would be to add an "enable" flag for this script. The script would not generate any output file unless this "enable" flag is provided to the script. The platforms willing to have the file generated by AmlToHex would provide it.
However this would add one more flag to the build system, in the Conf/tools_def.txt file.

Regards,
Pierre

-----Original Message-----
From: Ard Biesheuvel <ard.biesheuvel@arm.com> 
Sent: 13 June 2020 10:38
To: devel@edk2.groups.io; Pierre Gondois <Pierre.Gondois@arm.com>
Cc: bob.c.feng@intel.com; liming.gao@intel.com; Sami Mujawar <Sami.Mujawar@arm.com>; Tomas Pilar <Tomas.Pilar@arm.com>; nd <nd@arm.com>
Subject: Re: [edk2-devel] [PATCH v1 0/3] Compile AML bytecode array into OBJ file

On 5/18/20 4:11 PM, PierreGondois via groups.io wrote:
> Following the BZ at 
> https://bugzilla.tianocore.org/show_bug.cgi?id=2425
> This patch serie is a another way to solve the dependency of C files 
> over ASL files. With this new method, the dependency is resolved at 
> the linking stage.
> 
> The last method to solve this dependency was to add the possibility to 
> modify INF files to depict such a dependency. This method was not 
> accepted. The discussion is available at 
> https://edk2.groups.io/g/devel/topic/72655342#56658
> 
> The last patch modifying the INF specification and INF parsing are 
> available at:
> https://edk2.groups.io/g/devel/topic/72655342#56658
> https://edk2.groups.io/g/devel/topic/72656060#56662
> 
> Pierre Gondois (3):
>    BaseTools: Generate multiple rules when multiple output files
>    BaseTools: Rename AmlToHex script to AmlToC
>    BaseTools: Compile AML bytecode arrays into .obj file
> 


Hello Pierre,

I have no comments on this series, but I noticed that AmlToHex was checked into the repository with CRLF line endings:

$ file BaseTools/BinWrappers/PosixLike/AmlToHex
Bourne-Again shell script, ASCII text executable, with CRLF line terminators

resulting in Build output like

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20181213
Copyright (c) 2000 - 2018 Intel Corporation

ASL Input: 
/home/ard/build/edk2-workspace/Build/ArmVirtQemuKernel-ARM/RELEASE_CLANG38/ARM/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe/OUTPUT/./RamDisk.iiii
- 42 lines, 305 bytes, 6 keywords
AML Output: 
/home/ard/build/edk2-workspace/Build/ArmVirtQemuKernel-ARM/RELEASE_CLANG38/ARM/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe/OUTPUT/./RamDisk.aml
- 124 bytes, 5 named objects, 1 executable opcodes

Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 0 Optimizations
/usr/bin/env: ‘bash\r’: No such file or directory


Note that this platform has no use for the hex-dumped output of the AML, so it would be better if we only call AmlToHex when necessary.

Thanks,
Ard.

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#61304): https://edk2.groups.io/g/devel/message/61304
Mute This Topic: https://groups.io/mt/74291745/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v1 0/3] Compile AML bytecode array into OBJ file

Posted by PierreGondois 18 weeks ago
[Bob] https://edk2.groups.io/g/devel/message/58782
I'd prefer the option 2#. I think that is the easiest way to meet the requirement. Since the aml file is the definite output of asl file, we can use it to descript the dependency relationship between c source file and asl source code.
[Pierre]
We have found what might be a better way to address the issue. If not convenient, we can still follow the option 2# that we discussed.

Regards,
Pierre

-----Original Message-----
From: PierreGondois <pierre.gondois@arm.com> 
Sent: Monday, May 18, 2020 3:11 PM
To: devel@edk2.groups.io
Cc: Pierre Gondois <Pierre.Gondois@arm.com>; bob.c.feng@intel.com; liming.gao@intel.com; Sami Mujawar <Sami.Mujawar@arm.com>; Tomas Pilar <Tomas.Pilar@arm.com>; nd <nd@arm.com>
Subject: [PATCH v1 0/3] Compile AML bytecode array into OBJ file

Following the BZ at https://bugzilla.tianocore.org/show_bug.cgi?id=2425
This patch serie is a another way to solve the dependency of C files over ASL files. With this new method, the dependency is resolved at the linking stage.

The last method to solve this dependency was to add the possibility to modify INF files to depict such a dependency. This method was not accepted. The discussion is available at https://edk2.groups.io/g/devel/topic/72655342#56658

The last patch modifying the INF specification and INF parsing are available at:
https://edk2.groups.io/g/devel/topic/72655342#56658
https://edk2.groups.io/g/devel/topic/72656060#56662

Pierre Gondois (3):
  BaseTools: Generate multiple rules when multiple output files
  BaseTools: Rename AmlToHex script to AmlToC
  BaseTools: Compile AML bytecode arrays into .obj file

 BaseTools/BinWrappers/PosixLike/{AmlToHex => AmlToC}               | 28 +++----
 BaseTools/BinWrappers/WindowsLike/{AmlToHex.bat => AmlToC.bat}     |  0
 BaseTools/Conf/build_rule.template                                 | 15 +++-
 BaseTools/Source/Python/{AmlToHex/AmlToHex.py => AmlToC/AmlToC.py} | 82 ++++++++------------
 BaseTools/Source/Python/AutoGen/GenMake.py                         |  6 ++
 BaseTools/Source/Python/AutoGen/ModuleAutoGen.py                   | 40 +++++-----
 6 files changed, 86 insertions(+), 85 deletions(-)  rename BaseTools/BinWrappers/PosixLike/{AmlToHex => AmlToC} (97%)  rename BaseTools/BinWrappers/WindowsLike/{AmlToHex.bat => AmlToC.bat} (100%)  rename BaseTools/Source/Python/{AmlToHex/AmlToHex.py => AmlToC/AmlToC.py} (52%)

--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#59748): https://edk2.groups.io/g/devel/message/59748
Mute This Topic: https://groups.io/mt/74291745/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-