SONAME clarification

Marco Atzeri marco_atzeri at yahoo.it
Fri Jan 30 11:20:14 CST 2009


--- "John W. Eaton" <jwe at octave.org> ha scritto:

> On 29-Jan-2009, Marco Atzeri wrote:
> | 
> | Hi John,
> | thanks for the effort, however
> | something is not as expected on cygwin
> |  
> | $ file lib*       
> | 
> | libcruft.so:         PE32 executable for MS
> Windows
> | (DLL) (console) Intel 80386 32-bit
> | libcruft.so.3.1.51+: symbolic link to
> `libcruft.so'
> | liblibcruftso:       current ar archive
> | 
> | I will try to investigate why I have "so" instead
> of
> | "dll".
> | For the last "liblibcruftso" SONAME does not work 
> | if $(basename) is already "libcruft"
> | 
> |
>
SONAME_FLAGS='-Wl,--out-implib=$(SHLLIBPRE)$(basename
> | $@)$(SHLLIB)'
> | 
> | should it be something like
> | SONAME_FLAGS='-Wl,--out-implib=$(patsubst
> | lib,$(SHLBINPRE)%,$@).$(SHLLIB)'
> 
> The missing . is definitely a mistake.
> 
> I see now that the use of $(basename) is also wrong.
> 
> The $(SONAME_FLAGS) variable is used in rules like
> 
>   $(SHLLIBPRE)cruft.$(SHLEXT): $(CRUFT_PICOBJ)
>           rm -f $@
>           $(SH_LD) $(SH_LDFLAGS) $(SONAME_FLAGS) -o
> $@ $^ $(LINK_DEPS)
> 
> So "$@" is "$(SHLLIBPRE)cruft.$(SHLEXT)".
> 
> You'll have to tell me what is the right conversion.
>  I don't really
> understand what the argument to --out-implib is
> supposed to be.
> 
> jwe
> 
Hi John, 
the Cywin reference is here
http://cygwin.com/cygwin-ug-net/dll.html#dll-build

gcc -shared -o cyg${module}.dll \
    -Wl,--out-implib=lib${module}.dll.a \
    -Wl,--export-all-symbols \
    -Wl,--enable-auto-import \
    -Wl,--whole-archive ${old_libs} \
    -Wl,--no-whole-archive ${dependency_libs}

while for mingw the convention is

gcc -shared -o lib${module}.dll \
    -Wl,--out-implib=lib${module}.dll.a \
....

Attached an additional patch, to amend yours.
Now I have the right call

g++ -shared -Wl,--export-all-symbols
-Wl,--enable-auto-import -Wl,--enable-auto-image-base 
-Wl,--out-implib=libcruft.dll.a -o cygcruft.dll ....

and files

libcruft.dll.a:         current ar archive
cygcruft.dll:           PE32 executable for MS Windows
(DLL) (console) Intel 80386 32-bit
cygcruft.dll.a.3.1.51+: symbolic link to `cygcruft.dll

Two additional notes:

1 )I can not test mingw so somemone else should verify
that the mingw portion is correct

2) I am blocked by this problem

http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-December/009785.html

so my build is incomplete and 
I can not check if the remaing of your patch is 
fine for the install phase.  

Best Regards
Marco



      Passa a Yahoo! Mail.

La webmail che ti offre GRATIS spazio illimitato, 
antispam e messenger integrato.
http://it.mail.yahoo.com/              
-------------- next part --------------
A non-text attachment was scrubbed...
Name: octave-hg-1.patch
Type: text/x-diff
Size: 889 bytes
Desc: 1495787889-octave-hg-1.patch
Url : https://www-old.cae.wisc.edu/pipermail/octave-maintainers/attachments/20090130/30f028d2/attachment.bin 


More information about the Octave-maintainers mailing list