git: dca37f39f47d - main - sysutils/libcdio: fix build with lld 17

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Fri, 06 Oct 2023 17:51:02 UTC
The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/ports/commit/?id=dca37f39f47dae363f7f2aa636e3e8b963752350

commit dca37f39f47dae363f7f2aa636e3e8b963752350
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-10-01 12:02:24 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-10-06 17:48:55 +0000

    sysutils/libcdio: fix build with lld 17
    
    Building sysutils/libcdio with lld 17 results in the following link
    errors:
    
      libtool: link: cc -shared  -fPIC -DPIC  .libs/_cdio_generic.o .libs/_cdio_stdio.o .libs/_cdio_stream.o .libs/abs_path.o .libs/aix.o .libs/audio.o .libs/cd_types.o .libs/cdio.o .libs/cdtext.o .libs/device.o .libs/disc.o .libs/ds.o FreeBSD/.libs/freebsd.o FreeBSD/.libs/freebsd_cam.o FreeBSD/.libs/freebsd_ioctl.o .libs/gnu_linux.o image/.libs/bincue.o image/.libs/cdrdao.o .libs/image_common.o image/.libs/nrg.o .libs/logging.o .libs/memory.o mmc/.libs/mmc.o mmc/.libs/mmc_hl_cmds.o mmc/.libs/mmc_ll_cmds.o mmc/.libs/mmc_util.o MSWindows/.libs/aspi32.o MSWindows/.libs/win32_ioctl.o MSWindows/.libs/win32.o .libs/netbsd.o .libs/osx.o .libs/read.o .libs/realpath.o .libs/sector.o .libs/solaris.o .libs/track.o .libs/utf8.o .libs/util.o   -L/usr/local/lib -lm -lcam  -O2 -fstack-protector-strong -Wl,--version-script=libcdio.la.ver -fstack-protector-strong   -Wl,-soname -Wl,libcdio.so.19 -o .libs/libcdio.so.19.0.0
      ld: error: version script assignment of 'CDIO_19' to symbol 'cdio_get_default_device_bsdi' failed: symbol not defined
      ld: error: version script assignment of 'CDIO_19' to symbol 'cdio_get_devices_bsdi' failed: symbol not defined
      ld: error: version script assignment of 'CDIO_19' to symbol 'cdio_have_bsdi' failed: symbol not defined
      ld: error: version script assignment of 'CDIO_19' to symbol 'cdio_open_am_bsdi' failed: symbol not defined
      ld: error: version script assignment of 'CDIO_19' to symbol 'cdio_open_bsdi' failed: symbol not defined
      ld: error: version script assignment of 'CDIO_19' to symbol 'cdio_set_drive_speed' failed: symbol not defined
      ld: error: version script assignment of 'CDIO_19' to symbol 'mmc_get_last_lsn' failed: symbol not defined
      ld: error: version script assignment of 'CDIO_19' to symbol 'mmc_isrc_track_read_subchannel' failed: symbol not defined
      cc: error: linker command failed with exit code 1 (use -v to see invocation)
    
    There are a number of symbols in libcdio's linker version scripts which
    are no longer defined, so remove them.
    
    PR:             274196
    Approved by:    jhale (maintainer)
    MFH:            2023Q4
---
 .../libcdio/files/patch-lib_driver_cdio__private.h | 13 +++++
 .../libcdio/files/patch-lib_driver_libcdio.sym     | 66 ++++++++++++++++++++++
 .../libcdio/files/patch-lib_iso9660_libiso9660.sym | 10 ++++
 3 files changed, 89 insertions(+)

diff --git a/sysutils/libcdio/files/patch-lib_driver_cdio__private.h b/sysutils/libcdio/files/patch-lib_driver_cdio__private.h
new file mode 100644
index 000000000000..7e8e9ed9dbfb
--- /dev/null
+++ b/sysutils/libcdio/files/patch-lib_driver_cdio__private.h
@@ -0,0 +1,13 @@
+--- lib/driver/cdio_private.h.orig	2018-08-12 16:33:48 UTC
++++ lib/driver/cdio_private.h
+@@ -553,10 +553,6 @@ extern "C" {
+   bool cdio_have_aix    (void);
+ 
+   /*! DEPRICATED: use cdio_have_driver().
+-    True if BSDI driver is available. */
+-  bool cdio_have_bsdi    (void);
+-
+-  /*! DEPRICATED: use cdio_have_driver().
+     True if FreeBSD driver is available. */
+   bool cdio_have_freebsd (void);
+ 
diff --git a/sysutils/libcdio/files/patch-lib_driver_libcdio.sym b/sysutils/libcdio/files/patch-lib_driver_libcdio.sym
new file mode 100644
index 000000000000..de53960d70f7
--- /dev/null
+++ b/sysutils/libcdio/files/patch-lib_driver_libcdio.sym
@@ -0,0 +1,66 @@
+--- lib/driver/libcdio.sym.orig	2018-08-12 16:33:48 UTC
++++ lib/driver/libcdio.sym
+@@ -48,7 +48,6 @@ cdio_get_default_device_bincue
+ cdio_get_cdtext_raw
+ cdio_get_default_device
+ cdio_get_default_device_bincue
+-cdio_get_default_device_bsdi
+ cdio_get_default_device_cdrdao
+ cdio_get_default_device_driver
+ cdio_get_default_device_freebsd
+@@ -59,7 +58,6 @@ cdio_get_devices_bincue
+ cdio_get_default_device_win32
+ cdio_get_devices
+ cdio_get_devices_bincue
+-cdio_get_devices_bsdi
+ cdio_get_devices_cdrdao
+ cdio_get_devices_freebsd
+ cdio_get_devices_linux
+@@ -101,7 +99,6 @@ cdio_have_bincue
+ cdio_guess_cd_type
+ cdio_have_atapi
+ cdio_have_bincue
+-cdio_have_bsdi
+ cdio_have_cdrdao
+ cdio_have_driver
+ cdio_have_freebsd
+@@ -135,7 +132,6 @@ cdio_open_am_bincue
+ cdio_open
+ cdio_open_am
+ cdio_open_am_bincue
+-cdio_open_am_bsdi
+ cdio_open_am_cd
+ cdio_open_am_cdrdao
+ cdio_open_am_freebsd
+@@ -146,7 +142,6 @@ cdio_open_bincue
+ cdio_open_am_solaris
+ cdio_open_am_win32
+ cdio_open_bincue
+-cdio_open_bsdi
+ cdio_open_cd
+ cdio_open_cdrdao
+ cdio_open_cue
+@@ -171,7 +166,6 @@ cdio_set_blocksize
+ cdio_realpath
+ cdio_set_arg
+ cdio_set_blocksize
+-cdio_set_drive_speed
+ cdio_set_speed
+ cdio_stdio_destroy
+ cdio_stdio_new
+@@ -224,7 +218,6 @@ mmc_get_hwinfo
+ mmc_get_dvd_struct_physical
+ mmc_get_event_status
+ mmc_get_hwinfo
+-mmc_get_last_lsn
+ mmc_get_mcn
+ mmc_get_media_changed
+ mmc_get_track_isrc
+@@ -236,7 +229,6 @@ mmc_is_disctype_overwritable
+ mmc_is_disctype_dvd
+ mmc_is_disctype_hd_dvd
+ mmc_is_disctype_overwritable
+-mmc_isrc_track_read_subchannel
+ mmc_last_cmd_sense
+ mmc_mode_select_10
+ mmc_mode_sense
diff --git a/sysutils/libcdio/files/patch-lib_iso9660_libiso9660.sym b/sysutils/libcdio/files/patch-lib_iso9660_libiso9660.sym
new file mode 100644
index 000000000000..d6800b8631ec
--- /dev/null
+++ b/sysutils/libcdio/files/patch-lib_iso9660_libiso9660.sym
@@ -0,0 +1,10 @@
+--- lib/iso9660/libiso9660.sym.orig	2018-08-12 16:33:48 UTC
++++ lib/iso9660/libiso9660.sym
+@@ -18,7 +18,6 @@ iso9660_find_fs_lsn
+ iso9660_filelist_new
+ iso9660_filelist_free
+ iso9660_find_fs_lsn
+-iso9660_fs_find_lsn
+ iso9660_fs_find_lsn_with_path
+ iso9660_fs_read_pvd
+ iso9660_fs_read_superblock