8000 Build cleanup by ngie-eign · Pull Request #85 · freebsd/atf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Build cleanup #85

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 9 commits into from
Mar 9, 2025
Merged

Build cleanup #85

merged 9 commits into from
Mar 9, 2025

Conversation

ngie-eign
Copy link
Contributor
@ngie-eign ngie-eign commented Dec 25, 2024

This PR addresses some build bugs and adds some build enhancements:

  • Remove leftover references of auto_array (bugfix).
  • Remove the atf-*-api manpages (enhancement).
  • Require -std=C++14 with ATF (enhancement).
  • Do a proper job at exposing the WCOREDUMP(..) macro on platforms which support it via autotools (bugfix).
  • Add __attribute__((nonnull)) support, similar to __attribute__((unused)), et al (enhancement).
  • Restore AC_PROG_CPP (bugfix).

@ngie-eign ngie-eign force-pushed the build-cleanup branch 2 times, most recently from 6ce107f to f054eeb Compare December 26, 2024 04:30
This entry should have been removed in the referenced commit.

Fixes:	6639d08
This change imports ac_cxx_compile_stdcxx.m4 from gnu,org and makes use
of the `AX_CXX_COMPILE_STDCXX` macro in configure.ac to ensure that the
compiler specified supports C++-14 (at bare minimum). This is being done
to quell some issues reported by scan-build about the code using C++
range-based for-loops (a feature added in C++-11).
These manpages have been deprecated for at least a release. Remove them
and all of the logic associated with them.

Signed-off-by: Enji Cooper <ngie@FreeBSD.org>
WCOREDUMP is considered an extension to the POSIX spec on multiple
platforms, and thus is not automatically exposed on all platforms. Add the
relevant preprocessor defines to config.h via autoconf, then leverage them
in atf-c(3).

This helps ensure that the platforms which support WCOREDUMP properly
expose the macro.

Signed-off-by: Enji Cooper <ngie@FreeBSD.org>
This feature is being detected so several functions can be appropriately
marked as taking non-NULL/-nullptr parameters, and the compiler and static
analyzers can (in turn) make intelligent decisions when optimizing and
analyzing code, respectively.

Signed-off-by: Enji Cooper <ngie@FreeBSD.org>
This was accidentally deleted post-0.21 release. It's still needed by
tests and build infrastructure.

Signed-off-by: Enji Cooper <ngie@FreeBSD.org>
The libcalls used have been in the POSIX standard since 2008.1. Require
them to be present instead of conditionally hoping they're present.

This fixes an issue where the autoconf code was messing up with a
combination of clang tools, which resulted in the autoconf code failing
to properly determine whether or not the functions were available.

Signed-off-by: Enji Cooper <ngie@FreeBSD.org>
This particular check unfortunately doesn't work when ATF_BUILD_CXX
contains multiple CXXFLAGS, or contains a path with spaces in it. Remove
this check to unbreak the dependent tests
post-793d4640031dc06ce8a239ffa9ab61322104c4ca.

Signed-off-by: Enji Cooper <ngie@FreeBSD.org>
The C++ toolchain is sanity checked when C++14 conformance is checked;
there's no reason why we need to check whether or not the C++ toolchain
works again.

Signed-off-by: Enji Cooper <ngie@FreeBSD.org>
@ngie-eign
Copy link
Contributor Author

@asomers, @emaste , @ihoro : ping?

@@ -62,6 +62,7 @@ AC_USE_SYSTEM_EXTENSIONS

AC_PROG_CXX
AC_LANG_COMPILER(C++)
AC_PROG_CPP
Copy link
Member

Choose a reason for hiding this comment

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

OK. Is this where it belongs though, it seems the CXX and C++ bits should be together without CPP in the middle

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll have to run through it again, but the order for invoking the macros is a bit fragile (autoconf/automake whine a lot about not calling things in the right order).

@emaste
Copy link
Member
emaste commented Dec 29, 2024

I've marked the files I've reviewed so far

@ngie-eign ngie-eign merged commit 718d40f into freebsd:master Mar 9, 2025
@ngie-eign ngie-eign deleted the build-cleanup branch March 9, 2025 02:48
ngie-eign added a commit that referenced this pull request Mar 29, 2025
* Garbage collect stray reference to auto_array

This entry should have been removed in the referenced commit.

Fixes:	6639d08

* Require C++-14 at bare minimum

This change imports ac_cxx_compile_stdcxx.m4 from gnu,org and makes use
of the `AX_CXX_COMPILE_STDCXX` macro in configure.ac to ensure that the
compiler specified supports C++-14 (at bare minimum). This is being done
to quell some issues reported by scan-build about the code using C++
range-based for-loops (a feature added in C++-11).

* Stop shipping atf-*-api(3) manpages

These manpages have been deprecated for at least a release. Remove them
and all of the logic associated with them.

Signed-off-by: Enji Cooper <ngie@FreeBSD.org>

* Expose WCOREDUMP(..) in a deterministic manner

WCOREDUMP is considered an extension to the POSIX spec on multiple
platforms, and thus is not automatically exposed on all platforms. Add the
relevant preprocessor defines to config.h via autoconf, then leverage them
in atf-c(3).

This helps ensure that the platforms which support WCOREDUMP properly
expose the macro.

Signed-off-by: Enji Cooper <ngie@FreeBSD.org>

* Add compiler feature detection for `__attribute__((nonnull))`

This feature is being detected so several functions can be appropriately
marked as taking non-NULL/-nullptr parameters, and the compiler and static
analyzers can (in turn) make intelligent decisions when optimizing and
analyzing code, respectively.

Signed-off-by: Enji Cooper <ngie@FreeBSD.org>

* Restore AC_PROG_CPP

This was accidentally deleted post-0.21 release. It's still needed by
tests and build infrastructure.

Signed-off-by: Enji Cooper <ngie@FreeBSD.org>

* atf-c/detail/env.c: remove unnecessary complexity

The libcalls used have been in the POSIX standard since 2008.1. Require
them to be present instead of conditionally hoping they're present.

This fixes an issue where the autoconf code was messing up with a
combination of clang tools, which resulted in the autoconf code failing
to properly determine whether or not the functions were available.

Signed-off-by: Enji Cooper <ngie@FreeBSD.org>

* Remove ATF_BUILD_CXX require.progs check

This particular check unfortunately doesn't work when ATF_BUILD_CXX
contains multiple CXXFLAGS, or contains a path with spaces in it. Remove
this check to unbreak the dependent tests
post-793d4640031dc06ce8a239ffa9ab61322104c4ca.

Signed-off-by: Enji Cooper <ngie@FreeBSD.org>

* Remove redundant C++ toolchain check

The C++ toolchain is sanity checked when C++14 conformance is checked;
there's no reason why we need to check whether or not the C++ toolchain
works again.

Signed-off-by: Enji Cooper <ngie@FreeBSD.org>

---------

Signed-off-by: Enji Cooper <ngie@FreeBSD.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
0