Discussion:
bug#32762: Bug at coreutils compile
vvcfee
2018-09-18 08:49:00 UTC
Permalink
Hi GNU team,Thanks for your great job!

recently I try to compile gnu coreutils manually on Centos7.3,and got some error when try to make:
[***@localhost coreutils]# make
make all-recursive
make[1]: Entering directory `/coreutils'
Making all in po
make[2]: Entering directory `/coreutils/po'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/coreutils/po'
Making all in .
make[2]: Entering directory `/coreutils'
CC lib/acl-internal.o
lib/acl-internal.c: In function 'free_permission_context':
lib/acl-internal.c:479:1: error: function might be candidate for attribute 'cons
t' [-Werror=suggest-attribute=const]
free_permission_context (struct permission_context *ctx)
^
cc1: all warnings being treated as errors
make[2]: *** [lib/acl-internal.o] Error 1
make[2]: Leaving directory `/coreutils'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/coreutils'
make: *** [all] Error 2


It seems like a bug has been reported before bug20753
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20753

Regards,
Arryboom
Assaf Gordon
2018-09-18 18:24:01 UTC
Permalink
tag -1 notabug
close -1
thanks

Hello,
Post by vvcfee
Hi GNU team,Thanks for your great job!
Thank you for the kind words.
Post by vvcfee
make all-recursive
make[1]: Entering directory `/coreutils'
Making all in po
make[2]: Entering directory `/coreutils/po'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/coreutils/po'
Making all in .
make[2]: Entering directory `/coreutils'
CC lib/acl-internal.o
lib/acl-internal.c:479:1: error: function might be candidate for attribute 'cons
t' [-Werror=suggest-attribute=const]
free_permission_context (struct permission_context *ctx)
^
cc1: all warnings being treated as errors
This is not a bug per-se, but a combination of two factors:

1. The compile issues a warning that a certain function
could be modified for improved performance.
2. The build process treats all warnings as errors.

This typically happens when one builds coreutils
directly from the git repository.

It should never happen when building from an official tarball.

===

If you did use a tarball (i.e. one of the files in
https://ftp.gnu.org/gnu/coreutils/ ) and still encountered this problem
- please do tell
which version of tarball and which version of gcc you are using.


If you are building from git (e.g. "git clone
git://git.sv.gnu.org/coreutils.git") and still want to proceed, you can
disable these warnings like so:

git clone git://git.sv.gnu.org/coreutils.git
cd coreutils
./bootstrap
./configure --disable-gcc-warnings
make


As a last resort, not very recommended, you can temporarily override
the CFLAGS to compile just that one file without warnings, like so:

[... after the build failure of acl-internal.o ...]
$ make CFLAGS="" ./lib/acl-internal.o
CC lib/acl-internal.o
[... then resume build as before ...]
$ make
...
...

===

Hope this helps. If not, please do reply and send more details.
I'm closing this as "not a bug", but discussion can continue by replying
to this thread.

regards,
- assaf

Loading...