bazel-contrib / toolchains_llvm

LLVM toolchain for bazel
Apache License 2.0
291 stars 209 forks source link

'stdlib.h' file not found #242

Closed firekind closed 6 months ago

firekind commented 9 months ago

Hello, I was trying to compile a simple hello world c program with stdlib.h included. The toolchain was configured with the chromium sysroot, and I was compiling it in an ubuntu 20.04 docker container. While it was compiling, it threw a fatal error: 'stdlib.h' file not found.

I tried running the omp_test.c test using the sysroot toolchain configured in MODULE.bazel, and even that threw the same error. The error goes away when I install libc6-dev package, which contains the required headers.

Is there any additional configuration required to use the headers present in the sysroot? and avoid installing packages in the container?

some additional information: I'm using #235 instead of master, since I'm using bzlmod

siddharthab commented 6 months ago

You definitely need to have libc headers until #155 is resolved. Other dependencies can be ncurses, libtinfo, etc. Container tests in tests/scripts/ can be informative to some extent. Please reopen if you want more information.