Hi, Bazel requires the headers used in compilation to be explicitly specified in Bazel. Since the compiler is resolving symbolic links to its actual paths Bazel finds a mismatch and therefore fails the compilation. Please follow the below link for more details of the issue: https://stackoverflow.com/questions/79274905/gcc-resolves-symbolic-links-to-absolute-paths-causing-issues-in-bazel-builds Thanks, Vaishali From: Jonathan Wakely <jwakely.gcc@xxxxxxxxx> Sent: Friday, December 13, 2024 3:03 PM To: Pundir, Vaishali (623) <vaishali.pundir@xxxxxxxxxxxxxxxxx> Cc: Andrew C Aitchison <andrew@xxxxxxxxxxxxxxx>; gcc-help <gcc-help@xxxxxxxxxxx> Subject: Re: Bazel Symbolic Links [**EXTERNAL E-MAIL**] On Fri, 13 Dec 2024, 06:32 vaishali.pundir--- via Gcc-help, <gcc-help@xxxxxxxxxxx<mailto:gcc-help@xxxxxxxxxxx>> wrote: Hi Mr. Andrew C Aitchison, We have tried using the "-no-canonical-prefixes" option, but unfortunately, it didn't resolve the issue. Below is the list of compiler options we are using: "-DBRS_PLATFORM_RH850", "-DBRS_COMP_GHS", "-DVMEM_30_RH850FACI01_HSM_ACTIVE", "-fprofile-arcs", "-ftest-coverage", "-g", "-O2", "-no-canonical-prefixes", "-Iexternal/+_repo_rules+test_sip /components/xxxx", The "-I" include path is a symbolic link to a local directory dynamically created by Bazel. During compilation, it is being resolved automatically to an absolute path like D:/test/sip_test/components/xxxx/test.h, which is causing problems because Bazel does not accept absolute paths. Why does bazel care how paths are resolved during compilation? You are not providing enough information to understand your issue. How is bazel even aware of how the path is resolved? Does it depend on the paths in # directives in the preprocessed output? Are you generating makefile dependencies that contain the paths? Are the resolved paths in the profile or coverage output? NOTE: We are running on Windows system. Thanks & Regards, Vaishali Pundir -----Original Message----- From: Andrew C Aitchison <andrew@xxxxxxxxxxxxxxx<mailto:andrew@xxxxxxxxxxxxxxx>> Sent: Thursday, December 12, 2024 9:32 PM To: Pundir, Vaishali (623) <vaishali.pundir@xxxxxxxxxxxxxxxxx<mailto:vaishali.pundir@xxxxxxxxxxxxxxxxx>> Cc: gcc-help@xxxxxxxxxxx<mailto:gcc-help@xxxxxxxxxxx> Subject: Re: Bazel Symbolic Links [**EXTERNAL E-MAIL**] On Thu, 12 Dec 2024, vaishali.pundir--- via Gcc-help wrote: > GCC resolves symbolic links to absolute paths, causing issues in Bazel > builds by including non-builtin files with absolute paths. > Is it possible to set GCC for relative path or it does not resolve > symbolic links by default. Does gcc option "-no-canonical-prefixes" or ld option "-rpath" help ? -- Andrew C. Aitchison Kendal, UK andrew@xxxxxxxxxxxxxxx<mailto:andrew@xxxxxxxxxxxxxxx> If you are not the addressee, please inform us immediately that you have received this e-mail by mistake, and delete it. We thank you for your support. If you are not the addressee, please inform us immediately that you have received this e-mail by mistake, and delete it. We thank you for your support.