On Fri, Mar 31, 2023 at 12:39 PM Gerd Hoffmann <kra...@redhat.com> wrote:
>
>   Hi,
>
> > > Getting down to one libc wrapper would be great.  Do you want to provide 
> > > a proposed
> > > implementation?  That could be handled as a separate task.
> >
> > I would like it if we could stop contributing to that problem. We very
> > much *know* there is a problem with both libc fragments and compiler
> > intrinsic fragments all over edk2.
>
> I'd suggest to start with what we already have in the tree.  Which is
> (not fully sure the list is actually complete):
>
>  - CryptoPkg/Library/Include/ carrying the bits needed to make openssl
>    compile, and
>  - CryptoPkg/Library/IntrinsicLib (again, for openssl, mostly IA32, some
>    X64) and,
>  - ArmPkg/Library/CompilerIntrinsicsLib (mostly ARM, some AARCH64).
>
> Can we move that over to MdePkg so everyone can easily share it instead
> of adding more copies of the same to the tree?

Yes please. The problem with starting with what's in the tree is that
it's very messy and sometimes of super dubious quality.
For instance, on CryptoPkg there's the same lack of rigour in the
headers and CrtWrapper.c that I would rather avoid, as to make this a
relatively proper thing

(did you know if OpenSSL strcpy's over 4KiB it silently fails?).

> I have an old branch gathering dust doing that for the intrinsics, I can
> try rebasing it to latest master next week ...

Yes please! I did think about bringing in compiler-rt from LLVM for
high quality relatively self-contained intrinsics a good while ago.
There's the open question that GCC and clang require intrinsics and a
very small set of libc string functions to properly generate code.
Could BaseTools implicitly link this in? If we do it correctly,
there's no reason why the binaries would grow beyond what it requires
from the intrinsics set.
And I actually did see problems with lacking memcpy when trying out
tree-wide GCC12/clang -ftrivial-auto-var-init...

Anyway, if you want help with this or want to sync up efforts, do ping
me off-list :)

-- 
Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102308): https://edk2.groups.io/g/devel/message/102308
Mute This Topic: https://groups.io/mt/97955736/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to