I'm not too sure why, but it seems my GCC is completely broken. I've reinstalled gcc, gcc-libs, g++, ldb, and a few other related libraries, but none resolved my issue. When I attempt to compile a hello world program like such:
# include <stdio.h>

int main(void) 
{
        puts("Hello world");
        return 0;
}
I receive the following error:
/usr/local/include/stdio.h:6:10: fatal error: arch/cdefs.h: No such file or directory
    6 | # include <arch/cdefs.h>
       |          ^~~~~~~~~~~~~~
compilation terminated.
Likewise, any other gcc-reliant compiler (like g++) displays errors during compilation.

Any idea how to fix this?
Till someone more knowledgeable appears I would remove -Rnsu base-devel and reinstall it.
gcc and libs had a recent minor update 9/30 but I doubt this is an issue that going back one version would fix. It sounds like something is missed in your libraries.

Keep an eye out what pkgs are removed with -Rnsu base-devel and what is installed again, compare. Keep an eye out for conflicting files when installation is done.
fungal_net wroteTill someone more knowledgeable appears I would remove -Rnsu base-devel and reinstall it.
gcc and libs had a recent minor update 9/30 but I doubt this is an issue that going back one version would fix. It sounds like something is missed in your libraries.

Keep an eye out what pkgs are removed with -Rnsu base-devel and what is installed again, compare. Keep an eye out for conflicting files when installation is done.
Just tried this, nothing changed. Also nothing conflicting during the reinstall. I tried reinstalling base with # pacman -S base too.
Something is broken in your system, but where. I would take whatever compilers you have installed, uninstall them completely and reinstall them. Also take a look at any .conf files relating to compilers and compare them with defaults (your edited ones will be saved with the same name plus .pacsave). Maybe all it is is a path issue defined inside a configuration that prevents the compiler of finding the right libraries. Sorry I can't be of more detailed help, hopefully JM or Eric can give you better advise.
i am not quite sure what compilers you tried to install but normally, standard headers are found in /usr/include. My standard stdio.h doesn't even have mention for arch/cdefs.h or cdefs.h
I believe I've figured out most of the issue. Two days ago, I attempted to build and install the Simple C Compiler. It seems that it did indeed install, though unsuccessfully, when I ran # make install. I didn't believe it had, as it threw multiple errors.
I've just now deleted all SCC files and folders, though there's still an issue with ld (LD); where compilation gets right up to the point ld is used and then simply refuses to go further, instead returning an error saying that ld was used incorrectly. I'd reinstall it, but I can't seem to figure out what the name for ld is.
I've fixed it completely, the issue with ld was that it was calling /usr/local/bin/ld, deleting the binary from there completely fixed my problem. Thanks for everyone's help.
this is rather strange that /usr/local/bin comes first than /usr/bin or /bin or /usr/bin. you better check your paths or whatever if you did not do this on purpose

Powered by Obarun