I've seen myriad threads over the years discussing this error on Solaris systems: /usr/local/bin/ld: cannot open linker script file /install/samba-3.5.2/source3/exports/libtalloc.so.2: No such file or directory collect2: ld returned 1 exit status make: *** [bin/libtalloc.so.2] Error 1 Mine happens to be Solaris 8, but it appears from web searches on this error that it affects a number of other Solaris versions as well. I determined that this is because the Makefile's DSO_EXPORTS_CMD (Makefile.in:31) uses a sed syntax that is probably peculiar to GNU sed: DSO_EXPORTS_CMD=-Wl,--version-script,$(srcdir)/exports/`basename $@ | \ sed 's/@SHLIBEXT@\(.[0-9]\{1,\}\)\{0,1\}$$/@SYMSEXT@/'` That turns into this during the build: `basename bin/libtalloc.so.2 | sed 's/so\(.[0-9]\{1,\}\)\{0,1\}$/syms/'` This is supposed to turn into "libtalloc.syms". However, the Solaris 8 (and others?) sed command does not recognize the use of curly braces against a multi-character regexp, so it just turns into libtalloc.so.2 since the sed doesn't match anything, and that file doesn't exist, of course. By changing the sed command, it becomes more verbose, but fixes the build problem on Solaris 8 (and others?) and gives the same results, with the "{0}" of {0,1} as the first -e and the {1} as the second -e: sed -e 's/@SHLIBEXT@$$/@SYMSEXT@/' -e 's/@SHLIBEXT@\.[0-9]\{1,\}$$/@SYMSEXT@/' (Note that I changed the "." to a "\." so it will match only a period, rather than "sox123" - separate bug?)
a simple sed 's/@SHLIBEXT@\.[0-9][0-9]*$$/@SYMSEXT@/' works as well? AFAICS this should do what we want without looking too ugly, right?
(In reply to comment #1) > a simple > > sed 's/@SHLIBEXT@\.[0-9][0-9]*$$/@SYMSEXT@/' > > works as well? AFAICS this should do what we want without looking too ugly, > right? Not quite. In English, the original RE says: 's/so\(.[0-9]\{1,\}\)\{0,1\}$/syms/' -- Find "so" followed by zero or one occurrences of the following pattern at the end of the line: ______ any character (should be \., a dot) followed by one or more digits and replace it with "syms" -- So you're looking for "libtalloc.so" as well as "libtalloc.so.2" and "libtalloc.so.999". (You won't match "libtalloc.so.2.1" with the original RE.) The pattern you show above would only match "libtalloc.so.2" and "libtalloc.so.999", not "libtalloc.so" as the original pattern is trying to do.
given that the solaris sed (maybe others, too) are limited as you pointed out, this might be a way to be compatible, match files ending on .so, .so.1 and .so.1.1 and so on: sed "s:so[\.0-9]*$:syms:" sure, this is also matching on "so0815" or "so..." but this is negligible I think.
I like the look of that. My main goal above was to duplicate the exact operation of the original, but if there's no grand historical reason dating back to Samba 1.0.3 why .so.1.1 should not be matched and replaced, then there's no reason to slavishly adhere to the original mechanism. It might be a tad safer to go: sed "s:\.so[\.0-9]*$:.syms:" ... but that's just me being fussy.
Created attachment 7015 [details] git-am patch Bjorn pushed to master. Patch Bjorn pushed to master.
Assigning to Karolin for 3.6.2. Jeremy.
wanted to wait for the commit hash in master: it's 37be1df3d7534c2cc8e1e25614164c2178372b94. Thanks Michael! imho we should also pick this one at least to 3.5.
Pushed to v3-5-test and v3-6-test. Closing out bug report. Thanks!