Hello I am trying to build clang from source, and I googled my question but it doesn't come up with anything.. "build clang from source freebsd" doesn't give any information on it. And my problem, is that my c/c++ compiler is missing a few files, I cannot find them with "pkg search" so it cannot find these files, and I have tried using gcc and freebsd's version of clang, neither works, same error.
/usr/local/bin/ld: cannot find crt1.o: No such file or directory
/usr/local/bin/ld: cannot find crti.o: No such file or directory
/usr/local/bin/ld: cannot find -lc: No such file or directory
/usr/local/bin/ld: cannot find crtn.o: No such file or directory
I hope you can help me find these files, or tell me whats wrong with my c/c++ compilers
The errors you're encountering indicate that the necessary C runtime files (`crt1.o`, `crti.o`, `crtn.o`) and the standard C library (`libc`) are missing. These files are part of the base system in FreeBSD (and GhostBSD, which is based on FreeBSD) and are typically located in the `/usr/lib` directory.
Here are the steps you can follow to resolve this issue:
1. Install the necessary base system files:
Ensure that the base system files are correctly installed. You can try reinstalling the base system libraries.
For FreeBSD:
sudo pkg install -f FreeBSD-lib
For GhostBSD:
sudo pkg install os-generic-userland-devtools
NOTE: When using GhostBSD using pkgbase, use: sudo pkg install -f FreeBSD-lib.
2. Install the development tools:
Ensure you have all the development tools installed, including `libc`, `clang`, and `gcc`.
sudo pkg install clang gcc
3. Check for the required files:
Verify that the required files are present in the `/usr/lib` directory. You should have the following files: