Bug 2253509 - libtiff-devel on Fedora 39 is built incorrectly so i686 and x86_64 can not be installed at once
Summary: libtiff-devel on Fedora 39 is built incorrectly so i686 and x86_64 can not be...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libtiff
Version: 39
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Michal Hlavinka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-12-07 19:05 UTC by William Bader
Modified: 2024-11-08 01:20 UTC (History)
5 users (show)

Fixed In Version: libtiff-4.4.0-10.fc39
Clone Of:
Environment:
Last Closed: 2024-11-08 01:20:31 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description William Bader 2023-12-07 19:05:27 UTC
I need to build both 32 and 64 bit applications that require libtiff-devel to link.
I have the 64 bit version installed.
If I try to install the 32 bit version, I get an error because both libtiff-devel-4.4.0-8.fc39.i686 and libtiff-devel-4.4.0-8.fc39.x86_64 include /usr/include/tiffconf.h.
I didn't have this problem in Fedora 37 and earlier, and I have other packages like libjpeg-turbo-devel with both 32 and 64 bit versions installed even though they share include files.

$ sudo dnf install libtiff-devel.i686
Last metadata expiration check: 0:25:52 ago on Thu 07 Dec 2023 01:04:27 PM EST.
Dependencies resolved.
=================================================================================================================================================================================
 Package                                       Architecture                         Version                                         Repository                              Size
=================================================================================================================================================================================
Installing:
 libtiff-devel                                 i686                                 4.4.0-8.fc39                                    fedora                                 545 k

Transaction Summary
=================================================================================================================================================================================
Install  1 Package

Total size: 545 k
Installed size: 1.7 M
Is this ok [y/N]: y
Downloading Packages:
[SKIPPED] libtiff-devel-4.4.0-8.fc39.i686.rpm: Already downloaded                                                                                                               
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Transaction test error:
  file /usr/include/tiffconf.h from install of libtiff-devel-4.4.0-8.fc39.i686 conflicts with file from package libtiff-devel-4.4.0-8.fc39.x86_64

libjpeg-turbo-devel (to pick as an example) allows both 32 and 64 bit versions to be installed at once even though they share /usr/include/libjpeg.h .

$ rpm -qa | grep libjpeg-turbo-devel
libjpeg-turbo-devel-2.1.4-3.fc39.x86_64
libjpeg-turbo-devel-2.1.4-3.fc39.i686

$ sudo dnf provides /usr/include/jpeg
jpegint.h  jpeglib.h  
scslaptop55 /tmp/work$ sudo dnf provides /usr/include/jpeglib.h 
Last metadata expiration check: 0:32:25 ago on Thu 07 Dec 2023 01:04:27 PM EST.
libjpeg-turbo-devel-2.1.4-3.fc39.i686 : Headers for the libjpeg-turbo library
Repo        : @System
Matched from:
Filename    : /usr/include/jpeglib.h

libjpeg-turbo-devel-2.1.4-3.fc39.i686 : Headers for the libjpeg-turbo library
Repo        : fedora
Matched from:
Filename    : /usr/include/jpeglib.h

libjpeg-turbo-devel-2.1.4-3.fc39.x86_64 : Headers for the libjpeg-turbo library
Repo        : @System
Matched from:
Filename    : /usr/include/jpeglib.h

libjpeg-turbo-devel-2.1.4-3.fc39.x86_64 : Headers for the libjpeg-turbo library
Repo        : fedora
Matched from:
Filename    : /usr/include/jpeglib.h



Reproducible: Always

Steps to Reproduce:
1. sudo dnf install libtiff-devel.x86_64 libtiff-devel.i686
2.
3.
Actual Results:  
Fails with
Error: Transaction test error:
  file /usr/include/tiffconf.h from install of libtiff-devel-4.4.0-8.fc39.i686 conflicts with file from package libtiff-devel-4.4.0-8.fc39.x86_64


Expected Results:  
Allow both installed at once so I can do both 32 and 64 bit development.

It should allow both to be installed at once, the same as other devel packages.
If tiffconf.h is different, it could use gcc predefined macros to select 32 or 64 bit targets.
I already have both the 32 and 64 bit libtiff runtimes installed.
As a work-around, I ran
cd /usr/lib/ && sudo ln -s libtiff.so.5 libtiff.so
which seems to be enough to get a link. (My applications are in C.)

When I looked for solutions on google, this conflict seems to have been introduced in Fedora 38 and causes problems for people trying to update from Fedora 37 or earlier to Fedora 38 or newer because the conflict causes "dnf system-upgrade download --refresh --releasever=39" to fail. In my case, I removed the 32 bit libtiff-devel when I updated from Fedora 37 to 39.

Comment 1 William Bader 2023-12-07 20:08:30 UTC
I built tiff-4.6.0 from source for 32 and 64 bits and compared the generated tiffconf.h
I started the 32 bit build with CFLAGS=-m32 CPPFLAGS=-m32 LDFLAGS=-m32 CXXFLAGS=-m32 ./configure
and the 64 bit build with ./configure
then did a make, saved the tiffconf.h, and then did a 'make distclean'.
The main difference is TIFF_SSIZE_T, but a predefined compiler macro could select that.
The other differences are either because Fedora 39 doesn't provide 32 bit libraries for JBIG, LERC, or LIBDEFLATE or because I haven't installed them.
Both gcc and clang set __i386__ for 32 bit compiles and __x86_64__ for 64 bit compiles, so at worst, the libtiff-devel packages could install a corresponding tiffconf-32.h or tiffconf-64.h and share a tiffconf.h that uses __i386__ or __x86_64__ to select which tiffconf-#.h to include.


$ diff tiffconf-32.h tiffconf-64.h 
48c48
< #define TIFF_SSIZE_T int32_t
---
> #define TIFF_SSIZE_T int64_t
79c79
< /* #undef JBIG_SUPPORT */
---
> #define JBIG_SUPPORT 1
82c82
< /* #undef LERC_SUPPORT */
---
> #define LERC_SUPPORT 1
110c110
< /* #undef LIBDEFLATE_SUPPORT */
---
> #define LIBDEFLATE_SUPPORT 1

This seems to be how it was done on RHEL8 where tiffconf.h is

#ifndef TIFFCONF_H_MULTILIB
#define TIFFCONF_H_MULTILIB

#include <bits/wordsize.h>

#if __WORDSIZE == 32
# include "tiffconf-32.h"
#elif __WORDSIZE == 64
# include "tiffconf-64.h"
#else
# error "unexpected value for __WORDSIZE macro"
#endif

#endif

$ diff tiffconf-32.h tiffconf-64.h
18c18
< #define TIFF_INT64_T signed long long
---
> #define TIFF_INT64_T signed long
30c30
< #define TIFF_UINT64_T unsigned long long
---
> #define TIFF_UINT64_T unsigned long
36c36
< #define TIFF_SSIZE_T signed int
---
> #define TIFF_SSIZE_T signed long

RHEL8 has libtiff-4.0 while Fedora 39 has libtiff-4.4.
The newer libtiff moved to using int32_t and int64_t instead of int, long, long long, so the 32 and 64 bit headers have fewer differences.

On my Fedora 39 system, I temporarily made the patch

$ diff -u tiffconf.h- tiffconf.h
--- tiffconf.h- 2023-08-27 20:00:00.000000000 -0400
+++ tiffconf.h  2023-12-07 14:58:51.126175761 -0500
@@ -39,7 +39,11 @@
 /* #undef TIFF_UINT8_T */
 
 /* Signed size type */
+#if defined(__i386__)
+#define TIFF_SSIZE_T int32_t
+#else
 #define TIFF_SSIZE_T int64_t
+#endif
 
 /* Compatibility stuff. */

Comment 2 Jeff Smith 2023-12-24 23:55:28 UTC
There has been a fix in place for the 32-bit/64-bit header issue going back many releases.
However, it depended on the output of `uname -i`, whose behavior changed with Fedora 38.
I have made a PR to fix this in rawhide: https://src.fedoraproject.org/rpms/libtiff/pull-request/7

Comment 3 William Bader 2023-12-25 08:28:14 UTC
Thanks for looking into the problem!
I see what the comment means, on Fedora 39 `uname -i` returns "unknown" while on RHEL 7 and 8 it returns "x86_64", but `uname -m` returns "x86_64" everywhere.
Regards, William

Comment 4 Fedora Update System 2024-10-23 11:12:15 UTC
FEDORA-2024-5fbec0afbd (libtiff-4.4.0-10.fc39) has been submitted as an update to Fedora 39.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-5fbec0afbd

Comment 5 Fedora Update System 2024-10-24 02:19:06 UTC
FEDORA-2024-5fbec0afbd has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-5fbec0afbd`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-5fbec0afbd

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 William Bader 2024-10-24 07:08:49 UTC
Thank you! I've already updated to Fedora 40.
The problem is on Fedora 40 also. Can you fix it on Fedora 40?
Regards, William

$ rpm -qa | grep tiff | grep devel
libtiff-devel-4.6.0-2.fc40.x86_64
$ sudo dnf install libtiff-devel.i686
Last metadata expiration check: 0:31:24 ago on Thu 24 Oct 2024 08:32:10 AM CEST.
Dependencies resolved.
=================================================================================================================================================================================
 Package                                       Architecture                         Version                                         Repository                              Size
=================================================================================================================================================================================
Installing:
 libtiff-devel                                 i686                                 4.6.0-2.fc40                                    fedora                                 259 k

Transaction Summary
=================================================================================================================================================================================
Install  1 Package

Total download size: 259 k
Installed size: 709 k
Is this ok [y/N]: y
Downloading Packages:
libtiff-devel-4.6.0-2.fc40.i686.rpm                                                                                                              355 kB/s | 259 kB     00:00    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                            282 kB/s | 259 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Transaction test error:
  file /usr/include/tiffconf.h from install of libtiff-devel-4.6.0-2.fc40.i686 conflicts with file from package libtiff-devel-4.6.0-2.fc40.x86_64

Comment 7 William Bader 2024-10-25 07:56:12 UTC
Thanks again!!! It is working on Fedora 40. I was able to install both the 32 and 64 bit versions of libtiff-devel.
$ rpm -q libtiff-devel
libtiff-devel-4.6.0-5.fc40.1.x86_64
libtiff-devel-4.6.0-5.fc40.1.i686
$ ls -l /usr/include/tiff*
-rw-r--r-- 1 root root 59865 Jul 18  2023 /usr/include/tiff.h
-rw-r--r-- 1 root root  3977 Oct 23 02:00 /usr/include/tiffconf-32.h
-rw-r--r-- 1 root root  3977 Oct 23 02:00 /usr/include/tiffconf-64.h
-rw-r--r-- 1 root root   250 Oct 23 02:00 /usr/include/tiffconf.h
-rw-r--r-- 1 root root 28488 Sep  5  2023 /usr/include/tiffio.h
-rw-r--r-- 1 root root  1525 May 22  2023 /usr/include/tiffio.hxx
-rw-r--r-- 1 root root  1415 Oct 23 02:00 /usr/include/tiffvers.h

Comment 8 Fedora Update System 2024-11-08 01:20:31 UTC
FEDORA-2024-5fbec0afbd (libtiff-4.4.0-10.fc39) has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.