GNU bug report logs - #75667
Emacs 30.0.93 build failure if -lz but not <zlib.h>

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Sun, 19 Jan 2025 08:30:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75667 in the body.
You can then email your comments to 75667 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#75667; Package emacs. (Sun, 19 Jan 2025 08:30:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Eggert <eggert <at> cs.ucla.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 19 Jan 2025 08:30:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Emacs bug reports and feature requests <bug-gnu-emacs <at> gnu.org>
Subject: Emacs 30.0.93 build failure if -lz but not <zlib.h>
Date: Sun, 19 Jan 2025 00:29:28 -0800
In the emacs-30.0.93 pretest, the build fails on cfarm119.cfarm.net 
which is running AIX 7.3. To reproduce the problem on that platform:

  /configure CC=/opt/IBM/openxlC/17.1.1/bin/ibm-clang 
--with-jpeg=ifavailable --with-png=ifavailable --with-gif=ifavailable 
--with-tiff=ifavailable --with-gnutls=ifavailable
  gmake

The build eventually fails with:

  CC       decompress.o
decompress.c:23:10: fatal error: 'zlib.h' file not found
#include <zlib.h>
         ^~~~~~~~

As the #include is protected by "#ifdef HAVE_ZLIB", it appears that 
'configure' assumes that if gcc -lz works then "#include <zlib.h>" will 
work too. That assumption is incorrect on this platform.

I suppose HAVE_ZLIB could be changed to be true only if zlib.h can be 
included; or perhaps the #include should be protected by #ifdef 
HAVE_ZLIB_H (though this sounds more complicated). Up to whoever did the 
zlib stuff.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75667; Package emacs. (Sun, 19 Jan 2025 09:25:02 GMT) Full text and rfc822 format available.

Message #8 received at 75667 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 75667 <at> debbugs.gnu.org
Subject: Re: bug#75667: Emacs 30.0.93 build failure if -lz but not <zlib.h>
Date: Sun, 19 Jan 2025 11:24:29 +0200
> Date: Sun, 19 Jan 2025 00:29:28 -0800
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> 
> In the emacs-30.0.93 pretest, the build fails on cfarm119.cfarm.net 
> which is running AIX 7.3. To reproduce the problem on that platform:
> 
>    /configure CC=/opt/IBM/openxlC/17.1.1/bin/ibm-clang 
> --with-jpeg=ifavailable --with-png=ifavailable --with-gif=ifavailable 
> --with-tiff=ifavailable --with-gnutls=ifavailable
>    gmake
> 
> The build eventually fails with:
> 
>    CC       decompress.o
> decompress.c:23:10: fatal error: 'zlib.h' file not found
> #include <zlib.h>
>           ^~~~~~~~
> 
> As the #include is protected by "#ifdef HAVE_ZLIB", it appears that 
> 'configure' assumes that if gcc -lz works then "#include <zlib.h>" will 
> work too. That assumption is incorrect on this platform.

Where is zlib.h on that platform?

> I suppose HAVE_ZLIB could be changed to be true only if zlib.h can be 
> included; or perhaps the #include should be protected by #ifdef 
> HAVE_ZLIB_H (though this sounds more complicated). Up to whoever did the 
> zlib stuff.

It's too late to make serious changes in the configury on the release
branch, but maybe we should simply disable HAVE_ZLIB_H on AIX?  Then
we could find a proper solution on master.




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Mon, 20 Jan 2025 00:35:02 GMT) Full text and rfc822 format available.

Notification sent to Paul Eggert <eggert <at> cs.ucla.edu>:
bug acknowledged by developer. (Mon, 20 Jan 2025 00:35:02 GMT) Full text and rfc822 format available.

Message #13 received at 75667-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 75667-done <at> debbugs.gnu.org
Subject: Re: bug#75667: Emacs 30.0.93 build failure if -lz but not <zlib.h>
Date: Sun, 19 Jan 2025 16:33:52 -0800
[Message part 1 (text/plain, inline)]
On 2025-01-19 01:24, Eli Zaretskii wrote:

> Where is zlib.h on that platform?

It isn't installed, as far as I can see. I expected it's in some 
optional package that is absent on that build platform.

Although cfarm119 does have a file /opt/freeware/include/zlib.h, that 
corresponds to /opt/freeware/lib/libz.a, not to what -lz picks up which 
is /usr/lib/libz.a (a symlink to /usr/opt/rpm/lib/libz.a). I wouldn't 
recommend mixing up versions like that.


> It's too late to make serious changes in the configury on the release
> branch, but maybe we should simply disable HAVE_ZLIB_H on AIX?  Then
> we could find a proper solution on master.

Not sure that would be a good idea as this isn't an AIX-specific 
problem. Anybody can mess up .h and -l in this way, on any OS.

On the same platform I discovered a similar problem with -lsqlite3. I 
fixed both problems on master by installing the attached, and I'm 
marking the bug as done.

For the release branch I suppose we can just say something like "just 
use --without-zlib if you have problems".

As I'm sure you know, this library configury is waaay too complex and 
idiosyncratic. Why don't libz and libsqlite3 use pkg-config, for 
example? But I'm inclined to let the relevant library experts deal with 
that whenever they have time.
[0001-Port-better-to-AIX-7.3-with-lz-but-not-zlib.h.patch (text/x-patch, attachment)]
[0002-Port-better-to-AIX-7.3-with-lsqlite3-but-not-sqlite3.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75667; Package emacs. (Sat, 25 Jan 2025 03:07:02 GMT) Full text and rfc822 format available.

Message #16 received at 75667 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: eggert <at> cs.ucla.edu, 75667 <at> debbugs.gnu.org
Subject: Re: bug#75667: Emacs 30.0.93 build failure if -lz but not <zlib.h>
Date: Fri, 24 Jan 2025 22:05:53 -0500
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > Where is zlib.h on that platform?

  > It isn't installed, as far as I can see. I expected it's in some 
  > optional package that is absent on that build platform.

If someone could find which one, it would be usefu to document this in
the usual place for noting peculiaritie of building on various
platfors.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 22 Feb 2025 12:24:30 GMT) Full text and rfc822 format available.

This bug report was last modified 113 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.