LOOKS LIKE A BUG: linkging change/error from v0.9.7g -> v0.9.8 on OSX 10.4.2

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

LOOKS LIKE A BUG: linkging change/error from v0.9.7g -> v0.9.8 on OSX 10.4.2

OpenMacNews
hi all,

after being pointed to the "install_name" ld flag by Apple engineering,

> Check the man page for ld under install_name - you'll see how  libraries can
> be linked with the full path to where they're  ultimately going or not.
> Clearly, in one case this happened, and in  the other not.

i'd looked for install_name in the openssl 0.9.8 src, to no avail ...

but, given the above pointer, and doing a little checking ALSO in 0.9.7 src, i
find:

% ls temp/
        openssl-0.9.7g  openssl-0.9.7g.tar.gz  openssl-0.9.8  openssl-0.9.8.tar.gz

% grep -rln install_name .
        ./openssl-0.9.7g/demos/engines/rsaref/Makefile
        ./openssl-0.9.7g/Makefile
        ./openssl-0.9.7g/Makefile.bak
        ./openssl-0.9.7g/Makefile.org
        ./openssl-0.9.8/demos/engines/rsaref/Makefile

% grep install_name `grep -rln install_name .`
        ./openssl-0.9.7g/demos/engines/rsaref/Makefile: SHAREDFLAGS='-dynamiclib
-install_name $(SHLIB)' \
        ./openssl-0.9.7g/Makefile:              -install_name
${INSTALLTOP}/lib/lib$$i${SHLIB_EXT} ) || exit 1; \
        ./openssl-0.9.7g/Makefile.bak:          -install_name
${INSTALLTOP}/lib/lib$$i${SHLIB_EXT} ) || exit 1; \
        ./openssl-0.9.7g/Makefile.org:          -install_name
${INSTALLTOP}/lib/lib$$i${SHLIB_EXT} ) || exit 1; \
        ./openssl-0.9.8/demos/engines/rsaref/Makefile: SHAREDFLAGS='-dynamiclib
-install_name $(SHLIB)' \


in ./openssl-0.9.7g/Makefile, @320:

        # For Darwin AKA Mac OS/X (dyld)
        do_darwin-shared:
                libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
                if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
                        libs="$(LIBKRB5) $$libs"; \
                fi; \
                ( set -x; ${CC} --verbose -dynamiclib -o lib$$i${SHLIB_EXT} \
                        lib$$i.a $$libs -all_load -current_version ${SHLIB_MAJOR}.${SHLIB_MINOR} \
                        -compatibility_version ${SHLIB_MAJOR}.`echo ${SHLIB_MINOR} | cut -d. -f1` \
---->   -install_name ${INSTALLTOP}/lib/lib$$i${SHLIB_EXT} ) || exit 1; \
                libs="-l`basename $$i${SHLIB_EXT} .dylib` $$libs"; \
                echo "" ; \
                done

whereas in ./openssl-0.9.8/Makefile.shared @198:

        # For Darwin AKA Mac OS/X (dyld)
        link_o.darwin:
                @ $(CALC_VERSIONS); \
                SHLIB=lib$(LIBNAME); \
                SHLIB_SUFFIX=.dylib; \
                ALLSYMSFLAGS='-all_load'; \
                NOALLSYMSFLAGS=''; \
                SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS)"; \
                if [ -n "$(LIBVERSION)" ]; then \
                        SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
                fi; \
                if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
                        SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
                fi; \
                $(LINK_SO_O)
        link_a.darwin:
                @ $(CALC_VERSIONS); \
                SHLIB=lib$(LIBNAME); \
                SHLIB_SUFFIX=.dylib; \
                ALLSYMSFLAGS='-all_load'; \
                NOALLSYMSFLAGS=''; \
                SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS)"; \
                if [ -n "$(LIBVERSION)" ]; then \
                        SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
                fi; \
                if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
                        SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
                fi; \
                $(LINK_SO_A)
        link_app.darwin:    # is there run-path on darwin?
                $(LINK_APP)

NOTE:  *no* instance of the "install_name"

iiuc, then, the 'issue' of incomplete install_name -- i.e., the missing
prepended paths -- lies in this stanza ... and it's a code bug in the latest
OpenSSL.

cheers,

richard

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: LOOKS LIKE A BUG: linkging change/error from v0.9.7g -> v0.9.8 on OSX 10.4.2

OpenMacNews
hi,

after staring a bit at the 'old' v0.9.7 src, i thought:

==================================================================
(EDITOR) ./openssl-0.9.8/Makefile.shared
@198:

        # For Darwin AKA Mac OS/X (dyld)
        link_o.darwin:
                @ $(CALC_VERSIONS); \
                SHLIB=lib$(LIBNAME); \
                SHLIB_SUFFIX=.dylib; \
                ALLSYMSFLAGS='-all_load'; \
                NOALLSYMSFLAGS=''; \
                SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS)"; \
                if [ -n "$(LIBVERSION)" ]; then \
                        SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
                fi; \
                if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
                        SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
                fi; \
+++ SHAREDFLAGS="$$SHAREDFLAGS -install_name
${INSTALLTOP}/lib/${SHLIB}${SHLIB_SUFFIX}";\
                $(LINK_SO_O)
        link_a.darwin:
                @ $(CALC_VERSIONS); \
                SHLIB=lib$(LIBNAME); \
                SHLIB_SUFFIX=.dylib; \
                ALLSYMSFLAGS='-all_load'; \
                NOALLSYMSFLAGS=''; \
                SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS)"; \
                if [ -n "$(LIBVERSION)" ]; then \
                        SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
                fi; \
                if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
                        SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
                fi; \
+++ SHAREDFLAGS="$$SHAREDFLAGS -install_name
${INSTALLTOP}/lib/${SHLIB}${SHLIB_SUFFIX}";\
                $(LINK_SO_A)
        link_app.darwin:    # is there run-path on darwin?
                $(LINK_APP)
==================================================================

should do the trick ...

but, now, i'm seeing various make errors of the sort:

        ...
        making all in crypto/pqueue...
        make[3]: Nothing to be done for `all'.
        if [ -n "libcrypto.0.9.8.dylib libssl.0.9.8.dylib" ]; then \
                        (cd ..; make libcrypto.0.9.8.dylib); \
        fi
        make[3]: `libcrypto.0.9.8.dylib' is up to date.
        making all in ssl...
        if [ -n "libcrypto.0.9.8.dylib libssl.0.9.8.dylib" ]; then \
                        (cd ..; make libssl.0.9.8.dylib); \
        fi
        nm: no name list
        ld: ./libcrypto.dylib can't be linked because it has the same install_name
(/usr/local/ssl098/lib/) as the output
        /usr/bin/libtool: internal link edit command failed
        making all in engines...
        ...

i'm missing something in the naming convention ...

richard
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]