解决ubuntu 16.04 64bit上fatal error: sys/cdefs.h: No such file or directory

错误信息:

make
Skip building js due to lack of nodejs
Skip building el due to lack of emacs
Skip building cl due to lack of sbcl
Skip building cpp due to lack of g++-6
Skip building i due to lack of ick
cp test/24_cmp2.c out/24_cmp2.c.tmp && mv out/24_cmp2.c.tmp out/24_cmp2.c
git submodule update --init
Submodule '8cc' (https://github.com/shinh/8cc) registered for path '8cc'
Submodule 'Whitespace' (https://github.com/koturn/Whitespace) registered for path 'Whitespace'
Submodule 'tinycc' (http://repo.or.cz/tinycc.git) registered for path 'tinycc'
Cloning into '8cc'...
remote: Counting objects: 4541, done.
remote: Compressing objects: 100% (187/187), done.
remote: Total 4541 (delta 112), reused 0 (delta 0), pack-reused 4354
Receiving objects: 100% (4541/4541), 1.42 MiB | 1.19 MiB/s, done.
Resolving deltas: 100% (3026/3026), done.
Checking connectivity... done.
Submodule path '8cc': checked out '842752b089019bf883e21604a98e712b55fd7727'
Cloning into 'Whitespace'...
remote: Counting objects: 54, done.
remote: Total 54 (delta 0), reused 0 (delta 0), pack-reused 54
Unpacking objects: 100% (54/54), done.
Checking connectivity... done.
Submodule path 'Whitespace': checked out '16be2c0617a6f7846c53802e1a4cb382ccf7dc8a'
Cloning into 'tinycc'...
remote: Counting objects: 8915, done.
remote: Compressing objects: 100% (2610/2610), done.
remote: Total 8915 (delta 6260), reused 8864 (delta 6217)
Receiving objects: 100% (8915/8915), 2.89 MiB | 531.00 KiB/s, done.
Resolving deltas: 100% (6260/6260), done.
Checking connectivity... done.
Submodule path 'tinycc': checked out 'c948732efaf823f36d05608fe716bfcc4a98b70c'
touch out/git_submodule.stamp
make -C 8cc && cp 8cc/8cc out/8cc
make[1]: Entering directory '/home/ondrej/repos/elvm/8cc'
cc -Wall -Wno-strict-aliasing -std=gnu11 -g -I. -O0 -DBUILD_DIR='"/home/ondrej/repos/elvm/8cc"'   -c -o main.o main.c
cc -Wall -Wno-strict-aliasing -std=gnu11 -g -I. -O0 -DBUILD_DIR='"/home/ondrej/repos/elvm/8cc"'   -c -o cpp.o cpp.c
cc -Wall -Wno-strict-aliasing -std=gnu11 -g -I. -O0 -DBUILD_DIR='"/home/ondrej/repos/elvm/8cc"'   -c -o debug.o debug.c
cc -Wall -Wno-strict-aliasing -std=gnu11 -g -I. -O0 -DBUILD_DIR='"/home/ondrej/repos/elvm/8cc"'   -c -o dict.o dict.c
cc -Wall -Wno-strict-aliasing -std=gnu11 -g -I. -O0 -DBUILD_DIR='"/home/ondrej/repos/elvm/8cc"'   -c -o gen.o gen.c
cc -Wall -Wno-strict-aliasing -std=gnu11 -g -I. -O0 -DBUILD_DIR='"/home/ondrej/repos/elvm/8cc"'   -c -o lex.o lex.c
cc -Wall -Wno-strict-aliasing -std=gnu11 -g -I. -O0 -DBUILD_DIR='"/home/ondrej/repos/elvm/8cc"'   -c -o vector.o vector.c
cc -Wall -Wno-strict-aliasing -std=gnu11 -g -I. -O0 -DBUILD_DIR='"/home/ondrej/repos/elvm/8cc"'   -c -o parse.o parse.c
cc -Wall -Wno-strict-aliasing -std=gnu11 -g -I. -O0 -DBUILD_DIR='"/home/ondrej/repos/elvm/8cc"'   -c -o buffer.o buffer.c
cc -Wall -Wno-strict-aliasing -std=gnu11 -g -I. -O0 -DBUILD_DIR='"/home/ondrej/repos/elvm/8cc"'   -c -o map.o map.c
cc -Wall -Wno-strict-aliasing -std=gnu11 -g -I. -O0 -DBUILD_DIR='"/home/ondrej/repos/elvm/8cc"'   -c -o error.o error.c
cc -Wall -Wno-strict-aliasing -std=gnu11 -g -I. -O0 -DBUILD_DIR='"/home/ondrej/repos/elvm/8cc"'   -c -o path.o path.c
cc -Wall -Wno-strict-aliasing -std=gnu11 -g -I. -O0 -DBUILD_DIR='"/home/ondrej/repos/elvm/8cc"'   -c -o file.o file.c
cc -Wall -Wno-strict-aliasing -std=gnu11 -g -I. -O0 -DBUILD_DIR='"/home/ondrej/repos/elvm/8cc"'   -c -o set.o set.c
cc -Wall -Wno-strict-aliasing -std=gnu11 -g -I. -O0 -DBUILD_DIR='"/home/ondrej/repos/elvm/8cc"'   -c -o encoding.o encoding.c
cc -o 8cc main.o cpp.o debug.o dict.o gen.o lex.o vector.o parse.o buffer.o map.o error.o path.o file.o set.o encoding.o 
make[1]: Leaving directory '/home/ondrej/repos/elvm/8cc'
cc -c -I. -std=gnu99 -m32 -W -Wall -W -Werror -MMD -MP -O -g -Wno-missing-field-initializers -Wno-missing-field-initializers ir/ir.c -o out/ir.o
In file included from /usr/include/stdio.h:27:0,
                 from ./ir/ir.h:4,
                 from ir/ir.c:1:
/usr/include/features.h:367:25: fatal error: sys/cdefs.h: No such file or directory
compilation terminated.
Makefile:62: recipe for target 'out/ir.o' failed
make: *** [out/ir.o] Error 1

解决方案:

sudo apt install libc6-dev-i386

标签: ubuntu, linux