unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#68842: 29.2; implicit declaration of function 'XOpenDisplay'
@ 2024-01-31  8:03 Ulrich Müller
  2024-01-31 17:26 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Ulrich Müller @ 2024-01-31  8:03 UTC (permalink / raw)
  To: 68842

[-- Attachment #1: Type: text/plain, Size: 5125 bytes --]

configure warns about an implicit function declaration for XOpenDisplay,
which in turn triggers a QA warning in Gentoo's package manager.

The relevant snippet from configure.log is:

configure:14158: checking whether X on GNU/Linux needs -b to link
configure:14175: x86_64-pc-linux-gnu-gcc -o conftest  -march=native -ggdb -O2 -pipe     -Wl,-O1 -Wl,--as-needed  conftest.c -lX11   >&5 
conftest.c: In function 'main':
conftest.c:125:1: warning: implicit declaration of function 'XOpenDisplay' [-Wimplicit-function-declaration]
  125 | XOpenDisplay ("foo");
      | ^~~~~~~~~~~~
configure:14175: $? = 0
configure:14223: result: no

Attached patch fixes the problem for me. Is it OK to merge it to the
emacs-29 branch? (In master, the test in question was removed altogether
by commit 6c1413d5ef0d1fea639b0d8c83a0c0065d99359b.)


In GNU Emacs 29.2 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.18.0) of 2024-01-19 built on localhost
Windowing system distributor 'The X.Org Foundation', version 11.0.12101011
System Description: Gentoo Linux

Configured using:
 'configure --prefix=/usr --build=x86_64-pc-linux-gnu
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --datarootdir=/usr/share
 --disable-silent-rules --docdir=/usr/share/doc/emacs-29.2
 --htmldir=/usr/share/doc/emacs-29.2/html --libdir=/usr/lib64
 --program-suffix=-emacs-29 --includedir=/usr/include/emacs-29
 --infodir=/usr/share/info/emacs-29 --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --without-compress-install --without-hesiod --without-pop
 --with-file-notification=inotify --with-pdumper --enable-acl
 --with-dbus --with-modules --with-gameuser=:gamestat --with-libgmp
 --with-gpm --without-native-compilation --without-json
 --without-kerberos --without-kerberos5 --with-lcms2 --with-xml2
 --without-mailutils --without-selinux --with-small-ja-dic
 --without-sqlite3 --with-gnutls --without-libsystemd --with-threads
 --without-tree-sitter --without-wide-int --with-sound=alsa --with-zlib
 --with-x --without-pgtk --without-ns --without-gconf --with-gsettings
 --without-toolkit-scroll-bars --with-xpm --with-xft --with-cairo
 --with-harfbuzz --with-libotf --with-m17n-flt --with-x-toolkit=lucid
 --with-xaw3d --with-gif --with-jpeg --with-png --with-rsvg --with-tiff
 --without-webp --with-imagemagick --with-dumping=pdumper
 'CFLAGS=-march=native -ggdb -O2 -pipe' 'LDFLAGS=-Wl,-O1
 -Wl,--as-needed''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG LCMS2 LIBOTF LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY
PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF X11 XAW3D XDBE XIM XINPUT2
XPM LUCID ZLIB

Important settings:
  value of $LC_CTYPE: en_GB.UTF-8
  value of $LC_TIME: en_GB.UTF-8
  value of $LANG: POSIX
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo x-toolkit
xinput2 x multi-tty make-network-process emacs)

Memory information:
((conses 16 37361 8954)
 (symbols 48 5129 0)
 (strings 32 14103 1583)
 (string-bytes 1 387374)
 (vectors 16 9311)
 (vector-slots 8 148873 16424)
 (floats 8 35 21)
 (intervals 56 348 0)
 (buffers 976 12))

[-- Attachment #2: 0001-configure.ac-Include-X11-Xlib.h-for-XOpenDisplay.patch --]
[-- Type: text/plain, Size: 1210 bytes --]

From bf9c28e82662dc406ce3a3d5d097c8a6f1fb6bd8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@gentoo.org>
Date: Wed, 31 Jan 2024 08:49:36 +0100
Subject: [PATCH] * configure.ac: Include X11/Xlib.h for XOpenDisplay.

Do not merge to master.
---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 78d5475f75a..34a5a89bea9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2697,7 +2697,7 @@ AC_DEFUN
 
   if test "${opsys}" = "gnu-linux"; then
     AC_CACHE_CHECK([whether X on GNU/Linux needs -b to link], [emacs_cv_b_link],
-    [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
+    [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>]],
      [[XOpenDisplay ("foo");]])],
      [xgnu_linux_first_failure=no],
      [xgnu_linux_first_failure=yes])
@@ -2706,7 +2706,7 @@ AC_DEFUN
       OLD_LIBS="$LIBS"
       CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
       LIBS="$LIBS -b i486-linuxaout"
-      AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>]],
        [[XOpenDisplay ("foo");]])],
        [xgnu_linux_second_failure=no],
        [xgnu_linux_second_failure=yes])
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* bug#68842: 29.2; implicit declaration of function 'XOpenDisplay'
  2024-01-31  8:03 bug#68842: 29.2; implicit declaration of function 'XOpenDisplay' Ulrich Müller
@ 2024-01-31 17:26 ` Eli Zaretskii
  2024-01-31 19:16   ` Ulrich Mueller
  2024-02-01  1:56   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 10+ messages in thread
From: Eli Zaretskii @ 2024-01-31 17:26 UTC (permalink / raw)
  To: Ulrich Müller, Po Lu; +Cc: 68842

> From: Ulrich Müller <ulm@gentoo.org>
> Date: Wed, 31 Jan 2024 09:03:29 +0100
> 
> configure warns about an implicit function declaration for XOpenDisplay,
> which in turn triggers a QA warning in Gentoo's package manager.
> 
> The relevant snippet from configure.log is:
> 
> configure:14158: checking whether X on GNU/Linux needs -b to link
> configure:14175: x86_64-pc-linux-gnu-gcc -o conftest  -march=native -ggdb -O2 -pipe     -Wl,-O1 -Wl,--as-needed  conftest.c -lX11   >&5 
> conftest.c: In function 'main':
> conftest.c:125:1: warning: implicit declaration of function 'XOpenDisplay' [-Wimplicit-function-declaration]
>   125 | XOpenDisplay ("foo");
>       | ^~~~~~~~~~~~
> configure:14175: $? = 0
> configure:14223: result: no
> 
> Attached patch fixes the problem for me. Is it OK to merge it to the
> emacs-29 branch? (In master, the test in question was removed altogether
> by commit 6c1413d5ef0d1fea639b0d8c83a0c0065d99359b.)

Po Lu, any comments to the patch?

I don't mind installing this on emacs-29, if it's TRT, but the chances
for us to have another Emacs 29.x release are slim at best at this
point.  So I wonder whether you should bother.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#68842: 29.2; implicit declaration of function 'XOpenDisplay'
  2024-01-31 17:26 ` Eli Zaretskii
@ 2024-01-31 19:16   ` Ulrich Mueller
  2024-01-31 19:32     ` Eli Zaretskii
  2024-02-01  1:56   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 10+ messages in thread
From: Ulrich Mueller @ 2024-01-31 19:16 UTC (permalink / raw)
  To: 68842; +Cc: Po Lu, Eli Zaretskii

Alternatively, commit 6c1413d5ef0d1fea639b0d8c83a0c0065d99359b could be
cherry-picked from master (which of course would be a more intrusive
change).

GCC has dropped option -b in version 4.6.0, which was released in 2011.
So that test isn't functional since a long time.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#68842: 29.2; implicit declaration of function 'XOpenDisplay'
  2024-01-31 19:16   ` Ulrich Mueller
@ 2024-01-31 19:32     ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2024-01-31 19:32 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: luangruo, 68842

> From: Ulrich Mueller <ulm@gentoo.org>
> Cc: Eli Zaretskii <eliz@gnu.org>, Po Lu <luangruo@yahoo.com>
> Date: Wed, 31 Jan 2024 20:16:08 +0100
> 
> Alternatively, commit 6c1413d5ef0d1fea639b0d8c83a0c0065d99359b could be
> cherry-picked from master (which of course would be a more intrusive
> change).
> 
> GCC has dropped option -b in version 4.6.0, which was released in 2011.
> So that test isn't functional since a long time.

I'd rather not remove support for some configuration, however ancient,
from the release branch.  That is not the kind of changes we are
supposed to make on that branch.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#68842: 29.2; implicit declaration of function 'XOpenDisplay'
  2024-01-31 17:26 ` Eli Zaretskii
  2024-01-31 19:16   ` Ulrich Mueller
@ 2024-02-01  1:56   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-02-01  7:38     ` Eli Zaretskii
  1 sibling, 1 reply; 10+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-02-01  1:56 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Ulrich Müller, 68842

Eli Zaretskii <eliz@gnu.org> writes:

> Po Lu, any comments to the patch?
>
> I don't mind installing this on emacs-29, if it's TRT, but the chances
> for us to have another Emacs 29.x release are slim at best at this
> point.  So I wonder whether you should bother.

I suggest cherry-picking 6c1413d5ef0d1fea639b0d8c83a0c0065d99359b
instead, because the systems where this flag is required have lapsed out
of existence.  It can't hurt.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#68842: 29.2; implicit declaration of function 'XOpenDisplay'
  2024-02-01  1:56   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-02-01  7:38     ` Eli Zaretskii
  2024-02-01  8:36       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2024-02-01  7:38 UTC (permalink / raw)
  To: Po Lu; +Cc: ulm, 68842

> From: Po Lu <luangruo@yahoo.com>
> Cc: Ulrich Müller <ulm@gentoo.org>,  68842@debbugs.gnu.org
> Date: Thu, 01 Feb 2024 09:56:59 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Po Lu, any comments to the patch?
> >
> > I don't mind installing this on emacs-29, if it's TRT, but the chances
> > for us to have another Emacs 29.x release are slim at best at this
> > point.  So I wonder whether you should bother.
> 
> I suggest cherry-picking 6c1413d5ef0d1fea639b0d8c83a0c0065d99359b
> instead, because the systems where this flag is required have lapsed out
> of existence.  It can't hurt.

That's not something we do on release branches -- they aren't supposed
to remove platforms or configurations.

So I'd prefer not to do that.  Is the original patch suggested by
Ulrich problematic in some way?  I understand that removing the text
is easier, but assuming we don't want to drop support for GCC 4.6 on
the release branch, do you see any problem in installing the patch
Ulrich posted?





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#68842: 29.2; implicit declaration of function 'XOpenDisplay'
  2024-02-01  7:38     ` Eli Zaretskii
@ 2024-02-01  8:36       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-02-01  8:44         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 10+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-02-01  8:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: ulm, 68842

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Po Lu <luangruo@yahoo.com>
>> Cc: Ulrich Müller <ulm@gentoo.org>,  68842@debbugs.gnu.org
>> Date: Thu, 01 Feb 2024 09:56:59 +0800
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > Po Lu, any comments to the patch?
>> >
>> > I don't mind installing this on emacs-29, if it's TRT, but the chances
>> > for us to have another Emacs 29.x release are slim at best at this
>> > point.  So I wonder whether you should bother.
>> 
>> I suggest cherry-picking 6c1413d5ef0d1fea639b0d8c83a0c0065d99359b
>> instead, because the systems where this flag is required have lapsed out
>> of existence.  It can't hurt.
>
> That's not something we do on release branches -- they aren't supposed
> to remove platforms or configurations.
>
> So I'd prefer not to do that.  Is the original patch suggested by
> Ulrich problematic in some way?  I understand that removing the text
> is easier, but assuming we don't want to drop support for GCC 4.6 on
> the release branch, do you see any problem in installing the patch
> Ulrich posted?

In that event, I see no problems with Ulrich's patch, as the configure
check is careful enough not to set emacs_cv_b_link=yes if that flag
doesn't work.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#68842: 29.2; implicit declaration of function 'XOpenDisplay'
  2024-02-01  8:36       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-02-01  8:44         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-02-01  9:03           ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-02-01  8:44 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: ulm, 68842

Po Lu <luangruo@yahoo.com> writes:

> In that event, I see no problems with Ulrich's patch, as the configure
> check is careful enough not to set emacs_cv_b_link=yes if that flag
> doesn't work.

Also FTR this flag isn't a requirement under GCC 4.6.  It's only
relevant for ancient versions of Binutils on Linux-based systems with
a.out binaries, which are a rare sight if not nonexistent today,
considering the exceedingly short half-lives of such systems.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#68842: 29.2; implicit declaration of function 'XOpenDisplay'
  2024-02-01  8:44         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-02-01  9:03           ` Eli Zaretskii
  2024-02-01  9:21             ` Ulrich Mueller
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2024-02-01  9:03 UTC (permalink / raw)
  To: Po Lu; +Cc: ulm, 68842

> From: Po Lu <luangruo@yahoo.com>
> Cc: ulm@gentoo.org,  68842@debbugs.gnu.org
> Date: Thu, 01 Feb 2024 16:44:27 +0800
> 
> Po Lu <luangruo@yahoo.com> writes:
> 
> > In that event, I see no problems with Ulrich's patch, as the configure
> > check is careful enough not to set emacs_cv_b_link=yes if that flag
> > doesn't work.

Thanks.  Ulrich, please install the patch on the emacs-29 branch.

> Also FTR this flag isn't a requirement under GCC 4.6.  It's only
> relevant for ancient versions of Binutils on Linux-based systems with
> a.out binaries, which are a rare sight if not nonexistent today,
> considering the exceedingly short half-lives of such systems.

OK.  Still, my point was that we don't usually remove support for
anything on a release branch, only on master.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#68842: 29.2; implicit declaration of function 'XOpenDisplay'
  2024-02-01  9:03           ` Eli Zaretskii
@ 2024-02-01  9:21             ` Ulrich Mueller
  0 siblings, 0 replies; 10+ messages in thread
From: Ulrich Mueller @ 2024-02-01  9:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Po Lu, 68842

>>>>> On Thu, 01 Feb 2024, Eli Zaretskii wrote:

> Thanks.  Ulrich, please install the patch on the emacs-29 branch.

Will do later today.

>> Also FTR this flag isn't a requirement under GCC 4.6.

To be accurate, the -b option is gone in GCC 4.6, so we're talking
about GCC 4.5 and earlier. (Which won't make any difference for this
discussion, I guess.)

>> It's only relevant for ancient versions of Binutils on Linux-based
>> systems with a.out binaries, which are a rare sight if not
>> nonexistent today, considering the exceedingly short half-lives
>> of such systems.

Yes, but let's go with my minimal patch and include the declaration.
Keeping the test won't hurt even if it's pretty much useless.





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-02-01  9:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-31  8:03 bug#68842: 29.2; implicit declaration of function 'XOpenDisplay' Ulrich Müller
2024-01-31 17:26 ` Eli Zaretskii
2024-01-31 19:16   ` Ulrich Mueller
2024-01-31 19:32     ` Eli Zaretskii
2024-02-01  1:56   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-01  7:38     ` Eli Zaretskii
2024-02-01  8:36       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-01  8:44         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-01  9:03           ` Eli Zaretskii
2024-02-01  9:21             ` Ulrich Mueller

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).