On 05/19/16 19:39, Kinney, Michael D wrote:
> 
>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
>> Laszlo Ersek
>> Sent: Thursday, May 19, 2016 2:26 AM
>> To: Kinney, Michael D <michael.d.kin...@intel.com>
>> Cc: edk2-devel@lists.01.org <edk2-de...@ml01.01.org>
>> Subject: Re: [edk2] [RFC] Structured PCD Proposal
>>
>> On 05/19/16 01:28, Kinney, Michael D wrote:
>>
>> [snip]
>>
>>> ## C Structure Syntax Proposal
>>>   * Use C typedef syntax to describe complex C structures
>>>   * Use a C language parser with support for struct/union/array/bit 
>>> fields/pack
>>>   * Recommend use of libclang C language parser into Abstract Syntax Tree 
>>> (AST)
>>>     - Included with LLVM release
>>>     - http://llvm.org/releases/download.html
>>>     - http://clang.llvm.org/doxygen/group__CINDEX.html
>>>   * Recommend use of Python bindings for CLANG for EDK II Python based 
>>> BaseTools
>>>     - pip install clang
>>
>> What versions are necessary? On RHEL-7, the following versions are
>> available (from EPEL only; RHEL does not provide clang):
>>
>> clang-devel: 3.4.2-8.el7
>> python-pip: 7.1.0-1.el7
> 
> I have not tried the prototype on RHEL-7 yet.  For Fedora 23, we have used:
>  
>   $ sudo dnf install clang


Up to and including Fedora 23, clang had been built from the source
package called "llvm", so Koji and pkgdb must be searched for "llvm",
when someone is looking for Fedora 23 packages on the web (i.e., not
with "dnf" or "yum"). In Fedora 24, "clang" got its own SRPM:

http://thread.gmane.org/gmane.linux.redhat.fedora.devel/216194
https://bugzilla.redhat.com/show_bug.cgi?id=1300945

So, looking for "llvm" packages, it seems to me that the last Fedora
releases that shipped 3.4-based clang binaries were Fedora 21, and
Fedora 22:

http://koji.fedoraproject.org/koji/buildinfo?buildID=552862
http://koji.fedoraproject.org/koji/buildinfo?buildID=552863

(However, Fedora 22 later moved to the 3.5 series.)

Why this matters: on RHEL-7 I'll only be able to use 3.4.2-based clang
(from EPEL-7). I think testing the BaseTools feature in a fully updated
Fedora 21 installation (3.4-based clang) would allow you to extrapolate
the results to EPEL-7:

Fedora 23: 3.7.0-4   works
Fedora 21: 3.4-15    ?
EPEL-7:    3.4.2-8   ?

Could you please test such a configuration?

Alternatively, if you have a public branch, and testing instructions,
I'd be happy to check them on my RHEL-7 system, using clang 3.4.2-8
(from EPEL-7).

>   $ git clone -b release_37 https://github.com/trolldbois/python-clang
>   $ cd python-clang
>   $ sudo python setup.py install

Unfortunately, this looks very bad. I shouldn't have to install, as
root, a Python package from a random github repository, in order to
build edk2 platforms.

At this point, quite a few downstreams (e.g., Linux distributions) build
OVMF packages. If the Structured PCD Feature is put to use in such
generic edk2 modules that OVMF pulls in (which I think will likely
happen), then all these downstreams are going to require the python
bindings for clang as native packages.

... Actually, the README file at
<https://github.com/trolldbois/python-clang> says:

    OBSOLETE. LLVM-CLANG NOW PUBLISHES PYTHON PACKAGE. JUST ADD THE
    OFFICIAL llvm-3.7 repo in your apt.

If the above statement -- about llvm-3.7 including the python bindings
for clang -- is correct, then Fedora 23 and later might be all set,
because their llvm and clang stuff does not predate 3.7. (See Fedora 23
above, for example: 3.7.0-4).

However, this dependency leaves a number of Linux distributions in the
cold; distros that are still supported
- by their vendors,
- and by edk2 in general (for example through the now-antique GCC44
  toolchain).

I think if clang and its python bindings become an unconditional
dependency for building edk2, then:

(1) Some Linux distributions that can currently build edk2 platforms
(through the older GCC toolchains) will lose that capability, because
they may not have (fresh enough) clang. This could be okay, but then we
should declare it as a fact (= removal of compatibility), and remove old
GCC toolchains as well.

(2) The python bindings for clang, as an official part of LLVM, look
like a bleeding edge feature, in edk2 terms (according to Wikipedia,
LLVM 3.7.0 was released on 1 September 2015). If the python bindings
become a hard requirement for building edk2, then I think BaseTools
should embed them (it's "just Python", I guess). Otherwise only bleeding
edge Linux distros will be able to build edk2.

(I removed the rest of the context, but I do thank you for your other
answers!)

Thanks,
Laszlo
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to