Re: Questions related to creation of libgcov.so

2018-08-17 Thread Martin Liška
Hello.

On 08/16/2018 03:29 PM, Michael Matz wrote:
> Hi,
> 
> On Thu, 16 Aug 2018, Martin Liška wrote:
> 
>> SHLIB_SOVERSION = 1
>> SHLIB_SONAME = @shlib_base_name@.so.$(SHLIB_SOVERSION)
>>
>> which would require a substitution for soversion, show I generalize even 
>> so much?
> 
> I wouldn't bother.  libgcov.so.1 sounds just fine, and due to symbol 
> versioning we never need to change the SO version anymore (like with 
> libgcc_s).

Good.

> 
>> About the location of libgcov.{a,so}, I believe right place would be now:
>>
>> /home/marxin/bin/gcc/lib64/libgcov.so.1
>> /home/marxin/bin/gcc/lib64/libgcov.so
>> /home/marxin/bin/gcc/lib64/libgcov.a
> 
> No.  With version dependend dirs the .so symlink and the .a file have to 
> be placed into the version dependend dirs.  Look at where libgcc_s.so and 
> libgcc.a are placed on your system.
> 
>> Because of LD_LIBRARY_PATH location I believe libgcov.so should not be in:
>> /home/marxin/bin/gcc/lib64/gcc/x86_64-pc-linux-gnu/9.0.0/libgcov.so
> 
> LD_LIBRARY_PATH doesn't affect the .so symlink (which is used for link 
> editing), but where the full SONAME library (i.e. libgcov.so.1) is found.  
> _That_ one should indeed be placed into a normal system directory like 
> /usr/lib, again look at the distribution of files from your system.

Ok, so proper layout would be:

/home/marxin/bin/gcc/lib64/libgcov.so.1
/home/marxin/bin/gcc/lib64/gcc/x86_64-pc-linux-gnu/9.0.0/libgcov.so
/home/marxin/bin/gcc/lib64/gcc/x86_64-pc-linux-gnu/9.0.0/libgcov.a

Where /home/marxin/bin/gcc/lib64/gcc/x86_64-pc-linux-gnu/9.0.0/libgcov.so 
points to
/home/marxin/bin/gcc/lib64/libgcov.so.1 ?


> 
>> One another question has popped up:
>>
>> libgcov.a archive consists of many one-function-per-object-file objects,
>> this is guarded with e.g. #ifdef L_gcov_reset macro. For shared library I 
>> need
>> something like:
>> +#if defined(L_gcov_reset) || defined(L_gcov_shared)
>>
>> question is whether it worth separating the functions into separate objects? 
>> I know
>> during linking linker can strip the unused ones. But still.
> 
> No, that wouldn't make sense because the shared library needs to contain 
> all the functions that are potentially callable (i.e. all of them).  There 
> are no unused ones.

Yes, but we build objects for libgcov.a separately, each object with one 
L_gcov_* macro defined.
So still it works in case of the static library.

Martin

> 
> 
> Ciao,
> Michael.
> 



Mhi

2018-08-17 Thread 张火锐
佳    
开   
V : zyt9496   
 
V     
發  
号  
X 
漂      Q:   
 
178  +>   
0010029  .   
---
普  专1  点
 
优 1  验   
 付..
漂   漂1
 数 
惠  1 
证    歀退订 
Unsubscribe

Re: Questions related to creation of libgcov.so

2018-08-17 Thread Joseph Myers
On Fri, 17 Aug 2018, Martin Liška wrote:

> Where /home/marxin/bin/gcc/lib64/gcc/x86_64-pc-linux-gnu/9.0.0/libgcov.so 
> points to
> /home/marxin/bin/gcc/lib64/libgcov.so.1 ?

Any symlinks need to be *relative*, not absolute, so the install tree is 
relocatable.  There's unlibsubdir / libsubdir_to_prefix in gcc/Makefile.in 
but I'm not sure if that's available in the libgcc/ directory at present.

-- 
Joseph S. Myers
jos...@codesourcery.com

gcc-8-20180817 is now available

2018-08-17 Thread gccadmin
Snapshot gcc-8-20180817 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/8-20180817/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 8 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-8-branch 
revision 263636

You'll find:

 gcc-8-20180817.tar.xzComplete GCC

  SHA256=a38b393bb1a331abbea65c5862cb80526b07856c72c2a144f4a8e45bd41ff1d0
  SHA1=169b4df9fbaba20d43ad3792af84ec7c725be4d6

Diffs from 8-20180810 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-8
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.