public inbox for dwarves@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Douglas RAILLARD <douglas.raillard@arm.com>
Cc: acme@redhat.com, dwarves@vger.kernel.org
Subject: Re: [PATCH] CMakeLists.txt: Add STATIC_LINK option
Date: Fri, 15 Oct 2021 10:22:43 -0300	[thread overview]
Message-ID: <YWmAo8Xv5YZBlL41@kernel.org> (raw)
In-Reply-To: <YWl/sfJLWEHGdJwV@kernel.org>

Em Fri, Oct 15, 2021 at 10:18:41AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Fri, Oct 15, 2021 at 11:10:08AM +0100, Douglas RAILLARD escreveu:
> > From: Douglas Raillard <douglas.raillard@arm.com>
> > 
> > Add a user-defined STATIC_LINK option that can be used to build a fully
> > static binary for the executables:
> > 
> >     cmake .. -DSTATIC_LINK=ON
> > 
> > This has been tested on Alpine Linux v3.14.
> 
> That is just for libdwarves. Humm, with your patch I'm getting this
> warning:
> 
> ⬢[acme@toolbox pahole]$ rm -rf build
> ⬢[acme@toolbox pahole]$ mkdir build
> ⬢[acme@toolbox pahole]$ cd build
> ⬢[acme@toolbox build]$ cmake -DSTATIC_LINK=ON ..
> -- The C compiler identification is GNU 11.2.1
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Check for working C compiler: /usr/bin/cc - skipped
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- Setting BUILD_SHARED_LIBS = ON
> -- Checking availability of DWARF and ELF development libraries
> -- Looking for dwfl_module_build_id in elf
> -- Looking for dwfl_module_build_id in elf - found
> -- Found dwarf.h header: /usr/include
> -- Found elfutils/libdw.h header: /usr/include
> -- Found libdw library: /usr/lib64/libdw.so
> -- Found libelf library: /usr/lib64/libelf.so
> -- Checking availability of DWARF and ELF development libraries - done
> -- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
> -- Checking availability of argp library
> -- Assuming argp is in libc
> -- Checking availability of argp library - done
> -- Checking availability of obstack library
> -- Assuming obstack is in libc
> -- Checking availability of obstack library - done
> -- Submodule update
> -- Submodule update - done
> -- Performing Test HAVE_REALLOCARRAY_SUPPORT
> -- Performing Test HAVE_REALLOCARRAY_SUPPORT - Success
> -- Configuring done
> -- Generating done
> CMake Warning:
>   Manually-specified variables were not used by the project:
> 
>     STATIC_LINK
> 
> 
> -- Build files have been written to: /var/home/acme/git/pahole/build
> ⬢[acme@toolbox build]$
> 
> And when I build I don't get a static binary, can you check? I'm doing a
> bit of investigation now.

Nevermind, brown paper bag on my head, this is _without_ your patch,
doh, with it I first get:

⬢[acme@toolbox build]$ cmake -DSTATIC_LINK=ON ..
-- The C compiler identification is GNU 11.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking availability of DWARF and ELF development libraries
-- Please install the elfutils-libs package
-- Please install the elfutils-libelf package
CMake Error at cmake/modules/FindDWARF.cmake:103 (message):
  Could NOT find some ELF and DWARF libraries, please install the missing
  packages
Call Stack (most recent call first):
  CMakeLists.txt:64 (find_package)


-- Configuring incomplete, errors occurred!
See also "/var/home/acme/git/pahole/build/CMakeFiles/CMakeOutput.log".
⬢[acme@toolbox build]$

Which means I don't have those static library files, will try installing
them.

- Arnaldo

  reply	other threads:[~2021-10-15 13:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15 10:10 [PATCH] CMakeLists.txt: Add STATIC_LINK option Douglas RAILLARD
2021-10-15 13:18 ` Arnaldo Carvalho de Melo
2021-10-15 13:22   ` Arnaldo Carvalho de Melo [this message]
2021-10-15 14:20     ` Arnaldo Carvalho de Melo
2021-10-15 14:39       ` Arnaldo Carvalho de Melo
2021-10-18  9:57       ` Douglas Raillard
2021-10-19 15:24         ` Arnaldo Carvalho de Melo
2021-10-19 16:03           ` Douglas Raillard
2021-10-19 17:29           ` Douglas Raillard
2021-10-20 12:49             ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YWmAo8Xv5YZBlL41@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=douglas.raillard@arm.com \
    --cc=dwarves@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox