Skip to contentSkip to conversation

protobuf-c: Do not use gold linker

PATCH In review Khem Raj 3 participants 7 messages Oct 16, 2021 – Oct 19, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/3 protobuf-c: Do not use gold linker

---
 meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb +2 -0
index cc037d3934..b5ab0a171c 100644
@@ -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.
Signature · 1 line
2.33.1
author
#1 lore raw

PATCH 2/3 libcrypt-openssl-rsa-perl: Fix build with openssl3+

---
 .../files/0001-Fix-for-Issue-31.patch         | 37 +++++++++++++++++++
 .../libcrypt-openssl-rsa-perl_0.32.bb         |  4 +-
 2 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 meta-perl/recipes-perl/libcrypt/files/0001-Fix-for-Issue-31.patch
meta-perl/recipes-perl/libcrypt/files/0001-Fix-for-Issue-31.patch new file +37 -0
new file mode 100644
index 0000000000..a5ea43f88b
@@ -0,0 +1,37 @@
+From 5e8202458e41ba1f7801746c503fe7c60ae340d5 Mon Sep 17 00:00:00 2001
+From: kambe-mikb <[email protected]>
+Date: Tue, 28 Sep 2021 17:40:18 +1000
+Subject: [PATCH] Fix for Issue 31
+
+Fix Issue 31 by removing reference to RSA_SSLV23_PADDING (removed from OpenSSL starting from v3.0.0)
+
+Upstream-Status: Submitted [https://github.com/toddr/Crypt-OpenSSL-RSA/pull/32]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ RSA.xs | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/RSA.xs b/RSA.xs
+index 46cb199..4f65dfc 100644
+--- a/RSA.xs
++++ b/RSA.xs
+@@ -640,12 +640,16 @@ use_pkcs1_oaep_padding(p_rsa)
+   CODE:
+     p_rsa->padding = RSA_PKCS1_OAEP_PADDING;
+ 
++#if OPENSSL_VERSION_NUMBER < 0x30000000L
++
+ void
+ use_sslv23_padding(p_rsa)
+     rsaData* p_rsa;
+   CODE:
+     p_rsa->padding = RSA_SSLV23_PADDING;
+ 
++#endif
++
+ # Sign text. Returns the signature.
+ 
+ SV*
+-- 
+2.33.1
+
meta-perl/recipes-perl/libcrypt/libcrypt-openssl-rsa-perl_0.32.bb +3 -1
index 48c04531ec..8dd2574e97 100644
@@ -3,7 +3,9 @@ SECTION = "libs"
 LICENSE = "Artistic-1.0 | GPL-1.0+"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=a67ceecc5d9a91a5a0d003ba50c26346"
 
-SRC_URI = "http://www.cpan.org/modules/by-module/Crypt/Crypt-OpenSSL-RSA-${PV}.tar.gz "
+SRC_URI = "http://www.cpan.org/modules/by-module/Crypt/Crypt-OpenSSL-RSA-${PV}.tar.gz \
+           file://0001-Fix-for-Issue-31.patch \
+"
 
 SRC_URI[sha256sum] = "adc74f0ae125c77f65d5dd32abb9c3429300a79543bf263494f333f9c0b62a61"
 
Signature · 1 line
2.33.1
author
#2 lore raw

PATCH 3/3 nodejs: Upgrade to 14.18.1

In reply to Khem Raj

License-Update: Reflect new location of gtest sources
remove node-inspect from license update Acorn to v8.4.1

---
 .../nodejs/{nodejs_14.17.1.bb => nodejs_14.18.1.bb}           | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename meta-oe/recipes-devtools/nodejs/{nodejs_14.17.1.bb => nodejs_14.18.1.bb} (98%)
meta-oe/recipes-devtools/nodejs/nodejs_14.18.1.bb renamed from meta-oe/recipes-devtools/nodejs/nodejs_14.17.1.bb +2 -2
similarity index 98%
rename from meta-oe/recipes-devtools/nodejs/nodejs_14.17.1.bb
rename to meta-oe/recipes-devtools/nodejs/nodejs_14.18.1.bb
index d468f2518e..a80811193e 100644
@@ -1,7 +1,7 @@
 DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript"
 HOMEPAGE = "http://nodejs.org"
 LICENSE = "MIT & BSD & Artistic-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=a1016f9b7979cfe6fc3466a9bba60b1e"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=6768abdfc4dae4fde59d6b4df96930f3"
 
 DEPENDS = "openssl"
 DEPENDS:append:class-target = " qemu-native"
@@ -33,7 +33,7 @@ SRC_URI:append:toolchain-clang:x86 = " \
 SRC_URI:append:toolchain-clang:powerpc64le = " \
            file://0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch \
            "
-SRC_URI[sha256sum] = "ddf1d2d56ddf35ecd98c5ea5ddcd690b245899f289559b4330c921255f5a247f"
+SRC_URI[sha256sum] = "3fa1d71adddfab2f5e3e41874b4eddbdf92b65cade4a43922fb1e437afcf89ed"
 
 S = "${WORKDIR}/node-v${PV}"
 
Signature · 1 line
2.33.1
#3 lore raw
In reply to Khem Raj
Quoted 7 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Khem Raj
Sent: den 16 oktober 2021 18:52
To: [email protected]
Cc: Khem Raj <[email protected]>
Subject: [oe] [meta-oe][PATCH 1/3] protobuf-c: Do not use gold linker

Add a motivation as to why this is needed.

//Peter

Quoted 23 lines
---
 meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb | 2 ++
 1 file changed, 2 insertions(+)
meta- renamed from meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb +0 -0

oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb
index cc037d3934..b5ab0a171c 100644

meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb +1 -0
@@ -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
author
#4 lore raw
Quoted 10 lines · Peter Kjellerstedt
Quoted 7 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Khem Raj
Sent: den 16 oktober 2021 18:52
To: [email protected]
Cc: Khem Raj <[email protected]>
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

Quoted 26 lines

//Peter

Quoted 23 lines
---
  meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb | 2 ++
  1 file changed, 2 insertions(+)
meta- renamed from meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb +0 -0

oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb
index cc037d3934..b5ab0a171c 100644

meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb +1 -0
@@ -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
#5 lore raw

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?

Quoted 63 lines · Khem Raj
Quoted 10 lines · Peter Kjellerstedt
Quoted 7 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Khem Raj
Sent: den 16 oktober 2021 18:52
To: [email protected]
Cc: Khem Raj <[email protected]>
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

Quoted 9 lines

//Peter

Review

Quoted 7 lines
---
  meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb | 2 ++
  1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/meta-

Quoted 8 lines
Quoted 8 lines

oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb
index cc037d3934..b5ab0a171c 100644

meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb +0 -0
@@ -19,6 +19,8 @@ S = "${WORKDIR}/git"
 
  inherit autotools pkgconfig
 
Quoted 9 lines
Quoted 8 lines
meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb +1 -0
+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: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

author
#6 lore raw
Quoted 9 lines · Martin Jansa

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
Quoted 5 lines

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

Quoted 63 lines · Khem Raj
Quoted 60 lines · Peter Kjellerstedt
Quoted 10 lines
Quoted 7 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Khem Raj
Sent: den 16 oktober 2021 18:52
To: [email protected]
Cc: Khem Raj <[email protected]>
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

Quoted 17 lines

//Peter

Quoted 15 lines
---
  meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb | 2 ++
  1 file changed, 2 insertions(+)
meta- renamed from meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb +0 -0

oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb
index cc037d3934..b5ab0a171c 100644

meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb +0 -0
@@ -19,6 +19,8 @@ S = "${WORKDIR}/git"
 
  inherit autotools pkgconfig
 
Quoted 9 lines
Quoted 8 lines
meta-oe/recipes-devtools/protobuf/protobuf-c_1.4.0.bb +1 -0
+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: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-