bugCompact Disc Input and Control Library - Bugs: bug #65751, libcdio-2.1.0 fails to compile...

 
 

bug #65751: libcdio-2.1.0 fails to compile with gcc-14.1 on 32bit platforms

Submitter:  Rudi Heitbaum <heitbaum>
Submitted:  Thu 16 May 2024 12:13:15 PM UTC
   
 
Category:  compilation Severity:  5 - Average
Item Group:  None Status:  None
Privacy:  Public Assigned to:  rocky
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 19 Jun 2024 11:12:03 AM UTC, comment #8: 

The bug here that I don't understand is why the check for the function in configuration succeeds while the the compilation fails.

Try adjusting CFLAGS to remove the -Wmissing-declarations option.
One way to do this in both the check and compilation and check is below. However you could just try setting CFLAGS before compilation.


diff --git a/configure.ac b/configure.ac
index 0399a718..408c0ddf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -118,7 +118,6 @@ else
         -Wdisabled-optimization
         -Wendif-labels
         -Winline
-        -Wmissing-declarations
         -Wmissing-prototypes
         -Wnested-externs
         -Wno-sign-compare


Rocky Bernstein <rocky>
Group administrator
Wed 19 Jun 2024 05:54:58 AM UTC, comment #7: 

Trying the patch you suggested results in same fail for me.

./../../libcdio-2.1.0/lib/driver/_cdio_generic.c:63:20: error: implicit declaration of function 'lseek64'; did you mean 'lseek'? [-Wimplicit-function-declaration]
   63 | #define CDIO_LSEEK lseek64
      |                    ^~~~~~~
../../../libcdio-2.1.0/lib/driver/_cdio_generic.c:173:10: note: in expansion of macro 'CDIO_LSEEK'
  173 |   return CDIO_LSEEK(p_env->fd, offset, whence);
      |          ^~~~~~~~~~
../../../libcdio-2.1.0/lib/driver/_cdio_generic.c:63:20: warning: nested extern declaration of 'lseek64' [-Wnested-externs]
   63 | #define CDIO_LSEEK lseek64
      |                    ^~~~~~~
../../../libcdio-2.1.0/lib/driver/_cdio_generic.c:173:10: note: in expansion of macro 'CDIO_LSEEK'
  173 |   return CDIO_LSEEK(p_env->fd, offset, whence);
      |          ^~~~~~~~~~
make[3]: * [Makefile:778: _cdio_generic.lo] Error 1

Not sure why it failed but I have confirmed the patched applied successfully.

(file #56174)

Immolo <immolo>
Wed 19 Jun 2024 03:35:09 AM UTC, comment #6: 

Starting with llvm16 and GCC14 this warning becomes an error as shown in https://wiki.gentoo.org/wiki/Modern_C_porting#-Wimplicit-function-declaration

So as this is here to stay I don't believe omitting the flag isn't the best way forward.

I'll check the patch later though and see how it preforms on my systems.

Immolo <immolo>
Wed 19 Jun 2024 02:55:44 AM UTC, comment #5: 

Based on the Gentoo build log https://918988.bugs.gentoo.org/attachment.cgi?id=876262

It looks like the configure test for fseeko64 succeeds, when we go to compile it there are different GCC flags used, namely
-Wimplicit-function-declaration and warning is treated as an error.

A simple fix is either to omit  -Wimplicit-function-declaration as a compile flag or add it to the flags used in checking for functions:


diff --git a/configure.ac b/configure.ac
index 0399a718..610948a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -117,6 +117,7 @@ else
         -Wdeclaration-after-statement
         -Wdisabled-optimization
         -Wendif-labels
+        -Wimplicit-function-declaration
         -Winline
         -Wmissing-declarations
         -Wmissing-prototypes


Rocky Bernstein <rocky>
Group administrator
Wed 19 Jun 2024 02:22:27 AM UTC, comment #4: 

That's a fair reply which is partly due to my first time usage of Savannah so let's fix this.

Most of the findings on this have been reported at https://bugs.gentoo.org/918988

As you mentioned this only seems to break on 32bit systems as my 64bit systems don't run into this issue.

I have tested this patch on i586 glibc and musl systems running Gentoo and this allows the libcdio to compile. On my x86_64 musl system this isn't required however adding the patch still allows to compile and pass the same tests so looks good to me.

If you can list some Arches under Linux you would like tested then I'll be happy to help here but I'll leave the other the OSs to someone else that has more experience with them.


(file #56172)

Immolo <immolo>
Mon 17 Jun 2024 10:25:45 PM UTC, comment #3: 

It looks to me as though the essential change is to replace CDIO_LSEEK with lseek unconditionally. CDIO_LSEEK is macro that can be lseek64 or lseek depending on a configure feature check. This check is removed in this patch.

So when you run configure, does configure indicate that fseeko64 exists but when you go to use it it says it is not defined?

I'd appreciate more detail here. You give a build log which shows configure output when the patch is applied, but how about without it applied?

<heitbaum> says it was tested, but what OS's and capabilities were tested?  For example: 64-bit systems and 32-bit systems on what operating systems. And did those systems have
lseek64 and fseek64 while only being 32-bit and supporting LFS?

In short, although I understand that as is there is a problem on certain kinds of OS's (32-bit i586-pc-linux-gnu without or with LFS support?), but I am also concerned that because of the simplifications, there is a possibility that this patch breaks things on other systems, such as those that <heitbaum> did not test on.

Rocky Bernstein <rocky>
Group administrator
Sun 16 Jun 2024 11:25:28 AM UTC, comment #2: 

I have test built this and it works correctly

Rudi Heitbaum <heitbaum>
Fri 14 Jun 2024 10:07:00 PM UTC, comment #1: 

With patch applied:

=================================================================
Testsuite summary for libcdio 2.1.0
=================================================================
# TOTAL: 16
# PASS:  9
# SKIP:  7
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
=================================================================

Immolo <immolo>
Thu 16 May 2024 12:13:15 PM UTC, original submission:  

Error is:

/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RK3288.arm-12.0-devel/build/libcdio-2.1.0/lib/driver/_cdio_stdio.c: In function '_stdio_seek':
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RK3288.arm-12.0-devel/build/libcdio-2.1.0/lib/driver/_cdio_stdio.c:53:20: error: implicit declaration of function 'fseeko64'; did you mean 'fseeko'? [-Wimplicit-function-declaration]
   53 | #define CDIO_FSEEK fseeko64
      |                    ^~~~~~~~
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RK3288.arm-12.0-devel/build/libcdio-2.1.0/lib/driver/_cdio_stdio.c:175:13: note: in expansion of macro 'CDIO_FSEEK'
  175 |   if ( (ret=CDIO_FSEEK (ud->fd, i_offset, whence)) ) {
      |             ^~~~~~~~~~
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RK3288.arm-12.0-devel/build/libcdio-2.1.0/lib/driver/_cdio_stdio.c:53:20: warning: nested extern declaration of 'fseeko64' [-Wnested-externs]
   53 | #define CDIO_FSEEK fseeko64
      |                    ^~~~~~~~
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RK3288.arm-12.0-devel/build/libcdio-2.1.0/lib/driver/_cdio_stdio.c:175:13: note: in expansion of macro 'CDIO_FSEEK'
  175 |   if ( (ret=CDIO_FSEEK (ud->fd, i_offset, whence)) ) {
      |             ^~~~~~~~~~
make[3]: * [Makefile:746: _cdio_stdio.lo] Error 1
make[3]: * Waiting for unfinished jobs....

Rudi Heitbaum <heitbaum>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #56174:  build.log added by immolo (92KiB - text/x-log - Gentoo - i586 musl fail with Rocky's patch)
file #56173:  build.log added by immolo (86KiB - text/x-log - Gentoo - i586 musl fail without patch applied)
file #56172:  build.log added by immolo (296KiB - text/x-log - Gentoo - x86_64 musl build log and test results)
file #56163:  remove-lfs-shms.patch added by immolo (3KiB - text/x-patch - Using Parona patch from https://bugs.gentoo.org/918988 resolves the issue for me. I have included the patch and the build log with test results for you.)
file #56164:  build.log added by immolo (316KiB - text/x-log - Using Parona patch from https://bugs.gentoo.org/918988 resolves the issue for me. I have included the patch and the build log with test results for you.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rocky (Posted a comment)
  • -email is unavailable- added by immolo (Updated the item)
  • -email is unavailable- added by heitbaum (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-06-19 immolo Attached File- Added build.log, #56174
    2024-06-19 immolo Attached File- Added build.log, #56173
    2024-06-19 immolo Attached File- Added build.log, #56172
    2024-06-17 rocky Assigned toNone rocky
    2024-06-14 immolo Attached File- Added remove-lfs-shms.patch, #56163
        Attached File- Added build.log, #56164

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code