Bug 1098680

Summary: [PATCH] scotch shared libraries have undefined references
Product: [Fedora] Fedora Reporter: Sandro Mani <manisandro>
Component: scotchAssignee: Miro Hrončok <mhroncok>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dakingun, laurence.mcglashan, mhroncok, nonamedotc
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-07 10:49:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1109444, 1116065    
Attachments:
Description Flags
Patch none

Description Sandro Mani 2014-05-17 01:55:56 UTC
Created attachment 896538 [details]
Patch

Description of problem:

When the shared libraries are created, the LDFLAGS are not passed. The shared libraries end up containing symbols of libraries against which they are not linked. Tentative patch attached. Patch is somewhat hacky, but the main goal was to have the LDFLAGS after the source files when producing the shared libraries.

$ readelf -Ws libscotch.so | grep BZ2
    31: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND BZ2_bzReadClose
    34: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND BZ2_bzWriteOpen
    51: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND BZ2_bzWriteClose
    52: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND BZ2_bzWrite
    59: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND BZ2_bzReadGetUnused
    73: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND BZ2_bzReadOpen
    78: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND BZ2_bzRead
$ readelf -Ws libscotch.so | grep lzmadec
    41: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND lzmadec_close
    49: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND lzmadec_dopen
    81: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND lzmadec_read
$ readelf -Ws libscotch.so | grep pthr
     2: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND pthread_detach
    14: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND pthread_barrier_init
    53: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND pthread_exit.5 (3)
    64: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND pthread_barrier_wait
    66: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND pthread_join
    67: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND pthread_self.5 (3)
    68: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND pthread_create
    70: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND pthread_barrier_destroy


$ ldd libscotch.so
        linux-vdso.so.1 =>  (0x00007fff27dfe000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f77855c4000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f7785c4c000)


***** With patch *****
$ ldd libscotch.so
        linux-vdso.so.1 =>  (0x00007fff6dd8e000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f1c7e832000)
        libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f1c7e622000)
        liblzmadec.so.0 => /lib64/liblzmadec.so.0 (0x00007f1c7e41d000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f1c7e115000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f1c7df0d000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f1c7dcf0000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f1c7d92a000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f1c7ed0a000)



Version-Release number of selected component (if applicable):
scotch-6.0.0-5.fc21.x86_64

Comment 1 Sandro Mani 2014-05-29 21:49:19 UTC
Ping?

Comment 2 Sandro Mani 2014-06-12 12:49:37 UTC
Ping?

Comment 3 Sandro Mani 2014-06-19 22:21:01 UTC
Ping?

Comment 4 Mukundan Ragavan 2014-07-03 00:53:05 UTC
Any news here?

Comment 5 Sandro Mani 2014-07-03 07:23:52 UTC
See [1]: the package should get orphaned hopefully in the coming days. As soon as that is the case, I'll take over scotch and apply the patch, so that we can move forward.


[1] https://fedorahosted.org/fesco/ticket/1315#comment:4

Comment 6 laurence.mcglashan 2014-07-03 09:15:21 UTC
I'm not a maintainer, so unfortunately I cannot help you update the package.

Have you got in touch with the owner of scotch about this issue, or is this specific to changes made to the Makefiles in the fedora rpm patches?

Your patch defines DYNLDFLAGS, but I can't find where that is used in the scotch Makefiles.

Comment 7 Sandro Mani 2014-07-03 09:22:44 UTC
In the proposed patch, I add a scotch_ldflags.patch which adds the DYNLDFLAGS to the calls which create the shared libraries, i.e. 

-					$(AR) $(ARFLAGS) $(@) $(?)
+					$(AR) $(ARFLAGS) $(@) $(?) $(DYNLDFLAGS)

Note that $(AR) here is misleading, since are is actually gcc when compiling a shared library, i.e. look at scotch-Makefile.shared.inc.in:
[...]
AR		= gcc
[...]


So the issue is sort of between fedora and upstream. upstream provides handwritten, not terribly flexible makefiles, and the fedora packages hack those makefiles to make it produce a shared library.

Comment 8 laurence.mcglashan 2014-07-03 09:50:05 UTC
Ok I remember that issue.

Other things to check while you're at it:

- You may need to update the Requires fields in the .spec file.
- Scotch 6.0 should have removed the dependency of scotch on the mpi libraries. I think the .spec file was updated last year but worth checking.

Comment 9 Sandro Mani 2014-07-05 19:12:43 UTC
Simple Patch Request
====================
Patch[master]=http://smani.fedorapeople.org/patches/scotch_underlinked-libraries.patch
ScratchBuild[master]=http://koji.fedoraproject.org/koji/taskinfo?taskID=7109043
Submitter=smani

Comment 10 Miro Hrončok 2014-07-05 19:40:32 UTC
http://koji.fedoraproject.org/koji/taskinfo?taskID=7109125

All ok?

Comment 11 Sandro Mani 2014-07-05 19:59:20 UTC
Awesome, thanks!