Skip to content

PHPC-1378: Omit CFLAGS/LDFLAGS in client metadata to avoid platform truncation #985

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

Merged
merged 1 commit into from
May 31, 2019

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented May 31, 2019

@jmikola jmikola requested a review from sgolemon May 31, 2019 15:34
dnl We can do this after the above scripts as they only modify STD_CFLAGS
AS_VAR_COPY(MONGOC_USER_SET_CFLAGS, [CFLAGS])
AS_VAR_COPY(MONGOC_USER_SET_LDFLAGS, [LDFLAGS])
AS_VAR_COPY(MONGOC_CC, [CC])
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't recall why AS_VAR_COPY was used here, unless it had something to do with resolving variables within CFLAGS and LDFLAGS; however, I can't make the connection to the polymorphic variable example provided in the Autoconf manual.

In any event, I don't think it was necessary for $CC since that should simply be the compiler name.

dnl consider restoring CFLAGS/LDFLAGS once CDRIVER-3134 is resolved.
AC_SUBST(MONGOC_CC, [$CC])
AC_SUBST(MONGOC_USER_SET_CFLAGS, [])
AC_SUBST(MONGOC_USER_SET_LDFLAGS, [])
Copy link
Member Author

Choose a reason for hiding this comment

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

I manually verified that this produces the same output in configure as the original pairing of AS_VAR_COPY and AC_SUBST:

MONGOC_CC=$CC

Predictably, there is no assignment for CFLAGS/LDFLAGS in configure with the empty AC_SUBST macros; however, MONGOC_USER_SET_LDFLAGS and MONGOC_USER_SET_CFLAGS are still included in ac_subst_vars which ensures that they at least get replaced when processing mongoc-config.h.in. @MONGOC_USER_SET_LDFLAGS@ and @MONGOC_USER_SET_CFLAGS@ are both replaced with empty strings during configuration.

Choose a reason for hiding this comment

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

That makes sense. Your change is certainly more straightforward in terms of what is happening.

dnl consider restoring CFLAGS/LDFLAGS once CDRIVER-3134 is resolved.
AC_SUBST(MONGOC_CC, [$CC])
AC_SUBST(MONGOC_USER_SET_CFLAGS, [])
AC_SUBST(MONGOC_USER_SET_LDFLAGS, [])

Choose a reason for hiding this comment

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

That makes sense. Your change is certainly more straightforward in terms of what is happening.

jmikola added a commit that referenced this pull request May 31, 2019
@jmikola jmikola merged commit 7e03567 into mongodb:master May 31, 2019
@jmikola jmikola deleted the 1.5-phpc-1378 branch May 31, 2019 16:46
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.

3 participants