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

Issue during compilation with glibc >= 2.30 #389

Open
forrest96 opened this issue Mar 27, 2023 · 1 comment
Open

Issue during compilation with glibc >= 2.30 #389

forrest96 opened this issue Mar 27, 2023 · 1 comment
Labels
enhancement good first issue Hacktoberfest Good first issue for new contributors coming from @Hacktoberfest help wanted

Comments

@forrest96
Copy link

On Linux systems which use glibc ≥2.30 the following will be logged
during compilation:

In file included from arch/arch_info.c:52:0: /usr/include/sys/sysctl.h:21:2: error: #warning "The <sys/sysctl.h> header is deprecated and will be removed." [-Werror=cpp] #warning "The <sys/sysctl.h> header is deprecated and will be removed." ^~~~~~~ cc1: all warnings being treated as errors

The release notes for glibc 2.30 read:

“The Linux-specific <sys/sysctl.h> header and the sysctl function have
been deprecated and will be removed from a future version of glibc.
Application should directly access /proc instead. For obtaining
random bits, the getentropy function can be used.”

(See also https://sourceware.org/ml/libc-alpha/2019-08/msg00029.html for
the full release notes.)

To Reproduce

1 install glibc and glibc-dev / glibc-devel >= 2.30

2 compile ltfs v. 2.4.5.0 :
./autogen.sh
./configure --prefix=$1 --enable-message-checker --enable-warning-as-error
make

Solution

Because of the deprecated sysctl() function, sysconf() should be used instead.

Source file src/libltfs/arch/arch_info.c

@piste-jp-ibm piste-jp-ibm added enhancement help wanted good first issue Hacktoberfest Good first issue for new contributors coming from @Hacktoberfest labels Apr 5, 2023
@piste-jp-ibm
Copy link
Member

It's not mandatory at this time because the main target is RHEL8 and RHEL7.

But it is good to move the API to sysconf() before reconsidering the main target OSs, because RHEL7 and RHEL8 support the API already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue Hacktoberfest Good first issue for new contributors coming from @Hacktoberfest help wanted
Projects
None yet
Development

No branches or pull requests

2 participants