From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mx.groups.io with SMTP id smtpd.web11.53003.1680265150050087511 for ; Fri, 31 Mar 2023 05:19:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AcCrrdxo; spf=pass (domain: gmail.com, ip: 209.85.216.42, mailfrom: pedro.falcato@gmail.com) Received: by mail-pj1-f42.google.com with SMTP id lr16-20020a17090b4b9000b0023f187954acso23154056pjb.2 for ; Fri, 31 Mar 2023 05:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680265149; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=0uw2ie2n/4CLD37hlS5MWb+Ukuj+Ccb8RQzTGoKRaBk=; b=AcCrrdxonIrWCH/b8/gbW+xzAAm7dkvismctn5AZTduxpDsuWOgbdWOkyDehj8P32l UP2BeFwmxmpSFuwXM4SPDnfmiKeGu4G1CUgBKAs096iDxcKPUElD7UYTHyrzP7AFes3h IJK6nE1DUQ//MNM6CBKQ5ajUyH58hCJGqS7fj+1xLMHAEZk3WP/nYV/g7I+0o+cUmtJm 2Ek1zi+qkszX+DHfv7Ou7gJ3aIA4HjDAOWD68cIZxw1pw4Fu9yjwTy6ztDDCUDPgqByz w2IEwRwydOhL1DOB5Lag/hujdHL2qzE7f8Al8u2lZLqwRh4KANodAcbkijTrXlV1dEEb kryg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680265149; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0uw2ie2n/4CLD37hlS5MWb+Ukuj+Ccb8RQzTGoKRaBk=; b=Trd0TLfvxd91XwPUwrfFDcMJ195vAXedZsjL8ztFz/PvgamEdXPXGtN8ZB6FLbfkvw 7RSFIIqK84HLtFfvzmrWFsmW8c/St1rU+kQgUYAuEvr8WjnRnPz0pMk3k3brfk8lU2/j GzmTcCCaT16ceqg17oXAcdTTYKIhuWinVNZMbRycL6LxkHoH+9hC79x4uXlXgrh+IVFE pojZtFPFVhMnkw84w/v0JTZjjsnKZkp7ZsBDujobHsAAF0gRXQ5nmU9r3TKIWwxXvdl0 85wMgevGcbc6vspbtvfZNUyJnWB60H0a12ZtV0CsDmcpIX5YEs7HhPsSIotAsSgtdmIU gGRA== X-Gm-Message-State: AAQBX9eyUhF7PXdTpPuJ8Oy/y/wdtF6BECaBAq/km92Fm2kakFYO7HzC pUcYVCaxT9Wgh1vEir3FNe0V213Jqk60VkgM208= X-Google-Smtp-Source: AKy350axBfrC1Wmb+dBrcQUR9e9UuI9T1xD4CnyZMBbM27u5y5aJ7Ndniq2jnDVCo0v2DXYfmz87ekzyCUaAQixJiZs= X-Received: by 2002:a17:90a:4595:b0:23e:fad0:dda1 with SMTP id v21-20020a17090a459500b0023efad0dda1mr7993300pjg.1.1680265149466; Fri, 31 Mar 2023 05:19:09 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Pedro Falcato" Date: Fri, 31 Mar 2023 13:18:58 +0100 Message-ID: Subject: Re: [edk2-devel] [PATCH 0/2] Support FDT library. To: Gerd Hoffmann Cc: devel@edk2.groups.io, "Kinney, Michael D" , "Lin, Benny" , "Gao, Liming" , "Liu, Zhiguang" , Sean Brogan , Michael Kubacki , Leif Lindholm Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Mar 31, 2023 at 12:39=E2=80=AFPM Gerd Hoffmann = wrote: > > Hi, > > > > Getting down to one libc wrapper would be great. Do you want to prov= ide 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 :) --=20 Pedro