Your message dated Wed, 06 May 2026 20:55:01 +0200
with message-id <[email protected]>
and subject line Fixed in 5.0.1-1
has caused the Debian Bug report #1068635,
regarding screen FTCBFS: pty.c:338:7: error: implicit declaration of function 
‘openpty’; did you mean ‘OpenPTY’? [-Werror=implicit-function-declaration]
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1068635: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1068635
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: screen
Version: 4.9.1-1
Tags: patch upstream
User: [email protected]
Usertags: ftcbfs

Hi,

screen fails to cross build from source:

| mips64el-linux-gnuabi64-gcc -c -I. -I..  -Wdate-time -D_FORTIFY_SOURCE=2 
-DETCSCREENRC='"/etc/screenrc"' 
-DSCREENENCODINGS='"/usr/share/screen/utf8encodings"' -DHAVE_CONFIG_H 
-DGIT_REV=\"\" \
|      -g -O2 -Werror=implicit-function-declaration 
-ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat 
-Werror=format-security -Wall -Wextra -Wno-unused-parameter 
-Wno-missing-field-initializers -D_GNU_SOURCE ../pty.c
| ../pty.c: In function ‘OpenPTY’:
| ../pty.c:338:7: error: implicit declaration of function ‘openpty’; did you 
mean ‘OpenPTY’? [-Werror=implicit-function-declaration]
|   338 |   if (openpty(&f, &s, TtyName, NULL, NULL) != 0)
|       |       ^~~~~~~
|       |       OpenPTY

The real cause here is that screen exercises a non-standard code path
due to configure time misdetection. It skips the SVR4 /dev/ptmx check in
cross compilation and directly falls back to openpty, which apparently
no longer works.

The "test -c /dev/ptmx" is conditionalized to not being performed during
cross compilation and doing it there would be confusing build and host.
However, AC_CHECK_FILE exists for this very purpose. During native
compilation, it becomes a simple test and during cross compilation it
becomes a hard failure where a user must supply the check result. Then
also supplying the result makes screen cross buildable again. I'm
attaching a patch for your convenience.

Note that with this patch applied, crossqa.debian.net will always
report screen as failed, because it does not supply this check result.
If you want to do this explicitly, you may add the following snippet to
d/rules:

    ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
    ifeq ($(DEB_HOST_ARCH_OS),linux)
    export ac_cv_file__dev_ptmx = yes
    endif
    endif

Or you may leave this to the builder at your choice, but there is no
sane way to detect this during build.

Helmut
--- screen-4.9.1.orig/configure.ac
+++ screen-4.9.1/configure.ac
@@ -756,10 +756,10 @@
 fi
 fi
 
-if test "$cross_compiling" = no ; then
+AC_CHECK_FILE([/dev/ptmx])
 AC_CHECKING(for SVR4 ptys)
 sysvr4ptys=
-if test -c /dev/ptmx ; then
+if test "x$ac_cv_file__dev_ptmx" = xyes ; then
 AC_TRY_LINK([
     #include <stdlib.h>
 ], [
@@ -767,7 +767,6 @@
 ],[AC_DEFINE(HAVE_SVR4_PTYS)
 sysvr4ptys=1])
 fi
-fi
 
 AC_CHECK_FUNCS(getpt)
 

--- End Message ---
--- Begin Message ---
Version: 5.0.1-1
Tags: upstream
Forwarded: https://savannah.gnu.org/bugs/?68134

5.0.1-1 now carries debian/patches/90-include-pty-header-when-openpty.patch, which ensures openpty() is properly declared/visible in the OpenPTY code path
(including glibc builds with -Werror=implicit-function-declaration).

Forwarded upstream.

Thanks for the report and analysis.

--- End Message ---

Reply via email to