[PATCH] gprofng: PR29987 bfd/archive.c:1447: undefined reference to `filename_ncmp'

Vladimir Mezentsev vladimir.mezentsev@oracle.com
Wed Jan 18 03:35:21 GMT 2023


Hi Luis,

On 1/17/23 02:21, Luis Machado wrote:
> Hi Vladimir,
>
> I gave the attach patch a try (had to rework it, as it doesn't apply 
> cleanly), and it still runs into a build error.

  I found Ubuntu machine and reproduced the build problem.
My fix for PR29987 was incorrect..
I made `git revert c2a5d74050e` and pushed to the master branch.

I need to research again how to solve the problem.

>
> Should we revert this (did it make it to binutils 2.40?) and try to 
> address it on-the-side as opposed to leaving the
> master branch in an unstable state?

My fix was not in binutils 2.40.

-Vladimir


>
> On 1/17/23 00:05, Vladimir Mezentsev wrote:
>> Hi Luis,
>>
>> On 1/16/23 06:10, Luis Machado wrote:
>>> Hi,
>>>
>>> I bisected a broken build on aarch64-linux Ubuntu 22.04 to this commit.
>>>
>>> It seems to cause a number of undefined references when building 
>>> with --enable-targets=all.
>>>
>>> -- 
>>> gprofng/src/../../../../repos/binutils-gdb/gprofng/src/Elf.cc:142: 
>>> undefined reference to `bfd_init'
>>>
>>> /usr/bin/ld: ./.libs/libgprofng.a(Elf.o): in function 
>>> `Elf::Elf(char*)':
>>> -- 
>>>
>>> A master build of binutils-gdb should hopefully run into the 
>>> problem. Passing --disable-gprofng seems to make the build complete OK.
>>>
>>> Could you please take a look at it?
>>
>>
>>
>> I don't have Ubuntu.
>> I cannot reproduce the problem on my configuration:
>>
>> % uname -a
>> Linux OL8.4-beta3 5.4.17-2102.200.13.el8uek.aarch64 #2 SMP Sun Mar 28 
>> 15:24:03 PDT 2021 aarch64 aarch64 aarch64 GNU/Linux
>>
>> % gcc --version
>> gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1.0.1)
>> Copyright (C) 2018 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions. There 
>> is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
>> PURPOSE.
>>
>> % libtool --version
>> libtool (GNU libtool) 2.4.6
>> Written by Gordon Matzigkeit, 1996
>> Copyright (C) 2014 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions. There 
>> is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
>> PURPOSE.
>>
>>
>> gprofng depends on libopcodes and as I see now gprofng directly 
>> depends on libbfd.
>> We use libtool to link gprofng only with libopcodes.
>> It looks like on my machines, libtool automatically links gprofng 
>> with libbfd because libopcodes depends on libbfd.
>>
>> I propose the fix below.
>> All builds on my machines are OK with and without this fix.
>> Could you check my fix on your machine ? Or should I push my path to 
>> the master branch now ?
>>
>>
>> Thank you,
>> -Vladimir
>>
>>
>> % cat 0001-gprofng-link-with-libbfd.patch
>>  From 8b2b7967649a605935d6810aa58c97437cd46b6b Mon Sep 17 00:00:00 2001
>> From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
>> Date: Mon, 16 Jan 2023 15:51:44 -0800
>> Subject: [PATCH] gprofng: link with libbfd
>>
>> gprofng/ChangeLog
>> 2023-01-16  Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
>>
>>      PR gprofng/29987
>>      * src/Makefile.am: Link with libbfd.
>>      * src/Makefile.in: Rebuild.
>> ---
>>   gprofng/src/Makefile.am | 1 +
>>   gprofng/src/Makefile.in | 4 +++-
>>   2 files changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/gprofng/src/Makefile.am b/gprofng/src/Makefile.am
>> index 2278b9a39bb..b3423e121e3 100644
>> --- a/gprofng/src/Makefile.am
>> +++ b/gprofng/src/Makefile.am
>> @@ -132,6 +132,7 @@ 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 \
>>       -lpthread -ldl
>>
>>   dbedir = $(SYSCONFDIR)
>> diff --git a/gprofng/src/Makefile.in b/gprofng/src/Makefile.in
>> index 71dccf5f952..90455880ec7 100644
>> --- a/gprofng/src/Makefile.in
>> +++ b/gprofng/src/Makefile.in
>> @@ -158,7 +158,8 @@ am__uninstall_files_from_dir = { \
>>   am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(bindir)" \
>>       "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(dbedir)"
>>   LTLIBRARIES = $(pkglib_LTLIBRARIES)
>> -libgprofng_la_DEPENDENCIES = $(top_builddir)/../opcodes/libopcodes.la
>> +libgprofng_la_DEPENDENCIES = $(top_builddir)/../opcodes/libopcodes.la \
>> +    $(top_builddir)/../bfd/libbfd.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 \
>> @@ -554,6 +555,7 @@ 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 \
>>       -lpthread -ldl
>>
>>   dbedir = $(SYSCONFDIR)
>



More information about the Binutils mailing list