Skip to content
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

Compile fails on MacOS Big Sur 11.2.1 (MacBook Pro mid-2015) #8300

Closed
sekuri opened this issue Feb 16, 2021 · 9 comments
Closed

Compile fails on MacOS Big Sur 11.2.1 (MacBook Pro mid-2015) #8300

sekuri opened this issue Feb 16, 2021 · 9 comments

Comments

@sekuri
Copy link

sekuri commented Feb 16, 2021

Hi, Tried to install from src following C++ installation instruction and received the following error during make (attaching make output here):
protobuf make error.txt
:

google/protobuf/generated_message_util.cc:70:9: error: 'init_priority' attribute is not supported on this platform 70 | fixed_address_empty_string{}; // NOLINT google/protobuf/generated_message_util.cc:90:56: error: 'init_priority' attribute is not supported on this platform 90 | PROTOBUF_ATTRIBUTE_INIT_PRIORITY static std::true_type init_empty_string =

Any help would be appreciated. Thx

@haberman
Copy link
Member

Could you try changing this line: https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/port_def.inc#L599

Try changing that to:

#if defined(__GNUC__) && defined(SUPPORTS_INIT_PRIORITY) && SUPPORTS_INIT_PRIORITY

If that works we can make that change in the code-base.

@sekuri
Copy link
Author

sekuri commented Feb 16, 2021

Worked like a charm. Attached is the make output. Thanks!
protobuf make output.txt

@sekuri
Copy link
Author

sekuri commented Feb 17, 2021

However... now I get a make check error. Please see attached. Should I open a different issue for this?

protobuf make check error.txt

In file included from no_warning_test.cc:7: ./google/protobuf/parse_context.h: In instantiation of 'const char* google::protobuf::internal::EpsCopyInputStream::AppendUntilEnd(const char*, const A&) [with A = google::protobuf::internal::EpsCopyInputStream::AppendString(const char*, std::string*)::<lambda(const char*, ptrdiff_t)>]': ./google/protobuf/parse_context.h:366:70: required from here ./google/protobuf/stubs/logging.h:188:50: error: comparison of unsigned expression in '>= 0' is always true [-Werror=type-limits] 188 | #define GOOGLE_DCHECK_GE(A, B) GOOGLE_DCHECK((A) >= (B))

@haberman
Copy link
Member

Hmm, have you passed options for extra warnings/errors to the compiler? When I build on Big Sur I do not get these errors/warnings. Our CI tests also build on macOS regularly and don't get these compile errors.

@sekuri
Copy link
Author

sekuri commented Feb 17, 2021

Nothing self-passed at all. One thing likely different is that I'm using gcc10 compiler from macports, not Apple's. Regardless, the above "make check" error didn't affect my installation - all works just fine. And definitely no errors on "make". All good from my end. Thanks

@nmaludy
Copy link

nmaludy commented Apr 8, 2021

@haberman i can confirm this error is seen on CentOS 8 using GCC 10.2.0 when you run with -std=gnu++17 -Wall -Werror -Wextra

I believe #7514 is related

@elharo
Copy link
Contributor

elharo commented Aug 27, 2021

seems to be fixed, reopen if not

@elharo elharo closed this as completed Aug 27, 2021
@Wuestenschiff
Copy link

I still experience this issue when building protobuf 3.17.1 (via conan) on mac os with gcc11 from homebrew

@elharo
Copy link
Contributor

elharo commented Sep 28, 2021

Not sure what conan is. What we support is head in this repo. if that still fails with a clean checkout (it didn't for me), let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants