bugCompact Disc Input and Control Library - Bugs: bug #49907, subdir-objects breaks symbol...

 
 

bug #49907: subdir-objects breaks symbol versioning

Submitter:  Jan Steffens <heftig>
Submitted:  Wed 21 Dec 2016 11:31:15 PM UTC
   
 
Category:  compilation Severity:  5 - Average
Item Group:  libcdio Status:  Fixed
Privacy:  Public Assigned to:  rocky
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 09 Oct 2017 04:40:11 PM UTC, comment #6: 

Sorry for the delay. Nicholas seems MIA.

I've applied the patch in commit ddd9848

Since I make mistakes, please double check that this addresses the problem, and get back to with the results so we can close or address further.

Thanks.

Rocky Bernstein <rocky>
Group administrator
Thu 05 Oct 2017 03:39:26 AM UTC, comment #5: 

I can confirm this bug. Currently I get the following output during build:


  CC       MSWindows/win32_ioctl.lo
  CC       MSWindows/win32.lo
nm: '.libs/freebsd.o': No such file
nm: '.libs/freebsd_cam.o': No such file
nm: '.libs/freebsd_ioctl.o': No such file
nm: '.libs/bincue.o': No such file
nm: '.libs/cdrdao.o': No such file
nm: '.libs/nrg.o': No such file
nm: '.libs/mmc.o': No such file
nm: '.libs/mmc_hl_cmds.o': No such file
nm: '.libs/mmc_ll_cmds.o': No such file
nm: '.libs/mmc_util.o': No such file
nm: '.libs/aspi32.o': No such file
nm: '.libs/win32_ioctl.o': No such file
nm: '.libs/win32.o': No such file
nm: '.libs/freebsd.o': No such file
nm: '.libs/freebsd_cam.o': No such file
nm: '.libs/freebsd_ioctl.o': No such file
nm: '.libs/bincue.o': No such file
nm: '.libs/cdrdao.o': No such file
nm: '.libs/nrg.o': No such file
nm: '.libs/mmc.o': No such file
nm: '.libs/mmc_hl_cmds.o': No such file
nm: '.libs/mmc_ll_cmds.o': No such file
nm: '.libs/mmc_util.o': No such file
nm: '.libs/aspi32.o': No such file
nm: '.libs/win32_ioctl.o': No such file
nm: '.libs/win32.o': No such file
  CCLD     libcdio.la


one possible fix is to change the file name generation in the Makefile:

-       @objs=`for obj in $(libcdio_la_OBJECTS); do sed -ne "s/^pic_object='\(.*\)'$$/\1/p" $$obj; done`; \
+       @objs=`for obj in $(libcdio_la_OBJECTS); do echo -n "$$(dirname $$obj)/"; sed -ne "s/^pic_object='\(.*\)'$$/\1/p" $$obj; done`; \


but I prefer the already submitted patch, which is much simpler and makes the process much more robust.

Stefan BrĂ¼ns <stefanbruens>
Thu 22 Dec 2016 04:09:41 AM UTC, comment #4: 

The attached patch seems to work and still passes the test suite.

However, the libraries no longer export the symbols _init, _fini, _edata, _end and __bss_start. I'm not sure how significant this is, since I think the ELF section headers supply the same information to the dynamic linker.

(file #39292)

Jan Steffens <heftig>
Thu 22 Dec 2016 03:25:01 AM UTC, comment #3: 

Whoops, that should have been subdir-objects, not shared-objects.

Jan Steffens <heftig>
Thu 22 Dec 2016 03:24:01 AM UTC, comment #2: 

Yes, that target.

I originally stumbled upon this because gvfs stopped building.

gvfs uses libcdio_cdda (from libcdio-paranoia). libcdio_cdda when built against libcdio 0.93 references mmc_get_hwinfo@@CDIO_16.

The link of gvfsd-cdda fails because ld cannot find this symbol in libcdio 0.94. It only provides an unversioned mmc_get_hwinfo.

This is on Arch Linux x86_64.



Basically, the recipe looks through the .lo objects the library depends on in order to find the actual object files hidden by libtool. It then extracts the symbols from these files, compares them to the list of to-be-exported symbols and writes a version script which exports and/or hides the symbols found, as well as assigning them all a version.

The problem with shared-objects is that the lo files now lie in subdirectories, but the paths to the actual object files are still relative to the lo files, not the Makefile, and the recipe ignores that.

Poking through the objects feels like a giant hack. There is probably a simpler way of handling the version script.

Jan Steffens <heftig>
Thu 22 Dec 2016 01:02:26 AM UTC, comment #1: 

To be clear, you mean the libcdio.la.ver target, right?

It might help if you could give some specific details to look for so we can know that this is fixed.

Nicolas would you look at and advise?

Via remake one can stop at the target and write out the expanded set of bash commands, if that will help.


Rocky Bernstein <rocky>
Group administrator
Wed 21 Dec 2016 11:31:15 PM UTC, original submission:  

The version script generator script in lib/driver/Makefile.am broke in 0.94.

It expects the pic_object paths to be relative to lib/driver, but with subdir-objects some of the objects are in subdirectories like lib/driver/mmc instead, and the pic_object paths are relative to those subdirectories.

As a result, a lot of symbols are silently left unversioned.

Jan Steffens <heftig>

 

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

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by stefanbruens (Posted a comment)
  • -email is unavailable- added by rocky (Updated the item)
  • -email is unavailable- added by heftig (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-04-13 rocky Open/ClosedOpen Closed
    2019-04-13 rocky StatusWorks For Me Fixed
    2017-10-24 rocky StatusIn Progress Works For Me
    2017-10-09 rocky StatusNone In Progress
        Assigned tonboullis rocky
    2016-12-22 heftig Attached File- Added 0001-Simplify-version-script-generation.patch, #39292
    2016-12-22 rocky Assigned toNone nboullis

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code