4

As of now, my archlinux system require current version of gcc (8.3) along with gcc 7.2 and gcc 5.5 (in some other path).

I am trying to compile the source code as below:

$ ./contrib/download-prerequisites

In build dir:

$ ../gcc-5.5.0/configure --prefix=/home/mjonyh/bin/gcc/5.5.0 --disable-multilib --enable-languages=c,c++,fortran

than found the error

sys/ustat.h: no such file or directory

Already installed: binutils gcc-libs libmpc gcc-ada libmpc dejagnu inetutils lib32-gcc-libs doxygen gcc-ada lib32-glibc

Update: I resolve the problem by manually comment out the ustat.h in gcc-x.x.x/libsanitizer/sanitizer-common/sanitizer-platform-limits-posix.cc (line number 157 and 250). Because archlinux deprecated the ustat.h in glibc.

7
  • I think you'll need to show us more output. All I can tell from the few lines shown is that something failed, causing make to report an error. There should be an error message further back showing directly what failed. May 12, 2019 at 4:33
  • what is that something? How can I find that? May 12, 2019 at 9:08
  • It looks like your error is from make, not configure, and you didn't show us the make command. Running make is going to produce a lot of output, including error messages. Save that output to a file, and then look for error messages in that file. May 12, 2019 at 20:23
  • Thank you all. I have found the problem. It is sys/ustat.h is missing. Since I am using gcc 8.3. Is there any way to handle it? May 14, 2019 at 8:18
  • Now that you've found the error, please include that information (the error message in the output of make) in your question. On my system, that file is provided by the libc6-dev package. The name might be different on Arch Linux. May 14, 2019 at 8:57

3 Answers 3

1

Apart from this:

Update: I resolve the problem by manually comment out the ustat.h in gcc-x.x.x/libsanitizer/sanitizer-common/sanitizer-platform-limits-posix.cc (line number 157 and 250). Because archlinux deprecated the ustat.h in glibc.

gcc-7.4.0 has removed ustat.h in sanitizer-platform-limits-posix.cc. Try 7.4.0 instead if this is possible.

1

The release notes for glibc 2.28 say this:

  • The obsolete function ustat is no longer available to newly linked binaries; the headers <ustat.h> and <sys/ustat.h> have been removed. This function has been deprecated in favor of fstatfs and statfs.

In order to build GCC 5.5, you have a few options:

  • Build on an older distribution which uses glibc 2.27 or earlier.
  • Backport the fix to the Go frontend to GCC 5. (ustat was added to Go only by accident, its deprecation predates the start of Go development, and perhaps even Google as a company.)
  • Disable the gccgo frontend using a suitable --enable-languages= argument to the configure invocation.
2
  • Since go language is not required by my system, I guess that the “troubleshooting “ I did, will not make a problem. What do you think? May 16, 2019 at 6:39
  • You can actually have the supported languages by your gcc version with configure --enable-languages=showmeplease
    – debuti
    Oct 4, 2021 at 19:44
0

There is a patch commit: https://github.com/gcc-mirror/gcc/commit/71b55d45e4304f5e2e98ac30473c581f58fc486b

libsanitizer: Use pre-computed size of struct ustat for Linux Cherry-pick compiler-rt revision 333213:

<sys/ustat.h> has been removed from glibc 2.28 by:

commit cf2478d53ad7071e84c724a986b56fe17f4f4ca7 Author: Adhemerval Zanella adhe[email protected] Date: Sun Mar 18 11:28:59 2018 +0800

Deprecate ustat syscall interface

This patch uses pre-computed size of struct ustat for Linux.

PR sanitizer/85835
* sanitizer_common/sanitizer_platform_limits_posix.cc: Don't
include <sys/ustat.h> for Linux.
(SIZEOF_STRUCT_USTAT): New.
(struct_ustat_sz): Use SIZEOF_STRUCT_USTAT for Linux.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.