[dpdk-dev] [RFC PATCH 0/2] pmdinfogen: rewrite in Python

Dmitry Kozlyuk dmitry.kozliuk at gmail.com
Thu Jul 2 02:07:43 CEST 2020


On Tue, 23 Jun 2020 07:28:06 -0400 Neil Horman wrote:
> On Mon, Jun 22, 2020 at 10:39:46PM +0300, Dmitry Kozlyuk wrote:
> > On Mon, 22 Jun 2020 08:41:17 -0400, Neil Horman wrote:  
> > > On Mon, Jun 22, 2020 at 03:45:01AM +0300, Dmitry Kozlyuk wrote:  
[snip]  
> > I was talking about these fields of struct elf_info:
> > 
> > 	/* if Nth symbol table entry has .st_shndx = SHN_XINDEX,
> > 	 * take shndx from symtab_shndx_start[N] instead
> > 	 */
> > 	Elf32_Word   *symtab_shndx_start;
> > 	Elf32_Word   *symtab_shndx_stop;
> > 
> > They are not used after being filled in parse_elf() and their endianness
> > fixed in the end despite the comment.
> >   
> Its been a while since I wrote this, so I need to go back and look closely, but
> as you say, these values aren't used after parse_elf completes, but they are(I
> think) used to correct the endianess of the section header index table, so that
> get_sym_value works properly.  You would (again I think), only note a problem if
> you were parsing an ELF file for an architecture with an endianess opposite that
> of what you are building on (i.e. an x86 system cross compiling for a powerpc
> target).

Thanks for the explanation. Anyway, it's yet another point to prefer
pyelftools to parsing ELF manually.


[snip]
> > Native builds can use Python or PowerShell, which is as capable as Unix
> > shells, but incompatible with them. To call lib.exe (MSVC analog of ar) is
> > probably simpler then parsing COFF, yes. So meson could select one of the
> > following for a Windows target (objects are COFF):
> > 
> > Host     Toolchain  Archive  Script      Extractor
> > -------  ---------  -------  ---------   ---------
> > Linux    MinGW      .a       sh          ar
> > Windows  MinGW      .a       PowerShell  ar
> > Windows  Clang      .lib     PowerShell  lib  
> I think if I read you right, what you're suggesting here is that meson setup a
> build time marco $ARCHIVETOOL, and set it to ar or lib.exe depending on the
> build environment, and just have the script in question use $ARCHIVER?  If so,
> I'd be good with that.  Do we have to worry about the use of divergent command
> line options for each tool as well?

As I said, PowerShell cannot consume the same shell script. My suggestion was
to have two scripts, one existing for shell and ar (used by Linux host), and
one new PowerShell script for both lib.exe and ar (used by Windows host).
Meson then would select which script to call. Another option is to have one
wrapper Python script for all hosts: a few extra lines to launch archiver,
but less files and no need to know shell/PowerShell when changing this part.
(I believe Bruce means the same.)  But it will still be a separate script.

-- 
Dmitry Kozlyuk


More information about the dev mailing list