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

arch/common-switches: undef _FORTIFY_SOURCE before redefining #36

Merged
merged 1 commit into from
Dec 21, 2024

Conversation

Cyanoxygen
Copy link
Member

@Cyanoxygen Cyanoxygen commented Dec 19, 2024

Otherwise for every invocation the compiler will emit this warning:

<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition

Otherwise for every invocation the compiler will emit this warning:

<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
@Cyanoxygen
Copy link
Member Author

The impact on not undefing is observed on building pcp: pcp needs to test whether functions passed to scandir() should be taking const struct dirent * or struct dirent *. The way it tests this is to see if there are warnings emitted out during compiling the test program.

Without undefing _FORTIFY_SOURCE the compiler emits the warning, thus failing the test, however functions passed to scandir() must take const struct dirent *, resulting a FTBFS.

@Cyanoxygen
Copy link
Member Author

Cyanoxygen commented Dec 19, 2024

I will report it to the upstream - instead of testing if there's any warning emitted out, it should test if the compiler exited with an error, with -Werror=incompatible-pointer-types.

Copy link
Member

@MingcongBai MingcongBai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Cyanoxygen
Copy link
Member Author

Upstream PR: performancecopilot/pcp#2111

1 similar comment
@Cyanoxygen
Copy link
Member Author

Upstream PR: performancecopilot/pcp#2111

@MingcongBai MingcongBai merged commit 179c260 into master Dec 21, 2024
1 check passed
@MingcongBai MingcongBai deleted the ftf-undef-first branch January 2, 2025 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants