diff options
| author | Pavel Raiskup <praiskup@redhat.com> | 2023-11-21 08:30:00 -0800 |
|---|---|---|
| committer | Karl Berry <karl@freefriends.org> | 2023-11-21 08:30:00 -0800 |
| commit | 8cdbdda5aec652c356fe6dbba96810202176ae75 (patch) | |
| tree | 7d7df5e52f8df808d3396fe1f4b02fc34ab1741f | |
| parent | 4adfd131e2fef36f387bced95da100d816e6cd7b (diff) | |
| download | automake-8cdbdda5aec652c356fe6dbba96810202176ae75.tar.gz | |
automake: make the ARFLAGS default 'cr' instead of 'cru'.
In some GNU/Linux distributions people started to compile 'ar'
binary with --enable-deterministic-archives (binutils project).
That, however, in combination with our previous long time working
default AR_FLAGS=cru causes warnings on such installations:
ar: `u' modifier ignored since `D' is the default (see `U')
The 'u' option (at least with GNU binutils) did small optimization
during repeated builds because it instructed 'ar' to not
open/close unchanged *.o files and to rather read their contents
from old archive file. However, its removal should not cause a
big performance hit for usual workflows.
Distributions started using --enable-deterministic-archives
knowing that it would disable the 'u', just to rather have a bit
more deterministic builds.
Also, to justify this change a bit more, keeping 'u' in ARFLAGS
could only result in many per-project changes to override
Automake's ARFLAGS default, just to silence such warnings.
Fixes bug#20082. Reported by Eric Blake.
* bin/automake.in (handle_libraries): Use 'ARFLAGS=cr' by default.
* doc/automake.texi (Building a library): Mention the changed
ARFLAGS default.
(@c LocalWords): Replace 'cru' with 'cr'.
* m4/ar-lib.m4 (AM_PROG_AR): Cut out 'cru' string into separate
ARFLAGS variable with new default 'cr'.
* NEWS: Document.
| -rw-r--r-- | NEWS | 5 | ||||
| -rw-r--r-- | bin/automake.in | 2 | ||||
| -rw-r--r-- | doc/automake.texi | 4 | ||||
| -rw-r--r-- | m4/ar-lib.m4 | 3 |
4 files changed, 9 insertions, 5 deletions
@@ -10,6 +10,9 @@ New in 1.17: - AM_PATH_PYTHON will also search for Python versions 3.10 - 3.15. It has previously searched for 3.0 - 3.9. (bug#53530) + - The default value of $ARFLAGS is now "cr" instead of "cru", to + support deterministic builds. (bug#20082) + - RANLIB may be overridden on a per-target basis. - AM_TEXI2FLAGS may be defined to pass extra flags to TEXI2DVI & TEXI2PDF. @@ -69,7 +72,7 @@ New in 1.17: - Pass any options given to AM_PROG_LEX on to AC_PROG_LEX. (bug#65600 and bug#65730) -* Obsolescent features: +* Obsolescence: - py-compile no longer supports Python 0.x or 1.x versions. Python 2.0, released in 2000, is currently the minimum required version. diff --git a/bin/automake.in b/bin/automake.in index edc0488..c0ffc19 100644 --- a/bin/automake.in +++ b/bin/automake.in @@ -2674,7 +2674,7 @@ sub handle_libraries () } define_variable ('AR', 'ar', INTERNAL); - define_variable ('ARFLAGS', 'cru', INTERNAL); + define_variable ('ARFLAGS', 'cr', INTERNAL); define_verbose_tagvar ('AR'); foreach my $pair (@liblist) diff --git a/doc/automake.texi b/doc/automake.texi index 635bdd2..af8dd83 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -5181,7 +5181,7 @@ library and the list of objects, and finally by calling @code{RANLIB} (Automake will complain otherwise). You should also call @code{AM_PROG_AR} to define @code{AR}, in order to support unusual archivers such as Microsoft lib. @code{ARFLAGS} will default to -@code{cru}; you can override this variable by setting it in your +@code{cr}; you can override this variable by setting it in your @file{Makefile.am} or by @code{AC_SUBST}ing it from your @file{configure.ac}. You can override the @code{AR} variable by defining a per-library @code{maude_AR} variable (@pxref{Program and @@ -13625,7 +13625,7 @@ attach the @file{test-suite.log} file. @c LocalWords: Miller's installable includedir inc pkgdata EXEEXT libexec bsd @c LocalWords: pkglib libexecdir prog libcpio cpio's dlopen dlpreopen linux @c LocalWords: subsubsection OBJEXT esac lib LTLIBRARIES liblob LIBADD AR ar -@c LocalWords: ARFLAGS cru ing maude libgettext lo LTLIBOBJS rpath SGI PRE yy +@c LocalWords: ARFLAGS cr ing maude libgettext lo LTLIBOBJS rpath SGI PRE yy @c LocalWords: libmaude CCLD CXXFLAGS FFLAGS LFLAGS OBJCFLAGS RFLAGS DEFS cc @c LocalWords: OBJCXXFLAGS @c LocalWords: SHORTNAME vtable srcdir nostdinc basename yxx cxx ll lxx gdb diff --git a/m4/ar-lib.m4 b/m4/ar-lib.m4 index f55b650..e655b26 100644 --- a/m4/ar-lib.m4 +++ b/m4/ar-lib.m4 @@ -18,12 +18,13 @@ AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([ar-lib])dnl AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} +: ${ARFLAGS=cr} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], [AC_LANG_PUSH([C]) am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], - [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + [am_ar_try='$AR $ARFLAGS libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=ar |
