Skip to contentSkip to conversation

package/bayer2rgb-neon: fix build

PATCH In review Fabrice Fontaine 3 participants 3 messages Jun 26, 2022 – Aug 11, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/bayer2rgb-neon: fix build

Fix the following build failure:

/home/autobuild/autobuild/instance-12/output-1/host/lib/gcc/aarch64-buildroot-linux-uclibc/10.3.0/../../../../aarch64-buildroot-linux-uclibc/bin/ld: ./.libs/libbayer2rgb3.so: undefined reference to `__bayer2rgb_missing_convert_dumb_implementation'

Fixes:
- http://autobuild.buildroot.org/results/69a637b7f1422ce2bf04dda573abb09388b9a02d

---
 ...-src-convert.c-remove-have_cplusplus.patch | 56 +++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 package/bayer2rgb-neon/0001-src-convert.c-remove-have_cplusplus.patch
package/bayer2rgb-neon/0001-src-convert.c-remove-have_cplusplus.patch new file +56 -0
new file mode 100644
index 0000000000..71a6291a3c
@@ -0,0 +1,56 @@
+From ca68dadf585aadb8adf582cd94f8fcdd4592e09f Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Sun, 26 Jun 2022 10:31:49 +0200
+Subject: [PATCH] src/convert.c: remove have_cplusplus
+
+Remove have_cplusplus function for simplicity and to avoid the following
+build failure:
+
+/home/autobuild/autobuild/instance-12/output-1/host/lib/gcc/aarch64-buildroot-linux-uclibc/10.3.0/../../../../aarch64-buildroot-linux-uclibc/bin/ld: ./.libs/libbayer2rgb3.so: undefined reference to `__bayer2rgb_missing_convert_dumb_implementation'
+
+Fixes:
+ - http://autobuild.buildroot.org/results/69a637b7f1422ce2bf04dda573abb09388b9a02d
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ src/convert.c | 19 +++++--------------
+ 1 file changed, 5 insertions(+), 14 deletions(-)
+
+diff --git a/src/convert.c b/src/convert.c
+index c852a14..83d631d 100644
+--- a/src/convert.c
++++ b/src/convert.c
+@@ -27,25 +27,16 @@ static bool have_neon()
+ #endif
+ }
+ 
+-static bool have_cplusplus()
+-{
+-#ifdef HAVE_CPLUSPLUS
+-	return true;
+-#else
+-	return false;
+-#endif
+-}
+-
+ void bayer2rgb_convert_dumb(struct image_in const *input,
+ 			    struct image_out const *output,
+ 			    struct image_conversion_info *info)
+ {
++#ifdef HAVE_CPLUSPLUS
++	return bayer2rgb_convert_cc(input, output, info);
++#else
+ 	extern void __bayer2rgb_missing_convert_dumb_implementation();
+-
+-	if (have_cplusplus())
+-		return bayer2rgb_convert_cc(input, output, info);
+-	else
+-		__bayer2rgb_missing_convert_dumb_implementation();
++	__bayer2rgb_missing_convert_dumb_implementation();
++#endif
+ }
+ 
+ void bayer2rgb_convert(struct image_in const *input,
+-- 
+2.35.1
+
Signature · 6 lines
2.35.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 4 lines · On Sun, 26 Jun 2022 10:45:17 +0200 Fabrice Fontaine…

Fix the following build failure:

/home/autobuild/autobuild/instance-12/output-1/host/lib/gcc/aarch64-buildroot-linux-uclibc/10.3.0/../../../../aarch64-buildroot-linux-uclibc/bin/ld: ./.libs/libbayer2rgb3.so: undefined reference to `__bayer2rgb_missing_convert_dumb_implementation'

Quoted 8 lines

Fixes:
- http://autobuild.buildroot.org/results/69a637b7f1422ce2bf04dda573abb09388b9a02d

---
 ...-src-convert.c-remove-have_cplusplus.patch | 56 +++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 package/bayer2rgb-neon/0001-src-convert.c-remove-have_cplusplus.patch

I have applied to fix the immediate build issue, but I am not entirely convinced this is the completely correct fix.

Indeed, the function __bayer2rgb_missing_convert_dumb_implementation() is not implemented anywhere. So as soon as C++ support is not available, bayer2rgb-neon doesn't build. So the correct fix would be (IMO) to drop this logic, and make C++ a requirement in the configure.ac script.

Normally, this call to __bayer2rgb_missing_convert_dumb_implementation() gets optimized away by the dead code elimination gcc optimizations. But when you build with -Og as it is the case in the autobuilder failure you're pointing to, such optimization does not take place, and the call to __bayer2rgb_missing_convert_dumb_implementation() is preserved, even though it is never invoked practically at runtime.

Best regards,

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Fabrice Fontaine
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Fabrice" == Fabrice Fontaine <[email protected]> writes:

Fix the following build failure:
/home/autobuild/autobuild/instance-12/output-1/host/lib/gcc/aarch64-buildroot-linux-uclibc/10.3.0/../../../../aarch64-buildroot-linux-uclibc/bin/ld:
./.libs/libbayer2rgb3.so: undefined reference to
`__bayer2rgb_missing_convert_dumb_implementation'

Fixes:
- http://autobuild.buildroot.org/results/69a637b7f1422ce2bf04dda573abb09388b9a02d

Committed to 2022.05.x and 2022.02.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot