From a9548aeb8f5ea0a81a70ff6be6b15b0350a715b3 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sat, 10 Sep 2022 17:15:23 -0400 Subject: [PATCH] [SV 63037] Fix tests for newer OS / compiler * tests/scripts/features/load: Add function prototypes. * tests/scripts/features/temp_stdin: Only set user execute bits. Some configurations don't allow changing the group bits...?? --- tests/scripts/features/load | 15 +++++++++------ tests/scripts/features/temp_stdin | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/scripts/features/load b/tests/scripts/features/load index fa4b86f6..6d1978a5 100644 --- a/tests/scripts/features/load +++ b/tests/scripts/features/load @@ -4,7 +4,7 @@ $description = "Test the load operator."; $details = "Test dynamic loading of modules."; # Don't do anything if this system doesn't support "load" -exists $FEATURES{load} or return -1; +exists $FEATURES{'load'} or return -1; my $cc = get_config('CC'); if (! $cc) { @@ -26,6 +26,9 @@ print $F <<'EOF' ; int plugin_is_GPL_compatible; +int testload_gmk_setup (gmk_floc *); +int explicit_setup (gmk_floc *); + int testload_gmk_setup (gmk_floc *pos) { @@ -46,14 +49,14 @@ close($F) or die "close: testload.c: $!\n"; # Make sure we can compile -my $cflags = get_config('CFLAGS'); -my $cppflags = get_config('CPPFLAGS'); -my $ldflags = get_config('LDFLAGS'); -my $sobuild = "$cc ".($srcdir? "-I$srcdir/src":'')." $cppflags $cflags -shared -fPIC $ldflags -o testload.so testload.c"; +my $cppflags = get_config('CPPFLAGS') . ($srcdir ? " -I$srcdir/src" : ''); +my $cflags = get_config('CFLAGS') . ' -fPIC'; +my $ldflags = get_config('LDFLAGS') . ' -shared'; +my $sobuild = "$cc $cppflags $cflags $ldflags -o testload.so testload.c"; my $clog = `$sobuild 2>&1`; if ($? != 0) { - $verbose and print "Failed to build testload.so:\n$sobuild\n$_"; + $verbose and print "Failed to build testload.so:\n$sobuild\n$clog"; return -1; } diff --git a/tests/scripts/features/temp_stdin b/tests/scripts/features/temp_stdin index 5b65c51b..8c7a47a0 100644 --- a/tests/scripts/features/temp_stdin +++ b/tests/scripts/features/temp_stdin @@ -56,7 +56,7 @@ use File::Copy; my $makecopy = File::Spec->catfile($TEMPDIR, "make"); copy("$mkpath", $makecopy); # Set file mode bits, because perl copy won't. -chmod 0750, $makecopy; +chmod 0700, $makecopy; my @make_orig = @make_command; @make_command = ($makecopy); @@ -68,10 +68,10 @@ open(STDIN, "<", 'input.mk') || die "$0: cannot open input.mk for reading: $!"; run_make_test(" include bye.mk all:; \$(info hello) -\$(MAKE_RESTARTS)bye.mk: force; touch \$@ && chmod -x $makecopy +\$(MAKE_RESTARTS)bye.mk: force; touch \$@ && chmod u-x $makecopy force: ", - "-f-", "touch bye.mk && chmod -x $makecopy\nmake: $makecopy: $ERR_nonexe_file\n", 32512); + "-f-", "touch bye.mk && chmod u-x $makecopy\nmake: $makecopy: $ERR_nonexe_file\n", 32512); @make_command = @make_orig; unlink($makecopy);