Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: RuntimeLibExitBootServicesEvent function redefine in MU_BASECORE/PolicyServicePkg/Library/DxePolicyLib #565

Closed
1 task done
MarcChen46 opened this issue Sep 14, 2023 · 0 comments · Fixed by #566
Labels
state:needs-maintainer-feedback Needs more information from a maintainer to determine next steps state:needs-owner Needs an issue owner to be assigned state:needs-triage Needs to triaged to determine next steps type:bug Something isn't working urgency:high Significant with a critical impact

Comments

@MarcChen46
Copy link
Contributor

Is there an existing issue for this?

  • I have searched existing issues

Current Behavior

RuntimeLibExitBootServicesEvent function is already implemented in MU_BASECORE/MdePkg/Library/UefiRuntimeLib and get called in constructor.
The same RuntimeLibExitBootServicesEvent function is also implemented in MU_BASECORE/PolicyServicePkg/Library/DxePolicyLib and get called in constructor too.

In that case, on one driver's INF add both UefiRuntimeLib and DxePolicyLib, then it will have functio redefine compiler error as below.

image

Expected Behavior

DxePolicyLib should rename the RuntimeLibExitBootServicesEvent to prevent conflict with existing function in UefiRuntimeLib

Steps To Reproduce

add both UefiRuntimeLib and DxePolicyLib to the same INF file and build this driver should be able to reproduce the build error.

Build Environment

- OS(s):Windows 11
- Tool Chain(s): VS2022
- Targets Impacted: RELEASE, DEBUG

Version Information

4a53c6a187d2179924136a18bf015ecc0f2f06da

Urgency

High

Are you going to fix this?

Someone else needs to fix it

Do you need maintainer feedback?

Maintainer feedback requested

Anything else?

No response

@MarcChen46 MarcChen46 added state:needs-triage Needs to triaged to determine next steps type:bug Something isn't working labels Sep 14, 2023
@github-actions github-actions bot added state:needs-maintainer-feedback Needs more information from a maintainer to determine next steps urgency:high Significant with a critical impact state:needs-owner Needs an issue owner to be assigned labels Sep 14, 2023
@os-d os-d mentioned this issue Sep 14, 2023
5 tasks
@os-d os-d closed this as completed in #566 Sep 14, 2023
os-d added a commit that referenced this issue Sep 14, 2023
## Description

RuntimeLibExitBootServicesEventCallback is defined and exported in two
locations, RuntimeLib and PolicyLib. This causes a linker error if both
libraries are linked to a module.

This patch both changes the name of the callback in PolicyLib (as this
was not an accurate name) and marks it STATIC, as this function should
not be called at all except for the function pointer that is registered
for the event firing.

Closes #565.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Unit tests ran.

## Integration Instructions

N/A.
kenlautner pushed a commit that referenced this issue Oct 17, 2023
## Description

RuntimeLibExitBootServicesEventCallback is defined and exported in two
locations, RuntimeLib and PolicyLib. This causes a linker error if both
libraries are linked to a module.

This patch both changes the name of the callback in PolicyLib (as this
was not an accurate name) and marks it STATIC, as this function should
not be called at all except for the function pointer that is registered
for the event firing.

Closes #565.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Unit tests ran.

## Integration Instructions

N/A.
kenlautner pushed a commit that referenced this issue Oct 17, 2023
## Description

RuntimeLibExitBootServicesEventCallback is defined and exported in two
locations, RuntimeLib and PolicyLib. This causes a linker error if both
libraries are linked to a module.

This patch both changes the name of the callback in PolicyLib (as this
was not an accurate name) and marks it STATIC, as this function should
not be called at all except for the function pointer that is registered
for the event firing.

Closes #565.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Unit tests ran.

## Integration Instructions

N/A.
kenlautner pushed a commit that referenced this issue Oct 18, 2023
## Description

RuntimeLibExitBootServicesEventCallback is defined and exported in two
locations, RuntimeLib and PolicyLib. This causes a linker error if both
libraries are linked to a module.

This patch both changes the name of the callback in PolicyLib (as this
was not an accurate name) and marks it STATIC, as this function should
not be called at all except for the function pointer that is registered
for the event firing.

Closes #565.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Unit tests ran.

## Integration Instructions

N/A.
kenlautner pushed a commit that referenced this issue Oct 18, 2023
## Description

RuntimeLibExitBootServicesEventCallback is defined and exported in two
locations, RuntimeLib and PolicyLib. This causes a linker error if both
libraries are linked to a module.

This patch both changes the name of the callback in PolicyLib (as this
was not an accurate name) and marks it STATIC, as this function should
not be called at all except for the function pointer that is registered
for the event firing.

Closes #565.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Unit tests ran.

## Integration Instructions

N/A.
kenlautner pushed a commit that referenced this issue Oct 19, 2023
## Description

RuntimeLibExitBootServicesEventCallback is defined and exported in two
locations, RuntimeLib and PolicyLib. This causes a linker error if both
libraries are linked to a module.

This patch both changes the name of the callback in PolicyLib (as this
was not an accurate name) and marks it STATIC, as this function should
not be called at all except for the function pointer that is registered
for the event firing.

Closes #565.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Unit tests ran.

## Integration Instructions

N/A.
kenlautner pushed a commit that referenced this issue Oct 20, 2023
## Description

RuntimeLibExitBootServicesEventCallback is defined and exported in two
locations, RuntimeLib and PolicyLib. This causes a linker error if both
libraries are linked to a module.

This patch both changes the name of the callback in PolicyLib (as this
was not an accurate name) and marks it STATIC, as this function should
not be called at all except for the function pointer that is registered
for the event firing.

Closes #565.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Unit tests ran.

## Integration Instructions

N/A.
kenlautner pushed a commit that referenced this issue Oct 23, 2023
## Description

RuntimeLibExitBootServicesEventCallback is defined and exported in two
locations, RuntimeLib and PolicyLib. This causes a linker error if both
libraries are linked to a module.

This patch both changes the name of the callback in PolicyLib (as this
was not an accurate name) and marks it STATIC, as this function should
not be called at all except for the function pointer that is registered
for the event firing.

Closes #565.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Unit tests ran.

## Integration Instructions

N/A.
kenlautner pushed a commit that referenced this issue Dec 16, 2023
## Description

RuntimeLibExitBootServicesEventCallback is defined and exported in two
locations, RuntimeLib and PolicyLib. This causes a linker error if both
libraries are linked to a module.

This patch both changes the name of the callback in PolicyLib (as this
was not an accurate name) and marks it STATIC, as this function should
not be called at all except for the function pointer that is registered
for the event firing.

Closes #565.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Unit tests ran.

## Integration Instructions

N/A.
kenlautner pushed a commit that referenced this issue Dec 18, 2023
## Description

RuntimeLibExitBootServicesEventCallback is defined and exported in two
locations, RuntimeLib and PolicyLib. This causes a linker error if both
libraries are linked to a module.

This patch both changes the name of the callback in PolicyLib (as this
was not an accurate name) and marks it STATIC, as this function should
not be called at all except for the function pointer that is registered
for the event firing.

Closes #565.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Unit tests ran.

## Integration Instructions

N/A.
kenlautner pushed a commit that referenced this issue Dec 18, 2023
## Description

RuntimeLibExitBootServicesEventCallback is defined and exported in two
locations, RuntimeLib and PolicyLib. This causes a linker error if both
libraries are linked to a module.

This patch both changes the name of the callback in PolicyLib (as this
was not an accurate name) and marks it STATIC, as this function should
not be called at all except for the function pointer that is registered
for the event firing.

Closes #565.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Unit tests ran.

## Integration Instructions

N/A.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:needs-maintainer-feedback Needs more information from a maintainer to determine next steps state:needs-owner Needs an issue owner to be assigned state:needs-triage Needs to triaged to determine next steps type:bug Something isn't working urgency:high Significant with a critical impact
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant