public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Jeff Brasen via groups.io" <jbrasen=nvidia.com@groups.io>
To: Pedro Falcato <pedro.falcato@gmail.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Subject: Re: [edk2-devel] [PATCH] MdePkg/BaseFdtLib: Rename standard functions
Date: Mon, 11 Dec 2023 16:52:52 +0000	[thread overview]
Message-ID: <DS7PR12MB57892D7E124F684D47928DB3CB8FA@DS7PR12MB5789.namprd12.prod.outlook.com> (raw)
In-Reply-To: <CAKbZUD2qmOhxC4w66_Yw1Y4=V6DaQg+s9om=jkZbvZAAL0ioDw@mail.gmail.com>

Hit send before adding the cc on this one. (Would probably be good to get that added to here (https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process) so copy paste doesn't get folks 😊.

I sent them as different patch series as I thought this one might cause some discussion and wanted to separate it from that. 

This issue I was seeing is if you both include FdtLib and BaseCryptLib they both contain implementations of these standard functions with other functions in the same c files. This results in a link error as the linker won't discard part of a compilation unit if it is used so if you have

Foo.c has functions func1 and func2
Bar.c has functions func3 and func2

If func3 and func1 are both used externally that will cause both objects to be included and the linker to complain that func2 is defined twice.

We could move these to c files with just 1 function each in both libraries but that seemed like a bigger change than this.

-Jeff


> -----Original Message-----
> From: Pedro Falcato <pedro.falcato@gmail.com>
> Sent: Monday, December 11, 2023 9:00 AM
> To: devel@edk2.groups.io; Jeff Brasen <jbrasen@nvidia.com>
> Subject: Re: [edk2-devel] [PATCH] MdePkg/BaseFdtLib: Rename standard
> functions
> 
> External email: Use caution opening links or attachments
> 
> 
> On Mon, Dec 11, 2023 at 3:40 PM Jeff Brasen via groups.io
> <jbrasen=nvidia.com@groups.io> wrote:
> >
> 
> Jeff,
> 
> You're missing CC's on this patch. Also, you should probably send the
> 3 patches in a single series, since they're all related.
> 
> > Rename the standard functions in the LibFdtSupport to remove conflicts
> > with other libraries that define them.
> 
> This is a funny problem. What error were you seeing? As far as I can tell, you
> can totally define your local C library functions, it shouldn't result in any linker
> errors (even if, IIRC, deemed UB by the C spec).
> 
> --
> Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112319): https://edk2.groups.io/g/devel/message/112319
Mute This Topic: https://groups.io/mt/103110792/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2023-12-11 16:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11 15:39 [edk2-devel] [PATCH] MdePkg/BaseFdtLib: Rename standard functions Jeff Brasen via groups.io
2023-12-11 15:59 ` Pedro Falcato
2023-12-11 16:52   ` Jeff Brasen via groups.io [this message]
2024-01-23 17:20     ` Jeff Brasen via groups.io
2024-01-23 21:55 ` Michael D Kinney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DS7PR12MB57892D7E124F684D47928DB3CB8FA@DS7PR12MB5789.namprd12.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox