openembedded-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: Martin Jansa <martin.jansa@gmail.com>
Cc: Peter Kjellerstedt <peter.kjellerstedt@axis.com>,
	"openembedded-devel@lists.openembedded.org"
	<openembedded-devel@lists.openembedded.org>
Subject: Re: [oe] [meta-oe][PATCH 1/3] protobuf-c: Do not use gold linker
Date: Tue, 19 Oct 2021 09:06:10 -0700	[thread overview]
Message-ID: <CAMKF1srWe-NVQCA7-Y9h=utiFHFOJ5Vo=6tk1wVd3kcBzSr48A@mail.gmail.com> (raw)
In-Reply-To: <CA+chaQfD8hFQA7wYLYAbq3UN51xOTXEqkPZyrtwEbzTv9=rFjw@mail.gmail.com>

On Tue, Oct 19, 2021 at 8:09 AM Martin Jansa <martin.jansa@gmail.com> wrote:
>
> I'm seeing the same failure now, but it fails with bfd (with this fix) as well:
>
> | make[1]: Entering directory '/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0/build'
> | ./x86_64-oe-linux-libtool  --tag=CXX   --mode=link x86_64-oe-linux-g++  -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0/recipe-sysroot -std=c++11  -pthread -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0=/usr/src/debug/protobuf-c/1.4.0-r0                      -fdebug-prefix-map=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0=/usr/src/debug/protobuf-c/1.4.0-r0                      -fdebug-prefix-map=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0=/usr/src/debug/protobuf-c/1.4.0-r0                      -fdebug-prefix-map=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0=/usr/src/debug/protobuf-c/1.4.0-r0                      -fdebug-prefix-map=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0/recipe-sysroot-native=  -Wl,-z,relro,-z,now  -fuse-ld=bfd  -o protoc-c/protoc-gen-c protoc-c/protoc_gen_c-c_bytes_field.o protoc-c/protoc_gen_c-c_enum.o protoc-c/protoc_gen_c-c_enum_field.o protoc-c/protoc_gen_c-c_extension.o protoc-c/protoc_gen_c-c_field.o protoc-c/protoc_gen_c-c_file.o protoc-c/protoc_gen_c-c_generator.o protoc-c/protoc_gen_c-c_helpers.o protoc-c/protoc_gen_c-c_message.o protoc-c/protoc_gen_c-c_message_field.o protoc-c/protoc_gen_c-c_primitive_field.o protoc-c/protoc_gen_c-c_service.o protoc-c/protoc_gen_c-c_string_field.o protobuf-c/protoc_c_protoc_gen_c-protobuf-c.pb.o protoc-c/protoc_gen_c-main.o -lprotobuf -lpthread -lprotoc
> | x86_64-oe-linux-libtool: link: x86_64-oe-linux-g++ -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0/recipe-sysroot -std=c++11 -pthread -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0=/usr/src/debug/protobuf-c/1.4.0-r0 -fdebug-prefix-map=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0=/usr/src/debug/protobuf-c/1.4.0-r0 -fdebug-prefix-map=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0/recipe-sysroot= -fdebug-prefix-map=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0/recipe-sysroot-native= -fvisibility-inlines-hidden -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0=/usr/src/debug/protobuf-c/1.4.0-r0 -fdebug-prefix-map=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0=/usr/src/debug/protobuf-c/1.4.0-r0 -fdebug-prefix-map=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0/recipe-sysroot= -fdebug-prefix-map=/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0/recipe-sysroot-native= -Wl,-z -Wl,relro -Wl,-z -Wl,now -fuse-ld=bfd -o protoc-c/protoc-gen-c protoc-c/protoc_gen_c-c_bytes_field.o protoc-c/protoc_gen_c-c_enum.o protoc-c/protoc_gen_c-c_enum_field.o protoc-c/protoc_gen_c-c_extension.o protoc-c/protoc_gen_c-c_field.o protoc-c/protoc_gen_c-c_file.o protoc-c/protoc_gen_c-c_generator.o protoc-c/protoc_gen_c-c_helpers.o protoc-c/protoc_gen_c-c_message.o protoc-c/protoc_gen_c-c_message_field.o protoc-c/protoc_gen_c-c_primitive_field.o protoc-c/protoc_gen_c-c_service.o protoc-c/protoc_gen_c-c_string_field.o protobuf-c/protoc_c_protoc_gen_c-protobuf-c.pb.o protoc-c/protoc_gen_c-main.o  -lprotobuf -lpthread -lprotoc -pthread
> | /OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/protobuf-c/1.4.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/../../libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/11.2.0/ld.bfd: protobuf-c/protoc_c_protoc_gen_c-protobuf-c.pb.o:(.data.rel.ro+0x30): undefined reference to `descriptor_table_google_2fprotobuf_2fdescriptor_2eproto'
> | collect2: error: ld returned 1 exit status
>
> There is possible fix in meta-webosose:
> https://github.com/webosose/meta-webosose/commit/9250cad447658cc6cc431572cb3b2c606e3fe257
>
> I've verified that it fixes protobuf-c build for me, should I send it to meta-oe?
>

yes please

>
>
> On Sun, Oct 17, 2021 at 11:23 PM Khem Raj <raj.khem@gmail.com> wrote:
>>
>>
>>
>> On 10/17/21 3:51 AM, Peter Kjellerstedt wrote:
>> >> -----Original Message-----
>> >> From: openembedded-devel@lists.openembedded.org <openembedded-
>> >> devel@lists.openembedded.org> On Behalf Of Khem Raj
>> >> Sent: den 16 oktober 2021 18:52
>> >> To: openembedded-devel@lists.openembedded.org
>> >> Cc: Khem Raj <raj.khem@gmail.com>
>> >> Subject: [oe] [meta-oe][PATCH 1/3] protobuf-c: Do not use gold linker
>> >
>> > Add a motivation as to why this is needed.
>> >
>>
>> yeah, I should have added that gold linker ends up with symbols being
>> exported with weak attribute while libprotobuf.map lists these symbols
>> as global and exported. Gold linker ignores any mapping directive inside
>> extern 'C' blocks, it could be a bug in linker [1]
>>
>> also see gentoo bug [2]
>>
>> [1] https://sourceware.org/bugzilla/show_bug.cgi?id=24527
>> [2] https://bugs.gentoo.org/683892
>>
>> > //Peter
>> >
>> >>
>> >> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> >> ---
>> >>   meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb | 2 ++
>> >>   1 file changed, 2 insertions(+)
>> >>
>> >> diff --git a/meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb b/meta-
>> >> oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb
>> >> index cc037d3934..b5ab0a171c 100644
>> >> --- a/meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb
>> >> +++ b/meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb
>> >> @@ -19,6 +19,8 @@ S = "${WORKDIR}/git"
>> >>
>> >>   inherit autotools pkgconfig
>> >>
>> >> +LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -
>> >> fuse-ld=bfd ', '', d)}"
>> >> +
>> >>   # After several fix attempts there is still a race between generating
>> >>   # t.test-full.pb.h and compiling cxx_generate_packed_data.c despite
>> >>   # BUILT_SOURCES and explicit dependencies.
>> >> --
>> >> 2.33.1
>> >
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#93410): https://lists.openembedded.org/g/openembedded-devel/message/93410
>> Mute This Topic: https://lists.openembedded.org/mt/86375042/3617156
>> Group Owner: openembedded-devel+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [Martin.Jansa@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>


      reply	other threads:[~2021-10-19 16:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-16 16:52 [meta-oe][PATCH 1/3] protobuf-c: Do not use gold linker Khem Raj
2021-10-16 16:52 ` [meta-perl][PATCH 2/3] libcrypt-openssl-rsa-perl: Fix build with openssl3+ Khem Raj
2021-10-16 16:52 ` [meta-oe][PATCH 3/3] nodejs: Upgrade to 14.18.1 Khem Raj
2021-10-17 10:51 ` [oe] [meta-oe][PATCH 1/3] protobuf-c: Do not use gold linker Peter Kjellerstedt
2021-10-17 21:23   ` Khem Raj
2021-10-19 15:09     ` Martin Jansa
2021-10-19 16:06       ` Khem Raj [this message]

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='CAMKF1srWe-NVQCA7-Y9h=utiFHFOJ5Vo=6tk1wVd3kcBzSr48A@mail.gmail.com' \
    --to=raj.khem@gmail.com \
    --cc=martin.jansa@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=peter.kjellerstedt@axis.com \
    /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 NNTP newsgroup(s).