diff options
author | Manoj Srivastava <srivasta@debian.org> | 2016-01-16 12:55:37 -0800 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2016-01-16 12:55:37 -0800 |
commit | 355fd6b5ba54d704fd27f952cf545589cf14e12c (patch) | |
tree | b7634c0ae480e05434d69a6987f8f3cd560d6767 /tests | |
parent | bd8a0ad0472821d08b152dd3fa2bfcf5ed99ab7d (diff) |
[fix-ar-deterministic]: Fix issues with ar operating in deterministic mode
It looks like the ar program in the binutils package in debian is now
configured with --enable-deterministic-archives. However, when dealing
with archive members, make needs the timestamp of the file in order to
decide to update it or not. With the current deterministic behavior of
ar, the timestamp is always 0. This change in ar introduced a behavior
that is not backward compatible and forces the use of the option U
make fails to build, failing 7 out of 10 archive tests.Since make seems
t depend on timestamps to handle rebuilds of archives correctly, it
makes sense to always pass on the -U flag, and depend on a version of ar
that supports it.
Should this U option be included in a Makefile, older versions of ar
would reject it and fail.
There is some online discussion:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798804
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798913
https://bugzilla.redhat.com/show_bug.cgi?id=1195883
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scripts/features/archives | 20 | ||||
-rw-r--r-- | tests/scripts/targets/POSIX | 2 |
2 files changed, 11 insertions, 11 deletions
diff --git a/tests/scripts/features/archives b/tests/scripts/features/archives index b0acfecb..697d0e5e 100644 --- a/tests/scripts/features/archives +++ b/tests/scripts/features/archives @@ -14,31 +14,31 @@ utouch(-60, qw(a1.o a2.o a3.o)); my $ar = $CONFIG_FLAGS{AR}; # Some versions of ar print different things on creation. Find out. -my $created = `$ar rv libxx.a a1.o 2>&1`; +my $created = `$ar rvU libxx.a a1.o 2>&1`; # Some versions of ar print different things on add. Find out. -my $add = `$ar rv libxx.a a2.o 2>&1`; +my $add = `$ar rvU libxx.a a2.o 2>&1`; $add =~ s/a2\.o/#OBJECT#/g; # Some versions of ar print different things on replacement. Find out. -my $repl = `$ar rv libxx.a a2.o 2>&1`; +my $repl = `$ar rvU libxx.a a2.o 2>&1`; $repl =~ s/a2\.o/#OBJECT#/g; unlink('libxx.a'); # Very simple run_make_test('all: libxx.a(a1.o)', - '', "$ar rv libxx.a a1.o\n$created"); + '', "$ar rvU libxx.a a1.o\n$created"); # Multiple .o's. Add a new one to the existing library ($_ = $add) =~ s/#OBJECT#/a2.o/g; run_make_test('all: libxx.a(a1.o a2.o)', - '', "$ar rv libxx.a a2.o\n$_"); + '', "$ar rvU libxx.a a2.o\n$_"); # Touch one of the .o's so it's rebuilt utouch(-40, 'a1.o'); ($_ = $repl) =~ s/#OBJECT#/a1.o/g; -run_make_test(undef, '', "$ar rv libxx.a a1.o\n$_"); +run_make_test(undef, '', "$ar rvU libxx.a a1.o\n$_"); # Use wildcards run_make_test('all: libxx.a(*.o)', @@ -47,21 +47,21 @@ run_make_test('all: libxx.a(*.o)', # Touch one of the .o's so it's rebuilt utouch(-30, 'a1.o'); ($_ = $repl) =~ s/#OBJECT#/a1.o/g; -run_make_test(undef, '', "$ar rv libxx.a a1.o\n$_"); +run_make_test(undef, '', "$ar rvU libxx.a a1.o\n$_"); # Use both wildcards and simple names utouch(-50, 'a2.o'); ($_ = $add) =~ s/#OBJECT#/a3.o/g; -$_ .= "$ar rv libxx.a a2.o\n"; +$_ .= "$ar rvU libxx.a a2.o\n"; ($_ .= $repl) =~ s/#OBJECT#/a2.o/g; run_make_test('all: libxx.a(a3.o *.o)', '', - "$ar rv libxx.a a3.o\n$_"); + "$ar rvU libxx.a a3.o\n$_"); # Check whitespace handling utouch(-40, 'a2.o'); ($_ = $repl) =~ s/#OBJECT#/a2.o/g; run_make_test('all: libxx.a( a3.o *.o )', '', - "$ar rv libxx.a a2.o\n$_"); + "$ar rvU libxx.a a2.o\n$_"); rmfiles(qw(a1.o a2.o a3.o libxx.a)); diff --git a/tests/scripts/targets/POSIX b/tests/scripts/targets/POSIX index a24e3bcf..720a05aa 100644 --- a/tests/scripts/targets/POSIX +++ b/tests/scripts/targets/POSIX @@ -31,7 +31,7 @@ all: ; \@$script '', $out); # Test the default value of various POSIX-specific variables -my %POSIX = (AR => 'ar', ARFLAGS => '-rv', +my %POSIX = (AR => 'ar', ARFLAGS => '-rvU', YACC => 'yacc', YFLAGS => '', LEX => 'lex', LFLAGS => '', LDFLAGS => '', |