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

Don't include "params.h" if building with GCC 10 #183

Merged
merged 1 commit into from
Sep 19, 2020

Conversation

frederik-h
Copy link
Contributor

Hi,
The params.h header has been removed from GCC 10.
As reported by @doko42 in issue #181, this breaks the gcc-python-plugin build.

The changes of this commit allow me to build the plugin with GCC 10.
I have no idea if that's all that needs to be done, but I have tested the commit with GCC 10 and an old GCC 7 distribution package with both Python 2 and 3 and everything seems to work.

Best regards,
Frederik

The params.h header has been removed from GCC 10.
To allow building the plugin for GCC 10, the header
should be included conditionally for older GCC
versions only.
int i = option_enabled (opt_code, global_dc->option_state);
#else
/* Starting with GCC 10, options can be distinguished by language. */
/* TODO Expose the lang_mask to the user. */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a TODO? ;-)

#else
/* Starting with GCC 10, options can be distinguished by language. */
/* TODO Expose the lang_mask to the user. */
int i = option_enabled (opt_code, CL_LANG_ALL, global_dc->option_state);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the CL_LANG_ALL right here?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that that param is used as a mask, so using CL_LANG_ALL here looks correct to me.

Copy link

@jmikedupont2 jmikedupont2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this work

@doko42
Copy link

doko42 commented Sep 18, 2020

still doesn't build with that patch and current gcc-10 branch:

In file included from gcc-python.c:21:
gcc-python.h:234:10: error: ‘compiler_param’ does not name a type
234 | compiler_param, param_num)
| ^~~~~~~~~~~~~~

gcc-python.c:245:40: error: ‘compiler_params’ was not declared in this scope
245 | compiler_params[i].option,

@davidmalcolm davidmalcolm merged commit b6cb6bb into davidmalcolm:master Sep 19, 2020
@davidmalcolm
Copy link
Owner

Thanks for this; sorry about the delay in reviewing it.

@davidmalcolm
Copy link
Owner

IIRC parameters were reworked internally within GCC 10 to be more like regular options, hence these internal changes.

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

Successfully merging this pull request may close these issues.

4 participants