public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
To: "binutils@sourceware.org" <binutils@sourceware.org>
Subject: Re: [PATCH] gprofng: PR29987 bfd/archive.c:1447: undefined reference to `filename_ncmp'
Date: Fri, 13 Jan 2023 15:41:33 -0800	[thread overview]
Message-ID: <4f171a70-f1a4-f750-05aa-bf365970ae05@oracle.com> (raw)
In-Reply-To: <20230112205654.3456561-1-vladimir.mezentsev@oracle.com>

  I pushed my fixes to the master branch.
May I push this to the 2.40 branch ?

Thank you,
-Vladimir


On 1/12/23 12:56, vladimir.mezentsev@oracle.com wrote:
> From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
>
>
> gprofng only depends on libopcodes but has been linked with libbfd and libiberty.
> I removed unnecessary dependencies.
> But the libbfd build has a side effect.
> When I configure with --with-system-zlib and links my application with '../libbfd/libbfd.la -L ../libiberty -liberty',
> my application will be linked with /usr/lib/liberty.a instead of ../libiberty/liberty.a
> The problem is here:
> % grep dependency_libs bfd/libbfd.la
> dependency_libs=' -lz -L/usr/lib -lzstd /dev/shm/bld/libsframe/libsframe.la -ldl'
>                        ^^^^^^^^^^^^^^^^^
>                        |
>    This is probably $(ZSTD_LIBS). Why is it not just -lzstd?
>
>    
> Please review my fixes in gprofng below.
> Thank you,
> -Vladimir
>
> gprofng/ChangeLog
> 2023-01-12  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
>
> 	PR gprofng/29987
> 	* configure.ac: Remove dependencies on libbfd and libiberty.
> 	* gprofng/src/Makefile.am: Likewise.
> 	* configure: Rebuild.
> 	* Makefile.in: Rebuild.
> 	* src/Makefile.in: Rebuild.
> 	* doc/Makefile.in: Rebuild.
> 	* gp-display-html/Makefile.in: Rebuild.
> ---
>   gprofng/Makefile.in                 |  1 -
>   gprofng/configure                   | 11 ++---------
>   gprofng/configure.ac                |  6 ------
>   gprofng/doc/Makefile.in             |  1 -
>   gprofng/gp-display-html/Makefile.in |  1 -
>   gprofng/src/Makefile.am             |  2 --
>   gprofng/src/Makefile.in             |  8 ++------
>   7 files changed, 4 insertions(+), 26 deletions(-)
>
> diff --git a/gprofng/Makefile.in b/gprofng/Makefile.in
> index 01f7dca3f2a..3464b793813 100644
> --- a/gprofng/Makefile.in
> +++ b/gprofng/Makefile.in
> @@ -267,7 +267,6 @@ FGREP = @FGREP@
>   GPROFNG_BROKEN_JAVAC = @GPROFNG_BROKEN_JAVAC@
>   GPROFNG_CFLAGS = @GPROFNG_CFLAGS@
>   GPROFNG_CPPFLAGS = @GPROFNG_CPPFLAGS@
> -GPROFNG_LIBADD = @GPROFNG_LIBADD@
>   GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS = @GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS@
>   GPROFNG_NO_SWITCH_CFLAGS = @GPROFNG_NO_SWITCH_CFLAGS@
>   GREP = @GREP@
> diff --git a/gprofng/configure b/gprofng/configure
> index 40604319dc9..bcf971b75fa 100755
> --- a/gprofng/configure
> +++ b/gprofng/configure
> @@ -665,7 +665,6 @@ BUILD_COLLECTOR_TRUE
>   GPROFNG_NO_SWITCH_CFLAGS
>   gprofng_cflags
>   WERROR
> -GPROFNG_LIBADD
>   CXXCPP
>   OTOOL64
>   OTOOL
> @@ -12221,7 +12220,7 @@ else
>     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
>     lt_status=$lt_dlunknown
>     cat > conftest.$ac_ext <<_LT_EOF
> -#line 12224 "configure"
> +#line 12223 "configure"
>   #include "confdefs.h"
>   
>   #if HAVE_DLFCN_H
> @@ -12327,7 +12326,7 @@ else
>     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
>     lt_status=$lt_dlunknown
>     cat > conftest.$ac_ext <<_LT_EOF
> -#line 12330 "configure"
> +#line 12329 "configure"
>   #include "confdefs.h"
>   
>   #if HAVE_DLFCN_H
> @@ -15571,12 +15570,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
>   
>   
>   
> -GPROFNG_LIBADD="-L../../libiberty -liberty"
> -if test "$enable_shared" = "yes"; then
> -  GPROFNG_LIBADD="-L../../libiberty/pic -liberty"
> -fi
> -
> -
>   # Figure out what compiler warnings we can enable.
>   # See config/warnings.m4 for details.
>   
> diff --git a/gprofng/configure.ac b/gprofng/configure.ac
> index 83e60a640cf..55312cab3f8 100644
> --- a/gprofng/configure.ac
> +++ b/gprofng/configure.ac
> @@ -37,12 +37,6 @@ fi
>   AC_DISABLE_SHARED
>   LT_INIT
>   
> -GPROFNG_LIBADD="-L../../libiberty -liberty"
> -if test "$enable_shared" = "yes"; then
> -  GPROFNG_LIBADD="-L../../libiberty/pic -liberty"
> -fi
> -AC_SUBST(GPROFNG_LIBADD)
> -
>   # Figure out what compiler warnings we can enable.
>   # See config/warnings.m4 for details.
>   
> diff --git a/gprofng/doc/Makefile.in b/gprofng/doc/Makefile.in
> index a45018334e8..fd35f629403 100644
> --- a/gprofng/doc/Makefile.in
> +++ b/gprofng/doc/Makefile.in
> @@ -249,7 +249,6 @@ FGREP = @FGREP@
>   GPROFNG_BROKEN_JAVAC = @GPROFNG_BROKEN_JAVAC@
>   GPROFNG_CFLAGS = @GPROFNG_CFLAGS@
>   GPROFNG_CPPFLAGS = @GPROFNG_CPPFLAGS@
> -GPROFNG_LIBADD = @GPROFNG_LIBADD@
>   GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS = @GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS@
>   GPROFNG_NO_SWITCH_CFLAGS = @GPROFNG_NO_SWITCH_CFLAGS@
>   GREP = @GREP@
> diff --git a/gprofng/gp-display-html/Makefile.in b/gprofng/gp-display-html/Makefile.in
> index 42886f7c645..d2b9872fc71 100644
> --- a/gprofng/gp-display-html/Makefile.in
> +++ b/gprofng/gp-display-html/Makefile.in
> @@ -212,7 +212,6 @@ FGREP = @FGREP@
>   GPROFNG_BROKEN_JAVAC = @GPROFNG_BROKEN_JAVAC@
>   GPROFNG_CFLAGS = @GPROFNG_CFLAGS@
>   GPROFNG_CPPFLAGS = @GPROFNG_CPPFLAGS@
> -GPROFNG_LIBADD = @GPROFNG_LIBADD@
>   GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS = @GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS@
>   GPROFNG_NO_SWITCH_CFLAGS = @GPROFNG_NO_SWITCH_CFLAGS@
>   GREP = @GREP@
> diff --git a/gprofng/src/Makefile.am b/gprofng/src/Makefile.am
> index b802ffd39db..2278b9a39bb 100644
> --- a/gprofng/src/Makefile.am
> +++ b/gprofng/src/Makefile.am
> @@ -132,8 +132,6 @@ libgprofng_la_LDFLAGS = -version-info 0:0:0
>   # when -nostdlib is passed to libtool.
>   # See bug 29364 - libgprofng.so: needs to link against -pthread
>   libgprofng_la_LIBADD = $(top_builddir)/../opcodes/libopcodes.la \
> -	$(top_builddir)/../bfd/libbfd.la \
> -	$(GPROFNG_LIBADD) \
>   	-lpthread -ldl
>   
>   dbedir = $(SYSCONFDIR)
> diff --git a/gprofng/src/Makefile.in b/gprofng/src/Makefile.in
> index 4274762334e..71dccf5f952 100644
> --- a/gprofng/src/Makefile.in
> +++ b/gprofng/src/Makefile.in
> @@ -158,9 +158,7 @@ am__uninstall_files_from_dir = { \
>   am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(bindir)" \
>   	"$(DESTDIR)$(man1dir)" "$(DESTDIR)$(dbedir)"
>   LTLIBRARIES = $(pkglib_LTLIBRARIES)
> -am__DEPENDENCIES_1 =
> -libgprofng_la_DEPENDENCIES = $(top_builddir)/../opcodes/libopcodes.la \
> -	$(top_builddir)/../bfd/libbfd.la $(am__DEPENDENCIES_1)
> +libgprofng_la_DEPENDENCIES = $(top_builddir)/../opcodes/libopcodes.la
>   am__objects_1 = Application.lo BaseMetric.lo BaseMetricTreeNode.lo \
>   	CallStack.lo CatchOutOfMemory.lo ClassFile.lo Command.lo \
>   	CompCom.lo DataObject.lo DataSpace.lo Data_window.lo \
> @@ -192,6 +190,7 @@ libgprofng_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
>   PROGRAMS = $(bin_PROGRAMS)
>   am_gp_archive_OBJECTS = gp-archive.$(OBJEXT) ArchiveExp.$(OBJEXT)
>   gp_archive_OBJECTS = $(am_gp_archive_OBJECTS)
> +am__DEPENDENCIES_1 =
>   gp_archive_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1) \
>   	$(am__DEPENDENCIES_1)
>   am_gp_collect_app_OBJECTS = gp-collect-app.$(OBJEXT) checks.$(OBJEXT) \
> @@ -336,7 +335,6 @@ FGREP = @FGREP@
>   GPROFNG_BROKEN_JAVAC = @GPROFNG_BROKEN_JAVAC@
>   GPROFNG_CFLAGS = @GPROFNG_CFLAGS@
>   GPROFNG_CPPFLAGS = @GPROFNG_CPPFLAGS@
> -GPROFNG_LIBADD = @GPROFNG_LIBADD@
>   GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS = @GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS@
>   GPROFNG_NO_SWITCH_CFLAGS = @GPROFNG_NO_SWITCH_CFLAGS@
>   GREP = @GREP@
> @@ -556,8 +554,6 @@ libgprofng_la_LDFLAGS = -version-info 0:0:0
>   # when -nostdlib is passed to libtool.
>   # See bug 29364 - libgprofng.so: needs to link against -pthread
>   libgprofng_la_LIBADD = $(top_builddir)/../opcodes/libopcodes.la \
> -	$(top_builddir)/../bfd/libbfd.la \
> -	$(GPROFNG_LIBADD) \
>   	-lpthread -ldl
>   
>   dbedir = $(SYSCONFDIR)


  reply	other threads:[~2023-01-13 23:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12 20:56 vladimir.mezentsev
2023-01-13 23:41 ` Vladimir Mezentsev [this message]
2023-01-16 14:10   ` Luis Machado
2023-01-16 19:28     ` Joseph Myers
2023-01-17  0:05     ` Vladimir Mezentsev
2023-01-17 10:21       ` Luis Machado
2023-01-18  3:35         ` Vladimir Mezentsev

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=4f171a70-f1a4-f750-05aa-bf365970ae05@oracle.com \
    --to=vladimir.mezentsev@oracle.com \
    --cc=binutils@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).