defining float_t as double breaks libreoffice autopkgtest with glibc 2.33 on s390x

Bug #1915927 reported by Balint Reczey
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
clucene-core (Ubuntu)
Fix Released
Undecided
Balint Reczey
libreoffice (Ubuntu)
Fix Released
Undecided
Balint Reczey

Bug Description

Glibc 2.33 changed the float_t type from double to compiler-defined which is float on s390x:

https://sourceware.org/pipermail/libc-alpha/2021-February/122207.html
...

* On s390(x), the type float_t is now derived from the macro
  __FLT_EVAL_METHOD__ that is defined by the compiler, instead of being
  hardcoded to double. This does not affect the ABI of any libraries
  that are part of the GNU C Library, but may affect the ABI of other
  libraries that use this type in their interfaces. The new definition
  improves consistency with compiler behavior in many scenarios.
...

To not break clucene's ABI accidentally clucene fixed float_t to be double:

clucene-core (2.3.3.4+dfsg-1ubuntu1) hirsute; urgency=medium

  * Fix float_t abi to double ahead of glibc change.

 -- Dimitri John Ledkov <email address hidden> Mon, 01 Feb 2021 10:22:06 +0000

This conflicts with GCC's definition in libreoffice's autopkgtest:

https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-hirsute/hirsute/s390x/libr/libreoffice/20210215_232647_879ab@/log.gz
...
configure: error: Your version of libclucene has contribs-lib missing.
Error running configure at ./autogen.sh line 299.
make: *** [debian/rules:1936: config_host.mk] Error 25
...

In local reproduction the error is the following:
...
configure:22199: checking for CLucene/analysis/cjk/CJKAnalyzer.h
configure:22199: s390x-linux-gnu-g++ -c -g1 -O2 -ffile-prefix-map=/tmp/autopkgtest.RtAhHJ/build.yBG/src=. -fstack-protector-strong -Wformat -Werror=format-security -isystem /usr/lib/s390x-linux-gnu -Wdate-time -D_FORTIFY_SOURCE=2 -isystem /usr/lib/s390x-linux-gnu conftest.cpp >&5
In file included from /usr/include/CLucene/StdHeader.h:20,
                 from /usr/include/CLucene.h:11,
                 from conftest.cpp:83:
/usr/include/CLucene/SharedHeader.h:72:16: error: conflicting declaration 'typedef double float_t'
   72 | typedef double float_t;
      | ^~~~~~~
In file included from /usr/include/c++/10/cmath:45,
                 from /usr/include/c++/10/math.h:36,
                 from /usr/include/CLucene/SharedHeader.h:61,
                 from /usr/include/CLucene/StdHeader.h:20,
                 from /usr/include/CLucene.h:11,
                 from conftest.cpp:83:
/usr/include/math.h:149:15: note: previous declaration as 'typedef float float_t'
  149 | typedef float float_t;
      | ^~~~~~~
configure:22199: $? = 1
...

Revision history for this message
Balint Reczey (rbalint) wrote :

CLucene upstream did not react to the bug report
https://sourceforge.net/p/clucene/bugs/233/

IMO the cleanest fix is changing the ABI to let float_t be float and providing the shared library using a different name, at least on s390x.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

clucene-core (2.3.3.4+dfsg-1ubuntu1) hirsute; urgency=medium

  * Fix float_t abi to double ahead of glibc change.

 -- Dimitri John Ledkov <email address hidden> Mon, 01 Feb 2021 10:22:06 +0000

Changed in clucene-core (Ubuntu):
status: New → Fix Released
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

> IMO the cleanest fix is changing the ABI to let float_t be float and providing the shared library using a different name, at least on s390x.

this is against libc advice, and IBM recommendation. It would unnecessary cause an ABI break, requiring ABI transitions.

It is best for ABI to have stability continuity such that we don't need to bump sonames.

It should be left up to upstream to break ABI and bump soname with a new version, together with any other changes they want to make.

Changed in clucene-core (Ubuntu):
status: Fix Released → Triaged
Changed in libreoffice (Ubuntu):
status: New → Triaged
assignee: nobody → Dimitri John Ledkov (xnox)
Changed in clucene-core (Ubuntu):
assignee: nobody → Dimitri John Ledkov (xnox)
Revision history for this message
Balint Reczey (rbalint) wrote :

I did not mean bumping the SO version, but changing the name of the shared library.

Revision history for this message
Balint Reczey (rbalint) wrote :

Finally I renamed only the shared library _packages_ only on s390x.

Building in:
https://bileto.ubuntu.com/#/ticket/4455

Changed in libreoffice (Ubuntu):
assignee: Dimitri John Ledkov (xnox) → Balint Reczey (rbalint)
Changed in clucene-core (Ubuntu):
assignee: Dimitri John Ledkov (xnox) → Balint Reczey (rbalint)
status: Triaged → In Progress
Changed in libreoffice (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package clucene-core - 2.3.3.4+dfsg-1ubuntu3

---------------
clucene-core (2.3.3.4+dfsg-1ubuntu3) hirsute; urgency=medium

  * Make libclucene-contribs1v5f Conflict/Replace libclucene-contribs1v5

clucene-core (2.3.3.4+dfsg-1ubuntu2) hirsute; urgency=medium

  * Drop defining float_t as double on s390x, rename packages changing the ABI
    to use float_t as float instead (LP: #1915927)

 -- Balint Reczey <email address hidden> Wed, 17 Feb 2021 22:11:42 +0100

Changed in clucene-core (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libreoffice - 1:7.0.4~rc2-0ubuntu3

---------------
libreoffice (1:7.0.4~rc2-0ubuntu3) hirsute; urgency=medium

  * Build-depend on libclucene-dev (>= 2.3.3.4+dfsg-1ubuntu2~) to use
    libclucene's ABI defining float_t as float on s390x (LP: #1915927)

 -- Balint Reczey <email address hidden> Wed, 17 Feb 2021 19:29:42 +0100

Changed in libreoffice (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.