On Saturday 09 September 2017 19:23:19 fredvs wrote:
> > > Maybe in compiler/link.pas:509 (TLinker.AddSharedCLibrary()).
>
>     Procedure TLinker.AddSharedCLibrary(S:TCmdStr);
>       begin
>         if s='' then
>           exit;
>         { remove prefix 'lib' }
>         if
> Copy(s,1,length(target_info.sharedclibprefix))=target_info.sharedclibprefix
> then
>           Delete(s,1,length(target_info.sharedclibprefix));
>         { remove extension if any }
>         if
> Copy(s,length(s)-length(target_info.sharedclibext)+1,length(target_info.sha
>redclibext))=target_info.sharedclibext then
>
> Delete(s,length(s)-length(target_info.sharedclibext)+1,length(target_info.s
>haredclibext)+1); { ready to be added }
>         SharedLibFiles.Concat(S);
>       end;
>
> But... it is hypra-simple to fix.  And it would not make any trouble for
> previous code, it will be still compatible.
>
Because it is target system dependent there probably should be a new entry in 
target_info (tsysteminfo) for a character which starts a SONAME/filename. If 
the "external"/{$loadlib} name starts with that character the library name 
string should be used unchanged. For Linux and FreeBSD it would be ':'.
https://www.freebsd.org/cgi/man.cgi?ld(1)
"
-lnamespec
--library=namespec
           Add the archive or object file specified by namespec to the list of
           files to link.  This option may be used any number of times.  If
           namespec is of the form :filename, ld will search the library path
           for a file called filename, otherise it will search the library
           path for a file called libnamespec.a.
[...]
"
Linux man ld:
"
       -l namespec
       --library=namespec
           Add the archive or object file specified by namespec
           to the list of files to link.  This option may be
           used any number of times.  If namespec is of the form
           :filename, ld will search the library path for a file
           called filename, otherwise it will search the library
           path for a file called libnamespec.a.
[...]
"
For the linker script "INPUT (-l:file)" must be used.
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/simple-commands.html
"
INPUT(file, file, …), INPUT(file file …)

    The INPUT command directs the linker to include the named files in the 
link, as though they were named on the command line.

    For example, if you always want to include subr.o any time you do a link, 
but you can't be bothered to put it on every link command line, then you can 
put INPUT (subr.o) in your linker script.

    In fact, if you like, you can list all of your input files in the linker 
script, and then invoke the linker with nothing but a -T option.

    In case a sysroot prefix is configured, and the filename starts with the / 
character, and the script being processed was located inside the sysroot 
prefix, the filename will be looked for in the sysroot prefix. Otherwise, the 
linker will try to open the file in the current directory. If it is not 
found, the linker will search through the archive library search path. See 
the description of -L in Section 3.1 Command Line Options.

    If you use INPUT (-lfile), ld will transform the name to libfile.a, as 
with the command line argument -l. 
"
Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to