[PATCH] gprofng: a new GNU profiler

Joseph Myers joseph@codesourcery.com
Mon Aug 16 20:35:37 GMT 2021


On Mon, 16 Aug 2021, Vladimir Mezentsev via Binutils wrote:

> We use LD_PRELOAD to load our library in the profiled process's address space.
> As I understand, we can not build together our 32-bit and 64-bit libraries.
> We should build separately for each ABI.

Yes, that library should be built separately.

A distribution for x86_64 should, I hope, be able to have a single build 
of the gprofng host tools, and three separate builds of the libraries for 
the three ABIs (in multilib or multiarch directories depending on what's 
used by the distribution), unless the host tools need to be able to load 
the same libraries for the same ABI, or something like that.  So you 
should make sure it's straightforward to build just the host tools that 
only need to be built once, or to build just the libraries (for a single 
ABI) that need to be built separately for each ABI, and document 
(somewhere checked into the repository and kept up to date as the 
information changes, not just in emails or commit messages) how to do 
these builds and how to tell the host gprofng tools where to fine the 
libraries.

> If it is correct, how should I configure my build for the 32-bit ABI on x86_64
> ?
> Is it correct :
>    --enable-shared CFLAGS=-m32 CXXFLAGS=-m32 CCFLAGS=-m32
> --target=i686-pc-linux-gnu --prefix=INSTALL_DIR --libdir=INSTAL_DIR/lib32

For options required to be used in all compilations, they should go in CC 
and CXX, not CFLAGS and CXXFLAGS (CFLAGS and CXXFLAGS are for 
non-ABI-changing, non-semantic options such as -g -O2).

lib32 isn't a directory name normally used on x86, though some systems 
might use it.  Multilib directory arrangements conventially use (lib64, 
lib, libx32) as the directory names for 64-bit, 32-bit and x32 libraries.  
Multiarch directory arrangements use (lib/x86_64-linux-gnu, 
lib/i386-linux-gnu, lib/x86_64-linux-gnux32) as documented at 
<https://wiki.debian.org/Multiarch/Tuples>.

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Binutils mailing list