X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=Makefile.shared;h=0ff1a76534fa0ddcab90c0262ea41d8ec86ff5bc;hp=adf7d4ec3f2d03c01bb4b430c7d04bd6a72ce14b;hb=2fcff74c879c3ff5bcbf11390daf37442cb6aa0c;hpb=ab4d68983297988bfd9340f738b6183639739e7d diff --git a/Makefile.shared b/Makefile.shared index adf7d4ec3f..0ff1a76534 100644 --- a/Makefile.shared +++ b/Makefile.shared @@ -135,7 +135,7 @@ LINK_SO_A_VIA_O= \ ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \ ( $(SET_X); \ ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \ - $(LINK_SO) && rm -f $(LIBNAME).o + $(LINK_SO) && rm -f lib$(LIBNAME).o LINK_SO_A_UNPACKED= \ UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \ @@ -170,16 +170,16 @@ link_a.gnu: link_app.gnu: @ $(DO_GNU_APP); $(LINK_APP) -DO_BEOS_SO= SHLIB=lib$(LIBNAME).so; \ +link_a.linux-shared: + @if [ $(LIBNAME) != "crypto" -a $(LIBNAME) != "ssl" ]; then echo libname is $(LIBNAME); sleep 2; $(DO_GNU_SO); else \ + $(PERL) util/mkdef.pl $(LIBNAME) linux >$(LIBNAME).map; \ + $(CALC_VERSIONS); \ + SHLIB=lib$(LIBNAME).so; \ SHLIB_SUFFIX=; \ - ALLSYMSFLAGS='-Wl,--whole-archive'; \ + ALLSYMSFLAGS='-Wl,--whole-archive,--version-script=$(LIBNAME).map'; \ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ - SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SUFFIX" - -link_o.beos: - @ $(DO_BEOS_SO); $(LINK_SO_O) -link_a.beos: - @ $(DO_BEOS_SO); $(LINK_SO_A) + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \ + fi; $(LINK_SO_A) link_o.bsd: @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \ @@ -207,17 +207,29 @@ link_app.bsd: fi; $(LINK_APP) # For Darwin AKA Mac OS/X (dyld) -# link_o.darwin produces .so, because we let it use dso_dlfcn module, -# which has .so extension hard-coded. One can argue that one should -# develop special dso module for MacOS X. At least manual encourages -# to use native NSModule(3) API and refers to dlfcn as termporary hack. +# Originally link_o.darwin produced .so, because it was hard-coded +# in dso_dlfcn module. At later point dso_dlfcn switched to .dylib +# extension in order to allow for run-time linking with vendor- +# supplied shared libraries such as libz, so that link_o.darwin had +# to be harmonized with it. This caused minor controversy, because +# it was believed that dlopen can't be used to dynamically load +# .dylib-s, only so called bundle modules (ones linked with -bundle +# flag). The belief seems to be originating from pre-10.4 release, +# where dlfcn functionality was emulated by dlcompat add-on. In +# 10.4 dlopen was rewritten as native part of dyld and is documented +# to be capable of loading both dynamic libraries and bundles. In +# order to provide compatibility with pre-10.4 dlopen, modules are +# linked with -bundle flag, which makes .dylib extension misleading. +# It works, because dlopen is [and always was] extension-agnostic. +# Alternative to this heuristic approach is to develop specific +# MacOS X dso module relying on whichever "native" dyld interface. link_o.darwin: @ $(CALC_VERSIONS); \ SHLIB=lib$(LIBNAME); \ - SHLIB_SUFFIX=.so; \ + SHLIB_SUFFIX=.dylib; \ ALLSYMSFLAGS='-all_load'; \ NOALLSYMSFLAGS=''; \ - SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS)"; \ + SHAREDFLAGS="$(CFLAGS) `echo $(SHARED_LDFLAGS) | sed s/dynamiclib/bundle/`"; \ if [ -n "$(LIBVERSION)" ]; then \ SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \ fi; \ @@ -238,7 +250,7 @@ link_a.darwin: if [ -n "$$SHLIB_SOVER_NODOT" ]; then \ SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \ fi; \ - SHAREDFLAGS="$$SHAREDFLAGS -install_name $(INSTALLTOP)/lib/$$SHLIB$(SHLIB_EXT)"; \ + SHAREDFLAGS="$$SHAREDFLAGS -install_name $(INSTALLTOP)/$(LIBDIR)/$$SHLIB$(SHLIB_EXT)"; \ $(LINK_SO_A) link_app.darwin: # is there run-path on darwin? $(LINK_APP) @@ -260,7 +272,7 @@ link_o.cygwin: SHLIB_SOVER=${LIBVERSION:+"-$(LIBVERSION)"}; \ ALLSYMSFLAGS='-Wl,--whole-archive'; \ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ - SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base $$deffile -Wl,-s,-Bsymbolic"; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base $$deffile -Wl,-Bsymbolic"; \ $(LINK_SO_O) #for mingw target if def-file is in use dll-name should match library-name link_a.cygwin: @@ -281,11 +293,11 @@ link_a.cygwin: fi; \ dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \ $(PERL) util/mkrc.pl $$dll_name | \ - $(CROSS_COMPILE_PREFIX)windres -o rc.o; \ + $(CROSS_COMPILE)windres -o rc.o; \ extras="$$extras rc.o"; \ ALLSYMSFLAGS='-Wl,--whole-archive'; \ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ - SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-s,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \ [ -f apps/$$dll_name ] && rm apps/$$dll_name; \ [ -f test/$$dll_name ] && rm test/$$dll_name; \ $(LINK_SO_A) || exit 1; \ @@ -543,28 +555,10 @@ link_app.aix: LDFLAGS="$(CFLAGS) -Wl,-brtl,-blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \ $(LINK_APP) -link_o.reliantunix: - @ $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).so; \ - SHLIB_SUFFIX=; \ - ALLSYMSFLAGS=; \ - NOALLSYMSFLAGS=''; \ - SHAREDFLAGS='$(CFLAGS) -G'; \ - $(LINK_SO_O) -link_a.reliantunix: - @ $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).so; \ - SHLIB_SUFFIX=; \ - ALLSYMSFLAGS=; \ - NOALLSYMSFLAGS=''; \ - SHAREDFLAGS='$(CFLAGS) -G'; \ - $(LINK_SO_A_UNPACKED) -link_app.reliantunix: - $(LINK_APP) # Targets to build symbolic links when needed symlink.gnu symlink.solaris symlink.svr3 symlink.svr5 symlink.irix \ -symlink.aix symlink.reliantunix: +symlink.aix: @ $(CALC_VERSIONS); \ SHLIB=lib$(LIBNAME).so; \ $(SYMLINK_SO) @@ -579,11 +573,11 @@ symlink.hpux: expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \ $(SYMLINK_SO) # The following lines means those specific architectures do no symlinks -symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath symlink.beos: +symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath: # Compatibility targets link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu -link_a.bsd-gcc-shared link_a.linux-shared link_a.gnu-shared: link_a.gnu +link_a.bsd-gcc-shared link_a.gnu-shared: link_a.gnu link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared: link_app.gnu symlink.bsd-gcc-shared symlink.bsd-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu link_o.bsd-shared: link_o.bsd @@ -633,11 +627,3 @@ link_o.aix-shared: link_o.aix link_a.aix-shared: link_a.aix link_app.aix-shared: link_app.aix symlink.aix-shared: symlink.aix -link_o.reliantunix-shared: link_o.reliantunix -link_a.reliantunix-shared: link_a.reliantunix -link_app.reliantunix-shared: link_app.reliantunix -symlink.reliantunix-shared: symlink.reliantunix -link_o.beos-shared: link_o.beos -link_a.beos-shared: link_a.beos -link_app.beos-shared: link_app.gnu -symlink.beos-shared: symlink.beos