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

m4: fix detection of atomics #109

Merged
merged 1 commit into from Nov 22, 2016
Merged

m4: fix detection of atomics #109

merged 1 commit into from Nov 22, 2016

Conversation

yann-morin-1998
Copy link
Contributor

In cross-compilation, it is impossible to run code at configure time to
detect the target specifics.

As such, AC_TRY_RUN fails miserably to detect reliably that atomic
intrisics are present in a toolchain, and decides they are not just
because this is cross-compilation.

Instead of AC_TRY_RUN, use AC_LINK_IFELSE that does not need to actually
run code, since all we're interested in is whether the intrisics are
present (or not). Fix both the 32- and 64-bit variants, even if the
latter is not used currently.

Fixes build failures detected by the Buildroot autobuilders, like:
http://autobuild.buildroot.org/results/23a/23ac0e742ed3a70ae4d038f8c9eadc23e708f671/build-end.log
http://autobuild.buildroot.org/results/192/1923d0b570adba494f83747a9610ea6ec35f5223/build-end.log

and many other cases, espcially on architectures where such intrsics are
present, but where the toolchain does not have threads (and anyway, it
is much more efficient to use the intrisics rather than use mutexes).

Signed-off-by: "Yann E. MORIN" yann.morin.1998@free.fr

In cross-compilation, it is impossible to run code at configure time to
detect the target specifics.

As such, AC_TRY_RUN fails miserably to detect reliably that atomic
intrisics are present in a toolchain, and decides they are not just
because this is cross-compilation.

Instead of AC_TRY_RUN, use AC_LINK_IFELSE that does not need to actually
run code, since all we're interested in is whether the intrisics are
present (or not). Fix both the 32- and 64-bit variants, even if the
latter is not used currently.

Fixes build failures detected by the Buildroot autobuilders, like:
    http://autobuild.buildroot.org/results/23a/23ac0e742ed3a70ae4d038f8c9eadc23e708f671/build-end.log
    http://autobuild.buildroot.org/results/192/1923d0b570adba494f83747a9610ea6ec35f5223/build-end.log

and many other cases, espcially on architectures where such intrsics are
present, but where the toolchain does not have threads (and anyway, it
is much more efficient to use the intrisics rather than use mutexes).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
@yann-morin-1998
Copy link
Contributor Author

@rgerhards Ping? ;-) Any feedback to provide on this change?

@rgerhards
Copy link
Member

Sorry, I am right now busy with other parts of the rsyslog projects. I'll turn back to here ASAP.

@yann-morin-1998
Copy link
Contributor Author

@rgerhards Any chance you could have a look, please? ;-)

@rgerhards rgerhards self-assigned this Nov 10, 2016
@rgerhards rgerhards merged commit b839efb into rsyslog:master Nov 22, 2016
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.

None yet

2 participants