Issue 488 in protobuf: powerpc-linux cross compilation not compiling anymore

348 views
Skip to first unread message

prot...@googlecode.com

unread,
Mar 28, 2013, 5:40:46 AM3/28/13
to prot...@googlegroups.com
Status: New
Owner: liu...@google.com
Labels: Type-Defect Priority-Medium

New issue 488 by ch.pries...@gmail.com: powerpc-linux cross compilation not
compiling anymore
http://code.google.com/p/protobuf/issues/detail?id=488

What steps will reproduce the problem?
1.
Run configure command with cross toolchain:

./configure --host=powerpc-linux
--prefix=/opt/eldk-5.2.1/powerpc-4xx/sysroots/i686-eldk-linux CFLAGS='-fPIC
-g -O0' CXXFLAGS='-fPIC -g -O0'
CC=/opt/eldk-5.2.1/powerpc-4xx/sysroots/i686-eldk-linux/usr/bin/ppc440e-linux/powerpc-4xx-gcc
CXX=/opt/eldk-5.2.1/powerpc-4xx/sysroots/i686-eldk-linux/usr/bin/ppc440e-linux/powerpc-4xx-g++
LDFLAGS='-L/opt/eldk-5.2.1/powerpc-4xx/sysroots/ppc440e-linux/lib'

Use cross toolchain DENX ELDK 5.2.1 (http://www.denx.de/wiki/DULG/ELDK).
Configuration successful

2.
make

Fails with
/google/protobuf/stubs/platform_macros.h:61:2: error: #error Host
architecture was not detected as supported by protobuf
q
What is the expected output? What do you see instead?
expect working cross build. Performed successfully with V2.4.1 and below.
No information in release notes, that ppc-linux is not supported anymore

What version of the product are you using? On what operating system?
V2.5.0, Ubuntu 10.04, DENX ELDK 5.2.1

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

prot...@googlecode.com

unread,
Apr 3, 2013, 9:04:55 PM4/3/13
to prot...@googlegroups.com
Updates:
Status: NeedPatchFromUser
Owner: xiaof...@google.com

Comment #1 on issue 488 by xiaof...@google.com: powerpc-linux cross
We don't have the convenience to test on these platforms. Could you provide
us a patch to make it work on ppc? Thanks.

prot...@googlecode.com

unread,
Apr 18, 2013, 9:57:53 AM4/18/13
to prot...@googlegroups.com

Comment #2 on issue 488 by ch.pries...@gmail.com: powerpc-linux cross
Currently I switched back to 2.4.1, which works fine. For future version
upgrades I can provide patch. regards

prot...@googlecode.com

unread,
May 6, 2013, 9:10:57 AM5/6/13
to prot...@googlegroups.com

Comment #3 on issue 488 by stanis...@ochotnicky.com: powerpc-linux cross
Here is a proposed patch which I've tested to at least build on i686,
x86_64, ppc, ppc64, s390/s390x. It should also work on AARCH64 (64 bit ARM
architecture) once it becomes available. Tested with gcc 4.7.2 and 4.8.0


The patch should not affect architectures that are supported as primary
right now, but instead of failing to build it will use generic GCC __atomic
operations to produce architecture-dependent atomic code. Patch is against
2.5.0 but it applies cleanly on trunk for me as well.


Attachments:
0001-Add-generic-GCC-support-for-atomic-operations.patch 8.0 KB

prot...@googlecode.com

unread,
May 16, 2013, 6:03:49 AM5/16/13
to prot...@googlegroups.com

Comment #4 on issue 488 by stanis...@ochotnicky.com: powerpc-linux cross
My original patch didn't add new header file to Makefile.am so that caused
issues when compiling dependencies. This attached patch fixes it

Attachments:
0001-Add-generic-gcc-header-to-Makefile.am.patch 1.0 KB

prot...@googlecode.com

unread,
Feb 13, 2014, 8:54:13 AM2/13/14
to prot...@googlegroups.com

Comment #5 on issue 488 by andrew.i...@gmail.com: powerpc-linux cross
AArch64 is becoming more widely available.

prot...@googlecode.com

unread,
Apr 2, 2014, 7:32:00 PM4/2/14
to prot...@googlegroups.com

Comment #6 on issue 488 by wscul...@gmail.com: powerpc-linux cross
The application of the two patches from this ticket to the current trunk
enables a build on powerpc64 linux which otherwise fails with "#error Host
architecture was not detected as supported by protobuf". However, the
resulting binary fails 14 tests. While the test failures are likely
independent of the patch, I hesitate to open a ticket on the failing tests
until this issue reaches resolution.

This is blocking my ability to build and test or-tools.

prot...@googlecode.com

unread,
Jul 8, 2014, 2:15:45 PM7/8/14
to prot...@googlegroups.com

Comment #7 on issue 488 by lawr.es...@gmail.com: powerpc-linux cross
After apply 2 patches return following:
0001-Add-generic-GCC-support-for-atomic-operations.patch
0001-Add-generic-gcc-header-to-Makefile.am.patch


hadoop@bigdata5:~/protobuf-2.5.0> make
cd . && /bin/sh ./config.status Makefile
config.status: creating Makefile
make all-recursive
make[1]: Entering directory `/home/hadoop/protobuf-2.5.0'
Making all in .
make[2]: Entering directory `/home/hadoop/protobuf-2.5.0'
make[2]: Leaving directory `/home/hadoop/protobuf-2.5.0'
Making all in src
make[2]: Entering directory `/home/hadoop/protobuf-2.5.0/src'
/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I.
-I.. -pthread -Wall -Wwrite-strings -Woverloaded-virtual
-Wno-sign-compare -O2 -g -DNDEBUG -MT atomicops_internals_x86_gcc.lo -MD
-MP -MF .deps/atomicops_internals_x86_gcc.Tpo -c -o
atomicops_internals_x86_gcc.lo `test
-f 'google/protobuf/stubs/atomicops_internals_x86_gcc.cc' ||
echo './'`google/protobuf/stubs/atomicops_internals_x86_gcc.cc
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -pthread -Wall
-Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -O2 -g -DNDEBUG -MT
atomicops_internals_x86_gcc.lo -MD -MP
-MF .deps/atomicops_internals_x86_gcc.Tpo -c
google/protobuf/stubs/atomicops_internals_x86_gcc.cc -fPIC -DPIC
-o .libs/atomicops_internals_x86_gcc.o
In file included from ./google/protobuf/stubs/atomicops.h:188,
from
google/protobuf/stubs/atomicops_internals_x86_gcc.cc:36:
./google/protobuf/stubs/atomicops_internals_generic_gcc.h: In
function 'google::protobuf::internal::Atomic32
google::protobuf::internal::NoBarrier_CompareAndSwap(volatile
google::protobuf::internal::Atomic32*,
google::protobuf::internal::Atomic32,
google::protobuf::internal::Atomic32)':
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:12:
error: '__ATOMIC_RELAXED' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:12:
error: '__atomic_compare_exchange_n' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h: In
function 'google::protobuf::internal::Atomic32
google::protobuf::internal::NoBarrier_AtomicExchange(volatile
google::protobuf::internal::Atomic32*,
google::protobuf::internal::Atomic32)':
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:18:
error: '__ATOMIC_RELAXED' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:18:
error: '__atomic_exchange_n' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h: In
function 'google::protobuf::internal::Atomic32
google::protobuf::internal::NoBarrier_AtomicIncrement(volatile
google::protobuf::internal::Atomic32*,
google::protobuf::internal::Atomic32)':
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:23:
error: '__ATOMIC_RELAXED' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:23:
error: '__atomic_add_fetch' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h: In
function 'google::protobuf::internal::Atomic32
google::protobuf::internal::Barrier_AtomicIncrement(volatile
google::protobuf::internal::Atomic32*,
google::protobuf::internal::Atomic32)':
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:28:
error: '__ATOMIC_SEQ_CST' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:28:
error: '__atomic_add_fetch' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h: In
function 'google::protobuf::internal::Atomic32
google::protobuf::internal::Acquire_CompareAndSwap(volatile
google::protobuf::internal::Atomic32*,
google::protobuf::internal::Atomic32,
google::protobuf::internal::Atomic32)':
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:35:
error: '__ATOMIC_ACQUIRE' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:35:
error: '__atomic_compare_exchange' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h: In
function 'google::protobuf::internal::Atomic32
google::protobuf::internal::Release_CompareAndSwap(volatile
google::protobuf::internal::Atomic32*,
google::protobuf::internal::Atomic32,
google::protobuf::internal::Atomic32)':
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:43:
error: '__ATOMIC_RELEASE' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:43:
error: '__ATOMIC_ACQUIRE' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:43:
error: '__atomic_compare_exchange_n' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h: In
function 'void google::protobuf::internal::NoBarrier_Store(volatile
google::protobuf::internal::Atomic32*,
google::protobuf::internal::Atomic32)':
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:48:
error: '__ATOMIC_RELAXED' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:48:
error: '__atomic_store_n' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h: In
function 'void google::protobuf::internal::Acquire_Store(volatile
google::protobuf::internal::Atomic32*,
google::protobuf::internal::Atomic32)':
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:56:
error: '__ATOMIC_ACQUIRE' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:56:
error: '__atomic_store_n' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h: In
function 'void google::protobuf::internal::Release_Store(volatile
google::protobuf::internal::Atomic32*,
google::protobuf::internal::Atomic32)':
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:60:
error: '__ATOMIC_RELEASE' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:60:
error: '__atomic_store_n' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h: In
function 'google::protobuf::internal::Atomic32
google::protobuf::internal::NoBarrier_Load(const volatile
google::protobuf::internal::Atomic32*)':
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:64:
error: '__ATOMIC_RELAXED' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:64:
error: '__atomic_load_n' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h: In
function 'google::protobuf::internal::Atomic32
google::protobuf::internal::Acquire_Load(const volatile
google::protobuf::internal::Atomic32*)':
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:68:
error: '__ATOMIC_ACQUIRE' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:68:
error: '__atomic_load_n' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h: In
function 'google::protobuf::internal::Atomic32
google::protobuf::internal::Release_Load(const volatile
google::protobuf::internal::Atomic32*)':
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:72:
error: '__ATOMIC_RELEASE' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:72:
error: '__atomic_load_n' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h: In
function 'void google::protobuf::internal::Release_Store(volatile
google::protobuf::internal::Atomic64*,
google::protobuf::internal::Atomic64)':
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:78:
error: '__ATOMIC_RELEASE' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:78:
error: '__atomic_store_n' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h: In
function 'google::protobuf::internal::Atomic64
google::protobuf::internal::Acquire_Load(const volatile
google::protobuf::internal::Atomic64*)':
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:82:
error: '__ATOMIC_ACQUIRE' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:82:
error: '__atomic_load_n' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h: In
function 'google::protobuf::internal::Atomic64
google::protobuf::internal::Acquire_CompareAndSwap(volatile
google::protobuf::internal::Atomic64*,
google::protobuf::internal::Atomic64,
google::protobuf::internal::Atomic64)':
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:89:
error: '__ATOMIC_ACQUIRE' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:89:
error: '__atomic_compare_exchange_n' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h: In
function 'google::protobuf::internal::Atomic64
google::protobuf::internal::NoBarrier_CompareAndSwap(volatile
google::protobuf::internal::Atomic64*,
google::protobuf::internal::Atomic64,
google::protobuf::internal::Atomic64)':
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:97:
error: '__ATOMIC_RELAXED' was not declared in this scope
./google/protobuf/stubs/atomicops_internals_generic_gcc.h:97:
error: '__atomic_compare_exchange_n' was not declared in this scope
make[2]: *** [atomicops_internals_x86_gcc.lo] Error 1
make[2]: Leaving directory `/home/hadoop/protobuf-2.5.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/hadoop/protobuf-2.5.0'
make: *** [all] Error 2

prot...@googlecode.com

unread,
Aug 20, 2014, 5:05:09 PM8/20/14
to prot...@googlegroups.com

Comment #8 on issue 488 by xiaof...@google.com: powerpc-linux cross
Hi stanislav, thanks for providing the patch. We are about to make a new
release 2.6.0 and it's probably good to have this patch in. Can you help
send the patch to https://codereview.appspot.com/ and add me as the
reviewer? Once it's reviewed we'll commit the patch to svn trunk.

prot...@googlecode.com

unread,
Aug 21, 2014, 5:08:28 PM8/21/14
to prot...@googlegroups.com

Comment #9 on issue 488 by robert.e...@gmail.com: powerpc-linux cross
compilation not compiling anymore
https://code.google.com/p/protobuf/issues/detail?id=488

https://codereview.appspot.com/129490043/ is based on Stanislav's patch,
and is based on the patch we used in the Debian package of protobuf 2.5.0.

prot...@googlecode.com

unread,
Aug 25, 2014, 9:19:02 PM8/25/14
to prot...@googlegroups.com
Updates:
Status: Fixed
Labels: FixedIn-2.6.0

Comment #10 on issue 488 by xiaof...@google.com: powerpc-linux cross
Fixed in r575.
Reply all
Reply to author
Forward
0 new messages