tpoechtrager / osxcross

Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)
GNU General Public License v2.0
2.9k stars 329 forks source link

Compiler errors when calling build_compiler_rt.sh #259

Closed s-ag closed 3 years ago

s-ag commented 3 years ago

Hello,

I'm not sure if this is an OSXCross or a general LLVM issue. When building the compiler_rt I get these errors:

/root/osxcross/build/compiler-rt/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:174:31: error: invalid application of 'sizeof' to an incomplete type 'struct stat64'
  unsigned struct_stat64_sz = sizeof(struct stat64);
                              ^     ~~~~~~~~~~~~~~~
/root/osxcross/build/compiler-rt/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:174:45: note: forward declaration of '__sanitizer::stat64'
  unsigned struct_stat64_sz = sizeof(struct stat64);
                                            ^
/root/osxcross/build/compiler-rt/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:200:33: error: invalid application of 'sizeof' to an incomplete type 'struct statfs64'
  unsigned struct_statfs64_sz = sizeof(struct statfs64);
                                ^     ~~~~~~~~~~~~~~~~~
/root/osxcross/build/compiler-rt/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:200:47: note: forward declaration of '__sanitizer::statfs64'
  unsigned struct_statfs64_sz = sizeof(struct statfs64);

I fixed those for myself by replacing stat64 with stat and statfs64 with statfs as both sizes should be the same on a 64 bit platform, and it seems to work (at least for x86_64).

Greetings Holger

gerekon commented 3 years ago

Faced the same issue. @s-ag Thanks for the fix.