mk install: fatal error: sys/cdefs.h: No such file or directory

60 views
Skip to first unread message

Paul Dufresne

unread,
Jun 26, 2021, 10:41:16 AM6/26/21
to inferno-os
paul@kasparno:/inferno$ LANG=C mk install
(cd lib9; mk  install)
/inferno/Linux/386/lib/lib9.a doesn't exist: assuming it will be an archive
cc -c -m32 -g -O -Wuninitialized -Wunused-variable -Wreturn-type -Wimplicit -I/inferno/Linux/386/include -I/inferno/include -DLINUX_386 convD2M.c
In file included from /inferno/Linux/386/include/lib9.h:13,
                 from convD2M.c:1:
/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
  187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
      |   ^~~~~~~
/usr/include/features.h:469:12: fatal error: sys/cdefs.h: No such file or directory
  469 | #  include <sys/cdefs.h>
      |            ^~~~~~~~~~~~~
compilation terminated.
mk: cc -c -m32 ...  : exit status=exit(1)
mk: for j in ...  : exit status=exit(1)

Paul Dufresne

unread,
Jun 26, 2021, 10:54:23 AM6/26/21
to inferno-os
Fixed in Ubuntu (21.04 probably many more) by:
sudo apt install libc6-dev-i386

I now get the familiar for me (but I am unsure if CFLAGS -std=C89 will help or need an older version of gcc (currently 10.2):
/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
  187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
      |   ^~~~~~~
/usr/bin/ld: kproc-pthreads.o:/inferno/emu/Linux/../port/fns.h:23: multiple definition of `coherence'; os.o:/inferno/emu/Linux/../port/fns.h:23: first defined here
/usr/bin/ld: lock.o:/inferno/emu/Linux/../port/fns.h:23: multiple definition of `coherence'; os.o:/inferno/emu/Linux/../port/fns.h:23: first defined here
/usr/bin/ld: ipif6-posix.o:/inferno/emu/Linux/../port/fns.h:23: multiple definition of `coherence'; os.o:/inferno/emu/Linux/../port/fns.h:23: first defined here
/usr/bin/ld: cmd.o:/inferno/emu/Linux/../port/fns.h:23: multiple definition of `coherence'; os.o:/inferno/emu/Linux/../port/fns.h:23: first defined here
/usr/bin/ld: devmnt.o:/inferno/emu/Linux/../port/fns.h:23: multiple definition of `coherence'; os.o:/inferno/emu/Linux/../port/fns.h:23: first defined here
/usr/bin/ld: win-x11a.o:/inferno/emu/Linux/../port/fns.h:23: multiple definition of `coherence'; os.o:/inferno/emu/Linux/../port/fns.h:23: first defined here
[...]
and semi expected:
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libX11.so when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libX11.a when searching for -lX11
/usr/bin/ld: cannot find -lX11
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libX11.so when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libXext.so when searching for -lXext
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libXext.a when searching for -lXext
/usr/bin/ld: cannot find -lXext
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libXext.so when searching for -lXext
I had not found the requested: libext-dev package... need to find an alternative

Paul Dufresne

unread,
Jun 26, 2021, 11:23:03 AM6/26/21
to inferno-os
the -lX11 and -Xext problem are solved by:
 sudo apt install libx11-dev:i386
sudo apt install libxext-dev:i386

the multiple definition I encountered about 2 or 3 days ago in very different situation:
... which was finally fixed by compiling with a gcc version 4 I think...

where the root cause is the way inline functions are declared (old way rather than more recent way)
not clear, because I don't remember exactly the web page I did read.

Reply all
Reply to author
Forward
0 new messages