bug-xorriso
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-xorriso] [PATCH] mmc: fix static link with libcdio


From: Baruch Siach
Subject: [Bug-xorriso] [PATCH] mmc: fix static link with libcdio
Date: Fri, 21 Apr 2017 07:55:26 +0300

libburn and libcdio define identically named symbols. This leads to static
link failure when building xorriso statically:

.../usr/arm-buildroot-linux-musleabihf/sysroot/usr/lib/libcdio.a(mmc_ll_cmds.o):
 In function `mmc_get_configuration':
mmc_ll_cmds.c:(.text+0x0): multiple definition of `mmc_get_configuration'
libburn/xorriso_xorriso-mmc.o:.../xorriso-1.4.6/libburn/mmc.c:3325: first 
defined here
.../usr/arm-buildroot-linux-musleabihf/sysroot/usr/lib/libcdio.a(mmc_ll_cmds.o):
 In function `mmc_read_cd':
mmc_ll_cmds.c:(.text+0x3c8): multiple definition of `mmc_read_cd'
libburn/xorriso_xorriso-mmc.o:.../xorriso-1.4.6/libburn/mmc.c:2622: first 
defined here
.../usr/arm-buildroot-linux-musleabihf/sysroot/usr/lib/libcdio.a(mmc_ll_cmds.o):
 In function `mmc_set_speed':
mmc_ll_cmds.c:(.text+0x5f0): multiple definition of `mmc_set_speed'
libburn/xorriso_xorriso-mmc.o:.../xorriso-1.4.6/libburn/mmc.c:2886: first 
defined here

Rename the problematic symbols to avoid the conflict.
---
 libburn/mmc.c | 14 +++++++-------
 libburn/mmc.h |  6 +++---
 libburn/spc.c |  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/libburn/mmc.c b/libburn/mmc.c
index 9ed48a23b57e..582c589347b8 100644
--- a/libburn/mmc.c
+++ b/libburn/mmc.c
@@ -1952,7 +1952,7 @@ static int mmc_read_disc_info_al(struct burn_drive *d, 
int *alloc_len)
        if (d->status == BURN_DISC_EMPTY)
                {ret = 1; goto ex;}
 
-       mmc_get_configuration(d);
+       libburn_mmc_get_configuration(d);
 
        scsi_init_command(c, MMC_GET_DISC_INFO, sizeof(MMC_GET_DISC_INFO));
        c->dxfer_len = *alloc_len;
@@ -2616,7 +2616,7 @@ int mmc_read_cd_msf(struct burn_drive *d,
 /* ts B21119 : Derived from older mmc_read_sectors() 
    @param flag bit0= set DAP bit (also with o->dap_bit)
 */
-int mmc_read_cd(struct burn_drive *d, int start, int len,
+int libburn_mmc_read_cd(struct burn_drive *d, int start, int len,
                 int sec_type, int main_ch,
                const struct burn_read_opts *o, struct buffer *buf, int flag)
 {
@@ -2882,7 +2882,7 @@ ex:;
 }
 
 
-void mmc_set_speed(struct burn_drive *d, int r, int w)
+void libburn_mmc_set_speed(struct burn_drive *d, int r, int w)
 {
        struct command *c;
        int ret, end_lba = 0, get_max, get_min;
@@ -3320,7 +3320,7 @@ ex:
 }
 
 
-void mmc_get_configuration(struct burn_drive *d)
+void libburn_mmc_get_configuration(struct burn_drive *d)
 {
        int alloc_len = 8, ret;
 
@@ -4484,7 +4484,7 @@ static int mmc_get_performance_al(struct burn_drive *d, 
int descr_type,
        BURN_ALLOC_MEM(c, struct command, 1);
 
        if (d->current_profile < 0)
-               mmc_get_configuration(d);
+               libburn_mmc_get_configuration(d);
 
        if (*alloc_len < 8)
                {ret = 0; goto ex;}
@@ -5358,9 +5358,9 @@ int mmc_setup_drive(struct burn_drive *d)
        d->read_toc = mmc_read_toc;
        d->write = mmc_write;
        d->erase = mmc_erase;
-       d->read_cd = mmc_read_cd;
+       d->read_cd = libburn_mmc_read_cd;
        d->perform_opc = mmc_perform_opc;
-       d->set_speed = mmc_set_speed;
+       d->set_speed = libburn_mmc_set_speed;
        d->send_cue_sheet = mmc_send_cue_sheet;
        d->reserve_track = mmc_reserve_track;
        d->sync_cache = mmc_sync_cache;
diff --git a/libburn/mmc.h b/libburn/mmc.h
index 1a0b672924b7..c4f078b88e32 100644
--- a/libburn/mmc.h
+++ b/libburn/mmc.h
@@ -36,13 +36,13 @@ void mmc_erase(struct burn_drive *, int);
 void mmc_read_toc(struct burn_drive *);
 void mmc_read_disc_info(struct burn_drive *);
 void mmc_read_atip(struct burn_drive *);
-int mmc_read_cd(struct burn_drive *d, int start, int len,
+int libburn_mmc_read_cd(struct burn_drive *d, int start, int len,
                 int sec_type, int main_ch,
                 const struct burn_read_opts *o, struct buffer *buf, int flag);
-void mmc_set_speed(struct burn_drive *, int, int);
+void libburn_mmc_set_speed(struct burn_drive *, int, int);
 void mmc_read_lead_in(struct burn_drive *, struct buffer *);
 void mmc_perform_opc(struct burn_drive *);
-void mmc_get_configuration(struct burn_drive *);
+void libburn_mmc_get_configuration(struct burn_drive *);
 
 /* ts A61110 : added parameters trackno, lba, nwa. Redefined return value.
    @return 1=nwa is valid , 0=nwa is not valid , -1=error */
diff --git a/libburn/spc.c b/libburn/spc.c
index 3193312bc247..8f2d38aa90e2 100644
--- a/libburn/spc.c
+++ b/libburn/spc.c
@@ -654,7 +654,7 @@ void spc_sense_caps(struct burn_drive *d)
        if (mmc_function_spy(d, "sense_caps") <= 0)
                return;
 
-       mmc_get_configuration(d);
+       libburn_mmc_get_configuration(d);
 
        /* first command execution to learn Allocation Length */
        alloc_len = start_len;
-- 
2.11.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]