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?



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]
-=-=-=-=-=-=-=-=-=-=-=-