Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSYS UCRT64 (or MINGW64) fails to compile, missing /usr/include/sys headers, even if set correctly in Makefile #4986

Open
1 task done
eabase opened this issue Nov 3, 2024 · 7 comments
Labels

Comments

@eabase
Copy link

eabase commented Nov 3, 2024

Description / Steps to reproduce the issue

git clone https://github.com/picocom-ng/picocom.git
cd picocom

# Edit Makefile, and add the following lines:
EXTRA_CPPFLAGS += -I/usr/include

# Run make with:
CPPFLAGS=-DNO_CUSTOM_BAUD make

I'm tried to compile this in both UCRT64 and MINGW64 environments, and keep running into the same weird problem.

In the Makefile I add the header library path with:
EXTRA_CPPFLAGS += -I/usr/include/sys

Running make, results in:

# make

#----------------------------------------------- VVVVVVVVVVVVVVVVVV  -----------------------------
cc -Wall -g  -DVERSION_STR=\"v4.0.3-0-gd0946cd\" -I/usr/include/sys -DTTY_Q_SZ=0 -DCONFIGFILE -DHIGH_BAUD -DUUCP_LOCK_DIR=\"/var/lock\" -DHISTFILE=\".picocom_history\" -DLINENOISE -DNO_CUSTOM_BAUD -o picocom.o -c picocom.c
In file included from C:/msys64/ucrt64/lib/gcc/x86_64-w64-mingw32/14.2.0/include/mm_malloc.h:29,
                 from C:/msys64/ucrt64/include/malloc.h:85,
                 from C:/msys64/ucrt64/include/stdlib.h:656,
                 from picocom.c:21:
C:/msys64/usr/include/sys/errno.h:11:10: fatal error: sys/reent.h: No such file or directory
   11 | #include <sys/reent.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:118: picocom.o] Error 1

Yet at compile time the complaint is that it is missing, which is impossible!

Expected behavior

make recognizes the path to the header files and compiles without error

Actual behavior

make spits out error saying it can't find sys/reent.h, eventhough a few lines above it has the directory included.

Verification

Windows Version

MINGW64_NT-10.0-22631

Are you willing to submit a PR?

no

@eabase eabase added the bug label Nov 3, 2024
@Biswa96
Copy link
Member

Biswa96 commented Nov 3, 2024

Please do not mix MINGW/UCRT/CLANG environments with MSYS one. Use either one of those.

@eabase
Copy link
Author

eabase commented Nov 3, 2024

@Biswa96

Please do not mix MINGW/UCRT/CLANG environments with MSYS one. Use either one of those.

Hi Biswapriyo,
Yes I know that is the standard answer here, but I am not mixing anything AFAIK. So if you see something indicating that I am mixing something up, please tell me what it is. I try to only use the UCRT64 shell (as stated to be preferred on the MSYS web pages), and believe I have installed the correct dependencies. I do the above, and that's the error.

In regard to this, how can I determine what shell is best to use, for a particular repo/project?


At the end of the day, if people actually know how to compile things without relying on prepackaged Makefile scripts embedded in VS, Docker or Conda and the like, it should be obvious how to fix the dependencies.

@Biswa96
Copy link
Member

Biswa96 commented Nov 3, 2024

If that project support native Windows platform use ucrt64 else use msys.

@eabase
Copy link
Author

eabase commented Nov 3, 2024

@Biswa96
Cool, but how do I know if it "supports native Windows" platform? Clearly today out-of-the-box (OOTB), it doesn't, even though it did in the distant past. I recall compiling this OOTB in Cygwin about 8 years ago... So it need to be ported back, hopefully with UCRT64.

@Biswa96
Copy link
Member

Biswa96 commented Nov 3, 2024

how do I know if it "supports native Windows" platform?

The project will only uses APIs provided in Windows system. picocom does not support native Windows platform because it requires POSIX APIs. Try to compile the project in msys environment.

@eabase
Copy link
Author

eabase commented Nov 3, 2024

The project will only uses APIs provided in Windows system.

Which "APIs"? There shouldn't be any Windows APIs in the picocom project.

Try to compile the project in MSYS environment.

Are you sure? There are no compilers installed OOTB in MSYS. So which one should be installed there?

And from a technical perspective, what is preventing it from being compiled in UCRT64?
(I still don't understand the error message in OP.)

@eabase
Copy link
Author

eabase commented Nov 5, 2024

@Biswa96
I have the following packages installed and using UCRT64. I tried to follow all your documentation pages on how to install properly, but I'm obviously doing something wrong (or have installed something wrong) since my compile doesn't work.

Below is my pacman -Q list.
Do you see any packages that should not be there?
Do you see any missing packages?

Click to Show Package List
# pacman -Q

base 2022.06-1
base-devel 2022.12-2
bash 5.2.037-1
bash-completion 2.14.0-1
binutils 2.43.1-1
bison 3.8.2-5
brotli 1.1.0-1
bsdtar 3.7.7-1
bzip2 1.0.8-4
ca-certificates 20240203-2
coreutils 8.32-5
curl 8.10.1-1
dash 0.5.12-1
db 6.2.32-5
diffstat 1.66-1
diffutils 3.10-1
dos2unix 7.5.2-1
file 5.45-3
filesystem 2023.02.07-2
findutils 4.10.0-2
flex 2.6.4-3
gawk 5.3.1-1
gcc-libs 13.3.0-1
gdbm 1.24-1
getent 2.18.90-4
gettext 0.22.4-1
gmp 6.3.0-1
gnupg 2.4.5-1
grep 1~3.0-6
gzip 1.13-1
heimdal-libs 7.8.0-5
inetutils 2.5-2
info 7.1.1-1
less 661-1
libargp 20110921-4
libasprintf 0.22.4-1
libassuan 2.5.7-1
libbz2 1.0.8-4
libcurl 8.10.1-1
libdb 6.2.32-5
libedit 20240517_3.1-1
libevent 2.1.12-4
libexpat 2.6.3-1
libffi 3.4.6-1
libgcrypt 1.11.0-1
libgdbm 1.24-1
libgettextpo 0.22.4-1
libgnutls 3.8.7-1
libgpg-error 1.50-1
libgpgme 1.23.2-5
libhogweed 3.10-1
libiconv 1.17-1
libidn2 2.3.7-1
libintl 0.22.4-1
libksba 1.6.7-1
liblz4 1.10.0-1
liblzma 5.6.3-1
libnettle 3.10-1
libnghttp2 1.63.0-1
libnpth 1.7-1
libopenssl 3.3.2-1
libp11-kit 0.25.5-2
libpcre 8.45-4
libpcre2_8 10.44-1
libpsl 0.21.5-2
libreadline 8.2.013-1
libsqlite 3.46.1-1
libssh2 1.11.0-1
libtasn1 4.19.0-1
libunistring 1.2-1
libutil-linux 2.35.2-4
libxcrypt 4.4.36-1
libzstd 1.5.6-1
m4 1.4.19-2
make 4.4.1-2
mingw-w64-ucrt-x86_64-binutils 2.43.1-1
mingw-w64-ucrt-x86_64-boost 1.86.0-5
mingw-w64-ucrt-x86_64-bzip2 1.0.8-3
mingw-w64-ucrt-x86_64-crt-git 12.0.0.r360.gac299df46-1
mingw-w64-ucrt-x86_64-expat 2.6.3-1
mingw-w64-ucrt-x86_64-fzf 0.55.0-1
mingw-w64-ucrt-x86_64-gcc 14.2.0-1
mingw-w64-ucrt-x86_64-gcc-libs 14.2.0-1
mingw-w64-ucrt-x86_64-gdb 15.2-1
mingw-w64-ucrt-x86_64-gdb-multiarch 15.2-1
mingw-w64-ucrt-x86_64-gettext-runtime 0.22.5-2
mingw-w64-ucrt-x86_64-gmp 6.3.0-2
mingw-w64-ucrt-x86_64-headers-git 12.0.0.r360.gac299df46-1
mingw-w64-ucrt-x86_64-icu 75.1-2
mingw-w64-ucrt-x86_64-isl 0.27-1
mingw-w64-ucrt-x86_64-libffi 3.4.6-1
mingw-w64-ucrt-x86_64-libiconv 1.17-4
mingw-w64-ucrt-x86_64-libmangle-git 12.0.0.r360.gac299df46-1
mingw-w64-ucrt-x86_64-libsystre 1.0.1-6
mingw-w64-ucrt-x86_64-libtre 0.9.0-1
mingw-w64-ucrt-x86_64-libwinpthread-git 12.0.0.r360.gac299df46-1
mingw-w64-ucrt-x86_64-make 4.4.1-3
mingw-w64-ucrt-x86_64-mpc 1.3.1-2
mingw-w64-ucrt-x86_64-mpdecimal 4.0.0-1
mingw-w64-ucrt-x86_64-mpfr 4.2.1-2
mingw-w64-ucrt-x86_64-ncurses 6.5.20240831-1
mingw-w64-ucrt-x86_64-openssl 3.3.2-1
mingw-w64-ucrt-x86_64-pkgconf 1~2.3.0-1
mingw-w64-ucrt-x86_64-python 3.11.10-1
mingw-w64-ucrt-x86_64-readline 8.2.013-1
mingw-w64-ucrt-x86_64-source-highlight 3.1.9-5
mingw-w64-ucrt-x86_64-sqlite3 3.46.1-1
mingw-w64-ucrt-x86_64-tcl 8.6.13-1
mingw-w64-ucrt-x86_64-termcap 1.3.1-7
mingw-w64-ucrt-x86_64-tk 8.6.13-1
mingw-w64-ucrt-x86_64-tools-git 12.0.0.r360.gac299df46-1
mingw-w64-ucrt-x86_64-tzdata 2024b-1
mingw-w64-ucrt-x86_64-windows-default-manifest 6.4-4
mingw-w64-ucrt-x86_64-winpthreads-git 12.0.0.r360.gac299df46-1
mingw-w64-ucrt-x86_64-winstorecompat-git 12.0.0.r360.gac299df46-1
mingw-w64-ucrt-x86_64-xxhash 0.8.2-2
mingw-w64-ucrt-x86_64-xz 5.6.3-1
mingw-w64-ucrt-x86_64-zlib 1.3.1-1
mingw-w64-ucrt-x86_64-zstd 1.5.6-2
mingw-w64-x86_64-binutils 2.43.1-1
mingw-w64-x86_64-brotli 1.1.0-2
mingw-w64-x86_64-bzip2 1.0.8-3
mingw-w64-x86_64-c-ares 1.34.2-1
mingw-w64-x86_64-ca-certificates 20240203-1
mingw-w64-x86_64-cmake 3.30.5-1
mingw-w64-x86_64-cppdap 1.65-1
mingw-w64-x86_64-crt-git 12.0.0.r360.gac299df46-1
mingw-w64-x86_64-curl 8.10.1-1
mingw-w64-x86_64-expat 2.6.3-1
mingw-w64-x86_64-fzf 0.55.0-1
mingw-w64-x86_64-gcc 14.2.0-1
mingw-w64-x86_64-gcc-libs 14.2.0-1
mingw-w64-x86_64-gdb 15.2-1
mingw-w64-x86_64-gdb-multiarch 15.2-1
mingw-w64-x86_64-gettext-runtime 0.22.5-2
mingw-w64-x86_64-gmp 6.3.0-2
mingw-w64-x86_64-headers-git 12.0.0.r360.gac299df46-1
mingw-w64-x86_64-isl 0.27-1
mingw-w64-x86_64-jsoncpp 1.9.6-1
mingw-w64-x86_64-libarchive 3.7.7-1
mingw-w64-x86_64-libb2 0.98.1-2
mingw-w64-x86_64-libffi 3.4.6-1
mingw-w64-x86_64-libiconv 1.17-4
mingw-w64-x86_64-libidn2 2.3.7-2
mingw-w64-x86_64-libmangle-git 12.0.0.r360.gac299df46-1
mingw-w64-x86_64-libpsl 0.21.5-2
mingw-w64-x86_64-libssh2 1.11.0-2
mingw-w64-x86_64-libsystre 1.0.1-6
mingw-w64-x86_64-libtasn1 4.19.0-1
mingw-w64-x86_64-libtre 0.9.0-1
mingw-w64-x86_64-libunistring 1.2-1
mingw-w64-x86_64-libuv 1.49.2-1
mingw-w64-x86_64-libwinpthread-git 12.0.0.r360.gac299df46-1
mingw-w64-x86_64-lz4 1.10.0-1
mingw-w64-x86_64-make 4.4.1-3
mingw-w64-x86_64-mpc 1.3.1-2
mingw-w64-x86_64-mpdecimal 4.0.0-1
mingw-w64-x86_64-mpfr 4.2.1-2
mingw-w64-x86_64-ncurses 6.5.20240831-1
mingw-w64-x86_64-nghttp2 1.63.0-1
mingw-w64-x86_64-nghttp3 1.6.0-1
mingw-w64-x86_64-ninja 1.12.1-1
mingw-w64-x86_64-openssl 3.3.2-1
mingw-w64-x86_64-p11-kit 0.25.5-1
mingw-w64-x86_64-pkgconf 1~2.3.0-1
mingw-w64-x86_64-python 3.11.10-1
mingw-w64-x86_64-readline 8.2.013-1
mingw-w64-x86_64-rhash 1.4.4-3
mingw-w64-x86_64-sqlite3 3.46.1-1
mingw-w64-x86_64-tcl 8.6.13-1
mingw-w64-x86_64-termcap 1.3.1-7
mingw-w64-x86_64-tk 8.6.13-1
mingw-w64-x86_64-tools-git 12.0.0.r360.gac299df46-1
mingw-w64-x86_64-tzdata 2024b-1
mingw-w64-x86_64-windows-default-manifest 6.4-4
mingw-w64-x86_64-winpthreads-git 12.0.0.r360.gac299df46-1
mingw-w64-x86_64-winstorecompat-git 12.0.0.r360.gac299df46-1
mingw-w64-x86_64-xxhash 0.8.2-2
mingw-w64-x86_64-xz 5.6.3-1
mingw-w64-x86_64-zlib 1.3.1-1
mingw-w64-x86_64-zstd 1.5.6-2
mintty 1~3.7.6-1
mpfr 4.2.1-1
msys2-keyring 1~20241007-1
msys2-launcher 1.5-2
msys2-runtime 3.5.4-2
msys2-runtime-devel 3.5.4-2
nano 8.2-1
ncurses 6.5.20240831-2
nettle 3.10-1
openssl 3.3.2-1
p11-kit 0.25.5-2
pacman 6.1.0-8
pacman-contrib 1.10.6-1
pacman-mirrors 20240523-1
patch 2.7.6-2
perl 5.38.2-2
pinentry 1.3.1-1
pkgconf 2.3.0-1
rebase 4.5.0-4
sed 4.9-1
tar 1.35-2
texinfo 7.1.1-1
texinfo-tex 7.1.1-1
time 1.9-3
tmux 3.5.a-1
tree 2.1.3-1
tzcode 2024a-1
util-linux 2.35.2-4
wget 1.24.5-2
which 2.21-4
xz 5.6.3-1
zlib 1.3.1-1
zstd 1.5.6-1
#

The tools show up at:

------------------------------
 Installed Development Tools
------------------------------
/ucrt64/bin/cc
/ucrt64/bin/cpp
/ucrt64/bin/c++
/ucrt64/bin/g++
/usr/bin/make
/ucrt64/bin/ld
/usr/bin/ldd
/ucrt64/bin/pkgconf

If not convinced, please try to compile (make) any of these yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants