WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: GCC can't find Adress Sanitizer  (Read 76 times)

Offline zharr

  • Jr. Member
  • **
  • Posts: 50
GCC can't find Adress Sanitizer
« on: June 24, 2026, 01:02:11 PM »
Hey,
I've tried compiling my project with -fsanitize=address a few times now (tried across 14-16) but it never manages to find "/usr/local/lib/libasan_preinit.o" which it needs for linking.
Code: [Select]
gcc -print-search-dirsShows it is not looking in "/usr/local/lib", which I assume is why it doesn't work. A quick and dirty fix that does make it work:
Code: [Select]
sudo ln -s /usr/local/lib/libasan_preinit.o /usr/lib/Since this persisted across a few version without anybody else complaining it might not be super critical but perhaps it can get addressed in the next version. Until then, hopefully the people encountering that issue find this.
Thanks for your work on piCore!

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1584
Re: GCC can't find Adress Sanitizer
« Reply #1 on: June 24, 2026, 01:52:26 PM »
gcc is built for /usr/local, so not sure why its not including that by default.  You can define your search paths with enviroment variables too.

17.x is already built, did you look at that?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15685
Re: GCC can't find Adress Sanitizer
« Reply #2 on: June 24, 2026, 02:26:45 PM »
I haven’t seen that error, but I’ve seen a similar error with libgomp - up until now I’ve been unable to fix it without resorting to a similar symlink.

Offline zharr

  • Jr. Member
  • **
  • Posts: 50
Re: GCC can't find Adress Sanitizer
« Reply #3 on: June 24, 2026, 03:56:34 PM »
gcc is built for /usr/local, so not sure why its not including that by default.  You can define your search paths with enviroment variables too.

17.x is already built, did you look at that?
Thanks, can confirm setting "LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib" also works.
Have not tried 17 yet, and likely won't for a bit. Fully switching versions is quite a lot of work, though ig I could try it out normally