Skip to contentSkip to conversation

protobuf: fix build for some unsupported architectures

PATCH Superseded Baruch Siach 2 participants 5 messages May 8, 2014 – May 9, 2014

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 protobuf: fix build for some unsupported architectures

Add patches for making use of generic gcc atomic operations for unknown architectures. Patches taken from
http://code.google.com/p/protobuf/issues/detail?id=488 .

Disable build for architectures that are not supported.

Fixes:
http://autobuild.buildroot.net/results/7e5/7e5791225334096206887de8a38fd947e1f8e9a2/
http://autobuild.buildroot.net/results/cf1/cf147b9188d6787a6a1a6072bf9bc6f7ddf5e5ae/

Cc Phil Eichinger <[email protected]>

---
v2:
List supported architectures as dependencies, as this list is much shorter than the list of unsupported archs.

---
 package/protobuf/Config.in                         |   4 +
 ...generic-GCC-support-for-atomic-operations.patch | 214 +++++++++++++++++++++
 ...-02-Add-generic-gcc-header-to-Makefile.am.patch |  31 +++
 package/protobuf/protobuf.mk                       |   2 +
 4 files changed, 251 insertions(+)
 create mode 100644 package/protobuf/protobuf-01-Add-generic-GCC-support-for-atomic-operations.patch
 create mode 100644 package/protobuf/protobuf-02-Add-generic-gcc-header-to-Makefile.am.patch
package/protobuf/Config.in +4 -0
index a4f542e0fce1..98e0d398e949 100644
@@ -2,6 +2,8 @@ config BR2_PACKAGE_PROTOBUF
 	bool "protobuf"
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_x86_64 || BR2_i386 || BR2_arm || BR2_aarch64 || \
+	    BR2_mipsel || BR2_powerpc
 	help
 	  Protocol buffers are Google's language-neutral, platform-neutral,
 	  extensible mechanism for serializing structured data.
@@ -9,4 +11,6 @@ config BR2_PACKAGE_PROTOBUF
 	  http://code.google.com/p/protobuf/
 
 comment "protobuf needs a toolchain w/ C++, threads"
+	depends on BR2_x86_64 || BR2_i386 || BR2_arm || BR2_aarch64 || \
+	    BR2_mipsel || BR2_powerpc
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
package/protobuf/protobuf-01-Add-generic-GCC-support-for-atomic-operations.patch new file +214 -0

214 lines not on this page · raw message

package/protobuf/protobuf-02-Add-generic-gcc-header-to-Makefile.am.patch new file +31 -0
new file mode 100644
index 000000000000..c53c98a36f57
@@ -0,0 +1,31 @@
+From b53d00e42cdc4a4b57e31d58244cb46b3b05bd6a Mon Sep 17 00:00:00 2001
+From: Stanislav Ochotnicky <[email protected]>
+Date: Thu, 16 May 2013 12:01:10 +0200
+Subject: [PATCH] Add generic gcc header to Makefile.am
+
+This way it will get included properly during installation and
+distribution generation
+
+Patch source: Issue #488
+(http://code.google.com/p/protobuf/issues/detail?id=488)
+
+Signed-off-by: Baruch Siach <[email protected]>
+---
+ src/Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 4069603..2458ceb 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -42,6 +42,7 @@ nobase_include_HEADERS =                                        \
+   google/protobuf/stubs/atomicops_internals_arm_gcc.h           \
+   google/protobuf/stubs/atomicops_internals_arm_qnx.h           \
+   google/protobuf/stubs/atomicops_internals_atomicword_compat.h \
++  google/protobuf/stubs/atomicops_internals_generic_gcc.h       \
+   google/protobuf/stubs/atomicops_internals_macosx.h            \
+   google/protobuf/stubs/atomicops_internals_mips_gcc.h          \
+   google/protobuf/stubs/atomicops_internals_pnacl.h             \
+-- 
+1.8.1.4
+
package/protobuf/protobuf.mk +2 -0
index ceb64dfa63fb..04da975a2452 100644
@@ -12,6 +12,8 @@ PROTOBUF_LICENSE_FILES = COPYING.txt
 # N.B. Need to use host protoc during cross compilation.
 PROTOBUF_DEPENDENCIES = host-protobuf
 PROTOBUF_CONF_OPT = --with-protoc=$(HOST_DIR)/usr/bin/protoc
+# Patching Makefile.am
+PROTOBUF_AUTORECONF = YES
 
 PROTOBUF_INSTALL_STAGING = YES
 
Signature · 1 line
2.0.0.rc0
#1 lore raw

PATCH v2 1/1 protobuf: fix build for some unsupported architectures

Hi list,

Quoted 30 lines · Baruch Siach

Add patches for making use of generic gcc atomic operations for unknown architectures. Patches taken from
http://code.google.com/p/protobuf/issues/detail?id=488 .

Disable build for architectures that are not supported.

Fixes:
http://autobuild.buildroot.net/results/7e5/7e5791225334096206887de8a38fd947e1f8e9a2/
http://autobuild.buildroot.net/results/cf1/cf147b9188d6787a6a1a6072bf9bc6f7ddf5e5ae/

Cc Phil Eichinger <[email protected]>

---
v2:
List supported architectures as dependencies, as this list is much shorter than the list of unsupported archs.

---
 package/protobuf/Config.in                         |   4 +
 ...generic-GCC-support-for-atomic-operations.patch | 214 +++++++++++++++++++++
 ...-02-Add-generic-gcc-header-to-Makefile.am.patch |  31 +++
 package/protobuf/protobuf.mk                       |   2 +
 4 files changed, 251 insertions(+)
 create mode 100644 package/protobuf/protobuf-01-Add-generic-GCC-support-for-atomic-operations.patch
 create mode 100644 package/protobuf/protobuf-02-Add-generic-gcc-header-to-Makefile.am.patch
package/protobuf/Config.in +0 -0
index a4f542e0fce1..98e0d398e949 100644

package/protobuf/Config.in config BR2_PACKAGE_PROTOBUF · line 6

Quoted 5 lines
package/protobuf/Config.in +2 -0
@@ -2,6 +2,8 @@ config BR2_PACKAGE_PROTOBUF
 	bool "protobuf"
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_x86_64 || BR2_i386 || BR2_arm || BR2_aarch64 || \
+	    BR2_mipsel || BR2_powerpc

Forgot to propagate dependencies, sorry. Will fix in v3.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#2 lore raw

PATCH v2 1/1 protobuf: fix build for some unsupported architectures

In reply to Baruch Siach

Dear Baruch Siach,

package/protobuf/Config.in config BR2_PACKAGE_PROTOBUF · line 6

Quoted 6 lines · Baruch Siach
package/protobuf/Config.in +2 -0
@@ -2,6 +2,8 @@ config BR2_PACKAGE_PROTOBUF
 	bool "protobuf"
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_x86_64 || BR2_i386 || BR2_arm || BR2_aarch64 || \
+	    BR2_mipsel || BR2_powerpc

Unless there's a good reason to not support it, maybe we could keep BR2_armeb here in the list of supported architectures?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH v2 1/1 protobuf: fix build for some unsupported architectures

Hi Thomas,

Quoted 11 lines · Thomas Petazzoni

package/protobuf/Config.in config BR2_PACKAGE_PROTOBUF · line 6

Quoted 6 lines · Baruch Siach
package/protobuf/Config.in +2 -0
@@ -2,6 +2,8 @@ config BR2_PACKAGE_PROTOBUF
 	bool "protobuf"
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_x86_64 || BR2_i386 || BR2_arm || BR2_aarch64 || \
+	    BR2_mipsel || BR2_powerpc

Unless there's a good reason to not support it, maybe we could keep BR2_armeb here in the list of supported architectures?

I don't see __ARMEB__(?) in the list of protobuf supported architectures at src/google/protobuf/stubs/platform_macros.h, only __ARMEL__.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#4 lore raw

PATCH v2 1/1 protobuf: fix build for some unsupported architectures

Dear Baruch Siach,

Quoted 5 lines · Baruch Siach
Quoted 2 lines

Unless there's a good reason to not support it, maybe we could keep BR2_armeb here in the list of supported architectures?

I don't see __ARMEB__(?) in the list of protobuf supported architectures at src/google/protobuf/stubs/platform_macros.h, only __ARMEL__.

Ok, thanks for checking!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com