riscv32-unknown-elf-gcc mixes riscv system includes with host I86-64 system includes #686
-
I'm having a system library issue.
The result is a fatal error but what is difficult to understand is the first few system includes are from the right location escept "sys/cdefs.h" using the path from my host GCC (Ubuntu 22.04 on Intel64). I added to the make file a line before the compiler call to make sure of which GCC was called. It effectively the riscv gcc. See the result:
Running gcc configuration verification show that everything should be OK in terms of include header paths. I'm specifically looking for the 2 varaibles : --with-native-system-header-dir=/include --with-native-system-header-dir=/include showing the right paths.
So how is GCC use the right include paths for several includes and suddenly decide to use the host system include path? https://github.com/stnolting/riscv-gcc-prebuilt Any hint will be appreciated. I might have just made a stupid mistake or may be there is a bug. I spent several hours looking at everything I would thing of. I've used successfully multiple GCC cross compiler over the years and this the first time I see mixing include folders from multiple versions in the same compile run. Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I found the Issue. I publish it in case someone else face the same problem. On my workstation, there is a CPATH environment variable CPATH. This is the culprit. If a remove it, it works. It's a bit annoying since it might be required for another of my tools. I guess I will figure it out next time I use the tool that needs it. |
Beta Was this translation helpful? Give feedback.
-
I have never encountered this... However, thank you very much for sharing your finding! 👍 |
Beta Was this translation helpful? Give feedback.
I found the Issue. I publish it in case someone else face the same problem. On my workstation, there is a CPATH environment variable CPATH. This is the culprit. If a remove it, it works. It's a bit annoying since it might be required for another of my tools. I guess I will figure it out next time I use the tool that needs it.