Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

omajid
Copy link
Member

@omajid omajid commented Feb 8, 2020

I can't build release/3.1 out of the box on Fedora 31 with glibc 2.30. This fixes that.

This contains 3 changes:

omajid and others added 2 commits February 7, 2020 18:14
glibc has deprecated sys/sysctl.h:

    In file included from /coreclr/src/pal/src/misc/sysinfo.cpp:32:
    /usr/include/sys/sysctl.h:21:2: error: "The <sys/sysctl.h> header is deprecated and will be removed." [-Werror,-W#warnings]
    #warning "The <sys/sysctl.h> header is deprecated and will be removed."
     ^
    1 error generated.

Fix that by preferring sysconf and only including sys/sysctl.h if
HAVE_SYSCONF is not true. This mirrors the order of the implementation
code in this file (sysinfo.cpp) which checks for HAVE_SYSCONF
before HAVE_SYSCTL.

Fixes #27008
@jeffschwMSFT
Copy link
Member

@trylek @jkoritzinsky

@omajid omajid changed the title [release/3.1] Support glibc deprecation of sys/sysctl.h [release/3.1] WIP: Support glibc deprecation of sys/sysctl.h Feb 10, 2020
@omajid omajid force-pushed the 3.1-glibc-sysctl-deprecation branch 2 times, most recently from 44645cc to baf98d9 Compare February 11, 2020 13:57
Guard it with HAVE_SYSCONF/HAVE_XSW_USAGE, just like it is done in
master and dotnet/runtime.
@omajid omajid force-pushed the 3.1-glibc-sysctl-deprecation branch from baf98d9 to a9d2b4f Compare February 11, 2020 15:30
@omajid omajid changed the title [release/3.1] WIP: Support glibc deprecation of sys/sysctl.h [release/3.1] Support glibc deprecation of sys/sysctl.h Feb 11, 2020
#endif // HAVE_XSWDEV

#if HAVE_XSW_USAGE
#include <sys/sysctl.h>
Copy link
Member Author

Choose a reason for hiding this comment

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

sys/sysctl.h provides struct xsw_usage. I can either put that in #ifdef __APPLE__ or just under a check for HAVE_XSW_USAGE.

Copy link
Member

Choose a reason for hiding this comment

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

HAVE_XSW_USAGE sounds good to me

@omajid omajid marked this pull request as ready for review February 11, 2020 19:03
@omajid
Copy link
Member Author

omajid commented Feb 11, 2020

cc'ing everyone involved in the original PRs: @janvorli @lpereira @am11 @stephentoub @wfurt @jkotas

@jkotas
Copy link
Member

jkotas commented Feb 11, 2020

For servicing, I think we should just disable the warnings that are causing problems to minimize the churn.

#20124

@omajid
Copy link
Member Author

omajid commented Feb 13, 2020

Thanks, @jkotas for that idea! I opened #28012 to do that. I am closing this PR in favour of that one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants