-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protobuf-3.0.0-beta-1 compilation error on OpenBSD 5.8 release compiler [solved/workaround] #1038
Comments
Hi @eau-u4f , we don't have resources to build/test the code on OpenBSD. Could you help provide a fix? I think the problem is just that the __thread_local keyword is not supported and you only need to change this macro definition to be defined for your targeting platform: |
Hi @xfxyjwf i can help you test on OpenBSD. Actually i just created a port for OpenBSD 6.0 and i can confirm that the patch needed is indeed the one you mentioned. (if you like to incorporate it upstream it would be great). inlined. diff --git a/src/google/protobuf/stubs/platform_macros.h b/src/google/protobuf/stubs/platform_macros.h index 4ba4b34..4ea1bc7 100644 --- a/src/google/protobuf/stubs/platform_macros.h +++ b/src/google/protobuf/stubs/platform_macros.h @@ -114,7 +114,7 @@ GOOGLE_PROTOBUF_PLATFORM_ERROR #undef GOOGLE_PROTOBUF_PLATFORM_ERROR -#if defined(GOOGLE_PROTOBUF_OS_ANDROID) || defined(GOOGLE_PROTOBUF_OS_IPHONE) +#if defined(GOOGLE_PROTOBUF_OS_ANDROID) || defined(GOOGLE_PROTOBUF_OS_IPHONE) || defined(__OpenBSD__) // Android ndk does not support the __thread keyword very well yet. Here // we use pthread_key_create()/pthread_getspecific()/... methods for // TLS support on android. |
@ramrunner Can you send the patch as a pull request? |
sure thing! |
Ah nice. I was also trying to update protobuf on OpenBSD. Presumably the next release will fix this, as this is still an issue in 3.1.0. |
FWIW, with the threadlocal patch applied, using the base OpenBSD gcc--4.2.1 now gives:
|
@vext01 can you try with the egcc/eg++ compilers? that's what i used. |
It works fine with eg{cc,++}, although it is preferable that it would work with the base compilers. Supposing we roll with eg{cc,++}, I then have just one test failure: (this is with an updated gtest) |
protobuf-3.1.0 is now broken on FreeBSD 9.3 using poudriere -T (TRYBROKEN) resulting in failed builds of mumble-1.2.8_3 kde-4.14.3 |
@forensic-courtofrecord can you provide any output of the failed compilation? |
$ gmake
gmake all-recursive
gmake[1]: Entering directory '/home/rival/Downloads/protobuf-3.0.0-beta-1'
Making all in .
gmake[2]: Entering directory '/home/rival/Downloads/protobuf-3.0.0-beta-1'
gmake[2]: Leaving directory '/home/rival/Downloads/protobuf-3.0.0-beta-1'
Making all in src
gmake[2]: Entering directory '/home/rival/Downloads/protobuf-3.0.0-beta-1/src'
depbase=
echo google/protobuf/arena.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'
;/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -pthread -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -O2 -g -DNDEBUG -MT google/protobuf/arena.lo -MD -MP -MF $depbase.Tpo -c -o google/protobuf/arena.lo google/protobuf/arena.cc &&
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -pthread -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -O2 -g -DNDEBUG -MT google/protobuf/arena.lo -MD -MP -MF google/protobuf/.deps/arena.Tpo -c google/protobuf/arena.cc -fPIC -DPIC -o google/protobuf/.libs/arena.o
In file included from google/protobuf/arena.cc:31:
./google/protobuf/arena.h:546: error: thread-local storage not supported for this target
google/protobuf/arena.cc:53: error: thread-local storage not supported for this target
Makefile:3507: recipe for target 'google/protobuf/arena.lo' failed
gmake[2]: *** [google/protobuf/arena.lo] Error 1
gmake[2]: Leaving directory '/home/rival/Downloads/protobuf-3.0.0-beta-1/src'
Makefile:1113: recipe for target 'all-recursive' failed
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory '/home/rival/Downloads/protobuf-3.0.0-beta-1'
Makefile:1019: recipe for target 'all' failed
gmake: *** [all] Error 2
Switching to a package version of gcc (4.9.3) and g++ (4.9.3) seems to make it complete and work so far.
so a CC=egcc and CXX=eg++ ./configure does the trick
The text was updated successfully, but these errors were encountered: