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

Fails to build in 64bit mode on Solaris #585

Closed
meltahan opened this issue Jul 10, 2015 · 11 comments
Closed

Fails to build in 64bit mode on Solaris #585

meltahan opened this issue Jul 10, 2015 · 11 comments

Comments

@meltahan
Copy link

In the platform_macros.h file, SOLARIS_64BIT_ENABLED is always undefined regardless of the --enable-64bit-solaris config flag

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jul 10, 2015

Could you help fix the issue in platform_macros.h? We don't work on Solaris machines and have to rely on our users to help fixing problems there.

@meltahan
Copy link
Author

I was thinking of how to fix this.. The problem is SOLARIS_64BIT_ENABLED is defined in config.h, and including config.h in platform_macros.h is not a good idea as it'll create macro names collisions with any other project including platform_macros.h or any other protobuf files that include it.

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jul 10, 2015

We had removed the use of config.h as it doesn't fit into the bazel build system. Is there any other predefined macros we can use here to distinguish between 64bit and 32bit on Solaris?

@meltahan
Copy link
Author

You can check for 64-bit on Solaris:
#if defined(sparc_v9) || defined(sparcv9) || defined(__arch64)

But you gotta get rid of the --enable-64bit-solaris flag as it won't make sense anymore

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jul 10, 2015

Thanks. That seems to be the way to go. Could you send a PR for this?

@meltahan
Copy link
Author

Sure. So to avoid breaking any existing auto build scripts that provide this --enable-64bit-solaris configure flag, should i just add a note saying it's deprecated and ignored?

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jul 10, 2015

It seems --enable-64bit-solaris does more than just adding the SOLARIS_64BIT_ENABLED macro (it adds -m64 to the C++ compiler arguments)? If so we probably don't want to remove it from the configure files.

@meltahan
Copy link
Author

Yes i noticed that. There are a few issues with it though. It appends the -m64 flag to CXXFLAGS and CFLAGS only if they were not provided by the user (users can provide these flags for purposes other than building a 64/32 bit build). It also doesn't add the -m64 flag to the LDFLAGS. I'll fix these issues and submit a PR that will make the --enable-64bit-solaris flag work properly.

@meltahan
Copy link
Author

Do you require a CLA from contributors?

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jul 16, 2015

@meltahan yes. When you send the pull request, a @googlebot will check your CLA and give instructions if you haven't signed it yet.

@motahan
Copy link
Contributor

motahan commented Sep 2, 2015

Finally the CLA issues are resolved. I'll submit a PR soon.

taoso pushed a commit to taoso/protobuf that referenced this issue Aug 1, 2018
Reported by honnef.co/go/tools/cmd/unused:
  proto/text.go:460:6: func writeRaw is unused (U1000)
adellahlou pushed a commit to adellahlou/protobuf that referenced this issue Apr 20, 2023
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

3 participants