dosemu2 / fdpp

FreeDOS plus-plus, 64bit DOS
GNU General Public License v3.0
198 stars 18 forks source link

Don't seem to be able to compile (maybe toolchain breakage) #223

Closed andrewbird closed 1 year ago

andrewbird commented 1 year ago

I'm seeing this (Ubuntu 22.04), but can't explain why it's only occurring now.

make[1]: Entering directory '/clients/common/fdpp.git/fdpp'
/clients/common/fdpp.git/fdpp/parsers/mkfar.sh /clients/common/fdpp.git/kernel/blockio.c >blockio.cc
/clients/common/fdpp.git/fdpp/parsers/mkasmdefs.sh /clients/common/fdpp.git/kernel/glob_asm.h >glob_asmdefs.h
clang++ -std=c++11 -c -fno-threadsafe-statics -fpic -iquote /clients/common/fdpp.git/fdpp/../hdr -DFDPP -DDEBUG -DWITHFAT32 -I . -I /clients/common/fdpp.git/include/fdpp -I /clients/common/fdpp.git/kernel -I /clients/common/fdpp.git/fdpp -DFDPPKRNLDIR=/clients/common/fdpp.git/inst/share/fdpp -DKRNL_ELFNAME=fdppkrnl.32.9.elf -DKRNL_MAP_NAME=fdppkrnl.32.9.map -DKERNEL_VERSION="1.6 [GIT: 1.6-149-gaf5afd3a]" -Wall -Wpacked -Werror=packed-non-pod -Wno-unknown-warning-option -ggdb3 -O2 -Wno-format-invalid-specifier -o blockio.o blockio.cc
In file included from blockio.cc:31:
In file included from /clients/common/fdpp.git/fdpp/../hdr/portab.h:167:
./farptr.hpp:22:10: fatal error: 'type_traits' file not found
#include <type_traits>
         ^~~~~~~~~~~~~
1 error generated.
make[1]: *** [makefile:172: blockio.o] Error 1
make[1]: Leaving directory '/clients/common/fdpp.git/fdpp'
make: *** [makefile:13: all] Error 2

I tried checking out a revision where I know it compiled before, but the problem persists. I looked at the apt log to see if clang got upgraded, but not for a month it seems.

$ dpkg -S /usr/include/c++/11/type_traits
libstdc++-11-dev:amd64: /usr/include/c++/11/type_traits

Ideas?

stsp commented 1 year ago

Its not happening on lp, so its your problem. You need to see with strace where does it look for a header.

andrewbird commented 1 year ago

Just posting this while I have it. I have to go out now.

openat(AT_FDCWD, "./type_traits", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/clients/common/fdpp.git/include/fdpp/type_traits", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/clients/common/fdpp.git/kernel/type_traits", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/type_traits", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/llvm-14/lib/clang/14.0.0/include/type_traits", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/include/type_traits", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/include/x86_64-linux-gnu/type_traits", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/include/type_traits", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/clients/common/fdpp.git/fdpp/../hdr/type_traits", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stsp commented 1 year ago

Any progress?

andrewbird commented 1 year ago

I'm busy with other things for the summer, so perhaps when I finally get back to it, it'll be fixed by magic somehow.

andrewbird commented 1 year ago

It seems I now need to install the libstdc++-12-dev package, not sure why. Anyway with that installed it now compiles

stsp commented 1 year ago

I think there is a build-essential package that installs those.

andrewbird commented 1 year ago

It was compiling fine in the past, then after one apt update;apt full-upgrade;apt autoremove cycle it started to fail. I can only imagine that libstdc++-12-dev was a dependency of some old package but not of its new revision and the apt autoremove tidied it away.

stsp commented 1 year ago
$ dpkg-query -s clang-15
Package: clang-15
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 361
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Source: llvm-toolchain-15
Version: 1:15.0.7-3
Provides: c++-compiler, c-compiler, objc-compiler
Depends: libc6 (>= 2.34), libclang-cpp15 (>= 1:15.0.7), libgcc-s1 (>= 3.0), libllvm15, libstdc++6 (>= 11), libstdc++-12-dev, libgcc-12-dev, libobjc-12-dev, libclang-common-15-dev (= 1:15.0.7-3), llvm-15-linker-tools (= 1:15.0.7-3), libclang1-15 (= 1:15.0.7-3), libc6-dev, binutils

So its a dep of clang.

andrewbird commented 1 year ago

Not sure why mine is different.

root@calypso:~# dpkg-query -s clang-15
Package: clang-15
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 380
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Source: llvm-toolchain-15
Version: 1:15.0.7-0ubuntu0.22.04.1
Provides: c++-compiler, c-compiler, objc-compiler
Depends: libc6 (>= 2.34), libclang-cpp15 (>= 1:15.0.7), libgcc-s1 (>= 3.0), libllvm15, libstdc++6 (>= 11), libstdc++-11-dev, libgcc-11-dev, libobjc-11-dev, libclang-common-15-dev (= 1:15.0.7-0ubuntu0.22.04.1), llvm-15-linker-tools (= 1:15.0.7-0ubuntu0.22.04.1), libclang1-15 (= 1:15.0.7-0ubuntu0.22.04.1), libc6-dev, binutils
Recommends: llvm-15-dev, python3
Suggests: clang-15-doc, wasi-libc
Description: C, C++ and Objective-C compiler
 Clang project is a C, C++, Objective C and Objective C++ front-end
 based on the LLVM compiler. Its goal is to offer a replacement to the
 GNU Compiler Collection (GCC).
 .
 Clang implements all of the ISO C++ 1998, 11, 14 and 17 standards and also
 provides most of the support of C++20.
Original-Maintainer: LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Homepage: https://www.llvm.org/
stsp commented 1 year ago

Mine is 23.04. So the packages are different, but your clang also refers to libstdc++-dev. See

ls -l `which clang`

, maybe its not referring to clang-15, but rather 14.

andrewbird commented 1 year ago
root@calypso:~# ls -l `which clang`
lrwxrwxrwx 1 root root 24 Apr  1  2022 /usr/bin/clang -> ../lib/llvm-14/bin/clang

root@calypso:~# /usr/bin/clang --version
Ubuntu clang version 14.0.0-1ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

root@calypso:~# dpkg-query -s clang-14
Package: clang-14
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 366
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Source: llvm-toolchain-14
Version: 1:14.0.0-1ubuntu1
Provides: c++-compiler, c-compiler, objc-compiler
Depends: libc6 (>= 2.34), libclang-cpp14 (>= 1:14.0.0), libgcc-s1 (>= 3.0), libllvm14, libstdc++6 (>= 11), libstdc++-11-dev, libgcc-11-dev, libobjc-11-dev, libclang-common-14-dev (= 1:14.0.0-1ubuntu1), llvm-14-linker-tools (= 1:14.0.0-1ubuntu1), libclang1-14 (= 1:14.0.0-1ubuntu1), libc6-dev, binutils
Recommends: llvm-14-dev, python3
Suggests: clang-14-doc
Description: C, C++ and Objective-C compiler
 Clang project is a C, C++, Objective C and Objective C++ front-end
 based on the LLVM compiler. Its goal is to offer a replacement to the
 GNU Compiler Collection (GCC).
 .
 Clang implements all of the ISO C++ 1998, 11, 14 and 17 standards and also
 provides most of the support of C++20.
Homepage: https://www.llvm.org/
Original-Maintainer: LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>

root@calypso:~# dpkg -L libstdc++-11-dev | grep type_traits
/usr/include/c++/11/bits/cpp_type_traits.h
/usr/include/c++/11/experimental/type_traits
/usr/include/c++/11/ext/type_traits.h
/usr/include/c++/11/tr1/type_traits
/usr/include/c++/11/tr2/type_traits
/usr/include/c++/11/type_traits

But as we saw https://github.com/dosemu2/fdpp/issues/223#issuecomment-1541553618 earlier, clang seems to be looking for version 12, not 11. Anyway not to worry about chasing this down, like I mentioned earlier in the thread I have very little time at the moment, so whatever the root cause is it'll probably be fixed by the time I get back to dosemu/fdpp fiddling.