how to build gcc 11 cross compiler for jetson nano (arm64)

Viewed 647

I'm following this guide but when I try to build the c++ library I get the following fatal error.

../../../../gcc-11.1.0/libsanitizer/asan/asan_linux.cpp: In function ‘void __asan::AsanCheckIncompatibleRT()’:
../../../../gcc-11.1.0/libsanitizer/asan/asan_linux.cpp:199:21: error: ‘PATH_MAX’ was not declared in this scope
  199 |       char filename[PATH_MAX];
      |                     ^~~~~~~~
../../../../gcc-11.1.0/libsanitizer/asan/asan_linux.cpp:200:35: error: ‘filename’ was not declared in this scope; did you mean ‘rename’?
  200 |       MemoryMappedSegment segment(filename, sizeof(filename));
      |                                   ^~~~~~~~
      |             
1 Answers

This appears to be a bug in libsanitizer/asan/asan_linux.cpp. It seems to find the wrong limits.h file. I was able to work around it by modifying asan_linux.cpp as follows.

-#include <limits.h>
+#include <linux/limits.h>
Related